-
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 Simplified LM Transition model #1901
base: develop
Are you sure you want to change the base?
Changes from 5 commits
a7136d3
e9226db
d03742a
e17872d
4b9c615
04cd56d
e29b4df
0319d62
b1edf61
7eee4ab
c461518
e68a9e4
bcdd671
9bb2435
a9a6ce4
86b068c
73c0a4b
8d5148e
9db7301
1e7e7a3
ab2d71b
a6fe9bc
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 | ||||
---|---|---|---|---|---|---|
|
@@ -1173,26 +1173,36 @@ static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = { | |||||
*/ | ||||||
enum class LM_OPTIONS { | ||||||
NONE, /*!< \brief No option / default. */ | ||||||
LM2015, /*!< \brief Cross-flow corrections. */ | ||||||
CROSSFLOW, /*!< \brief Cross-flow corrections. */ | ||||||
SLM, /*!< \brief Simplified version. */ | ||||||
PRODLIM, /*!< \brief Add production term to Pk. */ | ||||||
MALAN, /*!< \brief Kind of transition correlation model (Malan). */ | ||||||
SULUKSNA, /*!< \brief Kind of transition correlation model (Suluksna). */ | ||||||
KRAUSE, /*!< \brief Kind of transition correlation model (Krause). */ | ||||||
KRAUSE_HYPER, /*!< \brief Kind of transition correlation model (Krause hypersonic). */ | ||||||
MEDIDA_BAEDER,/*!< \brief Kind of transition correlation model (Medida-Baeder). */ | ||||||
MEDIDA, /*!< \brief Kind of transition correlation model (Medida). */ | ||||||
MENTER_LANGTRY, /*!< \brief Kind of transition correlation model (Menter-Langtry). */ | ||||||
MENTER_SLM, /*!< \brief Kind of transition correlation model (Menter Simplified LM model). */ | ||||||
CODER_SLM, /*!< \brief Kind of transition correlation model (Coder Simplified LM model). */ | ||||||
MOD_EPPLER_SLM, /*!< \brief Kind of transition correlation model (Modified Eppler Simplified LM model). */ | ||||||
DEFAULT /*!< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */ | ||||||
}; | ||||||
|
||||||
static const MapType<std::string, LM_OPTIONS> LM_Options_Map = { | ||||||
MakePair("NONE", LM_OPTIONS::NONE) | ||||||
MakePair("LM2015", LM_OPTIONS::LM2015) | ||||||
MakePair("CROSSFLOW", LM_OPTIONS::CROSSFLOW) | ||||||
MakePair("SLM", LM_OPTIONS::SLM) | ||||||
MakePair("PRODLIM", LM_OPTIONS::PRODLIM) | ||||||
MakePair("MALAN", LM_OPTIONS::MALAN) | ||||||
MakePair("SULUKSNA", LM_OPTIONS::SULUKSNA) | ||||||
MakePair("KRAUSE", LM_OPTIONS::KRAUSE) | ||||||
MakePair("KRAUSE_HYPER", LM_OPTIONS::KRAUSE_HYPER) | ||||||
MakePair("MEDIDA_BAEDER", LM_OPTIONS::MEDIDA_BAEDER) | ||||||
MakePair("MENTER_LANGTRY", LM_OPTIONS::MENTER_LANGTRY) | ||||||
MakePair("MENTER_SLM", LM_OPTIONS::MENTER_SLM) | ||||||
MakePair("CODER_SLM", LM_OPTIONS::CODER_SLM) | ||||||
MakePair("MOD_EPPLER_SLM", LM_OPTIONS::MOD_EPPLER_SLM) | ||||||
MakePair("DEFAULT", LM_OPTIONS::DEFAULT) | ||||||
}; | ||||||
|
||||||
|
@@ -1210,13 +1220,26 @@ enum class TURB_TRANS_CORRELATION { | |||||
DEFAULT /*!< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */ | ||||||
}; | ||||||
|
||||||
/*! | ||||||
* \brief Types of transition correlations for Simplified LM model | ||||||
*/ | ||||||
enum class TURB_TRANS_CORRELATION_SLM { | ||||||
MENTER_SLM, /*!< \brief Kind of transition correlation model (Menter Simplified LM model). */ | ||||||
CODER_SLM, /*!< \brief Kind of transition correlation model (Coder Simplified LM model). */ | ||||||
MOD_EPPLER_SLM, /*!< \brief Kind of transition correlation model (Modified Eppler Simplified LM model). */ | ||||||
DEFAULT /*!< \brief Kind of transition correlation model. */ | ||||||
}; | ||||||
|
||||||
/*! | ||||||
* \brief Structure containing parsed LM options. | ||||||
*/ | ||||||
struct LM_ParsedOptions { | ||||||
LM_OPTIONS version = LM_OPTIONS::NONE; /*!< \brief LM base model. */ | ||||||
bool LM2015 = false; /*!< \brief Use cross-flow corrections. */ | ||||||
bool CrossFlow = false; /*!< \brief Use cross-flow corrections. */ | ||||||
bool SLM = false; /*!< \brief Use simplified version. */ | ||||||
bool ProdLim = false; /*!< \brief Add production term to Pk. */ | ||||||
TURB_TRANS_CORRELATION Correlation = TURB_TRANS_CORRELATION::DEFAULT; | ||||||
TURB_TRANS_CORRELATION_SLM Correlation_SLM = TURB_TRANS_CORRELATION_SLM::DEFAULT; | ||||||
}; | ||||||
|
||||||
/*! | ||||||
|
@@ -1234,9 +1257,12 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh | |||||
return std::find(LM_Options, lm_options_end, option) != lm_options_end; | ||||||
}; | ||||||
|
||||||
LMParsedOptions.LM2015 = IsPresent(LM_OPTIONS::LM2015); | ||||||
LMParsedOptions.CrossFlow = IsPresent(LM_OPTIONS::CROSSFLOW); | ||||||
LMParsedOptions.SLM = IsPresent(LM_OPTIONS::SLM); | ||||||
LMParsedOptions.ProdLim = IsPresent(LM_OPTIONS::PRODLIM); | ||||||
|
||||||
int NFoundCorrelations = 0; | ||||||
int NFoundCorrelations_SLM = 0; | ||||||
if (IsPresent(LM_OPTIONS::MALAN)) { | ||||||
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MALAN; | ||||||
NFoundCorrelations++; | ||||||
|
@@ -1265,10 +1291,25 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh | |||||
LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MENTER_LANGTRY; | ||||||
NFoundCorrelations++; | ||||||
} | ||||||
if (IsPresent(LM_OPTIONS::MENTER_SLM)) { | ||||||
LMParsedOptions.Correlation_SLM = TURB_TRANS_CORRELATION_SLM::MENTER_SLM; | ||||||
NFoundCorrelations_SLM++; | ||||||
} | ||||||
if (IsPresent(LM_OPTIONS::CODER_SLM)) { | ||||||
LMParsedOptions.Correlation_SLM = TURB_TRANS_CORRELATION_SLM::CODER_SLM; | ||||||
NFoundCorrelations_SLM++; | ||||||
} | ||||||
if (IsPresent(LM_OPTIONS::MOD_EPPLER_SLM)) { | ||||||
LMParsedOptions.Correlation_SLM = TURB_TRANS_CORRELATION_SLM::MOD_EPPLER_SLM; | ||||||
NFoundCorrelations_SLM++; | ||||||
} | ||||||
|
||||||
if (NFoundCorrelations > 1) { | ||||||
SU2_MPI::Error("Two correlations selected for LM_OPTIONS. Please choose only one.", CURRENT_FUNCTION); | ||||||
} | ||||||
if (NFoundCorrelations_SLM > 1) { | ||||||
SU2_MPI::Error("Two correlations selected for Simplified model into LM_OPTIONS. Please choose only one.", CURRENT_FUNCTION); | ||||||
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.
Suggested change
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. I'd stick with my change since the options are for the simplified model. They are not simplified options. |
||||||
} | ||||||
|
||||||
if (LMParsedOptions.Correlation == TURB_TRANS_CORRELATION::DEFAULT){ | ||||||
if (Kind_Turb_Model == TURB_MODEL::SST) { | ||||||
|
@@ -1278,6 +1319,10 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh | |||||
} | ||||||
} | ||||||
|
||||||
if (LMParsedOptions.Correlation_SLM == TURB_TRANS_CORRELATION_SLM::DEFAULT){ | ||||||
LMParsedOptions.Correlation_SLM = TURB_TRANS_CORRELATION_SLM::MENTER_SLM; | ||||||
} | ||||||
|
||||||
return LMParsedOptions; | ||||||
} | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3471,9 +3471,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i | |
if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) { | ||
lmParsedOptions = ParseLMOptions(LM_Options, nLM_Options, rank, 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); | ||
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. is LM2015 gone? or is crossflow the same? 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. I have changed the option to CROSSFLOW, since I will use it also for the Simplified model. |
||
/*--- Check if problem is 2D and CrossFlow has been selected ---*/ | ||
if (lmParsedOptions.CrossFlow && val_nDim == 2) { | ||
SU2_MPI::Error("Cross-flow corrections are available only for 3D problems", CURRENT_FUNCTION); | ||
} | ||
} | ||
|
||
|
@@ -6113,11 +6113,27 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { | |
switch (Kind_Trans_Model) { | ||
case TURB_TRANS_MODEL::NONE: break; | ||
case TURB_TRANS_MODEL::LM: { | ||
cout << "Transition model: Langtry and Menter's 4 equation model"; | ||
if (lmParsedOptions.LM2015) { | ||
cout << " w/ cross-flow corrections (2015)" << endl; | ||
int NTurbEqs = 0; | ||
switch (Kind_Turb_Model) { | ||
case TURB_MODEL::SA: NTurbEqs = 1; break; | ||
case TURB_MODEL::SST: NTurbEqs = 2; break; | ||
case TURB_MODEL::NONE: SU2_MPI::Error("No turbulence model has been selected but LM transition model is active.", CURRENT_FUNCTION); break; | ||
} | ||
if (!lmParsedOptions.SLM) { | ||
int NEquations = 2; | ||
cout << "Transition model: Langtry and Menter's "<< NEquations+NTurbEqs <<" equation model"; | ||
} else { | ||
cout << " (2009)" << endl; | ||
int NEquations = 1; | ||
cout << "Transition model: Simplified Langtry and Menter's "<< NEquations+NTurbEqs <<" equation model"; | ||
} | ||
if (lmParsedOptions.CrossFlow) { | ||
cout << " w/ cross-flow corrections" << endl; | ||
} else { | ||
if (!lmParsedOptions.SLM) { | ||
cout << " (2009)" << endl; | ||
} else { | ||
cout << " (2015)" << endl; | ||
} | ||
} | ||
break; | ||
} | ||
|
@@ -6141,6 +6157,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { | |
} | ||
break; | ||
} | ||
cout << "Correlation Functions for Simplified LM model: "; | ||
switch (lmParsedOptions.Correlation_SLM) { | ||
case TURB_TRANS_CORRELATION_SLM::CODER_SLM: cout << "Coder et al. (2012)" << endl; break; | ||
case TURB_TRANS_CORRELATION_SLM::MOD_EPPLER_SLM: cout << "Modified Eppler (from Coder et al. 2012)" << endl; break; | ||
case TURB_TRANS_CORRELATION_SLM::MENTER_SLM: | ||
case TURB_TRANS_CORRELATION_SLM::DEFAULT: cout << "Menter et al. (2015)" << endl; break; | ||
} | ||
} | ||
cout << "Hybrid RANS/LES: "; | ||
switch (Kind_HybridRANSLES) { | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -25,6 +25,7 @@ | |||||
*/ | ||||||
|
||||||
#pragma once | ||||||
//#include <cmath> | ||||||
Check notice Code scanning / CodeQL Commented-out code Note
This comment appears to contain commented-out code.
|
||||||
|
||||||
/*! | ||||||
* \class TransLMCorrelations | ||||||
|
@@ -189,4 +190,107 @@ class TransLMCorrelations { | |||||
|
||||||
return F_length1; | ||||||
} | ||||||
|
||||||
/*! | ||||||
* \brief Compute Re_theta_c from correlations for the Simplified LM model. | ||||||
* \param[in] Tu - Turbulence intensity. | ||||||
* \param[in] du_ds - Streamwise velocity gradient. | ||||||
* \param[out] rethetac - Corrected value for Re_theta. | ||||||
*/ | ||||||
su2double ReThetaC_Correlations_SLM(const su2double Tu_L, const su2double lambda_theta, const su2double wall_dist, const su2double VorticityMag, const su2double VelocityMag) const { | ||||||
|
||||||
su2double rethetac = 0.0; | ||||||
|
||||||
switch (options.Correlation_SLM) { | ||||||
case TURB_TRANS_CORRELATION_SLM::MENTER_SLM: { | ||||||
|
||||||
/*-- Thwaites parameter ---*/ | ||||||
// su2double lambda_theta_local = 7.57e-3 * du_ds * wall_dist * wall_dist * Density / Laminar_Viscosity + 0.0128; | ||||||
su2double lambda_theta_local = lambda_theta; | ||||||
lambda_theta_local = min(max(lambda_theta_local, -1.0), 1.0); | ||||||
|
||||||
/*-- Function to sensitize the transition onset to the streamwise pressure gradient ---*/ | ||||||
su2double FPG = 0.0; | ||||||
const su2double C_PG1 = 14.68; | ||||||
const su2double C_PG1_lim = 1.5; | ||||||
const su2double C_PG2 = -7.34; | ||||||
const su2double C_PG2_lim = 3.0; | ||||||
const su2double C_PG3 = 0.0; | ||||||
if (lambda_theta_local >= 0.0) { | ||||||
FPG = min(1+ C_PG1 * lambda_theta_local, C_PG1_lim); | ||||||
} else { | ||||||
const su2double FirstTerm = C_PG2 * lambda_theta_local; | ||||||
const su2double SecondTerm = C_PG3 * min(lambda_theta_local + 0.0681, 0.0); | ||||||
FPG = min(1 + FirstTerm + SecondTerm, C_PG2_lim); | ||||||
} | ||||||
|
||||||
FPG = max(FPG, 0.0); | ||||||
|
||||||
const su2double C_TU1 = 100.0; | ||||||
const su2double C_TU2 = 1000.0; | ||||||
const su2double C_TU3 = 1.0; | ||||||
rethetac = C_TU1 + C_TU2 * exp(-C_TU3 * Tu_L * FPG); | ||||||
|
||||||
break; | ||||||
} case TURB_TRANS_CORRELATION_SLM::CODER_SLM: { | ||||||
|
||||||
/*-- Local pressure gradient parameter ---*/ | ||||||
const su2double H_c = max(min(wall_dist * VorticityMag / VelocityMag, 1.1542), 0.3823); | ||||||
|
||||||
/*-- Thwaites parameter ---*/ | ||||||
su2double lambda_theta_local = 0.0; | ||||||
const su2double H_c_delta = 0.587743 - H_c; | ||||||
if ( H_c >= 0.587743 ) { | ||||||
const su2double FirstTerm = 0.1919 * pow(H_c_delta, 3.0); | ||||||
const su2double SecondTerm = 0.4182 * pow(H_c_delta, 2.0); | ||||||
const su2double ThirdTerm = 0.2959 * H_c_delta; | ||||||
lambda_theta_local = FirstTerm + SecondTerm + ThirdTerm; | ||||||
} else { | ||||||
const su2double FirstTerm = 4.7596 * pow(H_c_delta, 3.0); | ||||||
const su2double SecondTerm = -0.3837 * pow(H_c_delta, 2.0); | ||||||
const su2double ThirdTerm = 0.3575 * H_c_delta; | ||||||
lambda_theta_local = FirstTerm + SecondTerm + ThirdTerm; | ||||||
} | ||||||
|
||||||
/*-- Function to sensitize the transition onset to the streamwise pressure gradient ---*/ | ||||||
su2double FPG = 0.0; | ||||||
if (lambda_theta_local <= 0.0) { | ||||||
const su2double FirstTerm = -12.986 * lambda_theta_local; | ||||||
const su2double SecondTerm = -123.66 * pow(lambda_theta_local, 2.0); | ||||||
const su2double ThirdTerm = -405.689 * pow(lambda_theta_local, 3.0); | ||||||
FPG = 1 - (FirstTerm + SecondTerm + ThirdTerm) * exp(-pow(Tu_L/1.5,1.5)); | ||||||
} else { | ||||||
FPG = 1 + 0.275 * (1 - exp(-35.0 * lambda_theta_local)) * exp(-Tu_L/0.5); | ||||||
} | ||||||
|
||||||
// This is not reported in the paper | ||||||
//FPG = max(FPG, 0.0); | ||||||
|
||||||
Comment on lines
+264
to
+266
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.
Suggested change
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. I have left it there since I do not know if I have to keep it or not. |
||||||
const su2double C_TU1 = 100.0; | ||||||
const su2double C_TU2 = 1000.0; | ||||||
const su2double C_TU3 = 1.0; | ||||||
rethetac = C_TU1 + C_TU2 * exp(-C_TU3 * Tu_L * FPG); | ||||||
|
||||||
break; | ||||||
} case TURB_TRANS_CORRELATION_SLM::MOD_EPPLER_SLM: { | ||||||
|
||||||
/*-- Local pressure gradient parameter ---*/ | ||||||
const su2double H_c = max(min(wall_dist * VorticityMag / VelocityMag, 1.1542), 0.3823); | ||||||
|
||||||
/*-- H_32 Shape factor --*/ | ||||||
const su2double H_32 = 1.515095 + 0.2041 * pow((1.1542 - H_c), 2.0956); | ||||||
|
||||||
rethetac = exp(127.94 * pow((H_32-1.515095), 2.0) + 6.774224); | ||||||
|
||||||
break; | ||||||
} | ||||||
case TURB_TRANS_CORRELATION_SLM::DEFAULT: | ||||||
SU2_MPI::Error("Transition correlation for Simplified LM model is set to DEFAULT but no default value has ben set in the code.", | ||||||
CURRENT_FUNCTION); | ||||||
break; | ||||||
} | ||||||
|
||||||
return rethetac; | ||||||
} | ||||||
|
||||||
}; |
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.
Can you add the param[out] for these please
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, I'll do it now.