Skip to content

Commit 0655c99

Browse files
adding standard reference temperature T0=298.15K as default value
1 parent 211dda0 commit 0655c99

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

Common/include/CConfig.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ class CConfig {
893893
Initial_BCThrust, /*!< \brief Ratio of turbulent to laminar viscosity at the actuator disk. */
894894
Pressure_FreeStream, /*!< \brief Total pressure of the fluid. */
895895
Pressure_Thermodynamic, /*!< \brief Thermodynamic pressure of the fluid. */
896+
Standard_Ref_Temperature, /*!< \brief Standard reference temperature for multicomponent flows. */
896897
Temperature_FreeStream, /*!< \brief Total temperature of the fluid. */
897898
Temperature_ve_FreeStream; /*!< \brief Total vibrational-electronic temperature of the fluid. */
898899
unsigned short wallModel_MaxIter; /*!< \brief maximum number of iterations for the Newton method for the wall model */
@@ -1924,6 +1925,12 @@ class CConfig {
19241925
*/
19251926
su2double GetPressure_Thermodynamic(void) const { return Pressure_Thermodynamic; }
19261927

1928+
/*!
1929+
* \brief Get the value of the standard reference temperature for multicomponent flows.
1930+
* \return Standard reference temperature.
1931+
*/
1932+
su2double GetStandard_RefTemperature(void) const { return Standard_Ref_Temperature; }
1933+
19271934
/*!
19281935
* \brief Get the value of the non-dimensionalized thermodynamic pressure.
19291936
* \return Non-dimensionalized thermodynamic pressure.

Common/src/CConfig.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,9 @@ void CConfig::SetConfig_Options() {
12111211
addDoubleOption("GAMMA_VALUE", Gamma, 1.4);
12121212
/*!\brief THERMODYNAMIC_PRESSURE \n DESCRIPTION: Thermodynamics(operating) Pressure (101325 Pa), only for incompressible flows) \ingroup Config*/
12131213
addDoubleOption("THERMODYNAMIC_PRESSURE", Pressure_Thermodynamic, 101325.0);
1214+
/*!\brief STANDARD_REFERENCE_TEMPERATURE \n DESCRIPTION: Standard reference temperature (298.15K), only for
1215+
* multicomponent incompressible flows) \ingroup Config*/
1216+
addDoubleOption("STANDARD_REFERENCE_TEMPERATURE", Standard_Ref_Temperature, 298.15);
12141217
/*!\brief CP_VALUE \n DESCRIPTION: Specific heat at constant pressure, Cp (1004.703 J/kg*K (air), constant density incompressible fluids only) \ingroup Config*/
12151218
addDoubleListOption("SPECIFIC_HEAT_CP", nSpecific_Heat_Cp, Specific_Heat_Cp);
12161219
/*!\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*/

SU2_CFD/include/fluid/CFluidScalar.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class CFluidScalar final : public CFluidModel {
4242
const int n_species_mixture; /*!< \brief Number of species in mixture. */
4343
su2double Gas_Constant; /*!< \brief Specific gas constant. */
4444
const su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */
45+
const su2double Ref_Temperature; /*!< \brief Reference temperature. */
4546
const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */
4647
const su2double Prandtl_Number; /*!< \brief Prandlt number.*/
4748

SU2_CFD/src/fluid/CFluidScalar.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ CFluidScalar::CFluidScalar(su2double value_pressure_operating, const CConfig* co
4545
: CFluidModel(),
4646
n_species_mixture(config->GetnSpecies() + 1),
4747
Pressure_Thermodynamic(value_pressure_operating),
48+
Ref_Temperature(config->GetStandard_RefTemperature()),
4849
GasConstant_Ref(config->GetGas_Constant_Ref()),
4950
Prandtl_Number(config->GetPrandtl_Turb()),
5051
wilke(config->GetKind_MixingViscosityModel() == MIXINGVISCOSITYMODEL::WILKE),
@@ -213,23 +214,23 @@ su2double CFluidScalar::ComputeMeanSpecificHeatCp(const su2double* val_scalars)
213214
}
214215

215216
su2double CFluidScalar::ComputeEnthalpyFromT(const su2double val_temperature, const su2double* val_scalars){
216-
su2double val_Enthalpy = Cp * (val_temperature - 298.15);
217+
su2double val_Enthalpy = Cp * (val_temperature - Ref_Temperature);
217218
return val_Enthalpy;
218219
}
219220

220221
void CFluidScalar::ComputeTempFromEnthalpy(const su2double val_enthalpy, su2double* val_temperature,
221222
const su2double* val_scalars) {
222223
MassToMoleFractions(val_scalars);
223224
su2double val_cp = ComputeMeanSpecificHeatCp(val_scalars);
224-
*val_temperature = val_enthalpy / val_cp + 298.15;
225+
*val_temperature = val_enthalpy / val_cp + Ref_Temperature;
225226
}
226227

227228
void CFluidScalar::GetEnthalpyDiffusivity(su2double* enthalpy_diffusions) {
229+
const su2double enthalpy_species_N = specificHeat[n_species_mixture - 1] * (Temperature - Ref_Temperature);
228230
for (int iVar = 0; iVar < n_species_mixture - 1; iVar++) {
229-
enthalpy_diffusions[iVar] = Density *
230-
(specificHeat[iVar] * massDiffusivity[iVar] -
231-
specificHeat[n_species_mixture - 1] * massDiffusivity[n_species_mixture - 1]) *
232-
(Temperature - 298.15);
231+
const su2double enthalpy_species_i = specificHeat[iVar] * (Temperature - Ref_Temperature);
232+
enthalpy_diffusions[iVar] = Density * (enthalpy_species_i * massDiffusivity[iVar] -
233+
enthalpy_species_N * massDiffusivity[n_species_mixture - 1]);
233234
}
234235
}
235236

0 commit comments

Comments
 (0)