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

New SA version/correction combinations and new way of specifying them in the config (SA_OPTIONS=...) #1646

Merged
merged 152 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
ebbf37a
initial commit of vorticity source turb models
WallyMaier Mar 11, 2022
e2887f9
towards SST Options framework
WallyMaier Mar 15, 2022
9bd7e91
A more realistic implementation
WallyMaier Mar 16, 2022
4344477
Merge branch 'develop' into feature_SST-Vm
WallyMaier Mar 21, 2022
bcb6c43
update SST_OPTION, remove SST_SUST
WallyMaier Mar 22, 2022
c57f6f5
Some convergence fixes + beginning to add structure
WallyMaier Mar 22, 2022
8d67a08
creat parsing function, tried to be consistent, updated some print st…
WallyMaier Mar 24, 2022
d8ca557
small fixes
WallyMaier Mar 24, 2022
b5275a1
added sst1994,sst1994m,sst2003,sst2003m
bigfooted Mar 29, 2022
3252c16
merge with develop, check that it runs
bigfooted Mar 29, 2022
5300b3c
some cleanup and parsed option corrections
WallyMaier Mar 30, 2022
f55c8f4
should compile now
WallyMaier Mar 30, 2022
9118ec0
Small fixes, seems to be working
WallyMaier Mar 31, 2022
ffcd49c
Merge branch 'develop' into feature_SST-Vm
bigfooted Mar 31, 2022
7653887
Update Common/src/CConfig.cpp
bigfooted Mar 31, 2022
9178a35
Update Common/src/CConfig.cpp
bigfooted Mar 31, 2022
aad365e
add productionlimiter to constants
bigfooted Apr 3, 2022
c71640e
Merge branch 'develop' into feature_SST-Vm
WallyMaier Apr 4, 2022
852655e
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
bigfooted Apr 4, 2022
dac78c8
fix sst production, implement review suggestions
bigfooted Apr 4, 2022
dcbfb9e
remove deprecated local variable Prodlimconstant
bigfooted Apr 4, 2022
a9c06ea
some rewrites to the sst1994 model to accomodate the original model
bigfooted Apr 5, 2022
29909ba
temporary save
bigfooted Apr 6, 2022
30f59a6
implement SUST and UQ again for backward compatibility
bigfooted Apr 6, 2022
f2cd8c0
fix uq problem with sst options
bigfooted Apr 6, 2022
34babb7
fix sust problem with sst options
bigfooted Apr 7, 2022
cd2001c
fix more SUST options
bigfooted Apr 9, 2022
2da1a82
fix more SUST options
bigfooted Apr 9, 2022
214b2b1
cleanup commented lines
bigfooted Apr 10, 2022
1df520e
Update Common/include/option_structure.hpp
bigfooted Apr 10, 2022
300230f
change to sustaining
bigfooted Apr 10, 2022
5669113
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
bigfooted Apr 10, 2022
4718be2
sst1994m reversed - first get regression tests working again
bigfooted Apr 10, 2022
c74f082
copy turb_sources from develop
bigfooted Apr 10, 2022
a9271be
change turb_sources back
bigfooted Apr 10, 2022
469b8ce
change entire sst model back
bigfooted Apr 10, 2022
7e0b446
add turb_sources
bigfooted Apr 10, 2022
d73234d
add sstvariable
bigfooted Apr 10, 2022
143c28b
add part of turbsources again
bigfooted Apr 10, 2022
bc9ddcb
turbsources modification
bigfooted Apr 11, 2022
49fe8b1
turbsources modification
bigfooted Apr 11, 2022
1640f2a
turbsources modification
bigfooted Apr 11, 2022
d123868
turbsources modification
bigfooted Apr 11, 2022
4df45d5
turbsources modification
bigfooted Apr 11, 2022
ea8290f
turbsources modification
bigfooted Apr 11, 2022
f3d61c2
turbsources modification
bigfooted Apr 11, 2022
41d20ab
turbsources modification
bigfooted Apr 11, 2022
df055ed
change keyword to SUSTAINING
bigfooted Apr 11, 2022
f893160
turbsources modification
bigfooted Apr 11, 2022
3cbeb32
turbsources modification
bigfooted Apr 11, 2022
8f8b517
using P_Base
bigfooted Apr 11, 2022
bbc7931
sstmodels in turb_sources
bigfooted Apr 11, 2022
8a751d0
sstmodels in turb_sources
bigfooted Apr 11, 2022
7dddf3b
sstmodels in turb_sources
bigfooted Apr 11, 2022
c112e36
fix uq in turb_sources
bigfooted Apr 11, 2022
bfa38c5
introduce prodlimconstant
bigfooted Apr 11, 2022
29d3988
introduce prodlimconstant
bigfooted Apr 11, 2022
0894bf4
removal of rotation corrections:
WallyMaier Apr 11, 2022
bf312cf
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 11, 2022
f49c488
update turbulent viscosity in sstsolver
bigfooted Apr 11, 2022
d2e763e
sstmodels in turb_sources
bigfooted Apr 11, 2022
df0a997
sstmodels in turb_sources
bigfooted Apr 12, 2022
7ecfe33
sstmodels in turb_sources
bigfooted Apr 12, 2022
1ef95e8
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 12, 2022
38c3ab5
sstmodels in turb_sources
bigfooted Apr 12, 2022
72c4416
sstmodels in turb_sources
bigfooted Apr 12, 2022
0d24bd0
sstmodels in turb_sources
bigfooted Apr 12, 2022
0224811
sstmodels in turb_sources
bigfooted Apr 12, 2022
3b6616b
sstmodels in turb_sources
bigfooted Apr 12, 2022
445266e
sstmodels in turb_sources
bigfooted Apr 12, 2022
370bbcf
sstmodels in turb_sources
bigfooted Apr 12, 2022
448075a
sstmodels in turb_sources
bigfooted Apr 12, 2022
ca8c998
sstmodels in turb_sources
bigfooted Apr 12, 2022
7fb8e5b
sstmodels in turb_sources
bigfooted Apr 12, 2022
d81913e
sstmodels in turb_sources
bigfooted Apr 12, 2022
aa876c3
use rank for cout messages
bigfooted Apr 14, 2022
32efc68
cleanup of files
bigfooted Apr 16, 2022
4b41461
cleanup of some more files
bigfooted Apr 16, 2022
7adf0d9
fix rank in cconfig
bigfooted Apr 16, 2022
7f4c663
cleanup of some more files
bigfooted Apr 16, 2022
888a738
cleanup of some more files
bigfooted Apr 16, 2022
dd2f15a
cleanup of some more files
bigfooted Apr 17, 2022
808816f
change sst_sust option
bigfooted Apr 19, 2022
8c02c31
fix RAE2822 SST Sust regression
WallyMaier Apr 19, 2022
7f4dd00
change uq option
bigfooted Apr 20, 2022
d2f05e0
merge with PR
bigfooted Apr 20, 2022
c94264b
fix using_uq for SA
Apr 20, 2022
d74d5fe
some cleanup of modified vs unmodified sst1994 and sst2003
bigfooted Apr 21, 2022
e9f135f
modify modified modifier
Apr 21, 2022
7122b48
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 21, 2022
cc6054f
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 21, 2022
7390934
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 24, 2022
576bfd0
remove using_uq boolean
bigfooted Apr 24, 2022
e5ec394
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
bigfooted Apr 24, 2022
98a3736
move sst.uq output message to within sst
bigfooted Apr 24, 2022
8be782a
default false to sstoption booleans
bigfooted Apr 24, 2022
4dfb8c8
fixed and checked v2003 model (production limiter)
bigfooted Apr 26, 2022
dbcad65
Merge branch 'develop' into feature_SST-Vm
bigfooted Apr 27, 2022
3ad9073
added rans naca0012 regression case
bigfooted May 2, 2022
4bc8810
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
bigfooted May 2, 2022
9b2b9ce
Update Common/include/option_structure.hpp
bigfooted May 4, 2022
17a5e69
Update Common/include/option_structure.hpp
bigfooted May 4, 2022
35dbc34
Update Common/include/option_structure.hpp
bigfooted May 4, 2022
958ec0d
add SST_SUST is deprecated message
May 4, 2022
7a5ecc8
cleanup
pcarruscag May 4, 2022
3572fb5
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
pcarruscag May 4, 2022
e7a3092
re-add V and KL options
WallyMaier May 4, 2022
08b7319
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
WallyMaier May 4, 2022
1ea2106
fix vorticity sst, add regressions for V and KL
WallyMaier May 4, 2022
7c2a65c
cleanup
pcarruscag May 5, 2022
d0a2009
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
pcarruscag May 5, 2022
d6ff7c8
fix regression files....need proper values
WallyMaier May 5, 2022
1033583
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
WallyMaier May 5, 2022
f21b7a0
again
WallyMaier May 5, 2022
8b85d97
update regression values
WallyMaier May 5, 2022
c0efb31
cleanup sources
pcarruscag May 5, 2022
fef8828
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
pcarruscag May 5, 2022
5dd09c9
Update SU2_CFD/include/numerics/turbulent/turb_sources.hpp
pcarruscag May 5, 2022
7728a57
Update SU2_CFD/include/numerics/turbulent/turb_sources.hpp
pcarruscag May 5, 2022
90d1107
cleanup, try to recover old residuals
pcarruscag May 6, 2022
f61026b
test reason for changes
pcarruscag May 10, 2022
34e3865
Merge remote-tracking branch 'upstream/develop' into feature_SST-Vm
pcarruscag May 10, 2022
780fb54
update tests, minor cleanup
pcarruscag May 10, 2022
78db549
Merge branch 'develop' into feature_SST-Vm
bigfooted May 15, 2022
031740f
Apply suggestions from code review
pcarruscag May 15, 2022
2752d7b
cleanup config
pcarruscag May 15, 2022
95f7fc6
Merge branch 'feature_SST-Vm' of https://github.com/su2code/SU2 into …
pcarruscag May 15, 2022
1cc18ba
Update config_template.cfg
pcarruscag May 15, 2022
c890e0a
Apply suggestions from code review
pcarruscag May 15, 2022
8b1364c
Merge branch 'develop' into feature_SST-Vm
bigfooted May 16, 2022
5c84858
additional vanv regression
bigfooted May 16, 2022
a1d7e57
SA options
pcarruscag May 16, 2022
b08defb
cleanup of vanv and fix unrelated spelling errors
bigfooted May 17, 2022
078ffce
testcase options
pcarruscag May 17, 2022
f82dc33
Merge branch 'develop' into feature_SST-Vm
WallyMaier May 19, 2022
e1f6976
Merge branch 'develop' into feature_SST-Vm
pcarruscag May 19, 2022
cfd1721
Merge branch 'feature_SST-Vm' into sa_options
pcarruscag May 19, 2022
73698f7
fix #1591
pcarruscag May 21, 2022
578121c
Merge remote-tracking branch 'upstream/develop' into feature_SST-Vm
pcarruscag May 21, 2022
28c3fa7
Merge branch 'feature_SST-Vm' into sa_options
pcarruscag May 21, 2022
20a20bf
change tutorials branch
pcarruscag May 21, 2022
5e07976
Apply suggestions from code review
pcarruscag May 21, 2022
57fe61f
Update TestCases/transition/Schubauer_Klebanoff/transitional_BC_model…
bigfooted May 22, 2022
5432af6
Update TestCases/transition/Schubauer_Klebanoff/transitional_BC_model…
pcarruscag May 22, 2022
86c1c01
Merge remote-tracking branch 'upstream/develop' into sa_options
pcarruscag May 24, 2022
d5fc713
Merge branch 'develop' into sa_options
bigfooted May 24, 2022
3341a57
require EXPERIMENTAL flag for non-standard SA correction combinations
pcarruscag May 25, 2022
cbe631e
typos
pcarruscag May 25, 2022
3701aaa
Merge branch 'sa_options' of https://github.com/su2code/SU2 into sa_o…
pcarruscag May 26, 2022
878671d
Apply suggestions from code review
pcarruscag May 26, 2022
1a8ff57
Update TestCases/turbulence_models/sa/rae2822/turb_SA_COMP_EDW_RAE282…
pcarruscag May 27, 2022
3fa7b8a
Merge branch 'develop' into sa_options
pcarruscag May 27, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
uses: docker://su2code/test-su2:20200303
with:
# -t <Tutorials-branch> -c <Testcases-branch>
args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}}
args: -b ${{github.ref}} -t sa_options -c develop -s ${{matrix.testscript}}
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
unit_tests:
runs-on: ubuntu-latest
name: Unit Tests
Expand Down
25 changes: 14 additions & 11 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,10 +699,12 @@ class CConfig {
*Marker_WallFunctions, /*!< \brief Markers for which wall functions must be applied. */
*Marker_SobolevBC; /*!< \brief Markers in the gradient solver */

unsigned short nConfig_Files; /*!< \brief Number of config files for multiphysics problems. */
string *Config_Filenames; /*!< \brief List of names for configuration files. */
SST_OPTIONS *SST_Options; /*!< \brief List of modifications/corrections/versions of SST turbulence model.*/
unsigned short nSST_Options; /*!< \brief number of SST options specified. */
unsigned short nConfig_Files; /*!< \brief Number of config files for multiphysics problems. */
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.*/
unsigned short nSST_Options; /*!< \brief Number of SST options specified. */
unsigned short nSA_Options; /*!< \brief Number of SA 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 @@ -1015,7 +1017,6 @@ class CConfig {
WINDOW_FUNCTION Kind_WindowFct; /*!< \brief Type of window (weight) function for objective functional. */
unsigned short Kind_HybridRANSLES; /*!< \brief Kind of Hybrid RANS/LES. */
unsigned short Kind_RoeLowDiss; /*!< \brief Kind of Roe scheme with low dissipation for unsteady flows. */
bool QCR; /*!< \brief Spalart-Allmaras with Quadratic Constitutive Relation, 2000 version (SA-QCR2000) . */

unsigned short nSpanWiseSections; /*!< \brief number of span-wise sections */
unsigned short nSpanMaxAllZones; /*!< \brief number of maximum span-wise sections for all zones */
Expand Down Expand Up @@ -1137,7 +1138,8 @@ class CConfig {
unsigned short nScreenOutput, /*!< \brief Number of screen output variables (max: 6). */
nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */
bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */
SST_ParsedOptions sstParsedOptions; /*!< \brief additional parameters for the SST turbulence model */
SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */
SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence 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 @@ -9058,11 +9060,6 @@ class CConfig {
*/
su2double GetConst_DES(void) const { return Const_DES; }

/*!
* \brief Get QCR (SA-QCR2000).
*/
bool GetQCR(void) const { return QCR;}

/*!
* \brief Get if AD preaccumulation should be performed.
*/
Expand Down Expand Up @@ -9629,4 +9626,10 @@ class CConfig {
*/
SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; }

/*!
* \brief Get parsed SA option data structure.
* \return SA option data structure.
*/
SA_ParsedOptions GetSAParsedOptions() const { return saParsedOptions; }

};
114 changes: 100 additions & 14 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -912,19 +912,11 @@ static const MapType<std::string, LIMITER> Limiter_Map = {
enum class TURB_MODEL {
NONE, /*!< \brief No turbulence model. */
SA, /*!< \brief Kind of Turbulent model (Spalart-Allmaras). */
SA_NEG, /*!< \brief Kind of Turbulent model (Negative Spalart-Allmaras). */
SA_E, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Edwards). */
SA_COMP, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Compressibility Correction). */
SA_E_COMP, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Edwards with Compressibility Correction). */
SST, /*!< \brief Kind of Turbulence model (Menter SST). */
};
static const MapType<std::string, TURB_MODEL> Turb_Model_Map = {
MakePair("NONE", TURB_MODEL::NONE)
MakePair("SA", TURB_MODEL::SA)
MakePair("SA_NEG", TURB_MODEL::SA_NEG)
MakePair("SA_E", TURB_MODEL::SA_E)
MakePair("SA_COMP", TURB_MODEL::SA_COMP)
MakePair("SA_E_COMP", TURB_MODEL::SA_E_COMP)
MakePair("SST", TURB_MODEL::SST)
};

Expand All @@ -944,10 +936,6 @@ inline TURB_FAMILY TurbModelFamily(TURB_MODEL model) {
case TURB_MODEL::NONE:
return TURB_FAMILY::NONE;
case TURB_MODEL::SA:
case TURB_MODEL::SA_NEG:
case TURB_MODEL::SA_E:
case TURB_MODEL::SA_COMP:
case TURB_MODEL::SA_E_COMP:
return TURB_FAMILY::SA;
case TURB_MODEL::SST:
return TURB_FAMILY::KW;
Expand Down Expand Up @@ -998,6 +986,7 @@ struct SST_ParsedOptions {
* \param[in] SST_Options - Selected SST option from config.
* \param[in] nSST_Options - Number of options selected.
* \param[in] rank - MPI rank.
* \return Struct with SST options.
*/
inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigned short nSST_Options, int rank) {
SST_ParsedOptions SSTParsedOptions;
Expand Down Expand Up @@ -1056,18 +1045,115 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
return SSTParsedOptions;
}

/*!
* \brief SA Options
*/
enum class SA_OPTIONS {
NONE, /*!< \brief No option / default. */
NEG, /*!< \brief Negative SA. */
EDW, /*!< \brief Edwards version. */
FT2, /*!< \brief Use FT2 term. */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use the keyword NOFT2 instead of FT2 to be more compatible with the NASA naming.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem as with "modified" "unmodified" if we want to default to noft2 we need two options, and one will be redundant

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can change to WITHFT2 to avoid confusion

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For compatibility with previous config files and avoid problems with transition, see #1066 (comment), I think it is better to set the default to the no-ft2 version and add activate it with WITHFT2.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the nasa website should be leading here. If they call it SA-NOFT2, then I think for the end user it is most clear if we use SA_OPTIONS=NOFT2
Also, if the user sees in the config file that the turbulence model is SA, then it should be SA, and not SA-neg, or SA-noft2.
We should prevent submodels being activated in a hidden way. Maybe it is even better to either force the user to provide an SA_OPTION, to make her aware of the change (my preference), or give a warning that no SA_OPTION is found (might be missed).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree with you Nijso, if we were doing it from scratch, but that boat sailed and we are not going to break backward compatibility like that.
We can think about it for V8.

But I have a good solution for the "legal" combinations problem, to use the "illegal" ones it will be necessary to put "EXPERIMENTAL" in the SA options.
Ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can postpone the 'breaking' when we have the power of a V8 and the users had some time to adjust.
And if a user really wants to use combinations that are not found in the literature, we can allow it with some warnings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, done!

QCR2000, /*!< \brief Quadratic constitutive relation. */
COMP, /*!< \brief Compressibility correction. */
ROT, /*!< \brief Rotation correction. */
BC, /*!< \brief Bas-Cakmakcioclu transition. */
EXP, /*!< \brief Allow experimental combinations of options (according to TMR). */
};
static const MapType<std::string, SA_OPTIONS> SA_Options_Map = {
MakePair("NONE", SA_OPTIONS::NONE)
MakePair("NEGATIVE", SA_OPTIONS::NEG)
MakePair("EDWARDS", SA_OPTIONS::EDW)
MakePair("WITHFT2", SA_OPTIONS::FT2)
MakePair("QCR2000", SA_OPTIONS::QCR2000)
MakePair("COMPRESSIBILITY", SA_OPTIONS::COMP)
MakePair("ROTATION", SA_OPTIONS::ROT)
MakePair("BCM", SA_OPTIONS::BC)
MakePair("EXPERIMENTAL", SA_OPTIONS::EXP)
};

/*!
* \brief Structure containing parsed SA options.
*/
struct SA_ParsedOptions {
SA_OPTIONS version = SA_OPTIONS::NONE; /*!< \brief SA base model. */
bool ft2 = false; /*!< \brief Use ft2 term. */
bool qcr2000 = false; /*!< \brief Use QCR-2000. */
bool comp = false; /*!< \brief Use compressibility correction. */
bool rot = false; /*!< \brief Use rotation correction. */
bool bc = false; /*!< \brief BC transition. */
};

/*!
* \brief Function to parse SA options.
* \param[in] SA_Options - Selected SA option from config.
* \param[in] nSA_Options - Number of options selected.
* \param[in] rank - MPI rank.
* \return Struct with SA options.
*/
inline SA_ParsedOptions ParseSAOptions(const SA_OPTIONS *SA_Options, unsigned short nSA_Options, int rank) {
SA_ParsedOptions SAParsedOptions;

auto IsPresent = [&](SA_OPTIONS option) {
const auto sa_options_end = SA_Options + nSA_Options;
return std::find(SA_Options, sa_options_end, option) != sa_options_end;
};

const bool found_neg = IsPresent(SA_OPTIONS::NEG);
const bool found_edw = IsPresent(SA_OPTIONS::EDW);
const bool found_bsl = !found_neg && !found_edw;
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved

if (found_neg && found_edw) {
SU2_MPI::Error("Two versions (Negative and Edwards) selected for SA_OPTIONS. Please choose only one.", CURRENT_FUNCTION);
}

if (found_bsl) {
SAParsedOptions.version = SA_OPTIONS::NONE;
} else if (found_neg) {
SAParsedOptions.version = SA_OPTIONS::NEG;
} else {
SAParsedOptions.version = SA_OPTIONS::EDW;
}
SAParsedOptions.ft2 = IsPresent(SA_OPTIONS::FT2);
pcarruscag marked this conversation as resolved.
Show resolved Hide resolved
SAParsedOptions.qcr2000 = IsPresent(SA_OPTIONS::QCR2000);
SAParsedOptions.comp = IsPresent(SA_OPTIONS::COMP);
SAParsedOptions.rot = IsPresent(SA_OPTIONS::ROT);
SAParsedOptions.bc = IsPresent(SA_OPTIONS::BC);

/*--- Validate user settings when not in experimental mode. ---*/
if (!IsPresent(SA_OPTIONS::EXP)) {
const bool any_but_bc = SAParsedOptions.ft2 || SAParsedOptions.qcr2000 || SAParsedOptions.comp || SAParsedOptions.rot;

switch (SAParsedOptions.version) {
case SA_OPTIONS::NEG:
if (!SAParsedOptions.ft2 || SAParsedOptions.bc)
SU2_MPI::Error("A non-standard version of SA-neg was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
break;
case SA_OPTIONS::EDW:
if (any_but_bc || SAParsedOptions.bc)
SU2_MPI::Error("A non-standard version of SA-noft2-Edwards was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
break;
default:
if (SAParsedOptions.bc && any_but_bc)
SU2_MPI::Error("A non-standard version of SA-BCM was requested (see https://turbmodels.larc.nasa.gov/spalart.html).\n"
"If you want to continue, add EXPERIMENTAL to SA_OPTIONS.", CURRENT_FUNCTION);
break;
}
}
return SAParsedOptions;
}

/*!
* \brief Types of transition models
*/
enum class TURB_TRANS_MODEL {
NONE, /*!< \brief No transition model. */
LM, /*!< \brief Kind of transition model (Langtry-Menter (LM) for SST and Spalart-Allmaras). */
BC /*!< \brief Kind of transition model (BAS-CAKMAKCIOGLU (BC) 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("BC", TURB_TRANS_MODEL::BC)
};

/*!
Expand Down
64 changes: 44 additions & 20 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,8 @@ void CConfig::SetConfig_Options() {
addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, TURB_MODEL::NONE);
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify SST turbulence model options/corrections. \n Options: see \link SST_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
addEnumListOption("SST_OPTIONS", nSST_Options, SST_Options, SST_Options_Map);
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map);

/*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/
addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE);
Expand Down Expand Up @@ -2767,9 +2769,6 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: Roe with low dissipation for unsteady flows */
addEnumOption("ROE_LOW_DISSIPATION", Kind_RoeLowDiss, RoeLowDiss_Map, NO_ROELOWDISS);

/* DESCRIPTION: Activate SA Quadratic Constitutive Relation, 2000 version */
addBoolOption("SA_QCR", QCR, false);

/* DESCRIPTION: Compute Average for unsteady simulations */
addBoolOption("COMPUTE_AVERAGE", Compute_Average, false);

Expand Down Expand Up @@ -2996,6 +2995,8 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n");
else if (!option_name.compare("SOLID_TEMPERATURE_INIT"))
newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n");
else if (!option_name.compare("SA_QCR"))
newString.append("SA_QCR is deprecated. Use SA_OPTIONS=QCR2000 instead.\n\n");
else {
/*--- Find the most likely candidate for the unrecognized option, based on the length
of start and end character sequences shared by candidates and the option. ---*/
Expand Down Expand Up @@ -3054,9 +3055,21 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
string out = option_map[option_name]->SetValue(option_value);
if (out.compare("") != 0) {
/*--- valid option, but deprecated value ---*/
if ((!option_name.compare("KIND_TURB_MODEL")) && (option_value[0]=="SST_SUST"))
errorString.append("Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING instead.\n");

if (!option_name.compare("KIND_TURB_MODEL")) {
if (option_value[0] == "SST_SUST")
errorString.append("Option KIND_TURB_MODEL=SST_SUST is deprecated. Use KIND_TURB_MODEL=SST, SST_OPTIONS=SUSTAINING instead.\n");
else if (option_value[0] == "SA_NEG")
errorString.append("Option KIND_TURB_MODEL=SA_NEG is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=NEGATIVE instead.\n");
else if (option_value[0] == "SA_E")
errorString.append("Option KIND_TURB_MODEL=SA_E is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS instead.\n");
else if (option_value[0] == "SA_COMP")
errorString.append("Option KIND_TURB_MODEL=SA_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=COMPRESSIBILITY instead.\n");
else if (option_value[0] == "SA_E_COMP")
errorString.append("Option KIND_TURB_MODEL=SA_E_COMP is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=EDWARDS,COMPRESSIBILITY instead.\n");
} else if (!option_name.compare("KIND_TRANS_MODEL")) {
if (option_value[0] == "BC")
errorString.append("Option KIND_TRANS_MODEL=BC is deprecated. Use KIND_TURB_MODEL=SA, SA_OPTIONS=BCM instead.\n");
}
errorString.append(out);
errorString.append("\n");
err_count++;
Expand Down Expand Up @@ -3399,8 +3412,10 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
}

/*--- Postprocess SST_OPTIONS into structure. ---*/
if (Kind_Turb_Model==TURB_MODEL::SST) {
if (Kind_Turb_Model == TURB_MODEL::SST) {
sstParsedOptions = ParseSSTOptions(SST_Options, nSST_Options, rank);
} else if (Kind_Turb_Model == TURB_MODEL::SA) {
saParsedOptions = ParseSAOptions(SA_Options, nSA_Options, rank);
}

/*--- Check if turbulence model can be used for AXISYMMETRIC case---*/
Expand Down Expand Up @@ -4588,10 +4603,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
for (int i=0; i<7; ++i) eng_cyl[i] /= 12.0;
}

if ((Kind_Turb_Model != TURB_MODEL::SA) && (Kind_Trans_Model == TURB_TRANS_MODEL::BC)){
SU2_MPI::Error("BC transition model currently only available in combination with SA turbulence model!", CURRENT_FUNCTION);
}

if (Kind_Trans_Model == TURB_TRANS_MODEL::LM) {
SU2_MPI::Error("The LM transition model is under maintenance.", CURRENT_FUNCTION);
}
Expand Down Expand Up @@ -5861,11 +5872,26 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
cout << "Turbulence model: ";
switch (Kind_Turb_Model) {
case TURB_MODEL::NONE: break;
case TURB_MODEL::SA: cout << "Spalart Allmaras" << endl; break;
case TURB_MODEL::SA_NEG: cout << "Negative Spalart Allmaras" << endl; break;
case TURB_MODEL::SA_E: cout << "Edwards Spalart Allmaras" << endl; break;
case TURB_MODEL::SA_COMP: cout << "Compressibility Correction Spalart Allmaras" << endl; break;
case TURB_MODEL::SA_E_COMP: cout << "Compressibility Correction Edwards Spalart Allmaras" << endl; break;
case TURB_MODEL::SA:
switch (saParsedOptions.version) {
case SA_OPTIONS::NEG:
cout << "Negative-";
break;
case SA_OPTIONS::EDW:
cout << "Edwards-";
break;
default:
break;
}
cout << "Spalart-Allmaras";

if (!saParsedOptions.ft2) cout << "-noft2";
if (saParsedOptions.rot) cout << "-R";
if (saParsedOptions.comp) cout << "-comp";
if (saParsedOptions.qcr2000) cout << "-QCR2000";
if (saParsedOptions.bc) cout << "-BCM";
cout << endl;
break;
case TURB_MODEL::SST:
cout << "Menter's k-omega SST";
if (sstParsedOptions.version == SST_OPTIONS::V1994) cout << "-1994";
Expand All @@ -5891,11 +5917,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
cout << "." << endl;
break;
}
if (QCR) cout << "Using Quadratic Constitutive Relation, 2000 version (QCR2000)" << endl;
if (Kind_Trans_Model == TURB_TRANS_MODEL::BC) cout << "Using the revised BC transition model (2020)" << endl;
cout << "Hybrid RANS/LES: ";
switch (Kind_HybridRANSLES){
case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break;
switch (Kind_HybridRANSLES) {
case NO_HYBRIDRANSLES: cout << "No Hybrid RANS/LES" << endl; break;
case SA_DES: cout << "Detached Eddy Simulation (DES97) " << endl; break;
case SA_DDES: cout << "Delayed Detached Eddy Simulation (DDES) with Standard SGS" << endl; break;
case SA_ZDES: cout << "Delayed Detached Eddy Simulation (DDES) with Vorticity-based SGS" << endl; break;
Expand Down
Loading