@@ -1050,15 +1050,14 @@ void CConfig::SetPointersNull(void) {
10501050
10511051 Time_Ref = 1.0 ;
10521052
1053- Delta_UnstTime = 0.0 ;
1053+ Delta_UnstTime = 0.0 ;
10541054 Delta_UnstTimeND = 0.0 ;
1055- Total_UnstTime = 0.0 ;
1055+ Total_UnstTime = 0.0 ;
10561056 Total_UnstTimeND = 0.0 ;
10571057
10581058 Kind_TimeNumScheme = EULER_IMPLICIT;
10591059
10601060 Gas_Composition = nullptr ;
1061-
10621061}
10631062
10641063void CConfig::SetConfig_Options () {
@@ -1168,7 +1167,7 @@ void CConfig::SetConfig_Options() {
11681167 /* !\brief THERMAL_EXPANSION_COEFF \n DESCRIPTION: Thermal expansion coefficient (0.00347 K^-1 (air), used for Boussinesq approximation for liquids/non-ideal gases) \ingroup Config*/
11691168 addDoubleOption (" THERMAL_EXPANSION_COEFF" , Thermal_Expansion_Coeff, 0.00347 );
11701169 /* !\brief MOLECULAR_WEIGHT \n DESCRIPTION: Molecular weight for an incompressible ideal gas (28.96 g/mol (air) default) \ingroup Config*/
1171- addDoubleOption (" MOLECULAR_WEIGHT" , Molecular_Weight, 28.96 );
1170+ addDoubleListOption (" MOLECULAR_WEIGHT" , nMolecular_Weight, Molecular_Weight );
11721171
11731172 // /* DESCRIPTION: Specify if Mutation++ library is used */
11741173 /* --- Reading gas model as string or integer depending on TC library used. ---*/
@@ -3308,6 +3307,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
33083307 bool ideal_gas = ((Kind_FluidModel == STANDARD_AIR) ||
33093308 (Kind_FluidModel == IDEAL_GAS) ||
33103309 (Kind_FluidModel == INC_IDEAL_GAS) ||
3310+ (Kind_FluidModel == FLUID_MIXTURE) ||
33113311 (Kind_FluidModel == INC_IDEAL_GAS_POLY) ||
33123312 (Kind_FluidModel == CONSTANT_DENSITY));
33133313 bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) ||
@@ -3741,6 +3741,35 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
37413741 }
37423742 }
37433743
3744+ /* --- Set default values for various fluid properties. ---*/
3745+
3746+ const su2double Molecular_Weight_Default = 28.96 ;
3747+
3748+ if (Molecular_Weight == nullptr ) {
3749+ Molecular_Weight = new su2double[1 ];
3750+ Molecular_Weight[0 ] = Molecular_Weight_Default;
3751+ nMolecular_Weight = 1 ;
3752+ }
3753+
3754+ /* --- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/
3755+
3756+ if (Kind_FluidModel == FLUID_MIXTURE) {
3757+ /* --- Check whether the number of entries of each specified fluid property equals the number of transported scalar
3758+ equations solved + 1. nMolecular_Weight is used because it is required for the fluid mixing models. --- */
3759+ if (nMolecular_Weight != nSpecies_Init + 1 ) {
3760+ SU2_MPI::Error (
3761+ " The use of FLUID_MIXTURE requires the number of entries for MOLECULAR_WEIGHT\n "
3762+ " to be equal to the number of entries of SCALAR_INIT + 1" ,
3763+ CURRENT_FUNCTION);
3764+ }
3765+ /* --- Check whether the density model used is correct, in the case of FLUID_MIXTURE the density model must be
3766+ VARIABLE. Otherwise, if the density model is CONSTANT, the scalars will not have influence the mixture density and
3767+ it will remain constant through the complete domain. --- */
3768+ if (Kind_DensityModel != INC_DENSITYMODEL::VARIABLE) {
3769+ SU2_MPI::Error (" The use of FLUID_MIXTURE requires the INC_DENSITY_MODEL option to be VARIABLE" , CURRENT_FUNCTION);
3770+ }
3771+ }
3772+
37443773 /* --- Overrule the default values for viscosity if the US measurement system is used. ---*/
37453774
37463775 if (SystemMeasurements == US) {
@@ -4725,7 +4754,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47254754 }
47264755
47274756 if (Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) {
4728- if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY) {
4757+ if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY && Kind_FluidModel != FLUID_MIXTURE ) {
47294758 SU2_MPI::Error (" Variable density incompressible solver limited to ideal gases.\n Check the fluid model options (use INC_IDEAL_GAS, INC_IDEAL_GAS_POLY)." , CURRENT_FUNCTION);
47304759 }
47314760 }
@@ -4738,7 +4767,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47384767
47394768 if (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) {
47404769 if (Kind_ViscosityModel == VISCOSITYMODEL::SUTHERLAND) {
4741- if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY)) {
4770+ if ((Kind_FluidModel != INC_IDEAL_GAS) && (Kind_FluidModel != INC_IDEAL_GAS_POLY) && (Kind_FluidModel != FLUID_MIXTURE) ) {
47424771 SU2_MPI::Error (" Sutherland's law only valid for ideal gases in incompressible flows.\n Must use VISCOSITY_MODEL=CONSTANT_VISCOSITY and set viscosity with\n MU_CONSTANT, or use DENSITY_MODEL= VARIABLE with FLUID_MODEL= INC_IDEAL_GAS or INC_IDEAL_GAS_POLY for VISCOSITY_MODEL=SUTHERLAND.\n NOTE: FREESTREAM_VISCOSITY is no longer used for incompressible flows!" , CURRENT_FUNCTION);
47434772 }
47444773 }
0 commit comments