-
Notifications
You must be signed in to change notification settings - Fork 918
[WIP] Add initialization option for incompressible solver #2709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
efcf8a5
1dcbcf3
0df7d14
a27c73c
c61d3ed
482a1b1
b3e5240
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,6 +260,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i | |
| bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST))); | ||
| bool energy = config->GetEnergy_Equation(); | ||
| bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); | ||
| bool density_init = (config->GetKind_InitOptionInc() == DENSITY_INIT); | ||
|
|
||
| /*--- Compute dimensional free-stream values. ---*/ | ||
|
|
||
|
|
@@ -283,6 +284,14 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i | |
| } | ||
| ModVel_FreeStream = sqrt(ModVel_FreeStream); config->SetModVel_FreeStream(ModVel_FreeStream); | ||
|
|
||
| config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0)); | ||
| if (density_init) { | ||
| Pressure_Thermodynamic = Density_FreeStream * Temperature_FreeStream * config->GetGas_Constant(); | ||
|
Comment on lines
+288
to
+289
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it valid to use this for constant density fluids?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi!! The constant density fluid does not define and use the thermodynamics pressure, that is why the test cases that use the constant density model do not fail. For the other fluid models, the ideal gas law is used so they require the thermodynamic pressure, but for constant density, it is not used. Thank you so much in advance!!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what would be the initial pressure in that case?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi!! The initial pressure for incompressible solver is always initialized to zero. This thermodynamic pressure is mainly used for computing the density using the ideal gas law. in the constructor of the CIncEulerSolver: before the above code , there is a called to the SetNonDimensionalization. and in the SetNonDimensionalization, the FreeStream pressure is set as: I will add throw error. Thanks!!! |
||
| } else { | ||
| Pressure_Thermodynamic = config->GetPressure_Thermodynamic(); | ||
| } | ||
| config->SetPressure_Thermodynamic(Pressure_Thermodynamic); | ||
|
|
||
| CFluidModel* auxFluidModel = nullptr; | ||
|
|
||
| switch (config->GetKind_FluidModel()) { | ||
|
|
@@ -295,18 +304,12 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i | |
|
|
||
| case INC_IDEAL_GAS: | ||
|
|
||
| config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0)); | ||
| Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant(); | ||
| auxFluidModel = new CIncIdealGas(config->GetSpecific_Heat_Cp(), config->GetGas_Constant(), Pressure_Thermodynamic, STD_REF_TEMP); | ||
| auxFluidModel->SetTDState_T(Temperature_FreeStream); | ||
| Pressure_Thermodynamic = auxFluidModel->GetPressure(); | ||
| config->SetPressure_Thermodynamic(Pressure_Thermodynamic); | ||
| auxFluidModel->SetTDState_T(Temperature_FreeStream); | ||
| break; | ||
|
|
||
| case INC_IDEAL_GAS_POLY: | ||
|
|
||
| config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT/(config->GetMolecular_Weight()/1000.0)); | ||
| Pressure_Thermodynamic = Density_FreeStream*Temperature_FreeStream*config->GetGas_Constant(); | ||
| auxFluidModel = new CIncIdealGasPolynomial<N_POLY_COEFFS>(config->GetGas_Constant(), Pressure_Thermodynamic, STD_REF_TEMP); | ||
| if (viscous) { | ||
| /*--- Variable Cp model via polynomial. ---*/ | ||
|
|
@@ -315,24 +318,17 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i | |
| auxFluidModel->SetCpModel(config, Temperature_FreeStream); | ||
| } | ||
| auxFluidModel->SetTDState_T(Temperature_FreeStream); | ||
| Pressure_Thermodynamic = auxFluidModel->GetPressure(); | ||
| config->SetPressure_Thermodynamic(Pressure_Thermodynamic); | ||
| break; | ||
|
|
||
| case FLUID_MIXTURE: | ||
|
|
||
| config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0)); | ||
| Pressure_Thermodynamic = config->GetPressure_Thermodynamic(); | ||
| auxFluidModel = new CFluidScalar(Pressure_Thermodynamic, config); | ||
| auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init()); | ||
| break; | ||
|
|
||
| case FLUID_FLAMELET: | ||
|
|
||
| config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0)); | ||
| Pressure_Thermodynamic = config->GetPressure_Thermodynamic(); | ||
| auxFluidModel = new CFluidFlamelet(config, Pressure_Thermodynamic); | ||
| config->SetPressure_Thermodynamic(Pressure_Thermodynamic); | ||
| auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init()); | ||
| break; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ INC_VELOCITY_INIT= ( 0.2, 0, 0 ) | |
| INC_ENERGY_EQUATION= YES | ||
| INC_TEMPERATURE_INIT= 300.0 | ||
| INC_NONDIM= DIMENSIONAL | ||
| INIT_OPTION_INC= OPERATING_PRESSURE | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change the default please so that users in the wild are not surprised
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi! Thanks for your comment!! If I understand correctly, should I change the default to OPERATING_PRESSURE? or you mean to add the default in the config_template? I have already added this in the config_template: % Init option incompressible solver to choose between initial density (default) or operating pressure Thank you so much in advance!!!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. operating pressure so that not having it in the config is backward compatible |
||
| % | ||
| % -------------------- FLUID PROPERTIES ------------------------------------- % | ||
| % | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.