From 2a90db061332798de9c9f548ae14c9e95a39b293 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 12:04:36 +0200 Subject: [PATCH 01/11] Make ENUM_TURB_MODEL an enum class. Went well for the most part. In some switches a default: break; had to be added. in option_structure.inl the old ENUM_TURB_MODEL was stored in some unsigned short intInfo container which is not seamlessly possible as an enum class names its own new type. Imo the storage is not not necessary as it is never used so I just removed it. --- Common/include/CConfig.hpp | 4 +- Common/include/option_structure.hpp | 38 +++--- Common/include/option_structure.inl | 4 +- Common/src/CConfig.cpp | 35 +++--- SU2_CFD/include/output/CAdjFlowCompOutput.hpp | 2 +- SU2_CFD/include/output/CAdjFlowIncOutput.hpp | 2 +- SU2_CFD/include/output/CFlowCompFEMOutput.hpp | 2 +- SU2_CFD/include/output/CFlowCompOutput.hpp | 2 +- SU2_CFD/include/output/CFlowIncOutput.hpp | 2 +- SU2_CFD/include/output/CNEMOCompOutput.hpp | 6 +- .../include/solvers/CFVMFlowSolverBase.inl | 16 +-- SU2_CFD/include/solvers/CSolverFactory.hpp | 2 +- SU2_CFD/src/drivers/CDriver.cpp | 18 +-- .../interfaces/cfd/CMixingPlaneInterface.cpp | 4 +- SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp | 2 +- SU2_CFD/src/numerics/flow/flow_sources.cpp | 4 +- .../src/numerics/turbulent/turb_sources.cpp | 2 +- SU2_CFD/src/output/CAdjFlowCompOutput.cpp | 56 +++++---- SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 56 +++++---- SU2_CFD/src/output/CFlowCompOutput.cpp | 114 +++++++++--------- SU2_CFD/src/output/CFlowIncOutput.cpp | 109 +++++++++-------- SU2_CFD/src/output/CFlowOutput.cpp | 19 +-- SU2_CFD/src/output/CNEMOCompOutput.cpp | 74 ++++++------ SU2_CFD/src/output/output_physics.cpp | 2 +- .../src/output/output_structure_legacy.cpp | 44 ++++--- SU2_CFD/src/solvers/CAdjEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CAdjTurbSolver.cpp | 15 +-- SU2_CFD/src/solvers/CBaselineSolver.cpp | 6 +- SU2_CFD/src/solvers/CDiscAdjSolver.cpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 58 ++++----- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 10 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 6 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 4 +- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 6 +- SU2_CFD/src/solvers/CNSSolver.cpp | 6 +- SU2_CFD/src/solvers/CSolver.cpp | 10 +- SU2_CFD/src/solvers/CSolverFactory.cpp | 8 +- SU2_CFD/src/solvers/CTurbSASolver.cpp | 6 +- SU2_CFD/src/solvers/CTurbSolver.cpp | 2 +- SU2_CFD/src/variables/CIncNSVariable.cpp | 2 +- 42 files changed, 385 insertions(+), 381 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 897f5a0a6f0..9a39043c587 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -554,7 +554,7 @@ class CConfig { STRUCT_DEFORMATION Kind_Struct_Solver; /*!< \brief Determines the geometric condition (small or large deformations) for structural analysis. */ unsigned short Kind_DV_FEA; /*!< \brief Kind of Design Variable for FEA problems.*/ - unsigned short Kind_Turb_Model; /*!< \brief Turbulent model definition. */ + TURB_MODEL Kind_Turb_Model; /*!< \brief Turbulent model definition. */ unsigned short Kind_SGS_Model; /*!< \brief LES SGS model definition. */ unsigned short Kind_Trans_Model, /*!< \brief Transition model definition. */ Kind_ActDisk, Kind_Engine_Inflow, @@ -4162,7 +4162,7 @@ class CConfig { * \brief Get the kind of the turbulence model. * \return Kind of the turbulence model. */ - unsigned short GetKind_Turb_Model(void) const { return Kind_Turb_Model; } + TURB_MODEL GetKind_Turb_Model(void) const { return Kind_Turb_Model; } /*! * \brief Get the kind of the transition model. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index ac808765b11..425c0c89062 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -888,25 +888,25 @@ static const MapType Limiter_Map = { /*! * \brief Types of turbulent models */ -enum ENUM_TURB_MODEL { - NO_TURB_MODEL = 0, /*!< \brief No turbulence model. */ - SA = 1, /*!< \brief Kind of Turbulent model (Spalart-Allmaras). */ - SA_NEG = 2, /*!< \brief Kind of Turbulent model (Spalart-Allmaras). */ - SA_E = 3, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Edwards). */ - SA_COMP = 4, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Compressibility Correction). */ - SA_E_COMP = 5, /*!< \brief Kind of Turbulent model (Spalart-Allmaras Edwards with Compressibility Correction). */ - SST = 6, /*!< \brief Kind of Turbulence model (Menter SST). */ - SST_SUST = 7 /*!< \brief Kind of Turbulence model (Menter SST with sustaining terms for free-stream preservation). */ -}; -static const MapType Turb_Model_Map = { - MakePair("NONE", NO_TURB_MODEL) - MakePair("SA", SA) - MakePair("SA_NEG", SA_NEG) - MakePair("SA_E", SA_E) - MakePair("SA_COMP", SA_COMP) - MakePair("SA_E_COMP", SA_E_COMP) - MakePair("SST", SST) - MakePair("SST_SUST", SST_SUST) +enum class TURB_MODEL { + NONE, /*!< \brief No turbulence model. */ + SA, /*!< \brief Kind of Turbulent model (Spalart-Allmaras). */ + SA_NEG, /*!< \brief Kind of Turbulent model (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). */ + SST_SUST /*!< \brief Kind of Turbulence model (Menter SST with sustaining terms for free-stream preservation). */ +}; +static const MapType 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) + MakePair("SST_SUST", TURB_MODEL::SST_SUST) }; /*! diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index fdbc795efa5..a3a68c7667d 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -1889,7 +1889,7 @@ public: this->doubleInfo[i] = new su2double[1]; /* Check for a valid RANS turbulence model. */ - map::const_iterator iit; + map::const_iterator iit; iit = Turb_Model_Map.find(option_value[counter++]); if(iit == Turb_Model_Map.end()) { string newstring; @@ -1904,8 +1904,6 @@ public: return newstring; } - this->intInfo[i][0] = iit->second; - /* Extract the exchange distance. */ istringstream ss_1st(option_value[counter++]); if (!(ss_1st >> this->doubleInfo[i][0])) { diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index fa75b1d8819..e98d458f1de 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1076,7 +1076,7 @@ void CConfig::SetConfig_Options() { /*!\brief MATH_PROBLEM \n DESCRIPTION: Mathematical problem \n Options: DIRECT, ADJOINT \ingroup Config*/ addMathProblemOption("MATH_PROBLEM", ContinuousAdjoint, false, DiscreteAdjoint, discAdjDefault, Restart_Flow, discAdjDefault); /*!\brief KIND_TURB_MODEL \n DESCRIPTION: Specify turbulence model \n Options: see \link Turb_Model_Map \endlink \n DEFAULT: NO_TURB_MODEL \ingroup Config*/ - addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, NO_TURB_MODEL); + addEnumOption("KIND_TURB_MODEL", Kind_Turb_Model, Turb_Model_Map, TURB_MODEL::NONE); /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NO_TRANS_MODEL \ingroup Config*/ addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, NO_TRANS_MODEL); @@ -3273,16 +3273,16 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - if (Kind_Solver == NAVIER_STOKES && Kind_Turb_Model != NONE){ + if (Kind_Solver == NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == INC_NAVIER_STOKES && Kind_Turb_Model != NONE){ + if (Kind_Solver == INC_NAVIER_STOKES && Kind_Turb_Model != TURB_MODEL::NONE){ SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= INC_NAVIER_STOKES", CURRENT_FUNCTION); } - if (Kind_Solver == RANS && Kind_Turb_Model == NONE){ + if (Kind_Solver == RANS && Kind_Turb_Model == TURB_MODEL::NONE){ SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= RANS", CURRENT_FUNCTION); } - if (Kind_Solver == INC_RANS && Kind_Turb_Model == NONE){ + if (Kind_Solver == INC_RANS && Kind_Turb_Model == TURB_MODEL::NONE){ SU2_MPI::Error("A turbulence model must be specified with KIND_TURB_MODEL if SOLVER= INC_RANS", CURRENT_FUNCTION); } @@ -4043,18 +4043,18 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (MGCycle == FULLMG_CYCLE) FinestMesh = nMGLevels; if ((Kind_Solver == NAVIER_STOKES) && - (Kind_Turb_Model != NONE)) + (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = RANS; if ((Kind_Solver == INC_NAVIER_STOKES) && - (Kind_Turb_Model != NONE)) + (Kind_Turb_Model != TURB_MODEL::NONE)) Kind_Solver = INC_RANS; if (Kind_Solver == EULER || Kind_Solver == INC_EULER || Kind_Solver == NEMO_EULER || Kind_Solver == FEM_EULER) - Kind_Turb_Model = NONE; + Kind_Turb_Model = TURB_MODEL::NONE; Kappa_2nd_Flow = jst_coeff[0]; Kappa_4th_Flow = jst_coeff[1]; @@ -4435,7 +4435,7 @@ 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 != SA) && (Kind_Trans_Model == BC)){ + if ((Kind_Turb_Model != TURB_MODEL::SA) && (Kind_Trans_Model == BC)){ SU2_MPI::Error("BC transition model currently only available in combination with SA turbulence model!", CURRENT_FUNCTION); } @@ -4533,7 +4533,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /* --- Throw error if UQ used for any turbulence model other that SST --- */ - if (Kind_Solver == RANS && Kind_Turb_Model != SST && Kind_Turb_Model != SST_SUST && using_uq){ + if (Kind_Solver == RANS && Kind_Turb_Model != TURB_MODEL::SST && Kind_Turb_Model != TURB_MODEL::SST_SUST && using_uq){ SU2_MPI::Error("UQ capabilities only implemented for NAVIER_STOKES solver SST turbulence model", CURRENT_FUNCTION); } @@ -5620,13 +5620,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible RANS equations." << endl; cout << "Turbulence model: "; switch (Kind_Turb_Model) { - case SA: cout << "Spalart Allmaras" << endl; break; - case SA_NEG: cout << "Negative Spalart Allmaras" << endl; break; - case SA_E: cout << "Edwards Spalart Allmaras" << endl; break; - case SA_COMP: cout << "Compressibility Correction Spalart Allmaras" << endl; break; - case SA_E_COMP: cout << "Compressibility Correction Edwards Spalart Allmaras" << endl; break; - case SST: cout << "Menter's SST" << endl; break; - case SST_SUST: cout << "Menter's SST with sustaining terms" << endl; 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::SST: cout << "Menter's SST" << endl; break; + case TURB_MODEL::SST_SUST: cout << "Menter's SST with sustaining terms" << endl; break; + default: break; } if (QCR) cout << "Using Quadratic Constitutive Relation, 2000 version (QCR2000)" << endl; if (Kind_Trans_Model == BC) cout << "Using the revised BC transition model (2020)" << endl; diff --git a/SU2_CFD/include/output/CAdjFlowCompOutput.hpp b/SU2_CFD/include/output/CAdjFlowCompOutput.hpp index d0e74d5e1de..876632d9e6d 100644 --- a/SU2_CFD/include/output/CAdjFlowCompOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowCompOutput.hpp @@ -39,7 +39,7 @@ class CAdjFlowCompOutput final: public COutput { bool cont_adj; /*!< \brief Boolean indicating whether we run a cont. adjoint problem */ bool frozen_visc; /*!< \brief Boolean indicating whether frozen viscosity/turbulence is used. */ - unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + TURB_MODEL turb_model; /*!< \brief The kind of turbulence model*/ public: diff --git a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp index 60ef6779774..e4fd092d994 100644 --- a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp @@ -37,7 +37,7 @@ class CAdjFlowIncOutput final: public COutput { private: - unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + TURB_MODEL turb_model; /*!< \brief The kind of turbulence model*/ RADIATION_MODEL rad_model; /*!< \brief The kind of radiation model */ bool heat; /*!< \brief Boolean indicating whether have a heat problem*/ bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ diff --git a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp index e4b8afb49e0..75aa37606a2 100644 --- a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp @@ -39,7 +39,7 @@ class CVariable; class CFlowCompFEMOutput final: public CFlowOutput { private: - unsigned short turb_model; //!< Kind of turbulence model + TURB_MODEL turb_model; //!< Kind of turbulence model public: diff --git a/SU2_CFD/include/output/CFlowCompOutput.hpp b/SU2_CFD/include/output/CFlowCompOutput.hpp index b0db597d6c3..48133e7c1d6 100644 --- a/SU2_CFD/include/output/CFlowCompOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompOutput.hpp @@ -39,7 +39,7 @@ class CVariable; class CFlowCompOutput final: public CFlowOutput { private: - unsigned short turb_model; //!< Kind of turbulence model + TURB_MODEL turb_model; //!< Kind of turbulence model public: diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index ec28cd425c5..c746c0a1627 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -39,7 +39,7 @@ class CVariable; class CFlowIncOutput final: public CFlowOutput { private: - unsigned short turb_model; /*!< \brief The kind of turbulence model*/ + TURB_MODEL turb_model; /*!< \brief The kind of turbulence model*/ bool heat; /*!< \brief Boolean indicating whether have a heat problem*/ bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ unsigned short streamwisePeriodic; /*!< \brief Boolean indicating whether it is a streamwise periodic simulation. */ diff --git a/SU2_CFD/include/output/CNEMOCompOutput.hpp b/SU2_CFD/include/output/CNEMOCompOutput.hpp index be633d0162f..e74b296c014 100644 --- a/SU2_CFD/include/output/CNEMOCompOutput.hpp +++ b/SU2_CFD/include/output/CNEMOCompOutput.hpp @@ -38,9 +38,9 @@ class CVariable; class CNEMOCompOutput final: public CFlowOutput { private: - unsigned short turb_model, /*!< \brief Kind of turbulence model */ - iSpecies, /*!< \brief Species index */ - nSpecies; /*!< \brief Number of species */ + TURB_MODEL turb_model; /*!< \brief Kind of turbulence model */ + unsigned short iSpecies, /*!< \brief Species index */ + nSpecies; /*!< \brief Number of species */ public: /*! diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 93435dabe13..97a3d8e19a9 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -406,8 +406,8 @@ void CFVMFlowSolverBase::Viscous_Residual_impl(unsigned long iEdge, CGeome CNumerics *numerics, CConfig *config) { const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - const bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || - (config->GetKind_Turb_Model() == SST_SUST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || + (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -726,7 +726,7 @@ void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ** unsigned short iDim, iVar, iMesh; unsigned long iPoint, index, iChildren, Point_Fine; - unsigned short turb_model = config->GetKind_Turb_Model(); + TURB_MODEL turb_model = config->GetKind_Turb_Model(); su2double Area_Children, Area_Parent; const su2double* Solution_Fine = nullptr; const passivedouble* Coord = nullptr; @@ -734,7 +734,7 @@ void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ** (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); bool static_fsi = ((config->GetTime_Marching() == TIME_MARCHING::STEADY) && config->GetFSI_Simulation()); bool steady_restart = config->GetSteadyRestart(); - bool turbulent = (config->GetKind_Turb_Model() != NONE); + bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); string restart_filename = config->GetFilename(config->GetSolution_FileName(), "", iter); @@ -751,7 +751,7 @@ void CFVMFlowSolverBase::LoadRestart_impl(CGeometry **geometry, CSolver ** (that could appear in the restart file before the grid velocities). ---*/ unsigned short turbVars = 0; if (turbulent){ - if ((turb_model == SST) || (turb_model == SST_SUST)) turbVars = 2; + if ((turb_model == TURB_MODEL::SST) || (turb_model == TURB_MODEL::SST_SUST)) turbVars = 2; else turbVars = 1; } @@ -946,7 +946,7 @@ void CFVMFlowSolverBase::SetInitialCondition(CGeometry **geometry, CSolver CConfig *config, unsigned long TimeIter) { const bool restart = (config->GetRestart() || config->GetRestart_Flow()); - const bool rans = (config->GetKind_Turb_Model() != NONE); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); const bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); @@ -1266,7 +1266,7 @@ void CFVMFlowSolverBase::BC_Sym_Plane(CGeometry* geometry, CSolver** solve visc_numerics->SetPrimVarGradient(nodes->GetGradient_Primitive(iPoint), CMatrixView(Grad_Reflected)); /*--- Turbulent kinetic energy. ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0)); @@ -1432,7 +1432,7 @@ void CFVMFlowSolverBase::BC_Fluid_Interface(CGeometry* geometry, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint, 0)); diff --git a/SU2_CFD/include/solvers/CSolverFactory.hpp b/SU2_CFD/include/solvers/CSolverFactory.hpp index 9c667426747..a8a8171ed0b 100644 --- a/SU2_CFD/include/solvers/CSolverFactory.hpp +++ b/SU2_CFD/include/solvers/CSolverFactory.hpp @@ -99,7 +99,7 @@ class CSolverFactory { * \param[in] adjoint - Boolean indicating whether a primal or adjoint solver should be allocated * \return - A pointer to the allocated turbulent solver */ - static CSolver* CreateTurbSolver(ENUM_TURB_MODEL kindTurbModel, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, int adjoint); + static CSolver* CreateTurbSolver(TURB_MODEL kindTurbModel, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, int adjoint); /*! * \brief Create a heat solver diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index ff3cf72e75d..3f729be2384 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1303,7 +1303,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol case ADJ_NAVIER_STOKES: adj_ns = ns = compressible = true; - turbulent = (config->GetKind_Turb_Model() != NONE); break; + turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); break; case ADJ_RANS: adj_ns = ns = compressible = turbulent = true; @@ -1315,13 +1315,13 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol if (turbulent || fem_turbulent) switch (config->GetKind_Turb_Model()) { - case SA: spalart_allmaras = true; break; - case SA_NEG: neg_spalart_allmaras = true; break; - case SA_E: e_spalart_allmaras = true; break; - case SA_COMP: comp_spalart_allmaras = true; break; - case SA_E_COMP: e_comp_spalart_allmaras = true; break; - case SST: menter_sst = true; break; - case SST_SUST: menter_sst = true; break; + case TURB_MODEL::SA: spalart_allmaras = true; break; + case TURB_MODEL::SA_NEG: neg_spalart_allmaras = true; break; + case TURB_MODEL::SA_E: e_spalart_allmaras = true; break; + case TURB_MODEL::SA_COMP: comp_spalart_allmaras = true; break; + case TURB_MODEL::SA_E_COMP: e_comp_spalart_allmaras = true; break; + case TURB_MODEL::SST: menter_sst = true; break; + case TURB_MODEL::SST_SUST: menter_sst = true; break; default: SU2_MPI::Error("Specified turbulence model unavailable or none selected", CURRENT_FUNCTION); break; @@ -2697,7 +2697,7 @@ void CDriver::Print_DirectResidual(RECORDING kind_recording) { RMSTable << log10(solvers[FLOW_SOL]->GetRes_RMS(iVar)); } - if (configs->GetKind_Turb_Model() != NONE && !configs->GetFrozen_Visc_Disc()) { + if (configs->GetKind_Turb_Model() != TURB_MODEL::NONE && !configs->GetFrozen_Visc_Disc()) { for (unsigned short iVar = 0; iVar < solvers[TURB_SOL]->GetnVar(); iVar++) { if (!addVals) RMSTable.AddColumn("rms_Turb" + iVar_iZone2string(iVar, iZone), fieldWidth); diff --git a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp index 813b031b354..7ad3ac375bd 100644 --- a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp @@ -58,7 +58,7 @@ void CMixingPlaneInterface::GetDonor_Variable(CSolver *donor_solution, CGeometry unsigned long iSpan, unsigned long rank) { unsigned short nDim = nVar - 2; - bool turbulent = (donor_config->GetKind_Turb_Model() != NONE); + bool turbulent = (donor_config->GetKind_Turb_Model() != TURB_MODEL::NONE); @@ -93,7 +93,7 @@ void CMixingPlaneInterface::SetTarget_Variable(CSolver *target_solution, CGeomet unsigned long iSpan, unsigned long rank) { unsigned short nDim = nVar - 2; - bool turbulent = (target_config->GetKind_Turb_Model() != NONE); + bool turbulent = (target_config->GetKind_Turb_Model() != TURB_MODEL::NONE); target_solution->SetExtAverageDensity(Marker_Target, iSpan, Target_Variable[0]); diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp index 2c36fd3db7b..31074315c31 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp @@ -313,7 +313,7 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi auto& Ms = fluidmodel->GetSpeciesMolarMass(); bool viscous = config->GetViscous(); - bool rans = (config->GetKind_Turb_Model() != NONE); + bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); hs = fluidmodel->ComputeSpeciesEnthalpy(T, Tve, eve_i); /*--- Initialize residual and Jacobian arrays ---*/ diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 354f5d06f44..47a48c1e8c2 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -54,7 +54,7 @@ CSourceAxisymmetric_Flow::CSourceAxisymmetric_Flow(unsigned short val_nDim, unsi implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); viscous = config->GetViscous(); - rans = (config->GetKind_Turb_Model() != NONE); + rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); } @@ -700,7 +700,7 @@ CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_ CConfig *config) : CSourceBase_Flow(val_nDim, val_nVar, config) { - turbulent = (config->GetKind_Turb_Model() != NONE); + turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); energy = config->GetEnergy_Equation(); streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); diff --git a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp index 368e40367ec..9b729dcf456 100644 --- a/SU2_CFD/src/numerics/turbulent/turb_sources.cpp +++ b/SU2_CFD/src/numerics/turbulent/turb_sources.cpp @@ -760,7 +760,7 @@ CSourcePieceWise_TurbSST::CSourcePieceWise_TurbSST(unsigned short val_nDim, CNumerics(val_nDim, val_nVar, config) { incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); - sustaining_terms = (config->GetKind_Turb_Model() == SST_SUST); + sustaining_terms = (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); axisymmetric = config->GetAxisymmetric(); /*--- Closure constants ---*/ diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index 8e297cccc36..9256e2b268e 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -114,11 +114,11 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("RMS_ADJ_ENERGY", "rms[A_E]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint energy.", HistoryFieldType::RESIDUAL); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. @@ -142,11 +142,11 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAX_ADJ_ENERGY", "max[A_E]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint energy.", HistoryFieldType::RESIDUAL); if (!frozen_visc){ switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Maximum residual of the adjoint nu tilde. AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint dissipation. @@ -171,11 +171,11 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("BGS_ADJ_ENERGY", "bgs[A_E]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint energy.", HistoryFieldType::RESIDUAL); if (!frozen_visc){ switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: BGS residual of the adjoint nu tilde. AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: BGS residual of the adjoint kinetic energy. AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint dissipation. @@ -203,7 +203,7 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - if (turb_model && !frozen_visc) { + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence."); } @@ -232,10 +232,10 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); break; @@ -253,10 +253,10 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); break; @@ -276,10 +276,10 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; @@ -297,7 +297,7 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C SetHistoryOutputValue("LINSOL_ITER", adjflow_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(adjflow_solver->GetResLinSolver())); - if (turb_model && !frozen_visc) { + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { SetHistoryOutputValue("LINSOL_ITER_TURB", adjturb_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL_TURB", log10(adjturb_solver->GetResLinSolver())); } @@ -331,11 +331,11 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("ADJ_ENERGY", "Adjoint_Energy", "SOLUTION", "Adjoint energy"); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Adjoint nu tilde. AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Adjoint kinetic energy. AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint kinetic energy"); /// DESCRIPTION: Adjoint dissipation. @@ -360,11 +360,11 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ADJ_ENERGY", "Residual_Adjoint_Energy", "RESIDUAL", "Residual of the adjoint energy"); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Residual of the nu tilde. AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Residual of the adjoint kinetic energy. AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the turb. kinetic energy"); /// DESCRIPTION: Residual of the adjoint dissipation. @@ -395,7 +395,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS CVariable* Node_AdjTurb = nullptr; CPoint* Node_Geo = geometry->nodes; - if (turb_model && !frozen_visc) { + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { Node_AdjTurb = solver[ADJTURB_SOL]->GetNodes(); } @@ -417,16 +417,15 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS if (!frozen_visc) { // Turbulent switch(turb_model){ - case SST: + case TURB_MODEL::SST: SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); break; - case NONE: - break; + default: break; } } @@ -443,16 +442,15 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS if (!frozen_visc) { switch(config->GetKind_Turb_Model()){ - case SST: + case TURB_MODEL::SST: SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1) - Node_AdjTurb->GetSolution_Old(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); break; - case NONE: - break; + default: break; } } diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index f3132a4deb0..d98ab924ec9 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -120,11 +120,11 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. @@ -152,11 +152,11 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature.", HistoryFieldType::RESIDUAL); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Maximum residual of the adjoint nu tilde. AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint dissipation. @@ -180,11 +180,11 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("BGS_ADJ_TEMPERATURE", "bgs[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: BGS residual of the adjoint nu tilde. AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: BGS residual of the adjoint kinetic energy. AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint dissipation. @@ -215,7 +215,7 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - if (turb_model && !frozen_visc) { + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence."); } @@ -250,10 +250,10 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); break; @@ -278,10 +278,10 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); break; @@ -305,10 +305,10 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS } if (!frozen_visc) { switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; @@ -329,7 +329,7 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("LINSOL_ITER", adjflow_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(adjflow_solver->GetResLinSolver())); - if (turb_model && !frozen_visc) { + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { SetHistoryOutputValue("LINSOL_ITER_TURB", adjturb_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL_TURB", log10(adjturb_solver->GetResLinSolver())); } @@ -366,11 +366,11 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (!frozen_visc){ switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Adjoint nu tilde. AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Adjoint kinetic energy. AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint turbulent kinetic energy"); /// DESCRIPTION: Adjoint dissipation. @@ -407,11 +407,11 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ADJ_TEMPERATURE", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint temperature"); if (!frozen_visc){ switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Residual of the nu tilde. AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the adjoint Spalart-Allmaras variable"); break; - case SST: + case TURB_MODEL::SST: /// DESCRIPTION: Residual of the adjoint kinetic energy. AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the adjoint turb. kinetic energy"); /// DESCRIPTION: Residual of the adjoint dissipation. @@ -447,7 +447,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo CVariable* Node_AdjRad = nullptr; CPoint* Node_Geo = geometry->nodes; - if (turb_model && !frozen_visc){ + if ((turb_model != TURB_MODEL::NONE) && !frozen_visc){ Node_AdjTurb = solver[ADJTURB_SOL]->GetNodes(); } if (weakly_coupled_heat){ @@ -479,16 +479,15 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo // Turbulent if (!frozen_visc){ switch(turb_model){ - case SST: + case TURB_MODEL::SST: SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); break; - case NONE: - break; + default: break; } } // Radiation @@ -508,16 +507,15 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo } if (!frozen_visc){ switch(config->GetKind_Turb_Model()){ - case SST: + case TURB_MODEL::SST: SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1) - Node_AdjTurb->GetSolution_Old(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); break; - case NONE: - break; + default: break; } } if (config->AddRadiation()){ diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index ba9072d2653..3faad0e1365 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -118,15 +118,15 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("RMS_ENERGY", "rms[RhoE]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). - AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Root-mean square residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: - /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). - AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). - AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: + /// DESCRIPTION: Root-mean square residual of kinetic energy (TURB_MODEL::SST model). + AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the dissipation (TURB_MODEL::SST model). + AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -145,15 +145,15 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Maximum residual of nu tilde (SA model). - AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (SST model). - AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (SST model). - AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -172,15 +172,15 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("BGS_ENERGY", "bgs[RhoE]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Maximum residual of nu tilde (SA model). - AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (SST model). - AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (SST model). - AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -201,7 +201,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Linear solver iterations AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - if (turb_model) { + if (turb_model != TURB_MODEL::NONE) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence solver."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence solver."); } @@ -302,15 +302,15 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ // Turbulent Residuals switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -358,15 +358,15 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("RES_TKE", "Residual_TKE", "RESIDUAL", "Residual of turbulent kinetic energy"); AddVolumeOutput("RES_DISSIPATION", "Residual_Omega", "RESIDUAL", "Residual of the rate of dissipation"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -383,15 +383,15 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } } @@ -431,7 +431,7 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv CVariable* Node_Turb = nullptr; const auto Node_Geo = geometry->nodes; - if (config->GetKind_Turb_Model() != NONE){ + if (config->GetKind_Turb_Model() != TURB_MODEL::NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } @@ -449,15 +449,15 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv // Turbulent Residuals switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(iPoint, 0)); SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("NU_TILDE", iPoint, Node_Turb->GetSolution(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -502,15 +502,15 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv } switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("RES_TKE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_NU_TILDE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -527,15 +527,15 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } } @@ -597,10 +597,10 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("RMS_NU_TILDE", log10(turb_solver->GetRes_RMS(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; @@ -618,10 +618,10 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("MAX_NU_TILDE", log10(turb_solver->GetRes_Max(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; @@ -641,10 +641,10 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; @@ -664,7 +664,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetResLinSolver())); - if (turb_model) { + if (turb_model != TURB_MODEL::NONE) { SetHistoryOutputValue("LINSOL_ITER_TURB", turb_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL_TURB", log10(turb_solver->GetResLinSolver())); } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 91c91bde4ec..ff7af0395de 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -116,11 +116,11 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ if (config->AddRadiation()) AddHistoryOutput("RMS_RAD_ENERGY", "rms[E_Rad]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the radiative energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). - AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Root-mean square residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). @@ -145,15 +145,15 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Maximum residual of nu tilde (SA model). - AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (SST model). - AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (SST model). - AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -176,15 +176,15 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ if (config->AddRadiation()) AddHistoryOutput("BGS_RAD_ENERGY", "bgs[E_Rad]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the radiative energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: - /// DESCRIPTION: Maximum residual of nu tilde (SA model). - AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); + 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: + /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (SST model). - AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (SST model). - AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: + /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -214,7 +214,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Linear solver iterations AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - if (turb_model) { + if (turb_model != TURB_MODEL::NONE) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence solver."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence solver."); } @@ -262,13 +262,14 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_RMS(3))); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("RMS_NU_TILDE", log10(turb_solver->GetRes_RMS(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; + default: break; } if (config->AddRadiation()) @@ -281,13 +282,14 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_Max(3))); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("MAX_NU_TILDE", log10(turb_solver->GetRes_Max(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; + default: break; } if (multiZone){ @@ -297,13 +299,14 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv if (nDim == 3) SetHistoryOutputValue("BGS_VELOCITY-Z", log10(flow_solver->GetRes_BGS(3))); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; + default: break; } if (config->AddRadiation()) @@ -337,7 +340,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetResLinSolver())); - if (turb_model) { + if (turb_model != TURB_MODEL::NONE) { SetHistoryOutputValue("LINSOL_ITER_TURB", turb_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL_TURB", log10(turb_solver->GetResLinSolver())); } @@ -392,15 +395,15 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart–Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -451,15 +454,15 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("RES_TKE", "Residual_TKE", "RESIDUAL", "Residual of turbulent kinetic energy"); AddVolumeOutput("RES_DISSIPATION", "Residual_Omega", "RESIDUAL", "Residual of the rate of dissipation."); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart–Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -475,15 +478,15 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy."); AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate."); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of Spalart–Allmaras variable."); break; - case NONE: + case TURB_MODEL::NONE: break; } } @@ -528,7 +531,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve CVariable* Node_Rad = nullptr; const auto Node_Geo = geometry->nodes; - if (config->GetKind_Turb_Model() != NONE){ + if (config->GetKind_Turb_Model() != TURB_MODEL::NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } if (weakly_coupled_heat){ @@ -547,15 +550,15 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(iPoint, 0)); SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("NU_TILDE", iPoint, Node_Turb->GetSolution(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -601,15 +604,15 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, nDim+1)); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("RES_TKE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_NU_TILDE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -626,15 +629,15 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 246c777ed8e..121342060b6 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1299,8 +1299,8 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo const bool viscous = config->GetViscous(); const bool dynamic_grid = config->GetDynamic_Grid(); const bool gravity = config->GetGravityForce(); - const auto Kind_Turb_Model = config->GetKind_Turb_Model(); - const bool turbulent = Kind_Turb_Model != NONE; + const TURB_MODEL Kind_Turb_Model = config->GetKind_Turb_Model(); + const bool turbulent = Kind_Turb_Model != TURB_MODEL::NONE; const bool fixed_cl = config->GetFixed_CL_Mode(); const auto Kind_Solver = config->GetKind_Solver(); const auto Ref_NonDim = config->GetRef_NonDim(); @@ -1530,27 +1530,28 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo if (incompressible) file << "Incompressible RANS equations.\n"; file << "Turbulence model: "; switch (Kind_Turb_Model) { - case SA: + case TURB_MODEL::SA: file << "Spalart Allmaras\n"; break; - case SA_NEG: + case TURB_MODEL::SA_NEG: file << "Negative Spalart Allmaras\n"; break; - case SA_E: + case TURB_MODEL::SA_E: file << "Edwards Spalart Allmaras\n"; break; - case SA_COMP: + case TURB_MODEL::SA_COMP: file << "Compressibility Correction Spalart Allmaras\n"; break; - case SA_E_COMP: + case TURB_MODEL::SA_E_COMP: file << "Compressibility Correction Edwards Spalart Allmaras\n"; break; - case SST: + case TURB_MODEL::SST: file << "Menter's SST\n"; break; - case SST_SUST: + case TURB_MODEL::SST_SUST: file << "Menter's SST with sustaining terms\n"; break; + default: break; } break; } diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 405f9c73a57..1a91017b9da 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -132,11 +132,11 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("RMS_ENERGY_VE", "rms[RhoEve]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). @@ -159,11 +159,11 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Maximum residual of nu tilde (SA model). AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Maximum residual of kinetic energy (SST model). AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the dissipation (SST model). @@ -186,11 +186,11 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("BGS_ENERGY", "bgs[RhoE]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the energy.", HistoryFieldType::RESIDUAL); switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: /// DESCRIPTION: Maximum residual of nu tilde (SA model). AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Maximum residual of kinetic energy (SST model). AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the dissipation (SST model). @@ -309,15 +309,15 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ // Turbulent Residuals switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -365,15 +365,15 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ENERGY_VE", "Residual_Energy_ve", "RESIDUAL", "Residual of the energy_ve"); switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("RES_TKE", "Residual_TKE", "RESIDUAL", "Residual of turbulent kinetic energy"); AddVolumeOutput("RES_DISSIPATION", "Residual_Omega", "RESIDUAL", "Residual of the rate of dissipation"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -389,15 +389,15 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: AddVolumeOutput("LIMITER_TKE", "Limiter_TKE", "LIMITER", "Limiter value of turb. kinetic energy"); AddVolumeOutput("LIMITER_DISSIPATION", "Limiter_Omega", "LIMITER", "Limiter value of dissipation rate"); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: AddVolumeOutput("LIMITER_NU_TILDE", "Limiter_Nu_Tilde", "LIMITER", "Limiter value of the Spalart-Allmaras variable"); break; - case NONE: + case TURB_MODEL::NONE: break; } } @@ -430,7 +430,7 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv unsigned short nSpecies = config->GetnSpecies(); const auto Node_Geo = geometry->nodes; - if (config->GetKind_Turb_Model() != NONE){ + if (config->GetKind_Turb_Model() != TURB_MODEL::NONE){ Node_Turb = solver[TURB_SOL]->GetNodes(); } @@ -455,15 +455,15 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv // Turbulent Residuals switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(iPoint, 0)); SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("NU_TILDE", iPoint, Node_Turb->GetSolution(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -509,15 +509,15 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv } switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("RES_TKE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_NU_TILDE", iPoint, solver[TURB_SOL]->LinSysRes(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } @@ -535,15 +535,15 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv if (config->GetKind_SlopeLimit_Turb() != NO_LIMITER) { switch(config->GetKind_Turb_Model()){ - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("LIMITER_TKE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); SetVolumeOutputValue("LIMITER_DISSIPATION", iPoint, Node_Turb->GetLimiter(iPoint, 1)); break; - case SA: case SA_COMP: case SA_E: - case SA_E_COMP: case SA_NEG: + case TURB_MODEL::SA: case TURB_MODEL::SA_COMP: case TURB_MODEL::SA_E: + case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("LIMITER_NU_TILDE", iPoint, Node_Turb->GetLimiter(iPoint, 0)); break; - case NONE: + case TURB_MODEL::NONE: break; } } @@ -594,10 +594,10 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("RMS_NU_TILDE", log10(turb_solver->GetRes_RMS(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; @@ -615,10 +615,10 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("MAX_NU_TILDE", log10(turb_solver->GetRes_Max(0))); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; @@ -638,10 +638,10 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol switch(turb_model){ - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case SST: + case TURB_MODEL::SST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; diff --git a/SU2_CFD/src/output/output_physics.cpp b/SU2_CFD/src/output/output_physics.cpp index 6ebe8a2f9fa..a41451096ae 100644 --- a/SU2_CFD/src/output/output_physics.cpp +++ b/SU2_CFD/src/output/output_physics.cpp @@ -43,7 +43,7 @@ void COutputLegacy::ComputeTurboPerformance(CSolver *solver_container, CGeometry relVel = new su2double[nDim]; su2double muLam, kine, omega, nu; bool turbulent = ((config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS)); - bool menter_sst = (config->GetKind_Turb_Model() == SST); + bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST); unsigned short nBladesRow, nStages; diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index 23bcf5b028c..3734a5ed7ab 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -476,20 +476,22 @@ void COutputLegacy::SetConvHistory_Header(ofstream *ConvHist_file, CConfig *conf char flow_resid[]= ",\"Res_Flow[0]\",\"Res_Flow[1]\",\"Res_Flow[2]\",\"Res_Flow[3]\",\"Res_Flow[4]\""; char adj_flow_resid[]= ",\"Res_AdjFlow[0]\",\"Res_AdjFlow[1]\",\"Res_AdjFlow[2]\",\"Res_AdjFlow[3]\",\"Res_AdjFlow[4]\""; switch (config->GetKind_Turb_Model()) { - case SA:case SA_NEG:case SA_E: case SA_COMP: case SA_E_COMP: + 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: SPRINTF (turb_resid, ",\"Res_Turb[0]\""); break; - case SST:case SST_SUST: + case TURB_MODEL::SST:case TURB_MODEL::SST_SUST: SPRINTF (turb_resid, ",\"Res_Turb[0]\",\"Res_Turb[1]\""); break; + default: break; } switch (config->GetKind_Turb_Model()) { - case SA:case SA_NEG:case SA_E: case SA_COMP: case SA_E_COMP: + 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: SPRINTF (adj_turb_resid, ",\"Res_AdjTurb[0]\""); break; - case SST:case SST_SUST: + case TURB_MODEL::SST:case TURB_MODEL::SST_SUST: SPRINTF (adj_turb_resid, ",\"Res_AdjTurb[0]\",\"Res_AdjTurb[1]\""); break; + default: break; } char fem_resid[]= ",\"Res_FEM[0]\",\"Res_FEM[1]\",\"Res_FEM[2]\""; char heat_resid[]= ",\"Res_Heat\""; @@ -855,8 +857,9 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, if (compressible) nVar_Flow = nDim+2; else nVar_Flow = nDim+2; if (turbulent) { switch (config[val_iZone]->GetKind_Turb_Model()) { - case SA: case SA_NEG: case SA_E: case SA_E_COMP: case SA_COMP: nVar_Turb = 1; break; - case SST: case SST_SUST: nVar_Turb = 2; break; + case TURB_MODEL::SA: case TURB_MODEL::SA_NEG: case TURB_MODEL::SA_E: case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_COMP: nVar_Turb = 1; break; + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: nVar_Turb = 2; break; + default: break; } } if (transition) nVar_Trans = 2; @@ -876,8 +879,9 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, if (compressible) nVar_AdjFlow = nDim+2; else nVar_AdjFlow = nDim+2; if (turbulent) { switch (config[val_iZone]->GetKind_Turb_Model()) { - case SA: case SA_NEG: case SA_E: case SA_E_COMP: case SA_COMP: nVar_AdjTurb = 1; break; - case SST: case SST_SUST: nVar_AdjTurb = 2; break; + case TURB_MODEL::SA: case TURB_MODEL::SA_NEG: case TURB_MODEL::SA_E: case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_COMP: nVar_AdjTurb = 1; break; + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: nVar_AdjTurb = 2; break; + default: break; } } if (weakly_coupled_heat) nVar_AdjHeat = 1; @@ -1770,8 +1774,9 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, else cout << " Res[Rho]";//, cout << " Res[RhoE]"; switch (config[val_iZone]->GetKind_Turb_Model()) { - case SA: case SA_NEG: case SA_E: case SA_E_COMP: case SA_COMP: cout << " Res[nu]"; break; - case SST: case SST_SUST: cout << " Res[kine]" << " Res[omega]"; break; + case TURB_MODEL::SA: case TURB_MODEL::SA_NEG: case TURB_MODEL::SA_E: case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_COMP: cout << " Res[nu]"; break; + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: cout << " Res[kine]" << " Res[omega]"; break; + default: break; } if (weakly_coupled_heat) { @@ -2432,7 +2437,7 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry bool turbulent = config[val_iZone]->GetKind_Solver() == RANS; bool fixed_cl = config[val_iZone]->GetFixed_CL_Mode(); unsigned short Kind_Solver = config[val_iZone]->GetKind_Solver(); - unsigned short Kind_Turb_Model = config[val_iZone]->GetKind_Turb_Model(); + TURB_MODEL Kind_Turb_Model = config[val_iZone]->GetKind_Turb_Model(); unsigned short Ref_NonDim = config[val_iZone]->GetRef_NonDim(); unsigned short FinestMesh = config[val_iZone]->GetFinestMesh(); @@ -2823,13 +2828,14 @@ void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry if (incompressible) Breakdown_file << "Incompressible RANS equations." << "\n"; Breakdown_file << "Turbulence model: "; switch (Kind_Turb_Model) { - case SA: Breakdown_file << "Spalart Allmaras" << "\n"; break; - case SA_NEG: Breakdown_file << "Negative Spalart Allmaras" << "\n"; break; - case SA_E: Breakdown_file << "Edwards Spalart Allmaras" << "\n"; break; - case SA_COMP: Breakdown_file << "Compressibility Correction Spalart Allmaras" << "\n"; break; - case SA_E_COMP: Breakdown_file << "Compressibility Correction Edwards Spalart Allmaras" << "\n"; break; - case SST: Breakdown_file << "Menter's SST" << "\n"; break; - case SST_SUST: Breakdown_file << "Menter's SST with sustaining terms" << "\n"; break; + case TURB_MODEL::SA: Breakdown_file << "Spalart Allmaras" << "\n"; break; + case TURB_MODEL::SA_NEG: Breakdown_file << "Negative Spalart Allmaras" << "\n"; break; + case TURB_MODEL::SA_E: Breakdown_file << "Edwards Spalart Allmaras" << "\n"; break; + case TURB_MODEL::SA_COMP: Breakdown_file << "Compressibility Correction Spalart Allmaras" << "\n"; break; + case TURB_MODEL::SA_E_COMP: Breakdown_file << "Compressibility Correction Edwards Spalart Allmaras" << "\n"; break; + case TURB_MODEL::SST: Breakdown_file << "Menter's TURB_MODEL::SST" << "\n"; break; + case TURB_MODEL::SST_SUST: Breakdown_file << "Menter's TURB_MODEL::SST with sustaining terms" << "\n"; break; + default: break; } break; } @@ -6085,7 +6091,7 @@ void COutputLegacy::WriteTurboPerfConvHistory(CConfig *config){ string inMarker_Tag, outMarker_Tag, inMarkerTag_Mix; unsigned short nZone = config->GetnZone(); bool turbulent = ((config->GetKind_Solver() == RANS) || (config->GetKind_Solver() == DISC_ADJ_RANS)); - bool menter_sst = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); unsigned short nBladesRow, nStages; unsigned short iStage; diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index d8d389025ca..4e7f39deb6b 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -3329,7 +3329,7 @@ void CAdjEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); /*--- Gradient and limiter of Adjoint Variables ---*/ diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 611cb9f4b7d..45127a3f82f 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -772,7 +772,7 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) val_turb_ke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); else val_turb_ke = 0.0; diff --git a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp index d0078319c67..0ff334142ee 100644 --- a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp @@ -42,13 +42,14 @@ CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned sh /*--- Dimension of the problem ---*/ switch (config->GetKind_Turb_Model()) { - case SA : nVar = 1; break; - case SA_NEG : nVar = 1; break; - case SA_E : nVar = 1; break; - case SA_COMP : nVar = 1; break; - case SA_E_COMP : nVar = 1; break; - case SST : nVar = 2; break; - case SST_SUST : nVar = 2; break; + case TURB_MODEL::SA : nVar = 1; break; + case TURB_MODEL::SA_NEG : nVar = 1; break; + case TURB_MODEL::SA_E : nVar = 1; break; + case TURB_MODEL::SA_COMP : nVar = 1; break; + case TURB_MODEL::SA_E_COMP : nVar = 1; break; + case TURB_MODEL::SST : nVar = 2; break; + case TURB_MODEL::SST_SUST : nVar = 2; break; + default: break; } /*--- Initialize nVarGrad for deallocation ---*/ diff --git a/SU2_CFD/src/solvers/CBaselineSolver.cpp b/SU2_CFD/src/solvers/CBaselineSolver.cpp index 01f55c0d803..bdabb9c8dd7 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver.cpp @@ -357,7 +357,7 @@ void CBaselineSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf bool adjoint = ( config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint() ); unsigned short iInst = config->GetiInst(); bool steady_restart = config->GetSteadyRestart(); - unsigned short turb_model = config->GetKind_Turb_Model(); + TURB_MODEL turb_model = config->GetKind_Turb_Model(); su2double *Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) @@ -421,9 +421,9 @@ void CBaselineSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf /*--- First, remove any variables for the turbulence model that appear in the restart file before the grid velocities. ---*/ - if (turb_model == SA || turb_model == SA_NEG) { + if (turb_model == TURB_MODEL::SA || turb_model == TURB_MODEL::SA_NEG) { index++; - } else if (turb_model == SST) { + } else if (turb_model == TURB_MODEL::SST) { index+=2; } diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index 9dccf1caf6c..cf6f657497e 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -613,7 +613,7 @@ void CDiscAdjSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfi auto restart_filename = config->GetObjFunc_Extension(filename); restart_filename = config->GetFilename(restart_filename, "", val_iter); - const bool rans = (config->GetKind_Turb_Model() != NONE); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); /*--- Skip coordinates ---*/ unsigned short skipVars = geometry[MESH_0]->GetnDim(); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 2cd9ba5569f..1e9a6c76e55 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -55,7 +55,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, const auto nZone = geometry->GetnZone(); const bool restart = (config->GetRestart() || config->GetRestart_Flow()); - const bool rans = (config->GetKind_Turb_Model() != NONE); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); const auto direct_diff = config->GetDirectDiff(); const bool dual_time = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); @@ -447,7 +447,7 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet unsigned short iVar, iMarker, jMarker; long nDomain = 0, iDomain, jDomain; //bool ActDisk_Perimeter; - bool rans = (config->GetKind_Turb_Model() != NONE) && (solver_container[TURB_SOL] != nullptr); + bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE) && (solver_container[TURB_SOL] != nullptr); unsigned short nPrimVar_ = nPrimVar; if (rans) nPrimVar_ += 2; // Add two extra variables for the turbulence. @@ -789,8 +789,8 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); bool viscous = config->GetViscous(); bool gravity = config->GetGravityForce(); - bool turbulent = (config->GetKind_Turb_Model() != NONE); - bool tkeNeeded = (turbulent && (config->GetKind_Turb_Model() == SST || config->GetKind_Turb_Model() == SST_SUST)); + bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + bool tkeNeeded = (turbulent && (config->GetKind_Turb_Model() == TURB_MODEL::SST || config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)); bool free_stream_temp = (config->GetKind_FreeStreamOption() == FREESTREAM_OPTION::TEMPERATURE_FS); bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); bool aeroelastic = config->GetAeroelastic_Simulation(); @@ -1995,7 +1995,7 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain const bool body_force = config->GetBody_Force(); const bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR) || (config->GetKind_FluidModel() == IDEAL_GAS); - const bool rans = (config->GetKind_Turb_Model() != NONE); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); /*--- Pick one numerics object per thread. ---*/ CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM + omp_get_thread_num()*MAX_TERMS]; @@ -4283,7 +4283,7 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, bool implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT; bool viscous = config->GetViscous(); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal = new su2double[nDim]; @@ -4493,7 +4493,7 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -4538,7 +4538,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, string Marker_Tag = config->GetMarker_All_TagBound(val_marker); bool viscous = config->GetViscous(); bool gravity = (config->GetGravityForce()); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal, *FlowDirMix, TangVelocity, NormalVelocity; Normal = new su2double[nDim]; @@ -4981,7 +4981,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -5052,7 +5052,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain unsigned short nSpanWiseSections = geometry->GetnSpanWiseSections(config->GetMarker_All_TurbomachineryFlag(val_marker)); bool viscous = config->GetViscous(); bool gravity = (config->GetGravityForce()); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal, *turboNormal, *UnitNormal, *FlowDirMix, FlowDirMixMag, *turboVelocity; Normal = new su2double[nDim]; @@ -5495,7 +5495,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -6392,7 +6392,7 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -6459,7 +6459,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, su2double Gas_Constant = config->GetGas_ConstantND(); INLET_TYPE Kind_Inlet= config->GetKind_Inlet(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -6717,7 +6717,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -6757,7 +6757,7 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, su2double Gas_Constant = config->GetGas_ConstantND(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); bool gravity = (config->GetGravityForce()); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -6891,7 +6891,7 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -6928,7 +6928,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double *Normal = new su2double[nDim]; su2double *Velocity = new su2double[nDim]; @@ -7036,7 +7036,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -7158,7 +7158,7 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -7196,7 +7196,7 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai unsigned short Kind_Engine_Inflow = config->GetKind_Engine_Inflow(); su2double Gas_Constant = config->GetGas_ConstantND(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); bool Engine_HalfModel = config->GetEngine_HalfModel(); @@ -7378,7 +7378,7 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -7412,7 +7412,7 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta su2double Gas_Constant = config->GetGas_ConstantND(); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); su2double DampingFactor = config->GetDamp_Engine_Exhaust(); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); @@ -7629,7 +7629,7 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -7702,7 +7702,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); su2double Gas_Constant = config->GetGas_ConstantND(); - bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); bool ratio = (config->GetActDisk_Jump() == RATIO); su2double SecondaryFlow = config->GetSecondaryFlow_ActDisk(); @@ -8065,7 +8065,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C // // /*--- Turbulent kinetic energy ---*/ // -// if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) +// if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) // visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), // solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); // @@ -8128,7 +8128,7 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Gas_Constant = config->GetGas_ConstantND(); - const bool tkeNeeded = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); /*--- Get the actuator disk center and axis coordinates for the current marker. ---*/ for (iDim = 0; iDim < nDim; iDim++){ @@ -8610,9 +8610,9 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC su2double TotalNu, TotalOmega, TotalKine, TotalMassNu, TotalMassOmega, TotalMassKine, TotalAreaNu, TotalAreaOmega, TotalAreaKine; su2double Nu, Kine, Omega; su2double MachTest, soundSpeed; - bool turbulent = (config->GetKind_Turb_Model() != NONE); - bool spalart_allmaras = (config->GetKind_Turb_Model() == SA); - bool menter_sst = ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)); + bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + bool spalart_allmaras = (config->GetKind_Turb_Model() == TURB_MODEL::SA); + bool menter_sst = ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)); /*-- Variables declaration and allocation ---*/ Velocity = new su2double[nDim]; diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 1e594b30d71..30e29bf23b8 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -794,7 +794,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == FEM_RANS) || (config->GetKind_Solver() == FEM_LES); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST))); bool free_stream_temp = (config->GetKind_FreeStreamOption() == FREESTREAM_OPTION::TEMPERATURE_FS); bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 52644844da0..2c4eca0d5ea 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -245,7 +245,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i bool viscous = config->GetViscous(); bool turbulent = ((config->GetKind_Solver() == INC_RANS) || (config->GetKind_Solver() == DISC_ADJ_INC_RANS)); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST))); bool energy = config->GetEnergy_Equation(); bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); @@ -1318,7 +1318,7 @@ void CIncEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_cont const bool viscous = config->GetViscous(); const bool radiation = config->AddRadiation(); const bool vol_heat = config->GetHeatSource(); - const bool turbulent = (config->GetKind_Turb_Model() != NONE); + const bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); const bool energy = config->GetEnergy_Equation(); const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); @@ -2088,7 +2088,7 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -2333,7 +2333,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -2531,7 +2531,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if ((config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST)) + if ((config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST)) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index d459037e29d..27faa9eb549 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -323,9 +323,9 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c unsigned long iPoint, nonPhysicalPoints = 0; su2double eddy_visc = 0.0, turb_ke = 0.0, DES_LengthScale = 0.0; - unsigned short turb_model = config->GetKind_Turb_Model(); + const TURB_MODEL turb_model = config->GetKind_Turb_Model(); - bool tkeNeeded = ((turb_model == SST) || (turb_model == SST_SUST)); + bool tkeNeeded = ((turb_model == TURB_MODEL::SST) || (turb_model == TURB_MODEL::SST_SUST)); AD::StartNoSharedReading(); @@ -334,7 +334,7 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c /*--- Retrieve the value of the kinetic energy (if needed) ---*/ - if (turb_model != NONE && solver_container[TURB_SOL] != nullptr) { + if (turb_model != TURB_MODEL::NONE && solver_container[TURB_SOL] != nullptr) { eddy_visc = solver_container[TURB_SOL]->GetNodes()->GetmuT(iPoint); if (tkeNeeded) turb_ke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index e15509c8326..4bf564c9d7b 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -777,7 +777,7 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con bool monoatomic = config->GetMonoatomic(); bool axisymm = config->GetAxisymmetric(); bool viscous = config->GetViscous(); - bool rans = (config->GetKind_Turb_Model() != NONE); + bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM]; @@ -1004,7 +1004,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short bool dynamic_grid = config->GetGrid_Movement(); bool gravity = config->GetGravityForce(); bool turbulent = false; - bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == SST)); + bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST)); bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); /*--- Instatiate the fluid model ---*/ diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index e642b6e0306..cacd6df59f7 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -109,8 +109,8 @@ unsigned long CNEMONSSolver::SetPrimitive_Variables(CSolver **solver_container,C * further reduction if function is called in parallel ---*/ unsigned long nonPhysicalPoints = 0; - const unsigned short turb_model = config->GetKind_Turb_Model(); - //const bool tkeNeeded = (turb_model == SST) || (turb_model == SST_SUST); + const TURB_MODEL turb_model = config->GetKind_Turb_Model(); + //const bool tkeNeeded = (turb_model == TURB_MODEL::SST) || (turb_model == TURB_MODEL::SST_SUST); SU2_OMP_FOR_STAT(omp_chunk_size) for (unsigned long iPoint = 0; iPoint < nPoint; iPoint ++) { @@ -119,7 +119,7 @@ unsigned long CNEMONSSolver::SetPrimitive_Variables(CSolver **solver_container,C su2double eddy_visc = 0.0; //su2double turb_ke = 0.0; - if (turb_model != NONE && solver_container[TURB_SOL] != nullptr) { + if (turb_model != TURB_MODEL::NONE && solver_container[TURB_SOL] != nullptr) { eddy_visc = solver_container[TURB_SOL]->GetNodes()->GetmuT(iPoint); //if (tkeNeeded) turb_ke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 5a069877db6..d2a285c2486 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -132,8 +132,8 @@ unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, cons * further reduction if function is called in parallel ---*/ unsigned long nonPhysicalPoints = 0; - const unsigned short turb_model = config->GetKind_Turb_Model(); - const bool tkeNeeded = (turb_model == SST) || (turb_model == SST_SUST); + const TURB_MODEL turb_model = config->GetKind_Turb_Model(); + const bool tkeNeeded = (turb_model == TURB_MODEL::SST) || (turb_model == TURB_MODEL::SST_SUST); AD::StartNoSharedReading(); @@ -144,7 +144,7 @@ unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, cons su2double eddy_visc = 0.0, turb_ke = 0.0; - if (turb_model != NONE && solver_container[TURB_SOL] != nullptr) { + if (turb_model != TURB_MODEL::NONE && solver_container[TURB_SOL] != nullptr) { eddy_visc = solver_container[TURB_SOL]->GetNodes()->GetmuT(iPoint); if (tkeNeeded) turb_ke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index fdca2803df2..e5e9b8bb3fe 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -3527,7 +3527,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry, auto profile_filename = config->GetInlet_FileName(); unsigned short nVar_Turb = 0; - if (config->GetKind_Turb_Model() != NONE) nVar_Turb = solver[MESH_0][TURB_SOL]->GetnVar(); + if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) nVar_Turb = solver[MESH_0][TURB_SOL]->GetnVar(); /*--- names of the columns in the profile ---*/ vector columnNames; @@ -3613,15 +3613,13 @@ void CSolver::LoadInletProfile(CGeometry **geometry, if(nDim==3) columnName << "NORMAL-Z " << setw(24); switch (config->GetKind_Turb_Model()) { - case NO_TURB_MODEL: - /*--- no turbulence model---*/ - break; - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + case TURB_MODEL::NONE: break; + 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: /*--- 1-equation turbulence model: SA ---*/ columnName << "NU_TILDE " << setw(24); columnValue << config->GetNuFactor_FreeStream()*config->GetViscosity_FreeStreamND()/config->GetDensity_FreeStreamND() <<"\t"; break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /*--- 2-equation turbulence model (SST) ---*/ columnName << "TKE " << setw(24) << "DISSIPATION"; columnValue << config->GetTke_FreeStream() << "\t" << config->GetOmega_FreeStream() <<"\t"; diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index 4b1934b0e69..ebe38ccb53c 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -196,7 +196,7 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s CSolver *genericSolver = nullptr; - ENUM_TURB_MODEL kindTurbModel = static_cast(config->GetKind_Turb_Model()); + TURB_MODEL kindTurbModel = static_cast(config->GetKind_Turb_Model()); SolverMetaData metaData; @@ -310,18 +310,18 @@ CSolver* CSolverFactory::CreateSubSolver(SUB_SOLVER_TYPE kindSolver, CSolver **s } -CSolver* CSolverFactory::CreateTurbSolver(ENUM_TURB_MODEL kindTurbModel, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, int adjoint){ +CSolver* CSolverFactory::CreateTurbSolver(TURB_MODEL kindTurbModel, CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, int adjoint){ CSolver *turbSolver = nullptr; if (!adjoint){ switch (kindTurbModel) { - case SA: case SA_NEG: case SA_E: case SA_COMP: case SA_E_COMP: + 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: turbSolver = new CTurbSASolver(geometry, config, iMGLevel, solver[FLOW_SOL]->GetFluidModel()); solver[FLOW_SOL]->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); turbSolver->Postprocessing(geometry, solver, config, iMGLevel); break; - case SST: case SST_SUST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: turbSolver = new CTurbSSTSolver(geometry, config, iMGLevel); solver[FLOW_SOL]->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); turbSolver->Postprocessing(geometry, solver, config, iMGLevel); diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index c785b46861a..0585959c703 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -251,7 +251,7 @@ void CTurbSASolver::Postprocessing(CGeometry *geometry, CSolver **solver_contain const su2double cv1_3 = 7.1*7.1*7.1, cR1 = 0.5, rough_const = 0.03; - const bool neg_spalart_allmaras = (config->GetKind_Turb_Model() == SA_NEG); + const bool neg_spalart_allmaras = (config->GetKind_Turb_Model() == TURB_MODEL::SA_NEG); /*--- Compute eddy viscosity ---*/ @@ -295,7 +295,7 @@ void CTurbSASolver::Viscous_Residual(unsigned long iEdge, CGeometry* geometry, C /*--- Define an object to set solver specific numerics contribution. ---*/ auto SolverSpecificNumerics = [&](unsigned long iPoint, unsigned long jPoint) { /*--- Roughness heights. ---*/ - if (config->GetKind_Turb_Model() == SA) + if (config->GetKind_Turb_Model() == TURB_MODEL::SA) numerics->SetRoughness(geometry->nodes->GetRoughnessHeight(iPoint), geometry->nodes->GetRoughnessHeight(jPoint)); }; @@ -1607,7 +1607,7 @@ void CTurbSASolver::ComputeUnderRelaxationFactor(const CConfig *config) { SA_NEG model is more robust due to allowing for negative nu_tilde, so the under-relaxation is not applied to that variant. */ - if (config->GetKind_Turb_Model() == SA_NEG) return; + if (config->GetKind_Turb_Model() == TURB_MODEL::SA_NEG) return; /* Loop over the solution update given by relaxing the linear system for this nonlinear iteration. */ diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index 09644642ec6..b7988457ac1 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -103,7 +103,7 @@ void CTurbSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNum void CTurbSolver::BC_Fluid_Interface(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config) { - const bool sst = (config->GetKind_Turb_Model() == SST) || (config->GetKind_Turb_Model() == SST_SUST); + const bool sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST) || (config->GetKind_Turb_Model() == TURB_MODEL::SST_SUST); const auto nPrimVar = solver_container[FLOW_SOL]->GetnPrimVar(); su2double *PrimVar_j = new su2double[nPrimVar]; su2double solution_j[MAXNVAR] = {0.0}; diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index 60352af4b0e..87ab8e24d9a 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -41,7 +41,7 @@ CIncNSVariable::CIncNSVariable(su2double pressure, const su2double *velocity, su * Axisymmetric: total-viscosity * y-vel / y-coord * Streamwise Periodic: eddy viscosity (mu_t) ---*/ if (config->GetAxisymmetric() || - (config->GetStreamwise_Periodic_Temperature() && (config->GetKind_Turb_Model() != NONE))) { + (config->GetStreamwise_Periodic_Temperature() && (config->GetKind_Turb_Model() != TURB_MODEL::NONE))) { nAuxVar = 1; AuxVar.resize(nPoint,nAuxVar) = su2double(0.0); Grad_AuxVar.resize(nPoint,nAuxVar,nDim); From 08e58d554b3f60685b121052ff2748e1040402b6 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 12:23:01 +0200 Subject: [PATCH 02/11] Replace tab by space to please the CodeFactor god. --- SU2_CFD/src/output/output_structure_legacy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp index 3734a5ed7ab..74238103e2d 100644 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ b/SU2_CFD/src/output/output_structure_legacy.cpp @@ -1775,7 +1775,7 @@ void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, switch (config[val_iZone]->GetKind_Turb_Model()) { case TURB_MODEL::SA: case TURB_MODEL::SA_NEG: case TURB_MODEL::SA_E: case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_COMP: cout << " Res[nu]"; break; - case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: cout << " Res[kine]" << " Res[omega]"; break; + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: cout << " Res[kine]" << " Res[omega]"; break; default: break; } From 8f3087b77b59296e3435b604afd1fa6dc7d60f37 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 12:30:29 +0200 Subject: [PATCH 03/11] Make all SA+SST solver+variable methods final. --- SU2_CFD/include/solvers/CTurbSASolver.hpp | 42 +++++++++---------- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 36 ++++++++-------- SU2_CFD/include/variables/CTurbSAVariable.hpp | 14 +++---- .../include/variables/CTurbSSTVariable.hpp | 10 ++--- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/SU2_CFD/include/solvers/CTurbSASolver.hpp b/SU2_CFD/include/solvers/CTurbSASolver.hpp index 5b05ad95b95..23a090b09a6 100644 --- a/SU2_CFD/include/solvers/CTurbSASolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSASolver.hpp @@ -108,7 +108,7 @@ class CTurbSASolver final : public CTurbSolver { unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, - bool Output) override; + bool Output) final; /*! * \brief A virtual member. @@ -119,7 +119,7 @@ class CTurbSASolver final : public CTurbSolver { void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Compute the viscous flux for the turbulent equation at a particular edge. @@ -131,7 +131,7 @@ class CTurbSASolver final : public CTurbSolver { * \note Calls a generic implementation after defining a SolverSpecificNumerics object. */ void Viscous_Residual(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container, - CNumerics* numerics, CConfig* config) override; + CNumerics* numerics, CConfig* config) final; /*! * \brief Source term computation. @@ -145,7 +145,7 @@ class CTurbSASolver final : public CTurbSolver { CSolver **solver_container, CNumerics **numerics_container, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Source term computation. @@ -159,7 +159,7 @@ class CTurbSASolver final : public CTurbSolver { CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -175,7 +175,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -191,7 +191,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the Far Field boundary condition. @@ -207,7 +207,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -223,7 +223,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -239,7 +239,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -255,7 +255,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the outlet boundary condition. @@ -271,7 +271,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the engine inflow boundary condition. @@ -287,7 +287,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the engine exhaust boundary condition. @@ -303,7 +303,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose an actuator disk inlet boundary condition. @@ -319,7 +319,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose an actuator disk outlet boundary condition. @@ -335,7 +335,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose an actuator disk inlet boundary condition. @@ -353,7 +353,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *visc_numerics, CConfig *config, unsigned short val_marker, - bool val_inlet_surface) override; + bool val_inlet_surface) final; /*! * \brief Store of a set of provided inlet profile values at a vertex. @@ -363,7 +363,7 @@ class CTurbSASolver final : public CTurbSolver { */ void SetInletAtVertex(const su2double *val_inlet, unsigned short iMarker, - unsigned long iVertex) override; + unsigned long iVertex) final; /*! * \brief Get the set of value imposed at an inlet. @@ -379,7 +379,7 @@ class CTurbSASolver final : public CTurbSolver { unsigned short val_kind_marker, string val_marker, const CGeometry *geometry, - const CConfig *config) const override; + const CConfig *config) const final; /*! * \brief Set a uniform inlet profile @@ -390,12 +390,12 @@ class CTurbSASolver final : public CTurbSolver { * \param[in] config - Definition of the particular problem. * \param[in] iMarker - Surface marker where the coefficient is computed. */ - void SetUniformInlet(const CConfig* config, unsigned short iMarker) override; + void SetUniformInlet(const CConfig* config, unsigned short iMarker) final; /*! * \brief Get the value of nu tilde at the far-field. * \return Value of nu tilde at the far-field. */ - inline su2double GetNuTilde_Inf(void) const override { return Solution_Inf[0]; } + inline su2double GetNuTilde_Inf(void) const final { return Solution_Inf[0]; } }; diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 25b05c2f5cd..cf7c992617e 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -92,7 +92,7 @@ class CTurbSSTSolver final : public CTurbSolver { unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, - bool Output) override; + bool Output) final; /*! * \brief Computes the eddy viscosity. @@ -104,7 +104,7 @@ class CTurbSSTSolver final : public CTurbSolver { void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Compute the viscous flux for the turbulent equation at a particular edge. @@ -116,7 +116,7 @@ class CTurbSSTSolver final : public CTurbSolver { * \note Calls a generic implementation after defining a SolverSpecificNumerics object. */ void Viscous_Residual(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container, - CNumerics* numerics, CConfig* config) override; + CNumerics* numerics, CConfig* config) final; /*! * \brief Source term computation. @@ -130,7 +130,7 @@ class CTurbSSTSolver final : public CTurbSolver { CSolver **solver_container, CNumerics **numerics_container, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Source term computation. @@ -144,7 +144,7 @@ class CTurbSSTSolver final : public CTurbSolver { CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh) override; + unsigned short iMesh) final; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -160,7 +160,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the Navier-Stokes wall boundary condition. * \param[in] geometry - Geometrical definition of the problem. @@ -175,7 +175,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the Far Field boundary condition. @@ -191,7 +191,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -207,7 +207,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -223,7 +223,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the inlet boundary condition. @@ -239,7 +239,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Impose the outlet boundary condition. * \param[in] geometry - Geometrical definition of the problem. @@ -254,13 +254,13 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) override; + unsigned short val_marker) final; /*! * \brief Get the constants for the SST model. * \return A pointer to an array containing a set of constants */ - inline const su2double* GetConstants() const override { return constants; } + inline const su2double* GetConstants() const final { return constants; } /*! * \brief Store of a set of provided inlet profile values at a vertex. @@ -270,7 +270,7 @@ class CTurbSSTSolver final : public CTurbSolver { */ void SetInletAtVertex(const su2double *val_inlet, unsigned short iMarker, - unsigned long iVertex) override; + unsigned long iVertex) final; /*! * \brief Get the set of value imposed at an inlet. @@ -286,7 +286,7 @@ class CTurbSSTSolver final : public CTurbSolver { unsigned short val_kind_marker, string val_marker, const CGeometry *geometry, - const CConfig *config) const override; + const CConfig *config) const final; /*! * \brief Set a uniform inlet profile * @@ -296,19 +296,19 @@ class CTurbSSTSolver final : public CTurbSolver { * \param[in] config - Definition of the particular problem. * \param[in] iMarker - Surface marker where the coefficient is computed. */ - void SetUniformInlet(const CConfig* config, unsigned short iMarker) override; + void SetUniformInlet(const CConfig* config, unsigned short iMarker) final; /*! * \brief Get the value of the turbulent kinetic energy. * \return Value of the turbulent kinetic energy. */ - inline su2double GetTke_Inf(void) const override { return Solution_Inf[0]; } + inline su2double GetTke_Inf(void) const final { return Solution_Inf[0]; } /*! * \brief Get the value of the turbulent frequency. * \return Value of the turbulent frequency. */ - inline su2double GetOmega_Inf(void) const override { return Solution_Inf[1]; } + inline su2double GetOmega_Inf(void) const final { return Solution_Inf[1]; } }; diff --git a/SU2_CFD/include/variables/CTurbSAVariable.hpp b/SU2_CFD/include/variables/CTurbSAVariable.hpp index 0ac1dcd716c..3cae76ddf7d 100644 --- a/SU2_CFD/include/variables/CTurbSAVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSAVariable.hpp @@ -59,47 +59,47 @@ class CTurbSAVariable final : public CTurbVariable { /*! * \brief Destructor of the class. */ - ~CTurbSAVariable() override = default; + ~CTurbSAVariable() final = default; /*! * \brief Get the intermittency of the BC transition model. * \param[in] iPoint - Point index. * \return Value of the intermittency of the BC transition model. */ - inline su2double GetGammaBC(unsigned long iPoint) const override { return gamma_BC(iPoint); } + inline su2double GetGammaBC(unsigned long iPoint) const final { return gamma_BC(iPoint); } /*! * \brief Set the intermittency of the BC transition model. * \param[in] iPoint - Point index. * \param[in] val_gamma - New value of the intermittency. */ - inline void SetGammaBC(unsigned long iPoint, su2double val_gamma) override { gamma_BC(iPoint) = val_gamma; } + inline void SetGammaBC(unsigned long iPoint, su2double val_gamma) final { gamma_BC(iPoint) = val_gamma; } /*! * \brief Get the DES length scale * \param[in] iPoint - Point index. * \return Value of the DES length Scale. */ - inline su2double GetDES_LengthScale(unsigned long iPoint) const override { return DES_LengthScale(iPoint); } + inline su2double GetDES_LengthScale(unsigned long iPoint) const final { return DES_LengthScale(iPoint); } /*! * \brief Set the DES Length Scale. * \param[in] iPoint - Point index. */ - inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override { DES_LengthScale(iPoint) = val_des_lengthscale; } + inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) final { DES_LengthScale(iPoint) = val_des_lengthscale; } /*! * \brief Set the vortex tilting measure for computation of the EDDES length scale * \param[in] iPoint - Point index. */ void SetVortex_Tilting(unsigned long iPoint, CMatrixView, - const su2double* Vorticity, su2double LaminarViscosity) override; + const su2double* Vorticity, su2double LaminarViscosity) final; /*! * \brief Get the vortex tilting measure for computation of the EDDES length scale * \param[in] iPoint - Point index. * \return Value of the DES length Scale */ - inline su2double GetVortex_Tilting(unsigned long iPoint) const override { return Vortex_Tilting(iPoint); } + inline su2double GetVortex_Tilting(unsigned long iPoint) const final { return Vortex_Tilting(iPoint); } }; diff --git a/SU2_CFD/include/variables/CTurbSSTVariable.hpp b/SU2_CFD/include/variables/CTurbSSTVariable.hpp index 519aae585a5..9d735942b38 100644 --- a/SU2_CFD/include/variables/CTurbSSTVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSSTVariable.hpp @@ -62,7 +62,7 @@ class CTurbSSTVariable final : public CTurbVariable { /*! * \brief Destructor of the class. */ - ~CTurbSSTVariable() override = default; + ~CTurbSSTVariable() final = default; /*! * \brief Set the blending function for the blending of k-w and k-eps. @@ -70,20 +70,20 @@ class CTurbSSTVariable final : public CTurbVariable { * \param[in] val_dist - Value of the distance to the wall. * \param[in] val_density - Value of the density. */ - void SetBlendingFunc(unsigned long iPoint, su2double val_viscosity, su2double val_dist, su2double val_density) override; + void SetBlendingFunc(unsigned long iPoint, su2double val_viscosity, su2double val_dist, su2double val_density) final; /*! * \brief Get the first blending function. */ - inline su2double GetF1blending(unsigned long iPoint) const override { return F1(iPoint); } + inline su2double GetF1blending(unsigned long iPoint) const final { return F1(iPoint); } /*! * \brief Get the second blending function. */ - inline su2double GetF2blending(unsigned long iPoint) const override { return F2(iPoint); } + inline su2double GetF2blending(unsigned long iPoint) const final { return F2(iPoint); } /*! * \brief Get the value of the cross diffusion of tke and omega. */ - inline su2double GetCrossDiff(unsigned long iPoint) const override { return CDkw(iPoint); } + inline su2double GetCrossDiff(unsigned long iPoint) const final { return CDkw(iPoint); } }; From 67c1aa9afa20412a9ca40b45b134b771d7cdbc75 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 12:34:13 +0200 Subject: [PATCH 04/11] Make turb_sources/diffusion/convection methods final instead override. --- .../numerics/turbulent/turb_convection.hpp | 8 ++++---- .../numerics/turbulent/turb_diffusion.hpp | 14 +++++++------- .../numerics/turbulent/turb_sources.hpp | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp index 9bb218827c1..3b42bc9c527 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp @@ -41,13 +41,13 @@ class CUpwSca_TurbSA final : public CUpwScalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn() override; + void ExtraADPreaccIn() final; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) override; + void FinishResidualCalc(const CConfig* config) final; public: /*! @@ -71,13 +71,13 @@ class CUpwSca_TurbSST final : public CUpwScalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn() override; + void ExtraADPreaccIn() final; /*! * \brief SST specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) override; + void FinishResidualCalc(const CConfig* config) final; public: /*! diff --git a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp index a3a536f50b9..5dc78cd2069 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp @@ -44,13 +44,13 @@ class CAvgGrad_TurbSA final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) override; + void ExtraADPreaccIn(void) final; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) override; + void FinishResidualCalc(const CConfig* config) final; public: /*! @@ -78,13 +78,13 @@ class CAvgGrad_TurbSA_Neg final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) override; + void ExtraADPreaccIn(void) final; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) override; + void FinishResidualCalc(const CConfig* config) final; public: /*! @@ -117,13 +117,13 @@ class CAvgGrad_TurbSST final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) override; + void ExtraADPreaccIn(void) final; /*! * \brief SST specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) override; + void FinishResidualCalc(const CConfig* config) final; public: /*! @@ -140,7 +140,7 @@ class CAvgGrad_TurbSST final : public CAvgGrad_Scalar { /*! * \brief Sets value of first blending function. */ - void SetF1blending(su2double val_F1_i, su2double val_F1_j) override { + void SetF1blending(su2double val_F1_i, su2double val_F1_j) final { F1_i = val_F1_i; F1_j = val_F1_j; } diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f7777d0e6df..aceee19f941 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -150,7 +150,7 @@ class CSourcePieceWise_TurbSA final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; @@ -185,7 +185,7 @@ class CSourcePieceWise_TurbSA_COMP final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; @@ -219,7 +219,7 @@ class CSourcePieceWise_TurbSA_E final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; /*! @@ -254,7 +254,7 @@ class CSourcePieceWise_TurbSA_E_COMP : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; /*! @@ -285,7 +285,7 @@ class CSourcePieceWise_TurbSA_Neg : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; @@ -382,7 +382,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_F1_i - Value of the first blending function at point i. * \param[in] val_F1_j - Value of the first blending function at point j. */ - inline void SetF1blending(su2double val_F1_i, su2double val_F1_j) override { + inline void SetF1blending(su2double val_F1_i, su2double val_F1_j) final { F1_i = val_F1_i; F1_j = val_F1_j; } @@ -392,7 +392,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_F2_i - Value of the second blending function at point i. * \param[in] val_F2_j - Value of the second blending function at point j. */ - inline void SetF2blending(su2double val_F2_i, su2double val_F2_j) override { + inline void SetF2blending(su2double val_F2_i, su2double val_F2_j) final { F2_i = val_F2_i; F2_j = val_F2_j; } @@ -402,7 +402,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_CDkw_i - Value of the cross diffusion at point i. * \param[in] val_CDkw_j - Value of the cross diffusion at point j. */ - inline void SetCrossDiff(su2double val_CDkw_i, su2double val_CDkw_j) override { + inline void SetCrossDiff(su2double val_CDkw_i, su2double val_CDkw_j) final { CDkw_i = val_CDkw_i; CDkw_j = val_CDkw_j; } @@ -412,6 +412,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) override; + ResidualType<> ComputeResidual(const CConfig* config) final; }; From f810117293714283d718f266a3255b411fc6a132 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 12:42:22 +0200 Subject: [PATCH 05/11] Revert enum class TURB_MODEL addition to comments and strings. --- SU2_CFD/src/output/CFlowCompOutput.cpp | 36 +++++++++++++------------- SU2_CFD/src/output/CFlowIncOutput.cpp | 28 ++++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 3faad0e1365..13e88a5024f 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -119,14 +119,14 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Root-mean square residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: - /// DESCRIPTION: Root-mean square residual of kinetic energy (TURB_MODEL::SST model). - AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Root-mean square residual of the dissipation (TURB_MODEL::SST model). - AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). + AddHistoryOutput("RMS_TKE", "rms[k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). + AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -146,14 +146,14 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). - AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). - AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -173,14 +173,14 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). - AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). - AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; default: break; } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index ff7af0395de..e9af098ee40 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -117,8 +117,8 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Root-mean square residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). + AddHistoryOutput("RMS_NU_TILDE", "rms[nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Root-mean square residual of kinetic energy (SST model). @@ -146,14 +146,14 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("MAX_NU_TILDE", "max[nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). - AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). - AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("MAX_TKE", "max[k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; default: break; } @@ -177,14 +177,14 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ switch(turb_model){ 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: - /// DESCRIPTION: Maximum residual of nu tilde (TURB_MODEL::SA model). - AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (TURB_MODEL::SA model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of nu tilde (SA model). + AddHistoryOutput("BGS_NU_TILDE", "bgs[nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of nu tilde (SA model).", HistoryFieldType::RESIDUAL); break; case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: - /// DESCRIPTION: Maximum residual of kinetic energy (TURB_MODEL::SST model). - AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); - /// DESCRIPTION: Maximum residual of the dissipation (TURB_MODEL::SST model). - AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (TURB_MODEL::SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of kinetic energy (SST model). + AddHistoryOutput("BGS_TKE", "bgs[k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of kinetic energy (SST model).", HistoryFieldType::RESIDUAL); + /// DESCRIPTION: Maximum residual of the dissipation (SST model). + AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; default: break; } From acce0ac252be3445c8548897a16f049ea18581ef Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 13:33:29 +0200 Subject: [PATCH 06/11] Add SST_SUST where missing. And handle NONE instead of default in switches. --- SU2_CFD/src/drivers/CDriver.cpp | 6 ++-- SU2_CFD/src/output/CAdjFlowCompOutput.cpp | 40 +++++++++++------------ SU2_CFD/src/output/CAdjFlowIncOutput.cpp | 40 +++++++++++------------ SU2_CFD/src/output/CFlowCompOutput.cpp | 14 ++++---- SU2_CFD/src/output/CFlowIncOutput.cpp | 14 ++++---- SU2_CFD/src/output/CFlowOutput.cpp | 2 +- SU2_CFD/src/output/CNEMOCompOutput.cpp | 2 +- 7 files changed, 59 insertions(+), 59 deletions(-) diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 3f729be2384..a496ab7a171 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -1315,6 +1315,9 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol if (turbulent || fem_turbulent) switch (config->GetKind_Turb_Model()) { + case TURB_MODEL::NONE: + SU2_MPI::Error("No turbulence model selected.", CURRENT_FUNCTION); + break; case TURB_MODEL::SA: spalart_allmaras = true; break; case TURB_MODEL::SA_NEG: neg_spalart_allmaras = true; break; case TURB_MODEL::SA_E: e_spalart_allmaras = true; break; @@ -1322,9 +1325,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol case TURB_MODEL::SA_E_COMP: e_comp_spalart_allmaras = true; break; case TURB_MODEL::SST: menter_sst = true; break; case TURB_MODEL::SST_SUST: menter_sst = true; break; - default: - SU2_MPI::Error("Specified turbulence model unavailable or none selected", CURRENT_FUNCTION); - break; } /*--- If the Menter SST model is used, store the constants of the model and determine the diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index 9256e2b268e..0067c10e32c 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -118,13 +118,13 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES", " Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } /// END_GROUP @@ -146,13 +146,13 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the adjoint nu tilde. AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint dissipation. AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } /// END_GROUP @@ -175,13 +175,13 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: BGS residual of the adjoint nu tilde. AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: BGS residual of the adjoint kinetic energy. AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint dissipation. AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } @@ -235,11 +235,11 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C 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: SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } SetHistoryOutputValue("MAX_ADJ_DENSITY", log10(adjflow_solver->GetRes_Max(0))); @@ -256,11 +256,11 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C 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: SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } @@ -279,11 +279,11 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C 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: SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } } @@ -335,13 +335,13 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Adjoint nu tilde. AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Adjoint kinetic energy. AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint kinetic energy"); /// DESCRIPTION: Adjoint dissipation. AddVolumeOutput("ADJ_DISSIPATION", "Adjoint_Omega", "SOLUTION", "Adjoint rate of dissipation"); break; - default: break; + case TURB_MODEL::NONE: break; } } /// END_GROUP @@ -364,13 +364,13 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Residual of the nu tilde. AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Residual of the adjoint kinetic energy. AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the turb. kinetic energy"); /// DESCRIPTION: Residual of the adjoint dissipation. AddVolumeOutput("RES_ADJ_DISSIPATION", "Residual_Adjoint_Omega", "RESIDUAL", "Residual of the rate of dissipation"); break; - default: break; + case TURB_MODEL::NONE: break; } } /// END_GROUP @@ -417,7 +417,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS if (!frozen_visc) { // Turbulent switch(turb_model){ - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1)); break; @@ -425,7 +425,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); break; - default: break; + case TURB_MODEL::NONE: break; } } @@ -442,7 +442,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS if (!frozen_visc) { switch(config->GetKind_Turb_Model()){ - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1) - Node_AdjTurb->GetSolution_Old(iPoint, 1)); break; @@ -450,7 +450,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); break; - default: break; + case TURB_MODEL::NONE: break; } } diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index d98ab924ec9..3442dcd4598 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -124,13 +124,13 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the adjoint nu tilde. AddHistoryOutput("RMS_ADJ_NU_TILDE", "rms[A_nu]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Root-mean square residual of the adjoint kinetic energy. AddHistoryOutput("RMS_ADJ_TKE", "rms[A_k]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint dissipation. AddHistoryOutput("RMS_ADJ_DISSIPATION", "rms[A_w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ @@ -156,13 +156,13 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the adjoint nu tilde. AddHistoryOutput("MAX_ADJ_NU_TILDE", "max[A_nu]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Maximum residual of the adjoint kinetic energy. AddHistoryOutput("MAX_ADJ_TKE", "max[A_k]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint dissipation. AddHistoryOutput("MAX_ADJ_DISSIPATION", "max[A_w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } /// END_GROUP @@ -184,13 +184,13 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: BGS residual of the adjoint nu tilde. AddHistoryOutput("BGS_ADJ_NU_TILDE", "bgs[A_nu]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint nu tilde.", HistoryFieldType::RESIDUAL); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: BGS residual of the adjoint kinetic energy. AddHistoryOutput("BGS_ADJ_TKE", "bgs[A_k]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint kinetic energy.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint dissipation. AddHistoryOutput("BGS_ADJ_DISSIPATION", "bgs[A_w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint dissipation.", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ @@ -253,11 +253,11 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS 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: SetHistoryOutputValue("RMS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_RMS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("RMS_ADJ_TKE", log10(adjturb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_RMS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ @@ -281,11 +281,11 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS 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: SetHistoryOutputValue("MAX_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_Max(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("MAX_ADJ_TKE", log10(adjturb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_Max(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } @@ -308,11 +308,11 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS 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: SetHistoryOutputValue("BGS_ADJ_NU_TILDE", log10(adjturb_solver->GetRes_BGS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("BGS_ADJ_TKE", log10(adjturb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_DISSIPATION", log10(adjturb_solver->GetRes_BGS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ @@ -370,13 +370,13 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Adjoint nu tilde. AddVolumeOutput("ADJ_NU_TILDE", "Adjoint_Nu_Tilde", "SOLUTION", "Adjoint Spalart-Allmaras variable"); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Adjoint kinetic energy. AddVolumeOutput("ADJ_TKE", "Adjoint_TKE", "SOLUTION", "Adjoint turbulent kinetic energy"); /// DESCRIPTION: Adjoint dissipation. AddVolumeOutput("ADJ_DISSIPATION", "Adjoint_Omega", "SOLUTION", "Adjoint rate of dissipation"); break; - default: break; + case TURB_MODEL::NONE: break; } } @@ -411,13 +411,13 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Residual of the nu tilde. AddVolumeOutput("RES_ADJ_NU_TILDE", "Residual_Adjoint_Nu_Tilde", "RESIDUAL", "Residual of the adjoint Spalart-Allmaras variable"); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: /// DESCRIPTION: Residual of the adjoint kinetic energy. AddVolumeOutput("RES_ADJ_TKE", "Residual_Adjoint_TKE", "RESIDUAL", "Residual of the adjoint turb. kinetic energy"); /// DESCRIPTION: Residual of the adjoint dissipation. AddVolumeOutput("RES_ADJ_DISSIPATION", "Residual_Adjoint_Omega", "RESIDUAL", "Residual of adjoint rate of dissipation"); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ @@ -479,7 +479,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo // Turbulent if (!frozen_visc){ switch(turb_model){ - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1)); break; @@ -487,7 +487,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0)); break; - default: break; + case TURB_MODEL::NONE: break; } } // Radiation @@ -507,7 +507,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo } if (!frozen_visc){ switch(config->GetKind_Turb_Model()){ - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetVolumeOutputValue("RES_ADJ_TKE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_DISSIPATION", iPoint, Node_AdjTurb->GetSolution(iPoint, 1) - Node_AdjTurb->GetSolution_Old(iPoint, 1)); break; @@ -515,7 +515,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo case TURB_MODEL::SA_E_COMP: case TURB_MODEL::SA_NEG: SetVolumeOutputValue("RES_ADJ_NU_TILDE", iPoint, Node_AdjTurb->GetSolution(iPoint, 0) - Node_AdjTurb->GetSolution_Old(iPoint, 0)); break; - default: break; + case TURB_MODEL::NONE: break; } } if (config->AddRadiation()){ diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 13e88a5024f..6ccf9c70fbb 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -128,7 +128,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -155,7 +155,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -182,7 +182,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -604,7 +604,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } SetHistoryOutputValue("MAX_DENSITY", log10(flow_solver->GetRes_Max(0))); @@ -625,7 +625,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; - default: break; + case TURB_MODEL::NONE: break; } if (multiZone){ @@ -644,11 +644,11 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index e9af098ee40..1063bea7ab4 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -126,7 +126,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -155,7 +155,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -186,7 +186,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -269,7 +269,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } if (config->AddRadiation()) @@ -289,7 +289,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; - default: break; + case TURB_MODEL::NONE: break; } if (multiZone){ @@ -302,11 +302,11 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } if (config->AddRadiation()) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 121342060b6..f48c187cde8 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1530,6 +1530,7 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo if (incompressible) file << "Incompressible RANS equations.\n"; file << "Turbulence model: "; switch (Kind_Turb_Model) { + case TURB_MODEL::NONE: break; case TURB_MODEL::SA: file << "Spalart Allmaras\n"; break; @@ -1551,7 +1552,6 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo case TURB_MODEL::SST_SUST: file << "Menter's SST with sustaining terms\n"; break; - default: break; } break; } diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 1a91017b9da..203e3195e08 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -641,7 +641,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol 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: SetHistoryOutputValue("BGS_NU_TILDE", log10(turb_solver->GetRes_BGS(0))); break; - case TURB_MODEL::SST: + case TURB_MODEL::SST: case TURB_MODEL::SST_SUST: SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; From 8f7ccc5d82dc57252070eab68344996fae698af5 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 13:39:44 +0200 Subject: [PATCH 07/11] One more TURB_MODEL switch --- Common/src/CConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index e98d458f1de..c59c0fe710a 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -5620,6 +5620,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE) cout << "Incompressible RANS equations." << endl; 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; @@ -5627,7 +5628,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case TURB_MODEL::SA_E_COMP: cout << "Compressibility Correction Edwards Spalart Allmaras" << endl; break; case TURB_MODEL::SST: cout << "Menter's SST" << endl; break; case TURB_MODEL::SST_SUST: cout << "Menter's SST with sustaining terms" << endl; break; - default: break; } if (QCR) cout << "Using Quadratic Constitutive Relation, 2000 version (QCR2000)" << endl; if (Kind_Trans_Model == BC) cout << "Using the revised BC transition model (2020)" << endl; From 6c40737f8f5295ca7e16512add5318b347359c78 Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 13:50:23 +0200 Subject: [PATCH 08/11] Forgot the default: break; stuff in NEMOoutput. --- SU2_CFD/src/output/CNEMOCompOutput.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 203e3195e08..15553be3558 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -142,7 +142,7 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the dissipation (SST model). AddHistoryOutput("RMS_DISSIPATION", "rms[w]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -169,7 +169,7 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("MAX_DISSIPATION", "max[w]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -196,7 +196,7 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the dissipation (SST model). AddHistoryOutput("BGS_DISSIPATION", "bgs[w]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of dissipation (SST model).", HistoryFieldType::RESIDUAL); break; - default: break; + case TURB_MODEL::NONE: break; } /// END_GROUP @@ -601,7 +601,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("RMS_TKE", log10(turb_solver->GetRes_RMS(0))); SetHistoryOutputValue("RMS_DISSIPATION", log10(turb_solver->GetRes_RMS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } SetHistoryOutputValue("MAX_DENSITY", log10(NEMO_solver->GetRes_Max(0))); @@ -622,7 +622,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("MAX_TKE", log10(turb_solver->GetRes_Max(0))); SetHistoryOutputValue("MAX_DISSIPATION", log10(turb_solver->GetRes_Max(1))); break; - default: break; + case TURB_MODEL::NONE: break; } if (multiZone){ @@ -645,7 +645,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("BGS_TKE", log10(turb_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_DISSIPATION", log10(turb_solver->GetRes_BGS(1))); break; - default: break; + case TURB_MODEL::NONE: break; } } From 0b63bbec83aae48ae14907fb0225106b2d932f5f Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 13:54:45 +0200 Subject: [PATCH 09/11] Hopefully two last forgotten switches. I wont change the output_structure_legacy though --- SU2_CFD/src/solvers/CAdjTurbSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolverFactory.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp index 0ff334142ee..903d9ad0b8d 100644 --- a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp @@ -42,6 +42,7 @@ CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned sh /*--- Dimension of the problem ---*/ switch (config->GetKind_Turb_Model()) { + case TURB_MODEL::NONE: break; case TURB_MODEL::SA : nVar = 1; break; case TURB_MODEL::SA_NEG : nVar = 1; break; case TURB_MODEL::SA_E : nVar = 1; break; @@ -49,7 +50,6 @@ CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned sh case TURB_MODEL::SA_E_COMP : nVar = 1; break; case TURB_MODEL::SST : nVar = 2; break; case TURB_MODEL::SST_SUST : nVar = 2; break; - default: break; } /*--- Initialize nVarGrad for deallocation ---*/ diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index ebe38ccb53c..6b09b457481 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -327,8 +327,8 @@ CSolver* CSolverFactory::CreateTurbSolver(TURB_MODEL kindTurbModel, CSolver **so turbSolver->Postprocessing(geometry, solver, config, iMGLevel); solver[FLOW_SOL]->Preprocessing(geometry, solver, config, iMGLevel, NO_RK_ITER, RUNTIME_FLOW_SYS, false); break; - default: - SU2_MPI::Error("Unknown turbulence model", CURRENT_FUNCTION); + case TURB_MODEL::NONE: + SU2_MPI::Error("Trying to create TurbSolver container but TURB_MODEL=NONE.", CURRENT_FUNCTION); break; } } else { From 1d50d53afaac2c81dcffaaa8aa59acc0aca76c0d Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Sun, 17 Oct 2021 19:26:55 +0200 Subject: [PATCH 10/11] Revert "Make all SA+SST solver+variable methods final." This reverts commit 8f3087b77b59296e3435b604afd1fa6dc7d60f37. --- SU2_CFD/include/solvers/CTurbSASolver.hpp | 42 +++++++++---------- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 36 ++++++++-------- SU2_CFD/include/variables/CTurbSAVariable.hpp | 14 +++---- .../include/variables/CTurbSSTVariable.hpp | 10 ++--- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/SU2_CFD/include/solvers/CTurbSASolver.hpp b/SU2_CFD/include/solvers/CTurbSASolver.hpp index 23a090b09a6..5b05ad95b95 100644 --- a/SU2_CFD/include/solvers/CTurbSASolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSASolver.hpp @@ -108,7 +108,7 @@ class CTurbSASolver final : public CTurbSolver { unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, - bool Output) final; + bool Output) override; /*! * \brief A virtual member. @@ -119,7 +119,7 @@ class CTurbSASolver final : public CTurbSolver { void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Compute the viscous flux for the turbulent equation at a particular edge. @@ -131,7 +131,7 @@ class CTurbSASolver final : public CTurbSolver { * \note Calls a generic implementation after defining a SolverSpecificNumerics object. */ void Viscous_Residual(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container, - CNumerics* numerics, CConfig* config) final; + CNumerics* numerics, CConfig* config) override; /*! * \brief Source term computation. @@ -145,7 +145,7 @@ class CTurbSASolver final : public CTurbSolver { CSolver **solver_container, CNumerics **numerics_container, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Source term computation. @@ -159,7 +159,7 @@ class CTurbSASolver final : public CTurbSolver { CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -175,7 +175,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -191,7 +191,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the Far Field boundary condition. @@ -207,7 +207,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -223,7 +223,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -239,7 +239,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -255,7 +255,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the outlet boundary condition. @@ -271,7 +271,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the engine inflow boundary condition. @@ -287,7 +287,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the engine exhaust boundary condition. @@ -303,7 +303,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose an actuator disk inlet boundary condition. @@ -319,7 +319,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose an actuator disk outlet boundary condition. @@ -335,7 +335,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose an actuator disk inlet boundary condition. @@ -353,7 +353,7 @@ class CTurbSASolver final : public CTurbSolver { CNumerics *visc_numerics, CConfig *config, unsigned short val_marker, - bool val_inlet_surface) final; + bool val_inlet_surface) override; /*! * \brief Store of a set of provided inlet profile values at a vertex. @@ -363,7 +363,7 @@ class CTurbSASolver final : public CTurbSolver { */ void SetInletAtVertex(const su2double *val_inlet, unsigned short iMarker, - unsigned long iVertex) final; + unsigned long iVertex) override; /*! * \brief Get the set of value imposed at an inlet. @@ -379,7 +379,7 @@ class CTurbSASolver final : public CTurbSolver { unsigned short val_kind_marker, string val_marker, const CGeometry *geometry, - const CConfig *config) const final; + const CConfig *config) const override; /*! * \brief Set a uniform inlet profile @@ -390,12 +390,12 @@ class CTurbSASolver final : public CTurbSolver { * \param[in] config - Definition of the particular problem. * \param[in] iMarker - Surface marker where the coefficient is computed. */ - void SetUniformInlet(const CConfig* config, unsigned short iMarker) final; + void SetUniformInlet(const CConfig* config, unsigned short iMarker) override; /*! * \brief Get the value of nu tilde at the far-field. * \return Value of nu tilde at the far-field. */ - inline su2double GetNuTilde_Inf(void) const final { return Solution_Inf[0]; } + inline su2double GetNuTilde_Inf(void) const override { return Solution_Inf[0]; } }; diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index cf7c992617e..25b05c2f5cd 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -92,7 +92,7 @@ class CTurbSSTSolver final : public CTurbSolver { unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, - bool Output) final; + bool Output) override; /*! * \brief Computes the eddy viscosity. @@ -104,7 +104,7 @@ class CTurbSSTSolver final : public CTurbSolver { void Postprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Compute the viscous flux for the turbulent equation at a particular edge. @@ -116,7 +116,7 @@ class CTurbSSTSolver final : public CTurbSolver { * \note Calls a generic implementation after defining a SolverSpecificNumerics object. */ void Viscous_Residual(unsigned long iEdge, CGeometry* geometry, CSolver** solver_container, - CNumerics* numerics, CConfig* config) final; + CNumerics* numerics, CConfig* config) override; /*! * \brief Source term computation. @@ -130,7 +130,7 @@ class CTurbSSTSolver final : public CTurbSolver { CSolver **solver_container, CNumerics **numerics_container, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Source term computation. @@ -144,7 +144,7 @@ class CTurbSSTSolver final : public CTurbSolver { CSolver **solver_container, CNumerics *numerics, CConfig *config, - unsigned short iMesh) final; + unsigned short iMesh) override; /*! * \brief Impose the Navier-Stokes wall boundary condition. @@ -160,7 +160,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the Navier-Stokes wall boundary condition. * \param[in] geometry - Geometrical definition of the problem. @@ -175,7 +175,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the Far Field boundary condition. @@ -191,7 +191,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -207,7 +207,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -223,7 +223,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the inlet boundary condition. @@ -239,7 +239,7 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Impose the outlet boundary condition. * \param[in] geometry - Geometrical definition of the problem. @@ -254,13 +254,13 @@ class CTurbSSTSolver final : public CTurbSolver { CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, - unsigned short val_marker) final; + unsigned short val_marker) override; /*! * \brief Get the constants for the SST model. * \return A pointer to an array containing a set of constants */ - inline const su2double* GetConstants() const final { return constants; } + inline const su2double* GetConstants() const override { return constants; } /*! * \brief Store of a set of provided inlet profile values at a vertex. @@ -270,7 +270,7 @@ class CTurbSSTSolver final : public CTurbSolver { */ void SetInletAtVertex(const su2double *val_inlet, unsigned short iMarker, - unsigned long iVertex) final; + unsigned long iVertex) override; /*! * \brief Get the set of value imposed at an inlet. @@ -286,7 +286,7 @@ class CTurbSSTSolver final : public CTurbSolver { unsigned short val_kind_marker, string val_marker, const CGeometry *geometry, - const CConfig *config) const final; + const CConfig *config) const override; /*! * \brief Set a uniform inlet profile * @@ -296,19 +296,19 @@ class CTurbSSTSolver final : public CTurbSolver { * \param[in] config - Definition of the particular problem. * \param[in] iMarker - Surface marker where the coefficient is computed. */ - void SetUniformInlet(const CConfig* config, unsigned short iMarker) final; + void SetUniformInlet(const CConfig* config, unsigned short iMarker) override; /*! * \brief Get the value of the turbulent kinetic energy. * \return Value of the turbulent kinetic energy. */ - inline su2double GetTke_Inf(void) const final { return Solution_Inf[0]; } + inline su2double GetTke_Inf(void) const override { return Solution_Inf[0]; } /*! * \brief Get the value of the turbulent frequency. * \return Value of the turbulent frequency. */ - inline su2double GetOmega_Inf(void) const final { return Solution_Inf[1]; } + inline su2double GetOmega_Inf(void) const override { return Solution_Inf[1]; } }; diff --git a/SU2_CFD/include/variables/CTurbSAVariable.hpp b/SU2_CFD/include/variables/CTurbSAVariable.hpp index 3cae76ddf7d..0ac1dcd716c 100644 --- a/SU2_CFD/include/variables/CTurbSAVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSAVariable.hpp @@ -59,47 +59,47 @@ class CTurbSAVariable final : public CTurbVariable { /*! * \brief Destructor of the class. */ - ~CTurbSAVariable() final = default; + ~CTurbSAVariable() override = default; /*! * \brief Get the intermittency of the BC transition model. * \param[in] iPoint - Point index. * \return Value of the intermittency of the BC transition model. */ - inline su2double GetGammaBC(unsigned long iPoint) const final { return gamma_BC(iPoint); } + inline su2double GetGammaBC(unsigned long iPoint) const override { return gamma_BC(iPoint); } /*! * \brief Set the intermittency of the BC transition model. * \param[in] iPoint - Point index. * \param[in] val_gamma - New value of the intermittency. */ - inline void SetGammaBC(unsigned long iPoint, su2double val_gamma) final { gamma_BC(iPoint) = val_gamma; } + inline void SetGammaBC(unsigned long iPoint, su2double val_gamma) override { gamma_BC(iPoint) = val_gamma; } /*! * \brief Get the DES length scale * \param[in] iPoint - Point index. * \return Value of the DES length Scale. */ - inline su2double GetDES_LengthScale(unsigned long iPoint) const final { return DES_LengthScale(iPoint); } + inline su2double GetDES_LengthScale(unsigned long iPoint) const override { return DES_LengthScale(iPoint); } /*! * \brief Set the DES Length Scale. * \param[in] iPoint - Point index. */ - inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) final { DES_LengthScale(iPoint) = val_des_lengthscale; } + inline void SetDES_LengthScale(unsigned long iPoint, su2double val_des_lengthscale) override { DES_LengthScale(iPoint) = val_des_lengthscale; } /*! * \brief Set the vortex tilting measure for computation of the EDDES length scale * \param[in] iPoint - Point index. */ void SetVortex_Tilting(unsigned long iPoint, CMatrixView, - const su2double* Vorticity, su2double LaminarViscosity) final; + const su2double* Vorticity, su2double LaminarViscosity) override; /*! * \brief Get the vortex tilting measure for computation of the EDDES length scale * \param[in] iPoint - Point index. * \return Value of the DES length Scale */ - inline su2double GetVortex_Tilting(unsigned long iPoint) const final { return Vortex_Tilting(iPoint); } + inline su2double GetVortex_Tilting(unsigned long iPoint) const override { return Vortex_Tilting(iPoint); } }; diff --git a/SU2_CFD/include/variables/CTurbSSTVariable.hpp b/SU2_CFD/include/variables/CTurbSSTVariable.hpp index 9d735942b38..519aae585a5 100644 --- a/SU2_CFD/include/variables/CTurbSSTVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSSTVariable.hpp @@ -62,7 +62,7 @@ class CTurbSSTVariable final : public CTurbVariable { /*! * \brief Destructor of the class. */ - ~CTurbSSTVariable() final = default; + ~CTurbSSTVariable() override = default; /*! * \brief Set the blending function for the blending of k-w and k-eps. @@ -70,20 +70,20 @@ class CTurbSSTVariable final : public CTurbVariable { * \param[in] val_dist - Value of the distance to the wall. * \param[in] val_density - Value of the density. */ - void SetBlendingFunc(unsigned long iPoint, su2double val_viscosity, su2double val_dist, su2double val_density) final; + void SetBlendingFunc(unsigned long iPoint, su2double val_viscosity, su2double val_dist, su2double val_density) override; /*! * \brief Get the first blending function. */ - inline su2double GetF1blending(unsigned long iPoint) const final { return F1(iPoint); } + inline su2double GetF1blending(unsigned long iPoint) const override { return F1(iPoint); } /*! * \brief Get the second blending function. */ - inline su2double GetF2blending(unsigned long iPoint) const final { return F2(iPoint); } + inline su2double GetF2blending(unsigned long iPoint) const override { return F2(iPoint); } /*! * \brief Get the value of the cross diffusion of tke and omega. */ - inline su2double GetCrossDiff(unsigned long iPoint) const final { return CDkw(iPoint); } + inline su2double GetCrossDiff(unsigned long iPoint) const override { return CDkw(iPoint); } }; From b423073f419dbc63d0a6b71b46575b5d79c5d27c Mon Sep 17 00:00:00 2001 From: TobiKattmann Date: Tue, 19 Oct 2021 13:44:59 +0200 Subject: [PATCH 11/11] Revert "Make turb_sources/diffusion/convection methods final instead override." This reverts commit 67c1aa9afa20412a9ca40b45b134b771d7cdbc75. --- .../numerics/turbulent/turb_convection.hpp | 8 ++++---- .../numerics/turbulent/turb_diffusion.hpp | 14 +++++++------- .../numerics/turbulent/turb_sources.hpp | 18 +++++++++--------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp index 3b42bc9c527..9bb218827c1 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp @@ -41,13 +41,13 @@ class CUpwSca_TurbSA final : public CUpwScalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn() final; + void ExtraADPreaccIn() override; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) final; + void FinishResidualCalc(const CConfig* config) override; public: /*! @@ -71,13 +71,13 @@ class CUpwSca_TurbSST final : public CUpwScalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn() final; + void ExtraADPreaccIn() override; /*! * \brief SST specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) final; + void FinishResidualCalc(const CConfig* config) override; public: /*! diff --git a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp index 5dc78cd2069..a3a536f50b9 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp @@ -44,13 +44,13 @@ class CAvgGrad_TurbSA final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) final; + void ExtraADPreaccIn(void) override; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) final; + void FinishResidualCalc(const CConfig* config) override; public: /*! @@ -78,13 +78,13 @@ class CAvgGrad_TurbSA_Neg final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) final; + void ExtraADPreaccIn(void) override; /*! * \brief SA specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) final; + void FinishResidualCalc(const CConfig* config) override; public: /*! @@ -117,13 +117,13 @@ class CAvgGrad_TurbSST final : public CAvgGrad_Scalar { /*! * \brief Adds any extra variables to AD */ - void ExtraADPreaccIn(void) final; + void ExtraADPreaccIn(void) override; /*! * \brief SST specific steps in the ComputeResidual method * \param[in] config - Definition of the particular problem. */ - void FinishResidualCalc(const CConfig* config) final; + void FinishResidualCalc(const CConfig* config) override; public: /*! @@ -140,7 +140,7 @@ class CAvgGrad_TurbSST final : public CAvgGrad_Scalar { /*! * \brief Sets value of first blending function. */ - void SetF1blending(su2double val_F1_i, su2double val_F1_j) final { + void SetF1blending(su2double val_F1_i, su2double val_F1_j) override { F1_i = val_F1_i; F1_j = val_F1_j; } diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index aceee19f941..f7777d0e6df 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -150,7 +150,7 @@ class CSourcePieceWise_TurbSA final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; }; @@ -185,7 +185,7 @@ class CSourcePieceWise_TurbSA_COMP final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; }; @@ -219,7 +219,7 @@ class CSourcePieceWise_TurbSA_E final : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; }; /*! @@ -254,7 +254,7 @@ class CSourcePieceWise_TurbSA_E_COMP : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; }; /*! @@ -285,7 +285,7 @@ class CSourcePieceWise_TurbSA_Neg : public CSourceBase_TurbSA { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; }; @@ -382,7 +382,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_F1_i - Value of the first blending function at point i. * \param[in] val_F1_j - Value of the first blending function at point j. */ - inline void SetF1blending(su2double val_F1_i, su2double val_F1_j) final { + inline void SetF1blending(su2double val_F1_i, su2double val_F1_j) override { F1_i = val_F1_i; F1_j = val_F1_j; } @@ -392,7 +392,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_F2_i - Value of the second blending function at point i. * \param[in] val_F2_j - Value of the second blending function at point j. */ - inline void SetF2blending(su2double val_F2_i, su2double val_F2_j) final { + inline void SetF2blending(su2double val_F2_i, su2double val_F2_j) override { F2_i = val_F2_i; F2_j = val_F2_j; } @@ -402,7 +402,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] val_CDkw_i - Value of the cross diffusion at point i. * \param[in] val_CDkw_j - Value of the cross diffusion at point j. */ - inline void SetCrossDiff(su2double val_CDkw_i, su2double val_CDkw_j) final { + inline void SetCrossDiff(su2double val_CDkw_i, su2double val_CDkw_j) override { CDkw_i = val_CDkw_i; CDkw_j = val_CDkw_j; } @@ -412,6 +412,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { * \param[in] config - Definition of the particular problem. * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. */ - ResidualType<> ComputeResidual(const CConfig* config) final; + ResidualType<> ComputeResidual(const CConfig* config) override; };