Skip to content
Open
25 changes: 23 additions & 2 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,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 @@ -765,11 +766,13 @@ 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.*/
ROUGHSST_MODEL Kind_RoughSST_Model; /*!< \brief List of modifications/corrections/versions of rough-wall boundary conditions for SST turbulence 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 @@ -922,6 +925,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 @@ -1237,6 +1241,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 @@ -2088,6 +2093,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 @@ -2794,6 +2805,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 @@ -10216,6 +10233,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; }
* \brief Get rough-wall boundary conditions for SST.
*/
ROUGHSST_MODEL GetKindRoughSSTModel() const { return Kind_RoughSST_Model; }
Expand Down
64 changes: 61 additions & 3 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1222,10 +1222,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 @@ -1283,10 +1285,10 @@ struct LM_ParsedOptions {
* \brief Function to parse LM options.
* \param[in] LM_Options - Selected LM option from config.
* \param[in] nLM_Options - Number of options selected.
* \param[in] rank - MPI rank.
* \return Struct with SA options.
* \param[in] Kind_Turb_Model- Selected based turbulence model from config.
* \return Struct with LM options.
*/
inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned short nLM_Options, int rank, TURB_MODEL Kind_Turb_Model) {
inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned short nLM_Options, TURB_MODEL Kind_Turb_Model) {
LM_ParsedOptions LMParsedOptions;

auto IsPresent = [&](LM_OPTIONS option) {
Expand Down Expand Up @@ -1342,6 +1344,62 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh
}

/*!
* \brief AFT Options
*/
enum class AFT_OPTIONS {
NONE, /*!< \brief No option / default. */
AFT2019b /*!< \brief 2019b Coder SA-AFT model (https://doi.org/10.2514/6.2019-0039). */
};

static const MapType<std::string, AFT_OPTIONS> AFT_Options_Map = {
MakePair("NONE", AFT_OPTIONS::NONE)
MakePair("AFT2019b", AFT_OPTIONS::AFT2019b)
};

/*!
* \brief Types of transition correlations
*/
enum class AFT_CORRELATION {
NONE, /*!< \brief No option / default. */
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.
* \return Struct with AFT options.
*/
inline AFT_ParsedOptions ParseAFTOptions(const AFT_OPTIONS *AFT_Options, unsigned short nAFT_Options) {
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::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 Structure containing parsed options for data-driven fluid model.
*/
struct DataDrivenFluid_ParsedOptions {
Expand Down
25 changes: 24 additions & 1 deletion Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,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 @@ -1452,6 +1454,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 @@ -3631,12 +3635,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i

/*--- Postprocess LM_OPTIONS into structure. ---*/
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) {
lmParsedOptions = ParseLMOptions(LM_Options, nLM_Options, rank, Kind_Turb_Model);
lmParsedOptions = ParseLMOptions(LM_Options, nLM_Options, Kind_Turb_Model);

/*--- Check if problem is 2D and LM2015 has been selected ---*/
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);
}

/*--- Set the boolean Wall_Functions equal to true if there is a
Expand Down Expand Up @@ -6489,6 +6495,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 @@ -6510,6 +6520,19 @@ 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::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