Skip to content

Commit 4e0dfb8

Browse files
authored
Merge pull request #1810 from su2code/feature_LM2015_model
Implementation of LM model for SA and cross-flow corrections (LM2015)
2 parents fc1b39e + 66a7d5e commit 4e0dfb8

File tree

20 files changed

+922
-242
lines changed

20 files changed

+922
-242
lines changed

Common/include/CConfig.hpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ class CConfig {
589589
SPECIES_MODEL Kind_Species_Model; /*!< \brief Species model definition. */
590590
TURB_SGS_MODEL Kind_SGS_Model; /*!< \brief LES SGS model definition. */
591591
TURB_TRANS_MODEL Kind_Trans_Model; /*!< \brief Transition model definition. */
592+
TURB_TRANS_CORRELATION Kind_Trans_Correlation; /*!< \brief Transition correlation model definition. */
593+
su2double hRoughness; /*!< \brief RMS roughness for Transition model. */
592594
unsigned short Kind_ActDisk, Kind_Engine_Inflow,
593595
*Kind_Data_Riemann,
594596
*Kind_Data_Giles; /*!< \brief Kind of inlet boundary treatment. */
@@ -715,8 +717,10 @@ class CConfig {
715717
string *Config_Filenames; /*!< \brief List of names for configuration files. */
716718
SST_OPTIONS *SST_Options; /*!< \brief List of modifications/corrections/versions of SST turbulence model.*/
717719
SA_OPTIONS *SA_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
720+
LM_OPTIONS *LM_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
718721
unsigned short nSST_Options; /*!< \brief Number of SST options specified. */
719722
unsigned short nSA_Options; /*!< \brief Number of SA options specified. */
723+
unsigned short nLM_Options; /*!< \brief Number of SA options specified. */
720724
WALL_FUNCTIONS *Kind_WallFunctions; /*!< \brief The kind of wall function to use for the corresponding markers. */
721725
unsigned short **IntInfo_WallFunctions; /*!< \brief Additional integer information for the wall function markers. */
722726
su2double **DoubleInfo_WallFunctions; /*!< \brief Additional double information for the wall function markers. */
@@ -1155,6 +1159,7 @@ class CConfig {
11551159
bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */
11561160
SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */
11571161
SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */
1162+
LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */
11581163
su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */
11591164
unsigned short eig_val_comp; /*!< \brief Parameter used to determine type of eigenvalue perturbation */
11601165
su2double uq_urlx; /*!< \brief Under-relaxation factor */
@@ -4316,6 +4321,18 @@ class CConfig {
43164321
*/
43174322
TURB_TRANS_MODEL GetKind_Trans_Model(void) const { return Kind_Trans_Model; }
43184323

4324+
/*!
4325+
* \brief Get the kind of the transition correlations.
4326+
* \return Kind of the transition correlation.
4327+
*/
4328+
TURB_TRANS_CORRELATION GetKind_Trans_Correlation(void) const { return Kind_Trans_Correlation; }
4329+
4330+
/*!
4331+
* \brief Get RMS roughness for Transtion model from config
4332+
* \return Value of roughness.
4333+
*/
4334+
su2double GethRoughness(void) const { return hRoughness; }
4335+
43194336
/*!
43204337
* \brief Get the kind of the species model.
43214338
* \return Kind of the species model.
@@ -9685,4 +9702,10 @@ class CConfig {
96859702
*/
96869703
SA_ParsedOptions GetSAParsedOptions() const { return saParsedOptions; }
96879704

9705+
/*!
9706+
* \brief Get parsed LM option data structure.
9707+
* \return LM option data structure.
9708+
*/
9709+
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }
9710+
96889711
};

Common/include/option_structure.hpp

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,119 @@ static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = {
11821182
MakePair("LM", TURB_TRANS_MODEL::LM)
11831183
};
11841184

1185+
/*!
1186+
* \brief LM Options
1187+
*/
1188+
enum class LM_OPTIONS {
1189+
NONE, /*!< \brief No option / default. */
1190+
LM2015, /*!< \brief Cross-flow corrections. */
1191+
MALAN, /*!< \brief Kind of transition correlation model (Malan). */
1192+
SULUKSNA, /*!< \brief Kind of transition correlation model (Suluksna). */
1193+
KRAUSE, /*!< \brief Kind of transition correlation model (Krause). */
1194+
KRAUSE_HYPER, /*!< \brief Kind of transition correlation model (Krause hypersonic). */
1195+
MEDIDA_BAEDER,/*!< \brief Kind of transition correlation model (Medida-Baeder). */
1196+
MEDIDA, /*!< \brief Kind of transition correlation model (Medida). */
1197+
MENTER_LANGTRY, /*!< \brief Kind of transition correlation model (Menter-Langtry). */
1198+
DEFAULT /*!< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */
1199+
};
1200+
1201+
static const MapType<std::string, LM_OPTIONS> LM_Options_Map = {
1202+
MakePair("NONE", LM_OPTIONS::NONE)
1203+
MakePair("LM2015", LM_OPTIONS::LM2015)
1204+
MakePair("MALAN", LM_OPTIONS::MALAN)
1205+
MakePair("SULUKSNA", LM_OPTIONS::SULUKSNA)
1206+
MakePair("KRAUSE", LM_OPTIONS::KRAUSE)
1207+
MakePair("KRAUSE_HYPER", LM_OPTIONS::KRAUSE_HYPER)
1208+
MakePair("MEDIDA_BAEDER", LM_OPTIONS::MEDIDA_BAEDER)
1209+
MakePair("MENTER_LANGTRY", LM_OPTIONS::MENTER_LANGTRY)
1210+
MakePair("DEFAULT", LM_OPTIONS::DEFAULT)
1211+
};
1212+
1213+
/*!
1214+
* \brief Types of transition correlations
1215+
*/
1216+
enum class TURB_TRANS_CORRELATION {
1217+
MALAN, /*!< \brief Kind of transition correlation model (Malan). */
1218+
SULUKSNA, /*!< \brief Kind of transition correlation model (Suluksna). */
1219+
KRAUSE, /*!< \brief Kind of transition correlation model (Krause). */
1220+
KRAUSE_HYPER, /*!< \brief Kind of transition correlation model (Krause hypersonic). */
1221+
MEDIDA_BAEDER,/*!< \brief Kind of transition correlation model (Medida-Baeder). */
1222+
MEDIDA, /*!< \brief Kind of transition correlation model (Medida). */
1223+
MENTER_LANGTRY, /*!< \brief Kind of transition correlation model (Menter-Langtry). */
1224+
DEFAULT /*!< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */
1225+
};
1226+
1227+
/*!
1228+
* \brief Structure containing parsed LM options.
1229+
*/
1230+
struct LM_ParsedOptions {
1231+
LM_OPTIONS version = LM_OPTIONS::NONE; /*!< \brief LM base model. */
1232+
bool LM2015 = false; /*!< \brief Use cross-flow corrections. */
1233+
TURB_TRANS_CORRELATION Correlation = TURB_TRANS_CORRELATION::DEFAULT;
1234+
};
1235+
1236+
/*!
1237+
* \brief Function to parse LM options.
1238+
* \param[in] LM_Options - Selected LM option from config.
1239+
* \param[in] nLM_Options - Number of options selected.
1240+
* \param[in] rank - MPI rank.
1241+
* \return Struct with SA options.
1242+
*/
1243+
inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned short nLM_Options, int rank, TURB_MODEL Kind_Turb_Model) {
1244+
LM_ParsedOptions LMParsedOptions;
1245+
1246+
auto IsPresent = [&](LM_OPTIONS option) {
1247+
const auto lm_options_end = LM_Options + nLM_Options;
1248+
return std::find(LM_Options, lm_options_end, option) != lm_options_end;
1249+
};
1250+
1251+
LMParsedOptions.LM2015 = IsPresent(LM_OPTIONS::LM2015);
1252+
1253+
int NFoundCorrelations = 0;
1254+
if (IsPresent(LM_OPTIONS::MALAN)) {
1255+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MALAN;
1256+
NFoundCorrelations++;
1257+
}
1258+
if (IsPresent(LM_OPTIONS::SULUKSNA)) {
1259+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::SULUKSNA;
1260+
NFoundCorrelations++;
1261+
}
1262+
if (IsPresent(LM_OPTIONS::KRAUSE)) {
1263+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::KRAUSE;
1264+
NFoundCorrelations++;
1265+
}
1266+
if (IsPresent(LM_OPTIONS::KRAUSE_HYPER)) {
1267+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::KRAUSE_HYPER;
1268+
NFoundCorrelations++;
1269+
}
1270+
if (IsPresent(LM_OPTIONS::MEDIDA_BAEDER)) {
1271+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MEDIDA_BAEDER;
1272+
NFoundCorrelations++;
1273+
}
1274+
if (IsPresent(LM_OPTIONS::MEDIDA)) {
1275+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MEDIDA;
1276+
NFoundCorrelations++;
1277+
}
1278+
if (IsPresent(LM_OPTIONS::MENTER_LANGTRY)) {
1279+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MENTER_LANGTRY;
1280+
NFoundCorrelations++;
1281+
}
1282+
1283+
if (NFoundCorrelations > 1) {
1284+
SU2_MPI::Error("Two correlations selected for LM_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
1285+
}
1286+
1287+
if (LMParsedOptions.Correlation == TURB_TRANS_CORRELATION::DEFAULT){
1288+
if (Kind_Turb_Model == TURB_MODEL::SST) {
1289+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MENTER_LANGTRY;
1290+
} else if (Kind_Turb_Model == TURB_MODEL::SA) {
1291+
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MALAN;
1292+
}
1293+
}
1294+
1295+
return LMParsedOptions;
1296+
}
1297+
11851298
/*!
11861299
* \brief types of species transport models
11871300
*/

Common/src/CConfig.cpp

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,10 @@ void CConfig::SetConfig_Options() {
11031103

11041104
/*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11051105
addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE);
1106+
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
1107+
addEnumListOption("LM_OPTIONS", nLM_Options, LM_Options, LM_Options_Map);
1108+
/*!\brief HROUGHNESS \n DESCRIPTION: Value of RMS roughness for transition model \n DEFAULT: 1E-6 \ingroup Config*/
1109+
addDoubleOption("HROUGHNESS", hRoughness, 1e-6);
11061110

11071111
/*!\brief KIND_SCALAR_MODEL \n DESCRIPTION: Specify scalar transport model \n Options: see \link Scalar_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
11081112
addEnumOption("KIND_SCALAR_MODEL", Kind_Species_Model, Species_Model_Map, SPECIES_MODEL::NONE);
@@ -3455,6 +3459,16 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
34553459
SU2_MPI::Error("Axisymmetry is currently only supported for KIND_TURB_MODEL chosen as SST", CURRENT_FUNCTION);
34563460
}
34573461

3462+
/*--- Postprocess LM_OPTIONS into structure. ---*/
3463+
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) {
3464+
lmParsedOptions = ParseLMOptions(LM_Options, nLM_Options, rank, Kind_Turb_Model);
3465+
3466+
/*--- Check if problem is 2D and LM2015 has been selected ---*/
3467+
if (lmParsedOptions.LM2015 && val_nDim == 2) {
3468+
SU2_MPI::Error("LM2015 is available only for 3D problems", CURRENT_FUNCTION);
3469+
}
3470+
}
3471+
34583472
/*--- Set the boolean Wall_Functions equal to true if there is a
34593473
definition for the wall founctions ---*/
34603474

@@ -4748,10 +4762,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
47484762
for (int i=0; i<7; ++i) eng_cyl[i] /= 12.0;
47494763
}
47504764

4751-
if ((Kind_Turb_Model != TURB_MODEL::SST) && Kind_Trans_Model == TURB_TRANS_MODEL::LM) {
4752-
SU2_MPI::Error("LM transition model currently only available in combination with SST turbulence model!", CURRENT_FUNCTION);
4753-
}
4754-
47554765
if(Turb_Fixed_Values && !OptionIsSet("TURB_FIXED_VALUES_DOMAIN")){
47564766
SU2_MPI::Error("TURB_FIXED_VALUES activated, but no domain set with TURB_FIXED_VALUES_DOMAIN.", CURRENT_FUNCTION);
47574767
}
@@ -6082,7 +6092,35 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
60826092
}
60836093
switch (Kind_Trans_Model) {
60846094
case TURB_TRANS_MODEL::NONE: break;
6085-
case TURB_TRANS_MODEL::LM: cout << "Transition model: Langtry and Menter's 4 equation model (2009)" << endl; break;
6095+
case TURB_TRANS_MODEL::LM: {
6096+
cout << "Transition model: Langtry and Menter's 4 equation model";
6097+
if (lmParsedOptions.LM2015) {
6098+
cout << " w/ cross-flow corrections (2015)" << endl;
6099+
} else {
6100+
cout << " (2009)" << endl;
6101+
}
6102+
break;
6103+
}
6104+
}
6105+
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) {
6106+
6107+
cout << "Correlation Functions: ";
6108+
switch (lmParsedOptions.Correlation) {
6109+
case TURB_TRANS_CORRELATION::MALAN: cout << "Malan et al. (2009)" << endl; break;
6110+
case TURB_TRANS_CORRELATION::SULUKSNA: cout << "Suluksna et al. (2009)" << endl; break;
6111+
case TURB_TRANS_CORRELATION::KRAUSE: cout << "Krause et al. (2008)" << endl; break;
6112+
case TURB_TRANS_CORRELATION::KRAUSE_HYPER: cout << "Krause et al. (2008, paper)" << endl; break;
6113+
case TURB_TRANS_CORRELATION::MEDIDA_BAEDER: cout << "Medida and Baeder (2011)" << endl; break;
6114+
case TURB_TRANS_CORRELATION::MEDIDA: cout << "Medida PhD (2014)" << endl; break;
6115+
case TURB_TRANS_CORRELATION::MENTER_LANGTRY: cout << "Menter and Langtry (2009)" << endl; break;
6116+
case TURB_TRANS_CORRELATION::DEFAULT:
6117+
switch (Kind_Turb_Model) {
6118+
case TURB_MODEL::SA: cout << "Malan et al. (2009)" << endl; break;
6119+
case TURB_MODEL::SST: cout << "Menter and Langtry (2009)" << endl; break;
6120+
case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", CURRENT_FUNCTION); break;
6121+
}
6122+
break;
6123+
}
60866124
}
60876125
cout << "Hybrid RANS/LES: ";
60886126
switch (Kind_HybridRANSLES) {

SU2_CFD/include/numerics/CNumerics.hpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ class CNumerics {
8383
turb_ke_i, /*!< \brief Turbulent kinetic energy at point i. */
8484
turb_ke_j; /*!< \brief Turbulent kinetic energy at point j. */
8585
su2double
86-
intermittency_eff_i; /*!< \brief effective intermittency at point i. */
86+
intermittency_eff_i, /*!< \brief effective intermittency at point i. */
87+
intermittency_i; /*!< \brief intermittency at point i. */
8788
su2double
8889
Pressure_i, /*!< \brief Pressure at point i. */
8990
Pressure_j; /*!< \brief Pressure at point j. */
@@ -157,6 +158,8 @@ class CNumerics {
157158
TurbPsi_Grad_j, /*!< \brief Gradient of adjoint turbulent variables at point j. */
158159
AuxVar_Grad_i, /*!< \brief Gradient of an auxiliary variable at point i. */
159160
AuxVar_Grad_j; /*!< \brief Gradient of an auxiliary variable at point i. */
161+
su2double
162+
LocalGridLength_i; /*!< \brief Local grid length at point i. */
160163
const su2double *RadVar_Source; /*!< \brief Source term from the radiative heat transfer equation. */
161164
const su2double
162165
*Coord_i, /*!< \brief Cartesians coordinates of point i. */
@@ -392,6 +395,14 @@ class CNumerics {
392395
TransVar_Grad_j = val_transvar_grad_j;
393396
}
394397

398+
/*!
399+
* \brief Set the value of the turbulent variable.
400+
* \param[in] val_transvar_i - Value of the turbulent variable at point i.
401+
*/
402+
inline void SetLocalGridLength(const su2double val_localGridLength_i) {
403+
LocalGridLength_i = val_localGridLength_i;
404+
}
405+
395406
/*!
396407
* \brief Set the value of the adjoint turbulent variable.
397408
* \param[in] val_turbpsivar_i - Value of the adjoint turbulent variable at point i.
@@ -711,6 +722,20 @@ class CNumerics {
711722
intermittency_eff_i = val_intermittency_eff_i;
712723
}
713724

725+
/*!
726+
* \brief Set the value of the intermittency for the LM model.
727+
* \param[in] intermittency_i - Value of the intermittency at point i.
728+
*/
729+
void SetIntermittency(su2double val_intermittency_i) {
730+
intermittency_i = val_intermittency_i;
731+
}
732+
733+
/*!
734+
* \brief Get the value of the effective intermittency for the transition model.
735+
* \param[in] intermittency_eff_i - Value of the effective intermittency at point i.
736+
*/
737+
su2double GetIntermittencyEff() const { return intermittency_eff_i; }
738+
714739
/*!
715740
* \brief Set the gradient of the auxiliary variables.
716741
* \param[in] val_auxvar_grad_i - Gradient of the auxiliary variable at point i.

0 commit comments

Comments
 (0)