Skip to content

Commit

Permalink
Updat_AFT2017b
Browse files Browse the repository at this point in the history
AFT2017b
  • Loading branch information
sun5k committed Jan 16, 2025
1 parent a583d7c commit 5349d97
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1331,11 +1331,13 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh
*/
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)
};

Expand All @@ -1344,6 +1346,7 @@ static const MapType<std::string, AFT_OPTIONS> AFT_Options_Map = {
*/
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). */
};

Expand Down Expand Up @@ -1371,6 +1374,12 @@ inline AFT_ParsedOptions ParseAFTOptions(const AFT_OPTIONS *AFT_Options, unsigne
};

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;
Expand Down
7 changes: 7 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6338,6 +6338,13 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,15 @@ class TransAFTCorrelations {
su2double H12 = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
H12 = 0.376960 + sqrt( (HL + 2.453432) / 0.653181 );
H12 = min(max(H12, 2.2), 20.0);
break;
}

case AFT_CORRELATION::AFT2019b: {
H12 = 0.26 * HL + 2.4;
H12 = min(max(H12, 2.2), 20.0);
break;
}

Expand All @@ -231,7 +238,6 @@ class TransAFTCorrelations {
CURRENT_FUNCTION);
break;
}
H12 = min(max(H12, 2.2), 20.0);
return H12;
}

Expand All @@ -244,6 +250,11 @@ class TransAFTCorrelations {
su2double dNdRet = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
dNdRet = 0.028*(H12 - 1.0) - 0.0345 * exp(-pow(3.87/(H12 -1.0) - 2.52, 2.0));
break;
}

case AFT_CORRELATION::AFT2019b: {
dNdRet = 0.028*(H12 - 1.0) - 0.0345 * exp(-pow(3.87/(H12 -1.0) - 2.52, 2.0));
break;
Expand All @@ -266,6 +277,12 @@ class TransAFTCorrelations {
su2double Ret0 = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
Ret0 = 0.7 * tanh( 14.0 / (H12 - 1.0) - 9.24) + 2.492 / pow(H12 - 1.0, 0.43) + 0.62;
Ret0 = pow(10, Ret0);
break;
}

case AFT_CORRELATION::AFT2019b: {
Ret0 = 0.7 * tanh( 14.0 / (H12 - 1.0) - 9.24) + 2.492 / pow(H12 - 1.0, 0.43) + 0.62;
Ret0 = pow(10, Ret0);
Expand All @@ -289,6 +306,11 @@ class TransAFTCorrelations {
su2double D_H12 = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
D_H12 = H12 / ( 0.5482 * H12 - 0.5185);
break;
}

case AFT_CORRELATION::AFT2019b: {
D_H12 = 2.4 * H12 / (H12 - 1.0);
break;
Expand All @@ -311,6 +333,11 @@ class TransAFTCorrelations {
su2double l_H12 = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
l_H12 = (6.54 * H12 - 14.07) / pow(H12, 2.0);
break;
}

case AFT_CORRELATION::AFT2019b: {
l_H12 = (6.54 * H12 - 14.07) / pow(H12, 2.0);
break;
Expand All @@ -333,11 +360,16 @@ class TransAFTCorrelations {
su2double m_H12 = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2019b: {
case AFT_CORRELATION::AFT2017b: {
m_H12 = (0.058 * pow(H12 - 4, 2.0) / (H12 - 1.0) - 0.068) / l_Correlation;
break;
}

case AFT_CORRELATION::AFT2019b: {
m_H12 = (0.058 * pow(H12 - 4.0, 2.0) / (H12 - 1.0) - 0.068) / l_Correlation;
break;
}

case AFT_CORRELATION::NONE:
SU2_MPI::Error("Transition correlation is set to DEFAULT but no default value has ben set in the code.",
CURRENT_FUNCTION);
Expand All @@ -355,6 +387,11 @@ class TransAFTCorrelations {
su2double kv = 0.0;

switch (options.Correlation) {
case AFT_CORRELATION::AFT2017b: {
kv = 0.246175 * pow(H12, 2.0) - 0.141831 * H12 + 0.008886;
break;
}

case AFT_CORRELATION::AFT2019b: {
kv = 1.0 / (0.4036 * pow(H12, 2.0) - 2.5394 * H12 + 4.3273);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ class CSourcePieceWise_TransAFT final : public CNumerics {
su2double tt = 0;

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable tt is not used.
}

const su2double HL = dist_i * dist_i * Density_i / Laminar_Viscosity_i * HLGradTerm;
su2double HL = min( max(dist_i * dist_i * Density_i / Laminar_Viscosity_i * HLGradTerm, -0.25), 200.0);
/*--- Cal H12, dNdRet, Ret0, D_H12, l_H12, m_H12, kv ---*/
const su2double H12 = TransCorrelations.H12_Correlations(HL);
const su2double dNdRet = TransCorrelations.dNdRet_Correlations(H12);
Expand Down
2 changes: 1 addition & 1 deletion SU2_CFD/src/solvers/CTransAFTSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void CTransAFTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_conta
}

/*--- Cal H12, Hk, dNdRet, Ret0 ---*/
const su2double HL = dist_i * dist_i * Density_i / Laminar_Viscosity_i * HLGradTerm;
su2double HL = min( max(dist_i * dist_i * Density_i / Laminar_Viscosity_i * HLGradTerm, -0.25), 200.0);
const su2double H12 = TransCorrelations.H12_Correlations(HL);
const su2double dNdRet = TransCorrelations.dNdRet_Correlations(H12);
const su2double Ret0 = TransCorrelations.Ret0_Correlations(H12);
Expand Down

0 comments on commit 5349d97

Please sign in to comment.