-
Notifications
You must be signed in to change notification settings - Fork 847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implementation of Amplification Factor Transport(AFT) 2019b tranistion model #2422
base: develop
Are you sure you want to change the base?
Changes from all commits
e652a53
e1e12ca
058ee6e
448f5b9
a583d7c
5349d97
0de4e65
5686134
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1205,10 +1205,12 @@ inline SA_ParsedOptions ParseSAOptions(const SA_OPTIONS *SA_Options, unsigned sh | |
enum class TURB_TRANS_MODEL { | ||
NONE, /*!< \brief No transition model. */ | ||
LM, /*!< \brief Kind of transition model (Langtry-Menter (LM) for SST and Spalart-Allmaras). */ | ||
AFT, /*!< \brief Kind of transition model (Amplification Factor Transport model for Spalart-Allmaras). */ | ||
}; | ||
static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = { | ||
MakePair("NONE", TURB_TRANS_MODEL::NONE) | ||
MakePair("LM", TURB_TRANS_MODEL::LM) | ||
MakePair("AFT", TURB_TRANS_MODEL::AFT) | ||
}; | ||
|
||
/*! | ||
|
@@ -1324,6 +1326,73 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh | |
return LMParsedOptions; | ||
} | ||
|
||
/*! | ||
* \brief AFT Options | ||
*/ | ||
enum class AFT_OPTIONS { | ||
NONE, /*!< \brief No option / default. */ | ||
AFT2017b, /*!< \brief using AFT2017b model. */ | ||
AFT2019b /*!< \brief using AFT2019b model. */ | ||
}; | ||
|
||
static const MapType<std::string, AFT_OPTIONS> AFT_Options_Map = { | ||
MakePair("NONE", AFT_OPTIONS::NONE) | ||
MakePair("AFT2017b", AFT_OPTIONS::AFT2017b) | ||
MakePair("AFT2019b", AFT_OPTIONS::AFT2019b) | ||
}; | ||
|
||
/*! | ||
* \brief Types of transition correlations | ||
*/ | ||
enum class AFT_CORRELATION { | ||
NONE, /*!< \brief No option / default. */ | ||
AFT2017b, /*!< \brief Kind of transition correlation model (AFT2017b). */ | ||
AFT2019b /*!< \brief Kind of transition correlation model (AFT2019b). */ | ||
}; | ||
|
||
/*! | ||
* \brief Structure containing parsed AFT options. | ||
*/ | ||
struct AFT_ParsedOptions { | ||
AFT_OPTIONS version = AFT_OPTIONS::NONE; /*!< \brief AFT base model. */ | ||
AFT_CORRELATION Correlation = AFT_CORRELATION::NONE; | ||
}; | ||
|
||
/*! | ||
* \brief Function to parse AFT options. | ||
* \param[in] AFT_Options - Selected AFT option from config. | ||
* \param[in] nAFT_Options - Number of options selected. | ||
* \param[in] rank - MPI rank. | ||
* \return Struct with AFT options. | ||
*/ | ||
inline AFT_ParsedOptions ParseAFTOptions(const AFT_OPTIONS *AFT_Options, unsigned short nAFT_Options, int rank) { | ||
Comment on lines
+1365
to
+1368
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rank is not used, can you remove it from this function and maybe LMOptions if it is also not used there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay. I remove the rank both AFT and LM. |
||
AFT_ParsedOptions AFTParsedOptions; | ||
|
||
auto IsPresent = [&](AFT_OPTIONS option) { | ||
const auto aft_options_end = AFT_Options + nAFT_Options; | ||
return std::find(AFT_Options, aft_options_end, option) != aft_options_end; | ||
}; | ||
|
||
int NFoundCorrelations = 0; | ||
if (IsPresent(AFT_OPTIONS::AFT2017b)) { | ||
AFTParsedOptions.Correlation = AFT_CORRELATION::AFT2017b; | ||
AFTParsedOptions.version = AFT_OPTIONS::AFT2017b; | ||
NFoundCorrelations++; | ||
} | ||
|
||
if (IsPresent(AFT_OPTIONS::AFT2019b)) { | ||
AFTParsedOptions.Correlation = AFT_CORRELATION::AFT2019b; | ||
AFTParsedOptions.version = AFT_OPTIONS::AFT2019b; | ||
NFoundCorrelations++; | ||
} | ||
|
||
if (NFoundCorrelations > 1) { | ||
|
||
SU2_MPI::Error("Two correlations selected for AFT_OPTIONS. Please choose only one.", CURRENT_FUNCTION); | ||
} | ||
|
||
return AFTParsedOptions; | ||
} | ||
|
||
/*! | ||
* \brief types of species transport models | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1126,6 +1126,8 @@ | |
addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE); | ||
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ | ||
addEnumListOption("LM_OPTIONS", nLM_Options, LM_Options, LM_Options_Map); | ||
/*!\brief AFT_OPTIONS \n DESCRIPTION: Specify AFT transition model options/correlations. \n Options: see \link AFT_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ | ||
addEnumListOption("AFT_OPTIONS", nAFT_Options, AFT_Options, AFT_Options_Map); | ||
/*!\brief HROUGHNESS \n DESCRIPTION: Value of RMS roughness for transition model \n DEFAULT: 1E-6 \ingroup Config*/ | ||
addDoubleOption("HROUGHNESS", hRoughness, 1e-6); | ||
|
||
|
@@ -1424,6 +1426,8 @@ | |
/* DESCRIPTION: */ | ||
addDoubleOption("FREESTREAM_TURBULENCEINTENSITY", TurbIntensityAndViscRatioFreeStream[0], 0.05); | ||
/* DESCRIPTION: */ | ||
addDoubleOption("N_CRITICAL", N_Critcal, 0.0); | ||
/* DESCRIPTION: */ | ||
addDoubleOption("FREESTREAM_NU_FACTOR", NuFactor_FreeStream, 3.0); | ||
/* DESCRIPTION: */ | ||
addDoubleOption("LOWER_LIMIT_K_FACTOR", KFactor_LowerLimit, 1.0e-15); | ||
|
@@ -3532,6 +3536,8 @@ | |
if (lmParsedOptions.LM2015 && val_nDim == 2) { | ||
SU2_MPI::Error("LM2015 is available only for 3D problems", CURRENT_FUNCTION); | ||
} | ||
} else if (Kind_Trans_Model == TURB_TRANS_MODEL::AFT) { | ||
aftParsedOptions = ParseAFTOptions(AFT_Options, nAFT_Options, rank); | ||
} | ||
|
||
/*--- Set the boolean Wall_Functions equal to true if there is a | ||
|
@@ -6321,6 +6327,10 @@ | |
} | ||
break; | ||
} | ||
case TURB_TRANS_MODEL::AFT:{ | ||
cout << "Transition model: Amplification Factor Transport model"; | ||
break; | ||
} | ||
} | ||
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) { | ||
|
||
|
@@ -6342,6 +6352,26 @@ | |
break; | ||
} | ||
} | ||
if (Kind_Trans_Model == TURB_TRANS_MODEL::AFT) { | ||
|
||
switch (aftParsedOptions.Correlation) { | ||
case AFT_CORRELATION::AFT2017b: | ||
switch (Kind_Turb_Model) { | ||
case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break; | ||
case TURB_MODEL::SST: SU2_MPI::Error("k-w SST turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break; | ||
} | ||
Comment on lines
+6359
to
+6362
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This block of code appears twice, please refactor this a little to avoid duplicating it. |
||
cout << "-2017b" << endl; break; | ||
Check warning Code scanning / CodeQL Dead code due to goto or break statement Warning
This statement makes
if (...) ... Error loading related location Loading Check warning Code scanning / CodeQL Dead code due to goto or break statement Warning
This statement makes
if (...) ... Error loading related location Loading |
||
if(!saParsedOptions.ft2) SU2_MPI::Error("ft2 option of SA model has been not selected.", CURRENT_FUNCTION); | ||
case AFT_CORRELATION::AFT2019b: | ||
switch (Kind_Turb_Model) { | ||
case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break; | ||
case TURB_MODEL::SST: SU2_MPI::Error("k-w SST turbulence model has been selected but AFT transition model is active.", CURRENT_FUNCTION); break; | ||
} | ||
cout << "-2019b" << endl; break; | ||
if(!saParsedOptions.ft2) SU2_MPI::Error("ft2 option of SA model has been not selected.", CURRENT_FUNCTION); | ||
case AFT_CORRELATION::NONE: SU2_MPI::Error("NONE has been selected.", CURRENT_FUNCTION); break; | ||
} | ||
} | ||
cout << "Hybrid RANS/LES: "; | ||
switch (Kind_HybridRANSLES) { | ||
case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align the start of the comments and add some links to reference papers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure!
The reference paper is "https://doi.org/10.2514/6.2019-0039."
I'll add the above link.