CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

What is the class type of solver_container for IncNSSolver

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By bigfootedrockmidget
  • 1 Post By bigfootedrockmidget
  • 1 Post By EvertBunschoten

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 2, 2025, 03:43
Default What is the class type of solver_container for IncNSSolver
  #1
New Member
 
Qi Wang
Join Date: Oct 2024
Posts: 7
Rep Power: 2
QiWang is on a distinguished road
If I use IncNavier_Stokes in the configuration file, what exactly is the type of solver_container?
It is initialized in the CBaseSolver to be CSolver****, but it should be updated to be one of the derived classes right? I have been looking for the container_initialize but haven't find any clue.
Ultimately, I'm trying to find what SetInitialCondition the solver uses exactly. It has been three days and I just could not get this piece of information from the code.
QiWang is offline   Reply With Quote

Old   January 2, 2025, 05:08
Default
  #2
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 719
Rep Power: 21
bigfootedrockmidget is on a distinguished road
You can for instance follow one of the variables needed for initialization of the incompressible solver in vscode.

Take for instance INC_VELOCITY_INIT
You will see if you search for this variable, that there is a function GetIncVelocity_Init
This function is used in only one other file: CIncEulerSolver.cpp.
As you will see, the Navier-Stokes solver inherits a lot from the Euler Solver.
In the file, you will find CIncEulerSolver::SetNondimensionalization
If you do not use nondimensional numbers, the values used for nondimensionalization will simply be set to 1.


Another important place to look is CDriver.cpp, where the initialization has for instance InitializeSolver()
From this function, we call the initialization using the restart file.
QiWang likes this.
bigfootedrockmidget is offline   Reply With Quote

Old   January 2, 2025, 05:32
Default
  #3
Senior Member
 
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 719
Rep Power: 21
bigfootedrockmidget is on a distinguished road
btw, if you want to do some special initialization, you can use the python wrapper for this. There are some examples in the TestCases folder.
QiWang likes this.
bigfootedrockmidget is offline   Reply With Quote

Old   January 2, 2025, 06:59
Default
  #4
New Member
 
Qi Wang
Join Date: Oct 2024
Posts: 7
Rep Power: 2
QiWang is on a distinguished road
Quote:
Originally Posted by bigfootedrockmidget View Post
You can for instance follow one of the variables needed for initialization of the incompressible solver in vscode.

Take for instance INC_VELOCITY_INIT
You will see if you search for this variable, that there is a function GetIncVelocity_Init
This function is used in only one other file: CIncEulerSolver.cpp.
As you will see, the Navier-Stokes solver inherits a lot from the Euler Solver.
In the file, you will find CIncEulerSolver::SetNondimensionalization
If you do not use nondimensional numbers, the values used for nondimensionalization will simply be set to 1.


Another important place to look is CDriver.cpp, where the initialization has for instance InitializeSolver()
From this function, we call the initialization using the restart file.
Thanks for the reply! I did find the function in CIncEurlerSolver. However, I couldn't find where exactly that solver_container is set to be an instance of CIncEulerSolver. There is also some other initial condition in FVMSolver, which is really confusing because I really don't know exactly which one this sentence is calling
solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], solver_container[ZONE_0][INST_0], config_container[ZONE_0], TimeIter);
QiWang is offline   Reply With Quote

Old   January 2, 2025, 07:05
Default
  #5
New Member
 
Qi Wang
Join Date: Oct 2024
Posts: 7
Rep Power: 2
QiWang is on a distinguished road
Quote:
Originally Posted by bigfootedrockmidget View Post
btw, if you want to do some special initialization, you can use the python wrapper for this. There are some examples in the TestCases folder.
Thanks a lot for this heads-up. Yes I'm trying to do some special initialization for my adjoint calculation and reading the code from scratch is a big pain so far... I would really appreciate it if you could pinpoint one of the testcases so I can modify the initial condition for the adjoint calculation.
QiWang is offline   Reply With Quote

Old   January 2, 2025, 11:42
Default
  #6
New Member
 
Evert Bunschoten
Join Date: Nov 2024
Location: Netherlands
Posts: 11
Rep Power: 2
EvertBunschoten is on a distinguished road
The line

solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], solver_container[ZONE_0][INST_0], config_container[ZONE_0], TimeIter);

always calls the SetInitialCondition method from the derived class if defined. In case the solver you are using does not have the method SetInitialCondition defined, it will use the method from CFVMFlowSolverBase.
QiWang likes this.
EvertBunschoten is offline   Reply With Quote

Reply

Tags
su2

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
convergence problem of steady 2D film cooling calculation using chtMultiRegionFoam ruanyg968tf OpenFOAM Running, Solving & CFD 1 April 10, 2024 03:23
rhoSimpleFoam vs rhoPimpleFoam, steady state vs transient solver Oliver Meng OpenFOAM Running, Solving & CFD 28 January 12, 2023 05:13
activeBaffleVelocity boundary condition ? om3ro OpenFOAM Programming & Development 10 November 17, 2020 00:26
rSF: p divergence in combustor (wt negative value) zonda OpenFOAM Pre-Processing 4 April 10, 2018 07:59
singularity? mihaipruna OpenFOAM Running, Solving & CFD 5 April 24, 2012 18:18


All times are GMT -4. The time now is 11:10.