@@ -92,8 +92,8 @@ const unsigned int INST_0 = 0; /*!< \brief Definition of the first instance per
9292
9393const su2double STANDARD_GRAVITY = 9.80665 ; /* !< \brief Acceleration due to gravity at surface of earth. */
9494const su2double UNIVERSAL_GAS_CONSTANT = 8.3144598 ; /* !< \brief Universal gas constant in J/(mol*K) */
95- const su2double BOLTZMANN_CONSTANT = 1.3806503E-23 ; /* ! \brief Boltzmann's constant [J K^-1] */
96- const su2double AVOGAD_CONSTANT = 6.0221415E26 ; /* !< \brief Avogardro 's constant, number of particles in one kmole. */
95+ const su2double BOLTZMANN_CONSTANT = 1.3806503E-23 ; /* !< \brief Boltzmann's constant [J K^-1] */
96+ const su2double AVOGAD_CONSTANT = 6.0221415E26 ; /* !< \brief Avogadro 's constant, number of particles in one kmole. */
9797
9898const su2double EPS = 1.0E-16 ; /* !< \brief Error scale. */
9999const su2double TURB_EPS = 1.0E-16 ; /* !< \brief Turbulent Error scale. */
@@ -912,12 +912,11 @@ static const MapType<std::string, LIMITER> Limiter_Map = {
912912enum class TURB_MODEL {
913913 NONE, /* !< \brief No turbulence model. */
914914 SA, /* !< \brief Kind of Turbulent model (Spalart-Allmaras). */
915- SA_NEG, /* !< \brief Kind of Turbulent model (Spalart-Allmaras). */
915+ SA_NEG, /* !< \brief Kind of Turbulent model (Negative Spalart-Allmaras). */
916916 SA_E, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Edwards). */
917917 SA_COMP, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Compressibility Correction). */
918918 SA_E_COMP, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Edwards with Compressibility Correction). */
919919 SST, /* !< \brief Kind of Turbulence model (Menter SST). */
920- SST_SUST /* !< \brief Kind of Turbulence model (Menter SST with sustaining terms for free-stream preservation). */
921920};
922921static const MapType<std::string, TURB_MODEL> Turb_Model_Map = {
923922 MakePair (" NONE" , TURB_MODEL::NONE)
@@ -927,7 +926,6 @@ static const MapType<std::string, TURB_MODEL> Turb_Model_Map = {
927926 MakePair (" SA_COMP" , TURB_MODEL::SA_COMP)
928927 MakePair (" SA_E_COMP" , TURB_MODEL::SA_E_COMP)
929928 MakePair (" SST" , TURB_MODEL::SST)
930- MakePair (" SST_SUST" , TURB_MODEL::SST_SUST)
931929};
932930
933931/* !
@@ -952,19 +950,119 @@ inline TURB_FAMILY TurbModelFamily(TURB_MODEL model) {
952950 case TURB_MODEL::SA_E_COMP:
953951 return TURB_FAMILY::SA;
954952 case TURB_MODEL::SST:
955- case TURB_MODEL::SST_SUST:
956953 return TURB_FAMILY::KW;
957954 }
958955 return TURB_FAMILY::NONE;
959956}
960957
958+ /* !
959+ * \brief SST Options
960+ */
961+ enum class SST_OPTIONS {
962+ NONE, /* !< \brief No SST Turb model. */
963+ V1994, /* !< \brief 1994 Menter k-w SST model. */
964+ V2003, /* !< \brief 2003 Menter k-w SST model. */
965+ V1994m, /* !< \brief 1994m Menter k-w SST model. */
966+ V2003m, /* !< \brief 2003m Menter k-w SST model. */
967+ SUST, /* !< \brief Menter k-w SST model with sustaining terms. */
968+ V, /* !< \brief Menter k-w SST model with vorticity production terms. */
969+ KL, /* !< \brief Menter k-w SST model with Kato-Launder production terms. */
970+ UQ, /* !< \brief Menter k-w SST model with uncertainty quantification modifications. */
971+ };
972+ static const MapType<std::string, SST_OPTIONS> SST_Options_Map = {
973+ MakePair (" NONE" , SST_OPTIONS::NONE)
974+ MakePair (" V1994m" , SST_OPTIONS::V1994m)
975+ MakePair (" V2003m" , SST_OPTIONS::V2003m)
976+ // / TODO: For now we do not support "unmodified" versions of SST.
977+ // MakePair("V1994", SST_OPTIONS::V1994)
978+ // MakePair("V2003", SST_OPTIONS::V2003)
979+ MakePair (" SUSTAINING" , SST_OPTIONS::SUST)
980+ MakePair (" VORTICITY" , SST_OPTIONS::V)
981+ MakePair (" KATO-LAUNDER" , SST_OPTIONS::KL)
982+ MakePair (" UQ" , SST_OPTIONS::UQ)
983+ };
984+
985+ /* !
986+ * \brief Structure containing parsed SST options.
987+ */
988+ struct SST_ParsedOptions {
989+ SST_OPTIONS version = SST_OPTIONS::V1994; /* !< \brief Enum SST base model. */
990+ SST_OPTIONS production = SST_OPTIONS::NONE; /* !< \brief Enum for production corrections/modifiers for SST model. */
991+ bool sust = false ; /* !< \brief Bool for SST model with sustaining terms. */
992+ bool uq = false ; /* !< \brief Bool for using uncertainty quantification. */
993+ bool modified = false ; /* !< \brief Bool for modified (m) SST model. */
994+ };
995+
996+ /* !
997+ * \brief Function to parse SST options.
998+ * \param[in] SST_Options - Selected SST option from config.
999+ * \param[in] nSST_Options - Number of options selected.
1000+ * \param[in] rank - MPI rank.
1001+ */
1002+ inline SST_ParsedOptions ParseSSTOptions (const SST_OPTIONS *SST_Options, unsigned short nSST_Options, int rank) {
1003+ SST_ParsedOptions SSTParsedOptions;
1004+
1005+ auto IsPresent = [&](SST_OPTIONS option) {
1006+ const auto sst_options_end = SST_Options + nSST_Options;
1007+ return std::find (SST_Options, sst_options_end, option) != sst_options_end;
1008+ };
1009+
1010+ const bool found_1994 = IsPresent (SST_OPTIONS::V1994);
1011+ const bool found_2003 = IsPresent (SST_OPTIONS::V2003);
1012+ const bool found_1994m = IsPresent (SST_OPTIONS::V1994m);
1013+ const bool found_2003m = IsPresent (SST_OPTIONS::V2003m);
1014+
1015+ const bool default_version = !found_1994 && !found_1994m && !found_2003 && !found_2003m;
1016+
1017+ const bool sst_1994 = found_1994 || found_1994m || default_version;
1018+ const bool sst_2003 = found_2003 || found_2003m;
1019+
1020+ /* --- When V2003m or V1994m is selected, we automatically select sst_m. ---*/
1021+ const bool sst_m = found_1994m || found_2003m || default_version;
1022+
1023+ const bool sst_sust = IsPresent (SST_OPTIONS::SUST);
1024+ const bool sst_v = IsPresent (SST_OPTIONS::V);
1025+ const bool sst_kl = IsPresent (SST_OPTIONS::KL);
1026+ const bool sst_uq = IsPresent (SST_OPTIONS::UQ);
1027+
1028+ if (sst_1994 && sst_2003) {
1029+ SU2_MPI::Error (" Two versions (1994 and 2003) selected for SST_OPTIONS. Please choose only one." , CURRENT_FUNCTION);
1030+ } else if (sst_2003) {
1031+ SSTParsedOptions.version = SST_OPTIONS::V2003;
1032+ } else {
1033+ SSTParsedOptions.version = SST_OPTIONS::V1994;
1034+
1035+ if (rank==MASTER_NODE) {
1036+ std::cout <<
1037+ " WARNING: The current SST-1994m model is inconsistent with literature. We recommend using the SST-2003m model.\n "
1038+ " In SU2 v8 the 2003m model will become default, and the inconsistency will be fixed." << std::endl;
1039+ }
1040+ }
1041+
1042+ // Parse production modifications
1043+ if ((int (sst_v) + int (sst_kl) + int (sst_uq)) > 1 ) {
1044+ SU2_MPI::Error (" Please select only one SST production term modifier (VORTICITY, KATO-LAUNDER, or UQ)." , CURRENT_FUNCTION);
1045+ } else if (sst_v) {
1046+ SSTParsedOptions.production = SST_OPTIONS::V;
1047+ } else if (sst_kl) {
1048+ SSTParsedOptions.production = SST_OPTIONS::KL;
1049+ } else if (sst_uq) {
1050+ SSTParsedOptions.production = SST_OPTIONS::UQ;
1051+ }
1052+
1053+ SSTParsedOptions.sust = sst_sust;
1054+ SSTParsedOptions.modified = sst_m;
1055+ SSTParsedOptions.uq = sst_uq;
1056+ return SSTParsedOptions;
1057+ }
1058+
9611059/* !
9621060 * \brief Types of transition models
9631061 */
9641062enum class TURB_TRANS_MODEL {
9651063 NONE, /* !< \brief No transition model. */
9661064 LM, /* !< \brief Kind of transition model (Langtry-Menter (LM) for SST and Spalart-Allmaras). */
967- BC /* !< \brief Kind of transition model (BAS-CAKMAKCIOGLU (BC) for Spalart-Allmaras). */
1065+ BC /* !< \brief Kind of transition model (BAS-CAKMAKCIOGLU (BC) for Spalart-Allmaras). */
9681066};
9691067static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = {
9701068 MakePair (" NONE" , TURB_TRANS_MODEL::NONE)
@@ -1002,7 +1100,6 @@ static const MapType<std::string, TURB_SGS_MODEL> SGS_Model_Map = {
10021100 MakePair (" VREMAN" , TURB_SGS_MODEL::VREMAN)
10031101};
10041102
1005-
10061103/* !
10071104 * \brief Types of window (weight) functions for cost functional
10081105 */
0 commit comments