Skip to content

Commit 6c3eff1

Browse files
committed
PR comments
1 parent 3205992 commit 6c3eff1

3 files changed

Lines changed: 23 additions & 32 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3793,7 +3793,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
37933793
}
37943794

37953795
if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND) ) {
3796-
SU2_MPI::Error("Only WILKE and SUTHERLAND transport models are stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION);
3796+
SU2_MPI::Error("Only WILKE and SUTHERLAND transport models are stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION);
37973797
}
37983798

37993799
if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) {

SU2_CFD/include/fluid/CSU2TCLib.hpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ class CSU2TCLib : public CNEMOGas {
6464
phis, mus, /*!< \brief Auxiliary vectors to be used in Wilke/Blottner/Eucken model */
6565
A; /*!< \brief Auxiliary vector to be used in net production rate computation */
6666

67-
vector<su2double>
68-
mu_ref, /*!< \brief Vector containing reference viscosity for Sutherland's law */
69-
k_ref, /*!< \brief Vector containing reference thermal conducivities for Sutherland's law */
70-
Sm_ref, /*!< \brief Vector containing Sutherland's constant for viscosity */
71-
Sk_ref; /*!< \brief Vector containing Sutherland's constant for thermal conductivities */
67+
std::array<su2double,1> mu_ref; /*!< \brief Vector containing reference viscosity for Sutherland's law */
68+
std::array<su2double,1> k_ref; /*!< \brief Vector containing reference thermal conducivities for Sutherland's law */
69+
std::array<su2double,1> Sm_ref; /*!< \brief Vector containing Sutherland's constant for viscosity */
70+
std::array<su2double,1> Sk_ref; /*!< \brief Vector containing Sutherland's constant for thermal conductivities */
71+
72+
const su2double T_ref_suth = 273.15; /*!<\brief Reference temperature for Sutherland's model [K] */
7273

7374
su2activematrix CharElTemp, /*!< \brief Characteristic temperature of electron states. */
7475
ElDegeneracy, /*!< \brief Degeneracy of electron states. */
@@ -209,42 +210,42 @@ class CSU2TCLib : public CNEMOGas {
209210
void ComputeKeqConstants(unsigned short val_Reaction);
210211

211212
/*!
212-
* \brief Get species diffusion coefficients with Wilke/Blottner/Eucken transport model.
213+
* \brief Calculate species diffusion coefficients with Wilke/Blottner/Eucken transport model.
213214
*/
214215
void DiffusionCoeffWBE();
215216

216217
/*!
217-
* \brief Get viscosity with Wilke/Blottner/Eucken transport model.
218+
* \brief Calculate viscosity with Wilke/Blottner/Eucken transport model.
218219
*/
219220
void ViscosityWBE();
220221

221222
/*!
222-
* \brief Get T-R and V-E thermal conductivities vector with Wilke/Blottner/Eucken transport model.
223+
* \brief Calculate T-R and V-E thermal conductivities vector with Wilke/Blottner/Eucken transport model.
223224
*/
224225
void ThermalConductivitiesWBE();
225226

226227
/*!
227-
* \brief Get species diffusion coefficients with Gupta-Yos transport model.
228+
* \brief Calculate species diffusion coefficients with Gupta-Yos transport model.
228229
*/
229230
void DiffusionCoeffGY();
230231

231232
/*!
232-
* \brief Get viscosity with Gupta-Yos transport model.
233+
* \brief Calculate viscosity with Gupta-Yos transport model.
233234
*/
234235
void ViscosityGY();
235236

236237
/*!
237-
* \brief Get T-R and V-E thermal conductivities vector with Gupta-Yos transport model.
238+
* \brief Calculate T-R and V-E thermal conductivities vector with Gupta-Yos transport model.
238239
*/
239240
void ThermalConductivitiesGY();
240241

241242
/*!
242-
* \brief Get viscosity with Sutherland's transport model.
243+
* \brief Calculate viscosity with Sutherland's transport model.
243244
*/
244245
void ViscositySuth();
245246

246247
/*!
247-
* \brief Get T-R and V-E thermal conductivities vector with Sutherland's transport model.
248+
* \brief Calculate T-R and V-E thermal conductivities vector with Sutherland's transport model.
248249
*/
249250
void ThermalConductivitiesSuth();
250251

SU2_CFD/src/fluid/CSU2TCLib.cpp

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,6 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
5656
MolarFracWBE.resize(nSpecies,0.0);
5757
phis.resize(nSpecies,0.0);
5858
mus.resize(nSpecies,0.0);
59-
60-
/*--- Reference values for Sutherland's law viscosity ---*/
61-
//Note: Can be extended with better coefficients of individual species,.
62-
k_ref.resize(1,0.0);
63-
mu_ref.resize(1,0.0);
64-
Sm_ref.resize(1,0.0);
65-
Sk_ref.resize(1,0.0);
6659
}
6760

6861
if (gas_model =="ARGON"){
@@ -1843,8 +1836,7 @@ void CSU2TCLib::DiffusionCoeffGY(){
18431836
//}
18441837

18451838
/*--- Assign species diffusion coefficient ---*/
1846-
if (denom == 0) { DiffusionCoeff[iSpecies] = 0.0; }
1847-
else { DiffusionCoeff[iSpecies] = gam_t*gam_t*Mi*(1-Mi*gam_i) / denom; }
1839+
DiffusionCoeff[iSpecies] = (denom > EPS) ? (gam_t*gam_t*Mi*(1-Mi*gam_i) / denom) : su2double(0.0);
18481840
}
18491841
// if (ionization) {
18501842
//TODO: Update correct iElectron....
@@ -2013,13 +2005,13 @@ void CSU2TCLib::ThermalConductivitiesGY(){
20132005
}
20142006

20152007
/*--- Translational contribution to thermal conductivity ---*/
2016-
if (denom_t != 0) ThermalCond_tr += (15.0/4.0)*kb*gam_i/denom_t;
2008+
ThermalCond_tr += (denom_t > EPS) ? ((15.0/4.0)*kb*gam_i/denom_t) : su2double(0.0);
20172009

20182010
/*--- Translational contribution to thermal conductivity ---*/
2019-
if (RotationModes[iSpecies] != 0.0 && denom_r != 0) ThermalCond_tr += kb*gam_i/denom_r;
2011+
if (RotationModes[iSpecies] != 0.0) ThermalCond_tr += (denom_r > EPS) ? (kb*gam_i/denom_r) : su2double(0.0);
20202012

20212013
/*--- Vibrational-electronic contribution to thermal conductivity ---*/
2022-
if (denom_r != 0) ThermalCond_ve += kb*Cvve/R*gam_i / denom_r;
2014+
ThermalCond_ve += (denom_r > EPS) ? (kb*Cvve/R*gam_i / denom_r) : su2double(0.0);
20232015
}
20242016

20252017
ThermalConductivities[0] = ThermalCond_tr;
@@ -2028,11 +2020,10 @@ void CSU2TCLib::ThermalConductivitiesGY(){
20282020

20292021
void CSU2TCLib::ViscositySuth(){
20302022

2031-
su2double T_ref = 273.15;
2032-
su2double T_nd = T / T_ref;
2023+
su2double T_nd = T / T_ref_suth;
20332024

20342025
/*--- Calculate mixture laminar viscosity ---*/
2035-
Mu = mu_ref[0] * T_nd * sqrt(T_nd) * ((T_ref + Sm_ref[0]) / (T + Sm_ref[0]));
2026+
Mu = mu_ref[0] * T_nd * sqrt(T_nd) * ((T_ref_suth + Sm_ref[0]) / (T + Sm_ref[0]));
20362027

20372028
}
20382029

@@ -2050,9 +2041,8 @@ void CSU2TCLib::ThermalConductivitiesSuth(){
20502041
su2double scl = Cvve/Cvtr;
20512042

20522043
/*--- Compute k's using Sutherland's law ---*/
2053-
su2double T_ref = 273.15;
2054-
su2double T_nd = T / T_ref;
2055-
su2double k = k_ref[0] * T_nd * sqrt(T_nd) * ((T_ref + Sk_ref[0]) / (T + Sk_ref[0]));
2044+
su2double T_nd = T / T_ref_suth;
2045+
su2double k = k_ref[0] * T_nd * sqrt(T_nd) * ((T_ref_suth + Sk_ref[0]) / (T + Sk_ref[0]));
20562046
su2double kve = scl*k;
20572047

20582048
ThermalConductivities[0] = k;

0 commit comments

Comments
 (0)