@@ -912,19 +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 (Negative Spalart-Allmaras). */
916- SA_E, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Edwards). */
917- SA_COMP, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Compressibility Correction). */
918- SA_E_COMP, /* !< \brief Kind of Turbulent model (Spalart-Allmaras Edwards with Compressibility Correction). */
919915 SST, /* !< \brief Kind of Turbulence model (Menter SST). */
920916};
921917static const MapType<std::string, TURB_MODEL> Turb_Model_Map = {
922918 MakePair (" NONE" , TURB_MODEL::NONE)
923919 MakePair (" SA" , TURB_MODEL::SA)
924- MakePair (" SA_NEG" , TURB_MODEL::SA_NEG)
925- MakePair (" SA_E" , TURB_MODEL::SA_E)
926- MakePair (" SA_COMP" , TURB_MODEL::SA_COMP)
927- MakePair (" SA_E_COMP" , TURB_MODEL::SA_E_COMP)
928920 MakePair (" SST" , TURB_MODEL::SST)
929921};
930922
@@ -944,10 +936,6 @@ inline TURB_FAMILY TurbModelFamily(TURB_MODEL model) {
944936 case TURB_MODEL::NONE:
945937 return TURB_FAMILY::NONE;
946938 case TURB_MODEL::SA:
947- case TURB_MODEL::SA_NEG:
948- case TURB_MODEL::SA_E:
949- case TURB_MODEL::SA_COMP:
950- case TURB_MODEL::SA_E_COMP:
951939 return TURB_FAMILY::SA;
952940 case TURB_MODEL::SST:
953941 return TURB_FAMILY::KW;
@@ -998,6 +986,7 @@ struct SST_ParsedOptions {
998986 * \param[in] SST_Options - Selected SST option from config.
999987 * \param[in] nSST_Options - Number of options selected.
1000988 * \param[in] rank - MPI rank.
989+ * \return Struct with SST options.
1001990 */
1002991inline SST_ParsedOptions ParseSSTOptions (const SST_OPTIONS *SST_Options, unsigned short nSST_Options, int rank) {
1003992 SST_ParsedOptions SSTParsedOptions;
@@ -1056,18 +1045,115 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
10561045 return SSTParsedOptions;
10571046}
10581047
1048+ /* !
1049+ * \brief SA Options
1050+ */
1051+ enum class SA_OPTIONS {
1052+ NONE, /* !< \brief No option / default. */
1053+ NEG, /* !< \brief Negative SA. */
1054+ EDW, /* !< \brief Edwards version. */
1055+ FT2, /* !< \brief Use FT2 term. */
1056+ QCR2000, /* !< \brief Quadratic constitutive relation. */
1057+ COMP, /* !< \brief Compressibility correction. */
1058+ ROT, /* !< \brief Rotation correction. */
1059+ BC, /* !< \brief Bas-Cakmakcioclu transition. */
1060+ EXP, /* !< \brief Allow experimental combinations of options (according to TMR). */
1061+ };
1062+ static const MapType<std::string, SA_OPTIONS> SA_Options_Map = {
1063+ MakePair (" NONE" , SA_OPTIONS::NONE)
1064+ MakePair (" NEGATIVE" , SA_OPTIONS::NEG)
1065+ MakePair (" EDWARDS" , SA_OPTIONS::EDW)
1066+ MakePair (" WITHFT2" , SA_OPTIONS::FT2)
1067+ MakePair (" QCR2000" , SA_OPTIONS::QCR2000)
1068+ MakePair (" COMPRESSIBILITY" , SA_OPTIONS::COMP)
1069+ MakePair (" ROTATION" , SA_OPTIONS::ROT)
1070+ MakePair (" BCM" , SA_OPTIONS::BC)
1071+ MakePair (" EXPERIMENTAL" , SA_OPTIONS::EXP)
1072+ };
1073+
1074+ /* !
1075+ * \brief Structure containing parsed SA options.
1076+ */
1077+ struct SA_ParsedOptions {
1078+ SA_OPTIONS version = SA_OPTIONS::NONE; /* !< \brief SA base model. */
1079+ bool ft2 = false ; /* !< \brief Use ft2 term. */
1080+ bool qcr2000 = false ; /* !< \brief Use QCR-2000. */
1081+ bool comp = false ; /* !< \brief Use compressibility correction. */
1082+ bool rot = false ; /* !< \brief Use rotation correction. */
1083+ bool bc = false ; /* !< \brief BC transition. */
1084+ };
1085+
1086+ /* !
1087+ * \brief Function to parse SA options.
1088+ * \param[in] SA_Options - Selected SA option from config.
1089+ * \param[in] nSA_Options - Number of options selected.
1090+ * \param[in] rank - MPI rank.
1091+ * \return Struct with SA options.
1092+ */
1093+ inline SA_ParsedOptions ParseSAOptions (const SA_OPTIONS *SA_Options, unsigned short nSA_Options, int rank) {
1094+ SA_ParsedOptions SAParsedOptions;
1095+
1096+ auto IsPresent = [&](SA_OPTIONS option) {
1097+ const auto sa_options_end = SA_Options + nSA_Options;
1098+ return std::find (SA_Options, sa_options_end, option) != sa_options_end;
1099+ };
1100+
1101+ const bool found_neg = IsPresent (SA_OPTIONS::NEG);
1102+ const bool found_edw = IsPresent (SA_OPTIONS::EDW);
1103+ const bool found_bsl = !found_neg && !found_edw;
1104+
1105+ if (found_neg && found_edw) {
1106+ SU2_MPI::Error (" Two versions (Negative and Edwards) selected for SA_OPTIONS. Please choose only one." , CURRENT_FUNCTION);
1107+ }
1108+
1109+ if (found_bsl) {
1110+ SAParsedOptions.version = SA_OPTIONS::NONE;
1111+ } else if (found_neg) {
1112+ SAParsedOptions.version = SA_OPTIONS::NEG;
1113+ } else {
1114+ SAParsedOptions.version = SA_OPTIONS::EDW;
1115+ }
1116+ SAParsedOptions.ft2 = IsPresent (SA_OPTIONS::FT2);
1117+ SAParsedOptions.qcr2000 = IsPresent (SA_OPTIONS::QCR2000);
1118+ SAParsedOptions.comp = IsPresent (SA_OPTIONS::COMP);
1119+ SAParsedOptions.rot = IsPresent (SA_OPTIONS::ROT);
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+ }
1144+ return SAParsedOptions;
1145+ }
1146+
10591147/* !
10601148 * \brief Types of transition models
10611149 */
10621150enum class TURB_TRANS_MODEL {
10631151 NONE, /* !< \brief No transition model. */
10641152 LM, /* !< \brief Kind of transition model (Langtry-Menter (LM) for SST and Spalart-Allmaras). */
1065- BC /* !< \brief Kind of transition model (BAS-CAKMAKCIOGLU (BC) for Spalart-Allmaras). */
10661153};
10671154static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = {
10681155 MakePair (" NONE" , TURB_TRANS_MODEL::NONE)
10691156 MakePair (" LM" , TURB_TRANS_MODEL::LM)
1070- MakePair (" BC" , TURB_TRANS_MODEL::BC)
10711157};
10721158
10731159/* !
0 commit comments