@@ -1182,6 +1182,119 @@ static const MapType<std::string, TURB_TRANS_MODEL> Trans_Model_Map = {
11821182 MakePair (" LM" , TURB_TRANS_MODEL::LM)
11831183};
11841184
1185+ /* !
1186+ * \brief LM Options
1187+ */
1188+ enum class LM_OPTIONS {
1189+ NONE, /* !< \brief No option / default. */
1190+ LM2015, /* !< \brief Cross-flow corrections. */
1191+ MALAN, /* !< \brief Kind of transition correlation model (Malan). */
1192+ SULUKSNA, /* !< \brief Kind of transition correlation model (Suluksna). */
1193+ KRAUSE, /* !< \brief Kind of transition correlation model (Krause). */
1194+ KRAUSE_HYPER, /* !< \brief Kind of transition correlation model (Krause hypersonic). */
1195+ MEDIDA_BAEDER,/* !< \brief Kind of transition correlation model (Medida-Baeder). */
1196+ MEDIDA, /* !< \brief Kind of transition correlation model (Medida). */
1197+ MENTER_LANGTRY, /* !< \brief Kind of transition correlation model (Menter-Langtry). */
1198+ DEFAULT /* !< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */
1199+ };
1200+
1201+ static const MapType<std::string, LM_OPTIONS> LM_Options_Map = {
1202+ MakePair (" NONE" , LM_OPTIONS::NONE)
1203+ MakePair (" LM2015" , LM_OPTIONS::LM2015)
1204+ MakePair (" MALAN" , LM_OPTIONS::MALAN)
1205+ MakePair (" SULUKSNA" , LM_OPTIONS::SULUKSNA)
1206+ MakePair (" KRAUSE" , LM_OPTIONS::KRAUSE)
1207+ MakePair (" KRAUSE_HYPER" , LM_OPTIONS::KRAUSE_HYPER)
1208+ MakePair (" MEDIDA_BAEDER" , LM_OPTIONS::MEDIDA_BAEDER)
1209+ MakePair (" MENTER_LANGTRY" , LM_OPTIONS::MENTER_LANGTRY)
1210+ MakePair (" DEFAULT" , LM_OPTIONS::DEFAULT)
1211+ };
1212+
1213+ /* !
1214+ * \brief Types of transition correlations
1215+ */
1216+ enum class TURB_TRANS_CORRELATION {
1217+ MALAN, /* !< \brief Kind of transition correlation model (Malan). */
1218+ SULUKSNA, /* !< \brief Kind of transition correlation model (Suluksna). */
1219+ KRAUSE, /* !< \brief Kind of transition correlation model (Krause). */
1220+ KRAUSE_HYPER, /* !< \brief Kind of transition correlation model (Krause hypersonic). */
1221+ MEDIDA_BAEDER,/* !< \brief Kind of transition correlation model (Medida-Baeder). */
1222+ MEDIDA, /* !< \brief Kind of transition correlation model (Medida). */
1223+ MENTER_LANGTRY, /* !< \brief Kind of transition correlation model (Menter-Langtry). */
1224+ DEFAULT /* !< \brief Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA). */
1225+ };
1226+
1227+ /* !
1228+ * \brief Structure containing parsed LM options.
1229+ */
1230+ struct LM_ParsedOptions {
1231+ LM_OPTIONS version = LM_OPTIONS::NONE; /* !< \brief LM base model. */
1232+ bool LM2015 = false ; /* !< \brief Use cross-flow corrections. */
1233+ TURB_TRANS_CORRELATION Correlation = TURB_TRANS_CORRELATION::DEFAULT;
1234+ };
1235+
1236+ /* !
1237+ * \brief Function to parse LM options.
1238+ * \param[in] LM_Options - Selected LM option from config.
1239+ * \param[in] nLM_Options - Number of options selected.
1240+ * \param[in] rank - MPI rank.
1241+ * \return Struct with SA options.
1242+ */
1243+ inline LM_ParsedOptions ParseLMOptions (const LM_OPTIONS *LM_Options, unsigned short nLM_Options, int rank, TURB_MODEL Kind_Turb_Model) {
1244+ LM_ParsedOptions LMParsedOptions;
1245+
1246+ auto IsPresent = [&](LM_OPTIONS option) {
1247+ const auto lm_options_end = LM_Options + nLM_Options;
1248+ return std::find (LM_Options, lm_options_end, option) != lm_options_end;
1249+ };
1250+
1251+ LMParsedOptions.LM2015 = IsPresent (LM_OPTIONS::LM2015);
1252+
1253+ int NFoundCorrelations = 0 ;
1254+ if (IsPresent (LM_OPTIONS::MALAN)) {
1255+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MALAN;
1256+ NFoundCorrelations++;
1257+ }
1258+ if (IsPresent (LM_OPTIONS::SULUKSNA)) {
1259+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::SULUKSNA;
1260+ NFoundCorrelations++;
1261+ }
1262+ if (IsPresent (LM_OPTIONS::KRAUSE)) {
1263+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::KRAUSE;
1264+ NFoundCorrelations++;
1265+ }
1266+ if (IsPresent (LM_OPTIONS::KRAUSE_HYPER)) {
1267+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::KRAUSE_HYPER;
1268+ NFoundCorrelations++;
1269+ }
1270+ if (IsPresent (LM_OPTIONS::MEDIDA_BAEDER)) {
1271+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MEDIDA_BAEDER;
1272+ NFoundCorrelations++;
1273+ }
1274+ if (IsPresent (LM_OPTIONS::MEDIDA)) {
1275+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MEDIDA;
1276+ NFoundCorrelations++;
1277+ }
1278+ if (IsPresent (LM_OPTIONS::MENTER_LANGTRY)) {
1279+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MENTER_LANGTRY;
1280+ NFoundCorrelations++;
1281+ }
1282+
1283+ if (NFoundCorrelations > 1 ) {
1284+ SU2_MPI::Error (" Two correlations selected for LM_OPTIONS. Please choose only one." , CURRENT_FUNCTION);
1285+ }
1286+
1287+ if (LMParsedOptions.Correlation == TURB_TRANS_CORRELATION::DEFAULT){
1288+ if (Kind_Turb_Model == TURB_MODEL::SST) {
1289+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MENTER_LANGTRY;
1290+ } else if (Kind_Turb_Model == TURB_MODEL::SA) {
1291+ LMParsedOptions.Correlation = TURB_TRANS_CORRELATION::MALAN;
1292+ }
1293+ }
1294+
1295+ return LMParsedOptions;
1296+ }
1297+
11851298/* !
11861299 * \brief types of species transport models
11871300 */
0 commit comments