[WIP] Add initialization option for incompressible solver by Cristopher-Morales · Pull Request #2709 · su2code/SU2
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.
/*--- Read farfield conditions ---*/
Density_Inf = config->GetDensity_FreeStreamND();
Pressure_Inf = config->GetPressure_FreeStreamND();
Velocity_Inf = config->GetVelocity_FreeStreamND();
Temperature_Inf = config->GetTemperature_FreeStreamND();
if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) scalar_init = config->GetSpecies_Init();
GetFluidModel()->SetTDState_T(Temperature_Inf, scalar_init);
Enthalpy_Inf = GetFluidModel()->GetEnthalpy();
/*--- Initialize the solution to the far-field state everywhere. ---*/
if (navier_stokes) {
nodes = new CIncNSVariable(Pressure_Inf, Velocity_Inf, Enthalpy_Inf, nPoint, nDim, nVar, config);
} else {
nodes = new CIncEulerVariable(Pressure_Inf, Velocity_Inf, Enthalpy_Inf, nPoint, nDim, nVar, config);
}
before the above code , there is a called to the SetNonDimensionalization. and in the SetNonDimensionalization, the FreeStream pressure is set as:
/*--- Compute dimensional free-stream values. ---*/
Density_FreeStream = config->GetInc_Density_Init(); config->SetDensity_FreeStream(Density_FreeStream);
Temperature_FreeStream = config->GetInc_Temperature_Init(); config->SetTemperature_FreeStream(Temperature_FreeStream);
Pressure_FreeStream = 0.0; config->SetPressure_FreeStream(Pressure_FreeStream);
I will add throw error.