Skip to content

Commit 3341a57

Browse files
committed
require EXPERIMENTAL flag for non-standard SA correction combinations
1 parent 86c1c01 commit 3341a57

4 files changed

Lines changed: 33 additions & 19 deletions

File tree

Common/include/option_structure.hpp

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,16 +1057,18 @@ enum class SA_OPTIONS {
10571057
COMP, /*!< \brief Compressibility correction. */
10581058
ROT, /*!< \brief Rotation correction. */
10591059
BC, /*!< \brief Bas-Cakmakcioclu transition. */
1060+
EXP, /*!< \brief Allow experimental combinations of options (according to TMR). */
10601061
};
10611062
static const MapType<std::string, SA_OPTIONS> SA_Options_Map = {
10621063
MakePair("NONE", SA_OPTIONS::NONE)
10631064
MakePair("NEGATIVE", SA_OPTIONS::NEG)
10641065
MakePair("EDWARDS", SA_OPTIONS::EDW)
1065-
MakePair("FT2", SA_OPTIONS::FT2)
1066+
MakePair("WITHFT2", SA_OPTIONS::FT2)
10661067
MakePair("QCR2000", SA_OPTIONS::QCR2000)
10671068
MakePair("COMPRESSIBILITY", SA_OPTIONS::COMP)
10681069
MakePair("ROTATION", SA_OPTIONS::ROT)
10691070
MakePair("BCM", SA_OPTIONS::BC)
1071+
MakePair("EXPERIMENTAL", SA_OPTIONS::EXP)
10701072
};
10711073

10721074
/*!
@@ -1111,19 +1113,34 @@ inline SA_ParsedOptions ParseSAOptions(const SA_OPTIONS *SA_Options, unsigned sh
11111113
} else {
11121114
SAParsedOptions.version = SA_OPTIONS::EDW;
11131115
}
1114-
1115-
const bool found_bc = IsPresent(SA_OPTIONS::BC);
1116-
1117-
if (found_bc && !found_bsl) {
1118-
SU2_MPI::Error("The BCM transition model was developed for the baseline SA version.", CURRENT_FUNCTION);
1119-
}
1120-
11211116
SAParsedOptions.ft2 = IsPresent(SA_OPTIONS::FT2);
11221117
SAParsedOptions.qcr2000 = IsPresent(SA_OPTIONS::QCR2000);
11231118
SAParsedOptions.comp = IsPresent(SA_OPTIONS::COMP);
11241119
SAParsedOptions.rot = IsPresent(SA_OPTIONS::ROT);
1125-
SAParsedOptions.bc = found_bc;
1126-
1120+
SAParsedOptions.bc = IsPresent(SA_OPTIONS::BC);
1121+
1122+
/*--- Validate user settings when not in experimental mode. ---*/
1123+
if (!IsPresent(SA_OPTIONS::EXP)) {
1124+
const bool any_but_bc = SAParsedOptions.ft2 || SAParsedOptions.qcr2000 || SAParsedOptions.comp || SAParsedOptions.rot;
1125+
1126+
switch (SAParsedOptions.version) {
1127+
case SA_OPTIONS::NEG:
1128+
if (!SAParsedOptions.ft2 || SAParsedOptions.bc)
1129+
SU2_MPI::Error("A non-standard version of SA-neg was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
1130+
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
1131+
break;
1132+
case SA_OPTIONS::EDW:
1133+
if (any_but_bc || SAParsedOptions.bc)
1134+
SU2_MPI::Error("A non-standard version of SA-noft2-Edwards was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
1135+
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
1136+
break;
1137+
default:
1138+
if (SAParsedOptions.bc && any_but_bc)
1139+
SU2_MPI::Error("A non-standard version of SA-BCM was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
1140+
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
1141+
break;
1142+
}
1143+
}
11271144
return SAParsedOptions;
11281145
}
11291146

TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,17 @@
1212

1313
% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------%
1414
%
15-
% Physical governing equations (EULER, NAVIER_STOKES,
16-
% TNE2_EULER, TNE2_NAVIER_STOKES,
17-
% WAVE_EQUATION, HEAT_EQUATION, FEM_ELASTICITY,
18-
% POISSON_EQUATION)
15+
% Physical governing equations
1916
SOLVER= RANS
2017
%
2118
% Specify turbulence model
2219
KIND_TURB_MODEL= SA
23-
SA_OPTIONS= NEGATIVE
20+
SA_OPTIONS= NEGATIVE, EXPERIMENTAL
2421
%
25-
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
22+
% Mathematical problem
2623
MATH_PROBLEM= DISCRETE_ADJOINT
2724
%
28-
% Restart solution (NO, YES)
25+
% Restart solution
2926
RESTART_SOL= NO
3027

3128
% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------%

TestCases/rans/naca0012/turb_NACA0012_sa.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ SOLVER= RANS
1919
%
2020
% Specify turbulence model
2121
KIND_TURB_MODEL= SA
22-
SA_OPTIONS= NEGATIVE
22+
SA_OPTIONS= NEGATIVE, EXPERIMENTAL
2323
%
2424
% Mathematical problem (DIRECT, CONTINUOUS_ADJOINT)
2525
MATH_PROBLEM= DIRECT

TestCases/turbulence_models/sa/rae2822/turb_SA_NEG_RAE2822.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ SOLVER= RANS
2121
%
2222
% Specify turbulence model
2323
KIND_TURB_MODEL= SA
24-
SA_OPTIONS= NEGATIVE
24+
SA_OPTIONS= NEGATIVE, EXPERIMENTAL
2525
%
2626
% Restart solution (NO, YES)
2727
RESTART_SOL= NO

0 commit comments

Comments
 (0)