Skip to content
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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ class CConfig {
TURB_SGS_MODEL Kind_SGS_Model; /*!< \brief LES SGS model definition. */
TURB_TRANS_MODEL Kind_Trans_Model; /*!< \brief Transition model definition. */
TURB_TRANS_CORRELATION Kind_Trans_Correlation; /*!< \brief Transition correlation model definition. */
AFT_CORRELATION Kind_AFT_Correlation; /*!< \brief Transition correlation of AFT model definition. */
su2double hRoughness; /*!< \brief RMS roughness for Transition model. */
unsigned short Kind_ActDisk, Kind_Engine_Inflow,
*Kind_Data_Riemann,
Expand Down Expand Up @@ -734,10 +735,12 @@ class CConfig {
string *Config_Filenames; /*!< \brief List of names for configuration files. */
SST_OPTIONS *SST_Options; /*!< \brief List of modifications/corrections/versions of SST turbulence model.*/
SA_OPTIONS *SA_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
LM_OPTIONS *LM_Options; /*!< \brief List of modifications/corrections/versions of SA turbulence model.*/
LM_OPTIONS *LM_Options; /*!< \brief List of modifications/corrections/versions of LM transition model.*/
AFT_OPTIONS *AFT_Options; /*!< \brief List of modifications/corrections/versions of AFT transition model.*/
unsigned short nSST_Options; /*!< \brief Number of SST options specified. */
unsigned short nSA_Options; /*!< \brief Number of SA options specified. */
unsigned short nLM_Options; /*!< \brief Number of SA options specified. */
unsigned short nLM_Options; /*!< \brief Number of LM options specified. */
unsigned short nAFT_Options; /*!< \brief Number of AFT options specified. */
WALL_FUNCTIONS *Kind_WallFunctions; /*!< \brief The kind of wall function to use for the corresponding markers. */
unsigned short **IntInfo_WallFunctions; /*!< \brief Additional integer information for the wall function markers. */
su2double **DoubleInfo_WallFunctions; /*!< \brief Additional double information for the wall function markers. */
Expand Down Expand Up @@ -885,6 +888,7 @@ class CConfig {
Tke_FreeStream, /*!< \brief Total turbulent kinetic energy of the fluid. */
Intermittency_FreeStream, /*!< \brief Freestream intermittency (for sagt transition model) of the fluid. */
ReThetaT_FreeStream, /*!< \brief Freestream Transition Momentum Thickness Reynolds Number (for LM transition model) of the fluid. */
N_Critcal, /*!< \brief Critical N-factor (for AFT model). */
NuFactor_FreeStream, /*!< \brief Ratio of turbulent to laminar viscosity. */
NuFactor_Engine, /*!< \brief Ratio of turbulent to laminar viscosity at the engine. */
KFactor_LowerLimit, /*!< \Non dimensional coefficient for lower limit of K in SST model. */
Expand Down Expand Up @@ -1178,6 +1182,7 @@ class CConfig {
SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */
SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */
LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */
AFT_ParsedOptions aftParsedOptions; /*!< \brief Additional parameters for the AFT transition model. */
su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */
unsigned short eig_val_comp; /*!< \brief Parameter used to determine type of eigenvalue perturbation */
su2double uq_urlx; /*!< \brief Under-relaxation factor */
Expand Down Expand Up @@ -2007,6 +2012,12 @@ class CConfig {
*/
su2double GetReThetaT_FreeStream() const { return ReThetaT_FreeStream; }

/*!
* \brief Get the value of the critical N-factor.
* \return The critical N-factor.
*/
su2double GetN_Critical(void) const { return N_Critcal; }

/*!
* \brief Get the value of the non-dimensionalized freestream turbulence intensity.
* \return Non-dimensionalized freestream intensity.
Expand Down Expand Up @@ -2757,6 +2768,12 @@ class CConfig {
*/
void SetReThetaT_FreeStream(su2double val_ReThetaT_freestream) { ReThetaT_FreeStream = val_ReThetaT_freestream; }

/*!
* \brief Set the freestream momentum thickness Reynolds number.
* \param[in] val_ReThetaT_freestream - Value of the freestream momentum thickness Reynolds number.
*/
void SetN_Crtical(su2double val_N_critcal) { N_Critcal = val_N_critcal; }

/*!
* \brief Set the non-dimensional freestream energy.
* \param[in] val_energy_freestreamnd - Value of the non-dimensional freestream energy.
Expand Down Expand Up @@ -9920,4 +9937,10 @@ class CConfig {
*/
LM_ParsedOptions GetLMParsedOptions() const { return lmParsedOptions; }

/*!
* \brief Get parsed AFT option data structure.
* \return AFT option data structure.
*/
AFT_ParsedOptions GetAFTParsedOptions() const { return aftParsedOptions; }

};
69 changes: 69 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

/*!
Expand Down Expand Up @@ -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) {
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) {
Fixed Show fixed Hide fixed
SU2_MPI::Error("Two correlations selected for AFT_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
}

return AFTParsedOptions;
}

/*!
* \brief types of species transport models
*/
Expand Down
30 changes: 30 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,8 @@ void CConfig::SetConfig_Options() {
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);

Expand Down Expand Up @@ -1419,6 +1421,8 @@ void CConfig::SetConfig_Options() {
/* 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);
Expand Down Expand Up @@ -3521,6 +3525,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
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
Expand Down Expand Up @@ -6304,6 +6310,10 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
}
break;
}
case TURB_TRANS_MODEL::AFT:{
cout << "Transition model: Amplification Factor Transport model";
break;
}
}
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) {

Expand All @@ -6325,6 +6335,26 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
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;
}
cout << "-2017b" << endl; break;
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,10 @@
template <class FlowIndices>
using CUpwSca_TransLM = CUpwSca_TurbSST<FlowIndices>;

/*!
* \class CUpwSca_TransAFT
* \brief Re-use the SST convective fluxes for the scalar upwind discretization of AFT transition model equations.
* \ingroup ConvDiscr
*/
template <class FlowIndices>
using CUpwSca_TransAFT = CUpwSca_TurbSST<FlowIndices>;
Loading
Loading