From 2a66c5418c9b88def3f52bff4d3a54f823a337ad Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 10 Jun 2024 18:44:12 +0200 Subject: [PATCH 01/77] - Added TKE production limiter constant to config - Added production terms to SST --- Common/include/CConfig.hpp | 7 ++++++- Common/include/option_structure.hpp | 10 ++++++++-- Common/src/CConfig.cpp | 5 +++++ SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 4 ++++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 3 +++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 494c95429221..310c0f0f57e5 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -856,7 +856,8 @@ class CConfig { nMu_Temperature_Ref, /*!< \brief Number of species reference temperature for Sutherland model. */ nMu_S, /*!< \brief Number of species reference S for Sutherland model. */ nThermal_Conductivity_Constant,/*!< \brief Number of species constant thermal conductivity. */ - nPrandtl_Lam, /*!< \brief Number of species laminar Prandtl number. */ + nPrandtl_Lam, /*!< \brief Number of species + addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); Prandtl number. */ nPrandtl_Turb, /*!< \brief Number of species turbulent Prandtl number. */ nConstant_Lewis_Number; /*!< \brief Number of species Lewis Number. */ su2double Diffusivity_Constant; /*!< \brief Constant mass diffusivity for scalar transport. */ @@ -868,6 +869,8 @@ class CConfig { array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ su2double TurbIntensityAndViscRatioFreeStream[2]; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */ + su2double TKE_ProductionLimiterConstant; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */ + bool Change_TKE_ProductionLimiterConstant; su2double Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */ ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */ @@ -8813,6 +8816,8 @@ class CConfig { * \brief Set freestream turbonormal for initializing solution. */ const su2double* GetFreeStreamTurboNormal(void) const { return FreeStreamTurboNormal; } + const su2double GetTKE_ProductionLimiterConstant(void) const { return TKE_ProductionLimiterConstant; } + const bool GetChange_TKE_ProductionLimiterConstant(void) const { return Change_TKE_ProductionLimiterConstant; } /*! * \brief Set multizone properties. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 9bbe613c4bc2..e355a8364eb1 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -990,18 +990,20 @@ enum class SST_OPTIONS { V, /*!< \brief Menter k-w SST model with vorticity production terms. */ KL, /*!< \brief Menter k-w SST model with Kato-Launder production terms. */ UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */ + FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) MakePair("V1994m", SST_OPTIONS::V1994m) MakePair("V2003m", SST_OPTIONS::V2003m) /// TODO: For now we do not support "unmodified" versions of SST. - //MakePair("V1994", SST_OPTIONS::V1994) - //MakePair("V2003", SST_OPTIONS::V2003) + MakePair("V1994", SST_OPTIONS::V1994) + MakePair("V2003", SST_OPTIONS::V2003) MakePair("SUSTAINING", SST_OPTIONS::SUST) MakePair("VORTICITY", SST_OPTIONS::V) MakePair("KATO-LAUNDER", SST_OPTIONS::KL) MakePair("UQ", SST_OPTIONS::UQ) + MakePair("FULLPROD", SST_OPTIONS::FULLPROD) }; /*! @@ -1013,6 +1015,7 @@ struct SST_ParsedOptions { bool sust = false; /*!< \brief Bool for SST model with sustaining terms. */ bool uq = false; /*!< \brief Bool for using uncertainty quantification. */ bool modified = false; /*!< \brief Bool for modified (m) SST model. */ + bool fullProd = false; /*!< \brief Bool for full production term. */ }; /*! @@ -1030,6 +1033,8 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne return std::find(SST_Options, sst_options_end, option) != sst_options_end; }; + const bool found_fullProd = IsPresent(SST_OPTIONS::FULLPROD); + const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); const bool found_1994m = IsPresent(SST_OPTIONS::V1994m); @@ -1071,6 +1076,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.sust = sst_sust; SSTParsedOptions.modified = sst_m; SSTParsedOptions.uq = sst_uq; + SSTParsedOptions.fullProd = found_fullProd; return SSTParsedOptions; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 5ff351cfee5c..d42634331d30 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1427,6 +1427,8 @@ void CConfig::SetConfig_Options() { addDoubleOption("INITIAL_BCTHRUST", Initial_BCThrust, 4000.0); /* DESCRIPTION: */ addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); + addBoolOption("CHANGE_TKE_PRODUCTION_LIMITER_CONSTANT", Change_TKE_ProductionLimiterConstant, false); + addDoubleOption("TKE_PRODUCTION_LIMITER_CONSTANT", TKE_ProductionLimiterConstant, 10.0); /* DESCRIPTION: Side-slip angle (degrees, only for compressible flows) */ addDoubleOption("SIDESLIP_ANGLE", AoS, 0.0); /*!\brief AOA \n DESCRIPTION: Angle of attack (degrees, only for compressible flows) \ingroup Config*/ @@ -6175,6 +6177,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { break; } cout << "." << endl; + + if (Change_TKE_ProductionLimiterConstant) cout << "Changinf the value of the TKE production limiter constant to " << TKE_ProductionLimiterConstant << endl; + break; } switch (Kind_Trans_Model) { diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index bdf9d0c6fc47..3fa43f57679f 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -805,6 +805,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics { const su2double prod_limit = prod_lim_const * beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0]; su2double P = Eddy_Viscosity_i * pow(P_Base, 2); + if (!sstParsedOptions.modified) P -= Eddy_Viscosity_i * diverg*diverg * 2.0/3.0; + if (sstParsedOptions.fullProd) P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; + su2double pk = max(0.0, min(P, prod_limit)); const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; @@ -863,6 +866,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Implicit part ---*/ Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume; + if (sstParsedOptions.fullProd) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume; Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume; diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 555f8e771559..3a38e5108b87 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -108,6 +108,9 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh constants[9] = 0.44; //gamma_2 constants[10] = 10.0; // production limiter constant } + + if (config->GetChange_TKE_ProductionLimiterConstant()) constants[10] = config->GetTKE_ProductionLimiterConstant(); + /*--- Initialize lower and upper limits---*/ lowerlimit[0] = 1.0e-10; upperlimit[0] = 1.0e10; From 75825906dc03119d520bc7ab58b0aeef60516b0f Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 17 Jun 2024 16:20:50 +0200 Subject: [PATCH 02/77] - Added Production and Destruction terms of SST to output --- SU2_CFD/include/numerics/CNumerics.hpp | 4 +++ .../numerics/turbulent/turb_sources.hpp | 11 +++++++ SU2_CFD/include/variables/CTurbVariable.hpp | 33 +++++++++++++++++++ SU2_CFD/include/variables/CVariable.hpp | 6 ++++ SU2_CFD/src/output/CFlowOutput.cpp | 8 +++++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 7 ++++ SU2_CFD/src/variables/CTurbVariable.cpp | 7 ++++ 7 files changed, 76 insertions(+) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 450112df8f7f..5f4545f7b137 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -190,6 +190,8 @@ class CNumerics { bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */ + su2double ProdDistr[4]; + public: /*! * \brief Return type used in some "ComputeResidual" overloads to give a @@ -1605,6 +1607,8 @@ class CNumerics { * \return is_bounded_scalar : scalar solver uses bounded scalar convective transport */ inline bool GetBoundedScalar() const { return bounded_scalar;} + + inline su2double GetProdDest(int index) const {return ProdDistr[index];} }; /*! diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 3fa43f57679f..f9aeed8f244c 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -609,6 +609,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Ambient values for SST-SUST. ---*/ const su2double kAmb, omegaAmb; + su2double Pk, Dk, Pw, Dw; + su2double F1_i, F2_i, CDkw_i; su2double Residual[2]; su2double* Jacobian_i[2]; @@ -846,15 +848,24 @@ class CSourcePieceWise_TurbSST final : public CNumerics { } /*--- Add the production terms to the residuals. ---*/ + Pk = pk; + Pw = pw; Residual[0] += pk * Volume; Residual[1] += pw * Volume; /*--- Add the dissipation terms to the residuals.---*/ + Dk = dk; + Dw = dw; Residual[0] -= dk * Volume; Residual[1] -= dw * Volume; + ProdDistr[0] = Pk; + ProdDistr[1] = Dk; + ProdDistr[2] = Pw; + ProdDistr[3] = Dw; + /*--- Cross diffusion ---*/ Residual[1] += (1.0 - F1_i) * CDkw_i * Volume; diff --git a/SU2_CFD/include/variables/CTurbVariable.hpp b/SU2_CFD/include/variables/CTurbVariable.hpp index eb74e40dbf1c..facfac5af656 100644 --- a/SU2_CFD/include/variables/CTurbVariable.hpp +++ b/SU2_CFD/include/variables/CTurbVariable.hpp @@ -43,6 +43,10 @@ class CTurbVariable : public CScalarVariable { static constexpr size_t MAXNVAR = 2; VectorType turb_index; VectorType intermittency; /*!< \brief Value of the intermittency for the trans. model. */ + VectorType Pk; + VectorType Pw; + VectorType Dk; + VectorType Dw; /*! * \brief Constructor of the class. @@ -100,5 +104,34 @@ class CTurbVariable : public CScalarVariable { */ inline void SetIntermittency(unsigned long iPoint, su2double val_intermittency) final { intermittency(iPoint) = val_intermittency; } + /*! + * \brief Set the intermittency of the transition model. + * \param[in] iPoint - Point index. + * \param[in] val_intermittency - New value of the intermittency. + */ + inline void SetProdDestr(unsigned long iPoint, su2double* val_ProdDestr) final { + Pk(iPoint) = val_ProdDestr[0]; + Dk(iPoint) = val_ProdDestr[1]; + Pw(iPoint) = val_ProdDestr[2]; + Dw(iPoint) = val_ProdDestr[3]; + } + + /*! + * \brief Set the intermittency of the transition model. + * \param[in] iPoint - Point index. + * \param[in] val_intermittency - New value of the intermittency. + */ + inline su2double GetProdTKE(unsigned long iPoint) const final { + return Pk(iPoint); + } + inline su2double GetDestrTKE(unsigned long iPoint) const final { + return Dk(iPoint); + } + inline su2double GetProdW(unsigned long iPoint) const final { + return Pw(iPoint); + } + inline su2double GetDestrW(unsigned long iPoint) const final { + return Dw(iPoint); + } }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 358824ae8d7a..2d340ee0c39d 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2340,4 +2340,10 @@ class CVariable { inline virtual const su2double *GetScalarSources(unsigned long iPoint) const { return nullptr; } inline virtual const su2double *GetScalarLookups(unsigned long iPoint) const { return nullptr; } + + inline virtual void SetProdDestr(unsigned long iPoint, su2double* val_ProdDestr) { } + inline virtual su2double GetProdTKE(unsigned long iPoint) const { return 0.0; } + inline virtual su2double GetDestrTKE(unsigned long iPoint) const { return 0.0; } + inline virtual su2double GetProdW(unsigned long iPoint) const { return 0.0; } + inline virtual su2double GetDestrW(unsigned long iPoint) const { return 0.0; } }; diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 5ffee0d23f54..b0150173ac8d 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1252,6 +1252,10 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ case TURB_FAMILY::KW: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); + AddVolumeOutput("PROD_TKE", "Prod_TKE", "SOLUTION", "Production of turbulent kinetic energy"); + AddVolumeOutput("DESTR_TKE", "Destr_TKE", "SOLUTION", "Destruction of turbulent kinetic energy"); + AddVolumeOutput("PROD_W", "Prod_W", "SOLUTION", "Production of rate of dissipation"); + AddVolumeOutput("DESTR_W", "Destr_W", "SOLUTION", "Destruction of rate of dissipation"); break; case TURB_FAMILY::NONE: @@ -1528,6 +1532,10 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con case TURB_FAMILY::KW: SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(iPoint, 0)); SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); + SetVolumeOutputValue("PROD_TKE", iPoint, Node_Turb->GetProdTKE(iPoint)); + SetVolumeOutputValue("DESTR_TKE", iPoint, Node_Turb->GetDestrTKE(iPoint)); + SetVolumeOutputValue("PROD_W", iPoint, Node_Turb->GetProdW(iPoint)); + SetVolumeOutputValue("DESTR_W", iPoint, Node_Turb->GetDestrW(iPoint)); SetVolumeOutputValue("RES_TKE", iPoint, turb_solver->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, turb_solver->LinSysRes(iPoint, 1)); if (limiter) { diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 3a38e5108b87..cda1a6779046 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -371,6 +371,13 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta nodes->SetIntermittency(iPoint, numerics->GetIntermittencyEff()); } + su2double ProdDestr[4]; + ProdDestr[0] = numerics->GetProdDest(0); + ProdDestr[1] = numerics->GetProdDest(1); + ProdDestr[2] = numerics->GetProdDest(2); + ProdDestr[3] = numerics->GetProdDest(3); + nodes->SetProdDestr(iPoint, ProdDestr); + /*--- Subtract residual and the Jacobian ---*/ LinSysRes.SubtractBlock(iPoint, residual); diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 7fcc357c0ee3..773bb78dd1d9 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -35,4 +35,11 @@ CTurbVariable::CTurbVariable(unsigned long npoint, unsigned long ndim, unsigned turb_index.resize(nPoint) = su2double(1.0); intermittency.resize(nPoint) = su2double(1.0); + if (TurbModelFamily(config->GetKind_Turb_Model()) == TURB_FAMILY::KW) { + Pk.resize(nPoint) = su2double(1.0); + Pw.resize(nPoint) = su2double(1.0); + Dk.resize(nPoint) = su2double(1.0); + Dw.resize(nPoint) = su2double(1.0); + } + } From edce8ee37533cf6b86dc0180dadd0c85fb749a5c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 19 Jul 2024 17:12:13 +0200 Subject: [PATCH 03/77] - Added user-defined lower limits of TKE and W - Added user-defined production limiter constant for TKE --- Common/include/CConfig.hpp | 7 +++++++ Common/include/option_structure.hpp | 10 ++++++++++ Common/src/CConfig.cpp | 4 ++++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 310c0f0f57e5..042a866ed56e 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1168,6 +1168,9 @@ class CConfig { nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */ bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */ SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */ + su2double lowerLimitTKE, + lowerLimitDissipation; + su2double prodLimConst; SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */ LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */ su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */ @@ -9852,6 +9855,10 @@ class CConfig { */ SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; } + su2double GetLowerLimitTKE() const { return lowerLimitTKE; } + su2double GetLowerLimitDissipation() const { return lowerLimitDissipation; } + su2double GetProdLimConst() const { return prodLimConst; } + /*! * \brief Get parsed SA option data structure. * \return SA option data structure. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index e355a8364eb1..4b5e0b0c0718 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -991,6 +991,8 @@ enum class SST_OPTIONS { KL, /*!< \brief Menter k-w SST model with Kato-Launder production terms. */ UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */ FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ + LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ + PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1004,6 +1006,8 @@ static const MapType SST_Options_Map = { MakePair("KATO-LAUNDER", SST_OPTIONS::KL) MakePair("UQ", SST_OPTIONS::UQ) MakePair("FULLPROD", SST_OPTIONS::FULLPROD) + MakePair("LLT", SST_OPTIONS::LLT) + MakePair("PRODLIM", SST_OPTIONS::PRODLIM) }; /*! @@ -1016,6 +1020,8 @@ struct SST_ParsedOptions { bool uq = false; /*!< \brief Bool for using uncertainty quantification. */ bool modified = false; /*!< \brief Bool for modified (m) SST model. */ bool fullProd = false; /*!< \brief Bool for full production term. */ + bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ + bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ }; /*! @@ -1034,6 +1040,8 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne }; const bool found_fullProd = IsPresent(SST_OPTIONS::FULLPROD); + const bool found_llt = IsPresent(SST_OPTIONS::LLT); + const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1077,6 +1085,8 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.modified = sst_m; SSTParsedOptions.uq = sst_uq; SSTParsedOptions.fullProd = found_fullProd; + SSTParsedOptions.llt = found_llt; + SSTParsedOptions.prodLim = found_prodLim; return SSTParsedOptions; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d42634331d30..8297075bbe3d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1118,6 +1118,10 @@ void CConfig::SetConfig_Options() { /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); + addDoubleOption("LOWER_LIMIT_TKE", lowerLimitTKE, 1e-20); + addDoubleOption("LOWER_LIMIT_DISSIPATION", lowerLimitDissipation, 1e-6); + addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); + /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE); /*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index cda1a6779046..9a1f6647e665 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -102,11 +102,13 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh constants[8] = constants[4]/constants[6] - constants[2]*0.41*0.41/sqrt(constants[6]); //alfa_1 constants[9] = constants[5]/constants[6] - constants[3]*0.41*0.41/sqrt(constants[6]); //alfa_2 constants[10] = 20.0; // production limiter constant + if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } else { /* SST-V2003 */ constants[8] = 5.0 / 9.0; //gamma_1 constants[9] = 0.44; //gamma_2 constants[10] = 10.0; // production limiter constant + if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } if (config->GetChange_TKE_ProductionLimiterConstant()) constants[10] = config->GetTKE_ProductionLimiterConstant(); @@ -135,6 +137,11 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh Solution_Inf[0] = kine_Inf; Solution_Inf[1] = omega_Inf; + if (sstParsedOptions.llt) { + lowerlimit[0] = kine_Inf * config->GetLowerLimitTKE(); + lowerlimit[1] = omega_Inf * config->GetLowerLimitDissipation(); + } + /*--- Eddy viscosity, initialized without stress limiter at the infinity ---*/ muT_Inf = rhoInf*kine_Inf/omega_Inf; From 41c61cac187d6fae0490b9e6f80a8bdac962d0a7 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 09:50:27 +0200 Subject: [PATCH 04/77] - Changed the Cross-Diffusion term in F1 computations --- SU2_CFD/src/variables/CTurbSSTVariable.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index 3b88c4b8f3f3..eae2c3ef0b2b 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -69,7 +69,10 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco for (unsigned long iDim = 0; iDim < nDim; iDim++) CDkw(iPoint) += Gradient(iPoint,0,iDim)*Gradient(iPoint,1,iDim); CDkw(iPoint) *= 2.0*val_density*sigma_om2/Solution(iPoint,1); - CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const)); + // CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const)); + su2double exponent = 20.0; + if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; + CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -exponent)); /*--- F1 ---*/ From 7b11baa0b2b766458f67c6f23c137154caccc5ff Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 09:56:30 +0200 Subject: [PATCH 05/77] - Removed obsolete changes to TKE prod limiter --- Common/include/CConfig.hpp | 7 ++----- Common/src/CConfig.cpp | 2 -- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 042a866ed56e..e3ce7a2dcabd 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -869,8 +869,7 @@ class CConfig { array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ su2double TurbIntensityAndViscRatioFreeStream[2]; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */ - su2double TKE_ProductionLimiterConstant; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */ - bool Change_TKE_ProductionLimiterConstant; + su2double Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */ ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */ @@ -8819,8 +8818,6 @@ class CConfig { * \brief Set freestream turbonormal for initializing solution. */ const su2double* GetFreeStreamTurboNormal(void) const { return FreeStreamTurboNormal; } - const su2double GetTKE_ProductionLimiterConstant(void) const { return TKE_ProductionLimiterConstant; } - const bool GetChange_TKE_ProductionLimiterConstant(void) const { return Change_TKE_ProductionLimiterConstant; } /*! * \brief Set multizone properties. @@ -9858,7 +9855,7 @@ class CConfig { su2double GetLowerLimitTKE() const { return lowerLimitTKE; } su2double GetLowerLimitDissipation() const { return lowerLimitDissipation; } su2double GetProdLimConst() const { return prodLimConst; } - + /*! * \brief Get parsed SA option data structure. * \return SA option data structure. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 8297075bbe3d..943acf947591 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1431,8 +1431,6 @@ void CConfig::SetConfig_Options() { addDoubleOption("INITIAL_BCTHRUST", Initial_BCThrust, 4000.0); /* DESCRIPTION: */ addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); - addBoolOption("CHANGE_TKE_PRODUCTION_LIMITER_CONSTANT", Change_TKE_ProductionLimiterConstant, false); - addDoubleOption("TKE_PRODUCTION_LIMITER_CONSTANT", TKE_ProductionLimiterConstant, 10.0); /* DESCRIPTION: Side-slip angle (degrees, only for compressible flows) */ addDoubleOption("SIDESLIP_ANGLE", AoS, 0.0); /*!\brief AOA \n DESCRIPTION: Angle of attack (degrees, only for compressible flows) \ingroup Config*/ diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 9a1f6647e665..b0b5cabcd7fe 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -111,7 +111,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } - if (config->GetChange_TKE_ProductionLimiterConstant()) constants[10] = config->GetTKE_ProductionLimiterConstant(); /*--- Initialize lower and upper limits---*/ lowerlimit[0] = 1.0e-10; From 9482f513ae58e7ce0a3bf3a67c6783de75232d98 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 09:57:48 +0200 Subject: [PATCH 06/77] - Modified the config output --- Common/src/CConfig.cpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 943acf947591..50d706928898 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -6180,7 +6180,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { } cout << "." << endl; - if (Change_TKE_ProductionLimiterConstant) cout << "Changinf the value of the TKE production limiter constant to " << TKE_ProductionLimiterConstant << endl; + if (sstParsedOptions.prodLim) cout << "Changing the value of the TKE production limiter constant to " << prodLimConst << endl; break; } diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index b0b5cabcd7fe..7d4b5d4e4304 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -110,7 +110,6 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh constants[10] = 10.0; // production limiter constant if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } - /*--- Initialize lower and upper limits---*/ lowerlimit[0] = 1.0e-10; From 38a02d63306d83338b5d5965e20d2d578aad1a45 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 10:00:20 +0200 Subject: [PATCH 07/77] - Added lower limit changes for SST in config output --- Common/src/CConfig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 50d706928898..96bdf54e6f3c 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -6181,6 +6181,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "." << endl; if (sstParsedOptions.prodLim) cout << "Changing the value of the TKE production limiter constant to " << prodLimConst << endl; + if (sstParsedOptions.llt) cout << "Changing the value of the lower limits of TKE and Omega " << endl; break; } From c3e0d4b8cfd240522db6b284ee9dce31c5daf9b9 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 10:04:09 +0200 Subject: [PATCH 08/77] - Added wall distance output for mesh adaptation --- SU2_CFD/src/output/CFlowOutput.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index b0150173ac8d..01aabe0fee22 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1483,6 +1483,7 @@ void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { AddVolumeOutput("VORTICITY", "Vorticity", "VORTEX_IDENTIFICATION", "Value of the vorticity"); } AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); + AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "MISC", "Wall distance value"); } // Timestep info @@ -1516,6 +1517,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("VORTICITY", iPoint, Node_Flow->GetVorticity(iPoint)[2]); } SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); + SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); From 0f7558b40c6c94781ebf42c23f1b098cef132e5d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 11:12:21 +0200 Subject: [PATCH 09/77] - Added strain magnitude as output --- SU2_CFD/src/output/CFlowOutput.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 01aabe0fee22..cf614835a53e 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1484,6 +1484,7 @@ void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { } AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "MISC", "Wall distance value"); + AddVolumeOutput("STRAIN_MAG", "Strain_Magnitude", "MISC", "Strain magnitude value"); } // Timestep info @@ -1518,6 +1519,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con } SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); + SetVolumeOutputValue("STRAIN_MAG", iPoint, Node_Turb->GetStrainMag(iPoint)); } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); From 3be370d8e44337c4e6b1d64dfb6e4e59558b7553 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 22 Jul 2024 11:56:20 +0200 Subject: [PATCH 10/77] - added production limiter flag to output --- SU2_CFD/include/numerics/CNumerics.hpp | 2 +- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 3 +++ SU2_CFD/include/variables/CTurbVariable.hpp | 5 +++++ SU2_CFD/include/variables/CVariable.hpp | 1 + SU2_CFD/src/output/CFlowOutput.cpp | 2 ++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 3 ++- SU2_CFD/src/variables/CTurbVariable.cpp | 1 + 7 files changed, 15 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 5f4545f7b137..151bcdc2404c 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -190,7 +190,7 @@ class CNumerics { bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */ - su2double ProdDistr[4]; + su2double ProdDistr[5]; public: /*! diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f9aeed8f244c..482f0d4b0897 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -810,6 +810,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if (!sstParsedOptions.modified) P -= Eddy_Viscosity_i * diverg*diverg * 2.0/3.0; if (sstParsedOptions.fullProd) P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; + su2double PLim = 0.0; + if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; @@ -865,6 +867,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[1] = Dk; ProdDistr[2] = Pw; ProdDistr[3] = Dw; + ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ diff --git a/SU2_CFD/include/variables/CTurbVariable.hpp b/SU2_CFD/include/variables/CTurbVariable.hpp index facfac5af656..a95ca9f0991d 100644 --- a/SU2_CFD/include/variables/CTurbVariable.hpp +++ b/SU2_CFD/include/variables/CTurbVariable.hpp @@ -47,6 +47,7 @@ class CTurbVariable : public CScalarVariable { VectorType Pw; VectorType Dk; VectorType Dw; + VectorType PkLim; /*! * \brief Constructor of the class. @@ -114,6 +115,7 @@ class CTurbVariable : public CScalarVariable { Dk(iPoint) = val_ProdDestr[1]; Pw(iPoint) = val_ProdDestr[2]; Dw(iPoint) = val_ProdDestr[3]; + PkLim(iPoint) = val_ProdDestr[4]; } /*! @@ -133,5 +135,8 @@ class CTurbVariable : public CScalarVariable { inline su2double GetDestrW(unsigned long iPoint) const final { return Dw(iPoint); } + inline su2double GetPkLim(unsigned long iPoint) const final { + return PkLim(iPoint); + } }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 2d340ee0c39d..0f8360c18c95 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -2346,4 +2346,5 @@ class CVariable { inline virtual su2double GetDestrTKE(unsigned long iPoint) const { return 0.0; } inline virtual su2double GetProdW(unsigned long iPoint) const { return 0.0; } inline virtual su2double GetDestrW(unsigned long iPoint) const { return 0.0; } + inline virtual su2double GetPkLim(unsigned long iPoint) const { return 0.0; } }; diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index cf614835a53e..f5607c629655 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1254,6 +1254,7 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); AddVolumeOutput("PROD_TKE", "Prod_TKE", "SOLUTION", "Production of turbulent kinetic energy"); AddVolumeOutput("DESTR_TKE", "Destr_TKE", "SOLUTION", "Destruction of turbulent kinetic energy"); + AddVolumeOutput("PROD_TKE_LIM", "Prod_TKE_Lim", "SOLUTION", "Check if production limiter has been used for TKE"); AddVolumeOutput("PROD_W", "Prod_W", "SOLUTION", "Production of rate of dissipation"); AddVolumeOutput("DESTR_W", "Destr_W", "SOLUTION", "Destruction of rate of dissipation"); break; @@ -1538,6 +1539,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); SetVolumeOutputValue("PROD_TKE", iPoint, Node_Turb->GetProdTKE(iPoint)); SetVolumeOutputValue("DESTR_TKE", iPoint, Node_Turb->GetDestrTKE(iPoint)); + SetVolumeOutputValue("PROD_TKE_LIM", iPoint, Node_Turb->GetPkLim(iPoint)); SetVolumeOutputValue("PROD_W", iPoint, Node_Turb->GetProdW(iPoint)); SetVolumeOutputValue("DESTR_W", iPoint, Node_Turb->GetDestrW(iPoint)); SetVolumeOutputValue("RES_TKE", iPoint, turb_solver->LinSysRes(iPoint, 0)); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 7d4b5d4e4304..74c3a628aa28 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -376,11 +376,12 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta nodes->SetIntermittency(iPoint, numerics->GetIntermittencyEff()); } - su2double ProdDestr[4]; + su2double ProdDestr[5]; ProdDestr[0] = numerics->GetProdDest(0); ProdDestr[1] = numerics->GetProdDest(1); ProdDestr[2] = numerics->GetProdDest(2); ProdDestr[3] = numerics->GetProdDest(3); + ProdDestr[4] = numerics->GetProdDest(4); nodes->SetProdDestr(iPoint, ProdDestr); /*--- Subtract residual and the Jacobian ---*/ diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 773bb78dd1d9..00c9d7b2fa08 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -40,6 +40,7 @@ CTurbVariable::CTurbVariable(unsigned long npoint, unsigned long ndim, unsigned Pw.resize(nPoint) = su2double(1.0); Dk.resize(nPoint) = su2double(1.0); Dw.resize(nPoint) = su2double(1.0); + PkLim.resize(nPoint) = su2double(1.0); } } From 125fd6df50ae619eddb7237ad51524e31928b06a Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 24 Jul 2024 15:56:50 +0200 Subject: [PATCH 11/77] - Changed the Cross-Diffusion term in the residual of Omega --- SU2_CFD/src/variables/CTurbSSTVariable.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index eae2c3ef0b2b..de200423ca64 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -72,14 +72,14 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco // CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const)); su2double exponent = 20.0; if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; - CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -exponent)); + const su2double CDkw_Clipped = max(CDkw(iPoint), pow(10.0, -exponent)); /*--- F1 ---*/ arg2A = sqrt(Solution(iPoint,0))/(beta_star*Solution(iPoint,1)*val_dist+EPS*EPS); arg2B = 500.0*val_viscosity / (val_density*val_dist*val_dist*Solution(iPoint,1)+EPS*EPS); arg2 = max(arg2A, arg2B); - arg1 = min(arg2, 4.0*val_density*sigma_om2*Solution(iPoint,0) / (CDkw(iPoint)*val_dist*val_dist+EPS*EPS)); + arg1 = min(arg2, 4.0*val_density*sigma_om2*Solution(iPoint,0) / (CDkw_Clipped*val_dist*val_dist+EPS*EPS)); F1(iPoint) = tanh(pow(arg1, 4.0)); /*--- F2 ---*/ @@ -94,7 +94,7 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco F1(iPoint) = max(F1(iPoint), F3); } - AD::SetPreaccOut(F1(iPoint)); AD::SetPreaccOut(F2(iPoint)); AD::SetPreaccOut(CDkw(iPoint)); + AD::SetPreaccOut(F1(iPoint)); AD::SetPreaccOut(F2(iPoint)); AD::SetPreaccOut(CDkw_Clipped); AD::EndPreacc(); } From 91cc3b8abe9eb5a03543e4c5b1ff75d2642842e3 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 24 Jul 2024 16:29:48 +0200 Subject: [PATCH 12/77] - Added clipping of the cross-diffusion term in SST residual --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 482f0d4b0897..80e85f33a3d4 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -870,8 +870,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ - - Residual[1] += (1.0 - F1_i) * CDkw_i * Volume; + su2double CrossDiffusionTerm = (1.0 - F1_i) * CDkw_i; + if (CrossDiffusionTerm < 0.0) CrossDiffusionTerm = -min(Pw, abs(CrossDiffusionTerm)); + Residual[1] += CrossDiffusionTerm * Volume; /*--- Contribution due to 2D axisymmetric formulation ---*/ From 7b78756f530892af36350430d1852b76a20a2c7d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 24 Jul 2024 17:07:33 +0200 Subject: [PATCH 13/77] - changed cross diffusion term clipping in Omega residual --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 80e85f33a3d4..fe12364ff525 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -870,9 +870,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ - su2double CrossDiffusionTerm = (1.0 - F1_i) * CDkw_i; - if (CrossDiffusionTerm < 0.0) CrossDiffusionTerm = -min(Pw, abs(CrossDiffusionTerm)); - Residual[1] += CrossDiffusionTerm * Volume; + const su2double CrossDiffusionTerm = CDkw_i < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; + Residual[1] += (1.0 - F1_i) * CrossDiffusionTerm * Volume; /*--- Contribution due to 2D axisymmetric formulation ---*/ From 076d471fb0d093873b6e2aa672ab00fe8023cc08 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 24 Jul 2024 17:22:07 +0200 Subject: [PATCH 14/77] - Added CDkw and F1 as output --- SU2_CFD/src/output/CFlowOutput.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index f5607c629655..a55134a5066b 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1257,6 +1257,8 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ AddVolumeOutput("PROD_TKE_LIM", "Prod_TKE_Lim", "SOLUTION", "Check if production limiter has been used for TKE"); AddVolumeOutput("PROD_W", "Prod_W", "SOLUTION", "Production of rate of dissipation"); AddVolumeOutput("DESTR_W", "Destr_W", "SOLUTION", "Destruction of rate of dissipation"); + AddVolumeOutput("CDkw", "CDkw", "SOLUTION", "Cross-Diffusion term"); + AddVolumeOutput("F1", "F1", "SOLUTION", "F1 blending function"); break; case TURB_FAMILY::NONE: @@ -1542,6 +1544,8 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("PROD_TKE_LIM", iPoint, Node_Turb->GetPkLim(iPoint)); SetVolumeOutputValue("PROD_W", iPoint, Node_Turb->GetProdW(iPoint)); SetVolumeOutputValue("DESTR_W", iPoint, Node_Turb->GetDestrW(iPoint)); + SetVolumeOutputValue("CDkw", iPoint, Node_Turb->GetCrossDiff(iPoint)); + SetVolumeOutputValue("F1", iPoint, Node_Turb->GetF1blending(iPoint)); SetVolumeOutputValue("RES_TKE", iPoint, turb_solver->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, turb_solver->LinSysRes(iPoint, 1)); if (limiter) { From 2e73f775073f1c66a88d28956818fe90d1b4871b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 25 Jul 2024 15:25:29 +0200 Subject: [PATCH 15/77] - Fixed Supersonic inlet BC inclusion of TKE --- SU2_CFD/src/solvers/CEulerSolver.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 356c759564ce..6ab73156fd92 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -7341,6 +7341,8 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); /*--- Supersonic inlet flow: there are no outgoing characteristics, so all flow variables can be imposed at the inlet. @@ -7361,14 +7363,15 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con /*--- Compute the energy from the specified state ---*/ const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); - su2double Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); - + const su2double Energy_woTKE = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; + su2double Energy = Energy_woTKE; + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + if (tkeNeeded) Energy = Energy_woTKE + turbNodes->GetSolution(iPoint,0); if (!geometry->nodes->GetDomain(iPoint)) continue; From c662daf3d82af32fa19f9a610ee5d7866fbe0323 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 25 Jul 2024 15:41:20 +0200 Subject: [PATCH 16/77] - Corrected Riemann BC for TKE --- SU2_CFD/src/solvers/CEulerSolver.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 6ab73156fd92..b0944bbb0367 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5011,6 +5011,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT), gravity = config->GetGravityForce(), tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); su2double **P_Tensor = new su2double*[nVar], **invP_Tensor = new su2double*[nVar]; @@ -5110,7 +5112,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); + // if (tkeNeeded) Energy_e += GetTke_Inf(); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case STATIC_SUPERSONIC_INFLOW_PT: @@ -7365,7 +7368,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); const su2double Energy_woTKE = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; su2double Energy = Energy_woTKE; - + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) From 41e1c16ff9029c4b2244c3f303eb830f77c7a1ed Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 25 Jul 2024 19:41:02 +0200 Subject: [PATCH 17/77] - Fixed more BCs - Updated boundary conditions as in TMR page --- Common/include/CConfig.hpp | 2 ++ Common/include/option_structure.hpp | 5 +++++ Common/src/CConfig.cpp | 1 + SU2_CFD/src/solvers/CEulerSolver.cpp | 9 ++++++++- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 16 ++++++++++++++-- 5 files changed, 30 insertions(+), 3 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index e3ce7a2dcabd..aecc19402074 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1170,6 +1170,7 @@ class CConfig { su2double lowerLimitTKE, lowerLimitDissipation; su2double prodLimConst; + su2double LDomain; SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */ LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */ su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */ @@ -9855,6 +9856,7 @@ class CConfig { su2double GetLowerLimitTKE() const { return lowerLimitTKE; } su2double GetLowerLimitDissipation() const { return lowerLimitDissipation; } su2double GetProdLimConst() const { return prodLimConst; } + su2double GetLDomain() const { return LDomain; } /*! * \brief Get parsed SA option data structure. diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 4b5e0b0c0718..bec6739be306 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -993,6 +993,7 @@ enum class SST_OPTIONS { FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ + NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1008,6 +1009,7 @@ static const MapType SST_Options_Map = { MakePair("FULLPROD", SST_OPTIONS::FULLPROD) MakePair("LLT", SST_OPTIONS::LLT) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) + MakePair("NEWBC", SST_OPTIONS::NEWBC) }; /*! @@ -1022,6 +1024,7 @@ struct SST_ParsedOptions { bool fullProd = false; /*!< \brief Bool for full production term. */ bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ + bool newBC = false; /*!< \brief Bool for new boundary conditions. */ }; /*! @@ -1042,6 +1045,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool found_fullProd = IsPresent(SST_OPTIONS::FULLPROD); const bool found_llt = IsPresent(SST_OPTIONS::LLT); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); + const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1087,6 +1091,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.fullProd = found_fullProd; SSTParsedOptions.llt = found_llt; SSTParsedOptions.prodLim = found_prodLim; + SSTParsedOptions.newBC = found_newBC; return SSTParsedOptions; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 96bdf54e6f3c..0c27bc9a49d8 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1121,6 +1121,7 @@ void CConfig::SetConfig_Options() { addDoubleOption("LOWER_LIMIT_TKE", lowerLimitTKE, 1e-20); addDoubleOption("LOWER_LIMIT_DISSIPATION", lowerLimitDissipation, 1e-6); addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); + addDoubleOption("L_DOMAIN", LDomain, 1.0); /*!\brief KIND_TRANS_MODEL \n DESCRIPTION: Specify transition model OPTIONS: see \link Trans_Model_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_TRANS_MODEL", Kind_Trans_Model, Trans_Model_Map, TURB_TRANS_MODEL::NONE); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index b0944bbb0367..ff0227e61b5c 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -4768,6 +4768,8 @@ 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() == TURB_MODEL::SST; + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); auto *Normal = new su2double[nDim]; @@ -4917,7 +4919,8 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, } Pressure = Density*SoundSpeed*SoundSpeed/Gamma; Energy = Pressure/(Gamma_Minus_One*Density) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + // if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Store new primitive state for computing the flux. ---*/ @@ -7179,6 +7182,9 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, bool gravity = (config->GetGravityForce()); bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); + auto *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -7261,6 +7267,7 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, } Energy = P_Exit/(Density*Gamma_Minus_One) + 0.5*Velocity2; if (tkeNeeded) Energy += GetTke_Inf(); + // if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Conservative variables, using the derived quantities ---*/ V_outlet[0] = Pressure / ( Gas_Constant * Density); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 74c3a628aa28..3fb642f1dfcb 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -132,6 +132,11 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh su2double kine_Inf = 3.0/2.0*(VelMag2*Intensity*Intensity); su2double omega_Inf = rhoInf*kine_Inf/(muLamInf*viscRatio); + if (sstParsedOptions.newBC) { + su2double omega_Inf = 10 * sqrt(VelMag2) / config->GetLDomain(); + su2double kine_Inf = omega_Inf*(muLamInf*viscRatio)/rhoInf; + } + Solution_Inf[0] = kine_Inf; Solution_Inf[1] = omega_Inf; @@ -632,8 +637,15 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C const su2double viscRatio = Turb_Properties[1]; const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); - Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); - Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); + if (sstParsedOptions.newBC) { + su2double LDomain = 0.53; + Inlet_Vars[1] = 10 * sqrt(VelMag2) / LDomain; + Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; + } else { + Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); + Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); + } + } /*--- Set the turbulent variable states. Use free-stream SST From e9dfc27eef51714f6c0e73babf7d4b525e57a4cc Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 26 Jul 2024 12:48:18 +0200 Subject: [PATCH 18/77] - Fixed bug with Cross diffusion in W residual - Given option for cross diffusion limiting in W residual --- Common/include/CConfig.hpp | 3 +-- Common/include/option_structure.hpp | 5 +++++ SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 10 +++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index aecc19402074..8be15998e16f 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -856,8 +856,7 @@ class CConfig { nMu_Temperature_Ref, /*!< \brief Number of species reference temperature for Sutherland model. */ nMu_S, /*!< \brief Number of species reference S for Sutherland model. */ nThermal_Conductivity_Constant,/*!< \brief Number of species constant thermal conductivity. */ - nPrandtl_Lam, /*!< \brief Number of species - addDoubleOption("FREESTREAM_TURB2LAMVISCRATIO", TurbIntensityAndViscRatioFreeStream[1], 10.0); Prandtl number. */ + nPrandtl_Lam, /*!< \brief Prandtl number. */ nPrandtl_Turb, /*!< \brief Number of species turbulent Prandtl number. */ nConstant_Lewis_Number; /*!< \brief Number of species Lewis Number. */ su2double Diffusivity_Constant; /*!< \brief Constant mass diffusivity for scalar transport. */ diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bec6739be306..3ba4fcf36213 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -994,6 +994,7 @@ enum class SST_OPTIONS { LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ + LCD, /*!< \brief Menter k-w SST model with lower limit on the cross-diffusion term. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1010,6 +1011,7 @@ static const MapType SST_Options_Map = { MakePair("LLT", SST_OPTIONS::LLT) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) + MakePair("LCD", SST_OPTIONS::LCD) }; /*! @@ -1025,6 +1027,7 @@ struct SST_ParsedOptions { bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ bool newBC = false; /*!< \brief Bool for new boundary conditions. */ + bool lcd = true; /*!< \brief Bool lower limit on the cross-diffusion term. */ }; /*! @@ -1046,6 +1049,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool found_llt = IsPresent(SST_OPTIONS::LLT); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); + const bool found_lcd = IsPresent(SST_OPTIONS::LCD); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1092,6 +1096,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.llt = found_llt; SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; + SSTParsedOptions.lcd = found_lcd; return SSTParsedOptions; } diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index fe12364ff525..f9037b80fe00 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -870,7 +870,15 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ - const su2double CrossDiffusionTerm = CDkw_i < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; + su2double CrossDiffusionTerm = CDkw_i; + if (sstParsedOptions.lcd) { + su2double exponent = 20.0; + if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; + CrossDiffusionTerm = max(CrossDiffusionTerm, pow(10.0, -exponent)); + } else { + CrossDiffusionTerm = CrossDiffusionTerm < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; + } + Residual[1] += (1.0 - F1_i) * CrossDiffusionTerm * Volume; /*--- Contribution due to 2D axisymmetric formulation ---*/ From 9a6fc06707e2bcf0b7d4b15313d40fa9cd4870f7 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 26 Jul 2024 14:48:44 +0200 Subject: [PATCH 19/77] - changed default for cross diffusion --- Common/include/option_structure.hpp | 10 +++++----- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 3ba4fcf36213..2104fe078089 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -994,7 +994,7 @@ enum class SST_OPTIONS { LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ - LCD, /*!< \brief Menter k-w SST model with lower limit on the cross-diffusion term. */ + NCD, /*!< \brief Menter k-w SST model with lower limit on the cross-diffusion term. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1011,7 +1011,7 @@ static const MapType SST_Options_Map = { MakePair("LLT", SST_OPTIONS::LLT) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) - MakePair("LCD", SST_OPTIONS::LCD) + MakePair("NCD", SST_OPTIONS::NCD) }; /*! @@ -1027,7 +1027,7 @@ struct SST_ParsedOptions { bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ bool newBC = false; /*!< \brief Bool for new boundary conditions. */ - bool lcd = true; /*!< \brief Bool lower limit on the cross-diffusion term. */ + bool ncd = false; /*!< \brief Bool lower limit on the cross-diffusion term. */ }; /*! @@ -1049,7 +1049,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool found_llt = IsPresent(SST_OPTIONS::LLT); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); - const bool found_lcd = IsPresent(SST_OPTIONS::LCD); + const bool found_ncd = IsPresent(SST_OPTIONS::NCD); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1096,7 +1096,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.llt = found_llt; SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; - SSTParsedOptions.lcd = found_lcd; + SSTParsedOptions.ncd = found_ncd; return SSTParsedOptions; } diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f9037b80fe00..8d17dca60c16 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -871,12 +871,12 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Cross diffusion ---*/ su2double CrossDiffusionTerm = CDkw_i; - if (sstParsedOptions.lcd) { + if (sstParsedOptions.ncd) { + CrossDiffusionTerm = CrossDiffusionTerm < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; + } else { su2double exponent = 20.0; if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; CrossDiffusionTerm = max(CrossDiffusionTerm, pow(10.0, -exponent)); - } else { - CrossDiffusionTerm = CrossDiffusionTerm < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; } Residual[1] += (1.0 - F1_i) * CrossDiffusionTerm * Volume; From 251ae271f51a4c9e4f5780f0838542174bb0bd1c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 12 Aug 2024 18:38:46 +0200 Subject: [PATCH 20/77] - Restored old computation of Cross-Diffusion terms in the source residuals of SST --- Common/include/option_structure.hpp | 5 ----- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 11 +---------- SU2_CFD/src/variables/CTurbSSTVariable.cpp | 6 +++--- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 2104fe078089..bec6739be306 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -994,7 +994,6 @@ enum class SST_OPTIONS { LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ - NCD, /*!< \brief Menter k-w SST model with lower limit on the cross-diffusion term. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1011,7 +1010,6 @@ static const MapType SST_Options_Map = { MakePair("LLT", SST_OPTIONS::LLT) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) - MakePair("NCD", SST_OPTIONS::NCD) }; /*! @@ -1027,7 +1025,6 @@ struct SST_ParsedOptions { bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ bool newBC = false; /*!< \brief Bool for new boundary conditions. */ - bool ncd = false; /*!< \brief Bool lower limit on the cross-diffusion term. */ }; /*! @@ -1049,7 +1046,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool found_llt = IsPresent(SST_OPTIONS::LLT); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); - const bool found_ncd = IsPresent(SST_OPTIONS::NCD); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1096,7 +1092,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.llt = found_llt; SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; - SSTParsedOptions.ncd = found_ncd; return SSTParsedOptions; } diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 8d17dca60c16..9a028463a068 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -870,16 +870,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ - su2double CrossDiffusionTerm = CDkw_i; - if (sstParsedOptions.ncd) { - CrossDiffusionTerm = CrossDiffusionTerm < 0.0 ? -min(Pw, abs(CrossDiffusionTerm)) : CrossDiffusionTerm; - } else { - su2double exponent = 20.0; - if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; - CrossDiffusionTerm = max(CrossDiffusionTerm, pow(10.0, -exponent)); - } - - Residual[1] += (1.0 - F1_i) * CrossDiffusionTerm * Volume; + Residual[1] += (1.0 - F1_i) * CDkw_i * Volume; /*--- Contribution due to 2D axisymmetric formulation ---*/ diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index de200423ca64..8fa03688303e 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -72,14 +72,14 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco // CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const)); su2double exponent = 20.0; if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; - const su2double CDkw_Clipped = max(CDkw(iPoint), pow(10.0, -exponent)); + CDkw(iPoint)= max(CDkw(iPoint), pow(10.0, -exponent)); /*--- F1 ---*/ arg2A = sqrt(Solution(iPoint,0))/(beta_star*Solution(iPoint,1)*val_dist+EPS*EPS); arg2B = 500.0*val_viscosity / (val_density*val_dist*val_dist*Solution(iPoint,1)+EPS*EPS); arg2 = max(arg2A, arg2B); - arg1 = min(arg2, 4.0*val_density*sigma_om2*Solution(iPoint,0) / (CDkw_Clipped*val_dist*val_dist+EPS*EPS)); + arg1 = min(arg2, 4.0*val_density*sigma_om2*Solution(iPoint,0) / (CDkw(iPoint)*val_dist*val_dist+EPS*EPS)); F1(iPoint) = tanh(pow(arg1, 4.0)); /*--- F2 ---*/ @@ -94,7 +94,7 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco F1(iPoint) = max(F1(iPoint), F3); } - AD::SetPreaccOut(F1(iPoint)); AD::SetPreaccOut(F2(iPoint)); AD::SetPreaccOut(CDkw_Clipped); + AD::SetPreaccOut(F1(iPoint)); AD::SetPreaccOut(F2(iPoint)); AD::SetPreaccOut(CDkw(iPoint)); AD::EndPreacc(); } From 9c7c950a0505c5f592eb038a500ee36c11a100af Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 30 Aug 2024 17:13:40 +0200 Subject: [PATCH 21/77] Added BCs for SST-SUST --- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 3fb642f1dfcb..5ba522b22faa 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -133,8 +133,12 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh su2double omega_Inf = rhoInf*kine_Inf/(muLamInf*viscRatio); if (sstParsedOptions.newBC) { - su2double omega_Inf = 10 * sqrt(VelMag2) / config->GetLDomain(); - su2double kine_Inf = omega_Inf*(muLamInf*viscRatio)/rhoInf; + omega_Inf = 10 * sqrt(VelMag2) / config->GetLDomain(); + kine_Inf = omega_Inf*(muLamInf*viscRatio)/rhoInf; + } else if (sstParsedOptions.sust) { + omega_Inf = 5*sqrt(VelMag2)/config->GetLength_Reynolds(); + /*--- not good ---*/ + kine_Inf = pow(10.0, -6) * VelMag2; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ } Solution_Inf[0] = kine_Inf; From 9d82d5198b3c7682baa9d892d9868acd501740f8 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 30 Aug 2024 17:38:34 +0200 Subject: [PATCH 22/77] - Removed duplicate SST options --- Common/include/option_structure.hpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index bf6c0403c269..b8be96692b19 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -995,7 +995,6 @@ enum class SST_OPTIONS { COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ - LLT, /*!< \brief Menter k-w SST model with Lower Limits Treatments. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ }; @@ -1014,7 +1013,6 @@ static const MapType SST_Options_Map = { MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) MakePair("FULLPROD", SST_OPTIONS::FULLPROD) - MakePair("LLT", SST_OPTIONS::LLT) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) }; @@ -1032,7 +1030,6 @@ struct SST_ParsedOptions { bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ bool fullProd = false; /*!< \brief Bool for full production term. */ - bool llt = false; /*!< \brief Bool for Lower Limits Treatment. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ bool newBC = false; /*!< \brief Bool for new boundary conditions. */ }; @@ -1053,7 +1050,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne }; const bool found_fullProd = IsPresent(SST_OPTIONS::FULLPROD); - const bool found_llt = IsPresent(SST_OPTIONS::LLT); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); @@ -1115,7 +1111,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.dll = sst_dll; SSTParsedOptions.fullProd = found_fullProd; - SSTParsedOptions.llt = found_llt; SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; return SSTParsedOptions; From c10b0066d29040b704c85d81fa547bd85be27e74 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 30 Aug 2024 17:51:46 +0200 Subject: [PATCH 23/77] - Removed not used config variables --- Common/include/CConfig.hpp | 4 ---- Common/src/CConfig.cpp | 3 --- 2 files changed, 7 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 06d7882512ab..b61b634b1696 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1171,8 +1171,6 @@ class CConfig { nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */ bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */ SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */ - su2double lowerLimitTKE, - lowerLimitDissipation; su2double prodLimConst; su2double LDomain; SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */ @@ -9875,8 +9873,6 @@ class CConfig { */ SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; } - su2double GetLowerLimitTKE() const { return lowerLimitTKE; } - su2double GetLowerLimitDissipation() const { return lowerLimitDissipation; } su2double GetProdLimConst() const { return prodLimConst; } su2double GetLDomain() const { return LDomain; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index d14a8d758f83..49d9301ece34 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1118,8 +1118,6 @@ void CConfig::SetConfig_Options() { /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); - addDoubleOption("LOWER_LIMIT_TKE", lowerLimitTKE, 1e-20); - addDoubleOption("LOWER_LIMIT_DISSIPATION", lowerLimitDissipation, 1e-6); addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); addDoubleOption("L_DOMAIN", LDomain, 1.0); @@ -6230,7 +6228,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "." << endl; if (sstParsedOptions.prodLim) cout << "Changing the value of the TKE production limiter constant to " << prodLimConst << endl; - if (sstParsedOptions.llt) cout << "Changing the value of the lower limits of TKE and Omega " << endl; break; } From be98cdd5f5c14da59c9f126f4b1393cd396d039e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 30 Aug 2024 18:06:26 +0200 Subject: [PATCH 24/77] - fixed merge error --- SU2_CFD/src/solvers/CEulerSolver.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index da39dda790db..b1791925cf53 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -7357,6 +7357,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con /*--- Supersonic inlet flow: there are no outgoing characteristics, so all flow variables can be imposed at the inlet. ---*/ + /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -7378,19 +7379,12 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con /*--- Compute the energy from the specified state. ---*/ - const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); - const su2double Energy_woTKE = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; - su2double Energy = Energy_woTKE; - - /*--- Loop over all the vertices on this boundary marker ---*/ + const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); + const su2double Energy_woTKE = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; + su2double Energy = Energy_woTKE; - SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { - const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); if (tkeNeeded) Energy = Energy_woTKE + turbNodes->GetSolution(iPoint,0); - if (!geometry->nodes->GetDomain(iPoint)) continue; - /*--- Allocate the value at the inlet ---*/ auto* V_inlet = GetCharacPrimVar(val_marker, iVertex); From fc30f5d2bc1b98d59272e231d2ee72434a7ee377 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 2 Sep 2024 23:34:50 +0200 Subject: [PATCH 25/77] - Include full production and SSTm into the computation of the Stress Tensor --- SU2_CFD/include/numerics/CNumerics.hpp | 10 ++++--- .../include/numerics/flow/flow_diffusion.hpp | 4 ++- .../numerics/turbulent/turb_sources.hpp | 9 ++++--- .../numerics_simd/flow/diffusion/common.hpp | 6 +++-- .../flow/diffusion/viscous_fluxes.hpp | 5 +++- .../include/solvers/CFVMFlowSolverBase.inl | 10 ++++++- SU2_CFD/include/variables/CVariable.hpp | 12 ++++----- .../interfaces/fsi/CFlowTractionInterface.cpp | 10 ++++++- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 26 ++++++++++++------- SU2_CFD/src/numerics/flow/flow_sources.cpp | 5 +++- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 9 ++++++- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 ++- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 11 +++++++- SU2_CFD/src/solvers/CNSSolver.cpp | 15 ++++++++++- SU2_CFD/src/solvers/CSolver.cpp | 6 ++++- 15 files changed, 107 insertions(+), 35 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 151bcdc2404c..050a945b8184 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -479,12 +479,14 @@ class CNumerics { template FORCEINLINE static void ComputeStressTensor(size_t nDim, Mat1& stress, const Mat2& velgrad, Scalar viscosity, Scalar density=0.0, - Scalar turb_ke=0.0, bool reynolds3x3=false){ + Scalar turb_ke=0.0, bool fullProd=false, bool modified=false, bool reynolds3x3=false){ Scalar divVel = 0.0; for (size_t iDim = 0; iDim < nDim; iDim++) { divVel += velgrad[iDim][iDim]; } - Scalar pTerm = 2./3. * (divVel * viscosity + density * turb_ke); + Scalar pTerm = 0.0; + if (!modified) pTerm += 2./3. * density * turb_ke; + if (fullProd) pTerm += 2./3. * divVel * viscosity; for (size_t iDim = 0; iDim < nDim; iDim++){ for (size_t jDim = 0; jDim < nDim; jDim++){ @@ -558,9 +560,9 @@ class CNumerics { template NEVERINLINE static void ComputePerturbedRSM(size_t nDim, size_t uq_eigval_comp, bool uq_permute, su2double uq_delta_b, su2double uq_urlx, const Mat1& velgrad, Scalar density, - Scalar viscosity, Scalar turb_ke, Mat2& MeanPerturbedRSM) { + Scalar viscosity, Scalar turb_ke, bool fullProd, bool modified, Mat2& MeanPerturbedRSM) { Scalar MeanReynoldsStress[3][3]; - ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, true); + ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, fullProd, modified, true); for (size_t iDim = 0; iDim < 3; iDim++) for (size_t jDim = 0; jDim < 3; jDim++) MeanReynoldsStress[iDim][jDim] /= -density; diff --git a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp index a78c23bd2701..6612a90fd79a 100644 --- a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp +++ b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp @@ -203,7 +203,9 @@ class CAvgGrad_Base : public CNumerics { const su2double* const *val_gradprimvar, su2double val_turb_ke, su2double val_laminar_viscosity, - su2double val_eddy_viscosity); + su2double val_eddy_viscosity, + bool SSTFullProduction, + bool SSTm); /*! * \brief Get a component of the viscous stress tensor. diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 4f55e9f9d3e4..662d1d211787 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -837,7 +837,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { switch (sstParsedOptions.production) { case SST_OPTIONS::UQ: ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, PrimVar_Grad_i + idx.Velocity(), - Density_i, Eddy_Viscosity_i, ScalarVar_i[0], MeanPerturbedRSM); + Density_i, Eddy_Viscosity_i, ScalarVar_i[0], sstParsedOptions.fullProd, + sstParsedOptions.modified, MeanPerturbedRSM); P_Base = PerturbedStrainMag(ScalarVar_i[0]); break; @@ -873,8 +874,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { const su2double prod_limit = prod_lim_const * beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0]; su2double P = Eddy_Viscosity_i * pow(P_Base, 2); - if (!sstParsedOptions.modified) P -= Eddy_Viscosity_i * diverg*diverg * 2.0/3.0; - if (sstParsedOptions.fullProd) P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; + if (sstParsedOptions.fullProd) P -= Eddy_Viscosity_i * diverg*diverg * 2.0/3.0; + if (!sstParsedOptions.modified) P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; su2double PLim = 0.0; if ( P > prod_limit ) PLim = 1.0; @@ -950,7 +951,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Implicit part ---*/ Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume * (1.0 + zetaFMt); - if (sstParsedOptions.fullProd) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; + if (!sstParsedOptions.modified) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index 77b4d41fce9e..81e1060cb3f7 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -97,7 +97,9 @@ FORCEINLINE MatrixDbl stressTensor(Double viscosity, template NEVERINLINE void addPerturbedRSM(const PrimitiveType& V, const MatrixType& grad, - const Double& turb_ke, + const Double& turb_ke, + const bool FullProd, + const bool modified, MatrixDbl& tau, Ts... uq_args) { /*--- Handle SIMD dimensions 1 by 1. ---*/ @@ -109,7 +111,7 @@ NEVERINLINE void addPerturbedRSM(const PrimitiveType& V, su2double rsm[3][3]; CNumerics::ComputePerturbedRSM(nDim, uq_args..., velgrad, V.density()[k], - V.eddyVisc()[k], turb_ke[k], rsm); + V.eddyVisc()[k], turb_ke[k], FullProd, modified, rsm); for (size_t iDim = 0; iDim < nDim; ++iDim) for (size_t jDim = 0; jDim < nDim; ++jDim) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 9b34873fcdda..a517d0d2d37d 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -140,6 +140,9 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const auto& solution = static_cast(solution_); const auto& gradient = solution.GetGradient_Primitive(); + const bool SSTm = config.GetSSTParsedOptions().modified; + const bool SSTFullProduction = config.GetSSTParsedOptions().fullProd; + /*--- Compute distance and handle zero without "ifs" by making it large. ---*/ auto dist2_ij = squaredNorm(vector_ij); @@ -158,7 +161,7 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { if(uq) { Double turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + gatherVariables(jPoint, turbVars->GetSolution())); - addPerturbedRSM(avgV, avgGrad, turb_ke, tau, + addPerturbedRSM(avgV, avgGrad, turb_ke, SSTFullProduction, SSTm, tau, uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx); } diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index f60db438e185..616910bd62c9 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2364,6 +2364,9 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr const su2double Prandtl_Lam = config->GetPrandtl_Lam(); const bool energy = config->GetEnergy_Equation(); const bool QCR = config->GetSAParsedOptions().qcr2000; + TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; const bool axisymmetric = config->GetAxisymmetric(); const bool roughwall = (config->GetnRoughWall() > 0); const bool nemo = config->GetNEMOProblem(); @@ -2447,7 +2450,12 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr } /*--- Evaluate Tau ---*/ - CNumerics::ComputeStressTensor(nDim, Tau, Grad_Vel, Viscosity); + su2double tke = 0.0; + // if (TurbFamily == TURB_FAMILY::KW) { + + // } + // Don't knowhow to retrieve the TKE yet + CNumerics::ComputeStressTensor(nDim, Tau, Grad_Vel, Viscosity, Density, tke, SSTFullProduction, SSTm); /*--- If necessary evaluate the QCR contribution to Tau ---*/ diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 62e7d48a0536..d196ab809add 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -1588,6 +1588,12 @@ class CVariable { */ inline virtual su2double GetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const { return 0.0; } + /*! + * \brief A virtual member. + * \return Value of the primitive variables gradient. + */ + inline virtual CMatrixView GetGradient_Primitive(unsigned long iPoint, unsigned long iVar=0) { return nullptr; } + /*! * \brief Get the primitive variable gradients for all points. * \return Reference to primitive variable gradient. @@ -1609,12 +1615,6 @@ class CVariable { */ inline virtual su2double GetLimiter_Primitive(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! - * \brief A virtual member. - * \return Value of the primitive variables gradient. - */ - inline virtual CMatrixView GetGradient_Primitive(unsigned long iPoint, unsigned long iVar=0) { return nullptr; } - /*! * \brief A virtual member. * \return Value of the primitive variables gradient. diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index f4395640df14..1c542bb0460a 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -179,6 +179,9 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry unsigned long Vertex_Flow, unsigned long Point_Struct) { const auto Point_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNode(); + TURB_FAMILY TurbFamily = TurbModelFamily(flow_config->GetKind_Turb_Model()); + const bool SSTm = flow_config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = flow_config->GetSSTParsedOptions().fullProd; // Get the normal at the vertex: this normal goes inside the fluid domain. const su2double* Normal_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNormal(); @@ -205,7 +208,12 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry su2double Viscosity = flow_nodes->GetLaminarViscosity(Point_Flow); su2double tau[3][3]; - CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity); + su2double TKE = 0.0, Density = 0.0; + if (TurbFamily == TURB_FAMILY::KW && !SSTm) { + TKE = 0.0; // Have to find out how to pass the tke value if needed + Density = 0.0; + } + CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity, Density, TKE, SSTFullProduction, SSTm); for (auto iVar = 0u; iVar < nVar; iVar++) { for (auto jVar = 0u; jVar < nVar; jVar++) { // Viscous component in the tn vector --> Units of force (non-dimensional). diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index 962445c2851a..0780dfaaebbb 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -122,7 +122,9 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, const su2double* const *val_gradprimvar, const su2double val_turb_ke, const su2double val_laminar_viscosity, - const su2double val_eddy_viscosity) { + const su2double val_eddy_viscosity, + bool SSTFullProduction, + bool SSTm) { const su2double Density = val_primvar[nDim+2]; @@ -132,7 +134,7 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, if (sstParsedOptions.uq) { // laminar part - ComputeStressTensor(nDim, tau, val_gradprimvar+1, val_laminar_viscosity); + ComputeStressTensor(nDim, tau, val_gradprimvar+1, val_laminar_viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); // add turbulent part which was perturbed for (unsigned short iDim = 0 ; iDim < nDim; iDim++) for (unsigned short jDim = 0 ; jDim < nDim; jDim++) @@ -140,7 +142,7 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, } else { const su2double total_viscosity = val_laminar_viscosity + val_eddy_viscosity; // turb_ke is not considered in the stress tensor, see #797 - ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, su2double(0.0)); + ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); } } @@ -370,6 +372,8 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -429,13 +433,13 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, MeanPerturbedRSM); + Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); @@ -555,6 +559,8 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -614,12 +620,12 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, MeanPerturbedRSM); + Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); @@ -873,6 +879,8 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -944,13 +952,13 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, MeanPerturbedRSM); + Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 9ed1305f3cef..9e63716f9752 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -253,6 +253,9 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo su2double yinv, Velocity_i[3]; unsigned short iDim, iVar, jVar; + // I don't know how to pass the tke yet + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + if (Coord_i[1] > EPS) { yinv = 1.0/Coord_i[1]; @@ -317,7 +320,7 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo total_viscosity = (Laminar_Viscosity_i + Eddy_Viscosity_i); /*--- The full stress tensor is needed for variable density ---*/ - ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity); + ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity, 0.0, 0.0, SSTFullProduction); /*--- Viscous terms. ---*/ diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 3a219b06ea9e..bb40e1dbd310 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -592,6 +592,12 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con dp_drv, dp_drw, dp_drE, dH_dr, dH_dru, dH_drv, dH_drw, dH_drE, H, D[3][3], Dd[3], Mach_Inf, eps, scale = 1.0, RefVel2, RefDensity, Mach2Vel, *Velocity_Inf, factor; + TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + const auto* turb_solver = solver_container[TURB_SOL]; + const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; + auto *USens = new su2double[nVar]; auto *UnitNormal = new su2double[nDim]; auto *normal_grad_vel = new su2double[nDim]; @@ -762,7 +768,8 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con /*--- Turbulent kinetic energy ---*/ // turb_ke is not considered in the stress tensor, see #797 val_turb_ke = 0.0; - CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke); + if (TurbFamily == TURB_FAMILY::KW && !SSTm) val_turb_ke = Node_Turb->GetSolution(iPoint, 0); + CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); /*--- Form normal_grad_gridvel = \partial_n (u_omega) ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index d8327f1297a7..856e0d5eedd0 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -632,6 +632,8 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe const su2double kappa = config->GetwallModel_Kappa(); const su2double B = config->GetwallModel_B(); + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { if (!config->GetViscous_Wall(iMarker)) continue; @@ -703,7 +705,7 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe const su2double Lam_Visc_Wall = nodes->GetLaminarViscosity(iPoint); su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, 0.0, 0.0, SSTFullProduction); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 5b12013cee28..653f43372c15 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -875,6 +875,13 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, const unsigned short VEL_INDEX = nodes->GetVelIndex(); const unsigned short TVE_INDEX = nodes->GetTveIndex(); + // Is this only at the wall? + TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + const auto* turb_solver = solver_container[TURB_SOL]; + const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; + /*--- Loop over boundary points to calculate energy flux ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for(auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -958,7 +965,9 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Compute wall shear stress (using the stress tensor) ---*/ su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; - CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity); + su2double tke = 0.0; + if (TurbFamily == TURB_FAMILY::KW && !SSTm) tke = Node_Turb->GetSolution(iPoint, 0); + CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity, Density, tke, SSTFullProduction, SSTm); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim,Tau,UnitNormal,TauTangent); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 29a336c1a267..7d419c635b33 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -332,6 +332,11 @@ void CNSSolver::AddDynamicGridResidualContribution(unsigned long iPoint, unsigne su2double eddy_viscosity = nodes->GetEddyViscosity(iPoint); su2double total_viscosity = laminar_viscosity + eddy_viscosity; + // No config variable here. How to do it? + // TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + // const bool SSTm = config->GetSSTParsedOptions().modified; + // const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + /*--- Compute the viscous stress tensor ---*/ su2double tau[MAXNDIM][MAXNDIM] = {{0.0}}; @@ -799,6 +804,12 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, const unsigned short max_iter = config->GetwallModel_MaxIter(); const su2double relax = config->GetwallModel_RelFac(); + TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + const bool SSTm = config->GetSSTParsedOptions().modified; + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; + const auto* turb_solver = solver_container[TURB_SOL]; + const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; + /*--- Compute the recovery factor * use Molecular (Laminar) Prandtl number (see Nichols & Nelson, nomenclature ) ---*/ @@ -904,7 +915,9 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, const su2double Lam_Visc_Wall = nodes->GetLaminarViscosity(iPoint); su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall); + su2double tke = 0.0; + if (TurbFamily == TURB_FAMILY::KW && !SSTm) tke = Node_Turb->GetSolution(iPoint, 0); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, nodes->GetDensity(iPoint), tke, SSTFullProduction, SSTm); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index bfbd4edad583..6a417b41bca5 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -3989,6 +3989,8 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) const bool viscous_flow = config->GetViscous(); const su2double Pressure_Inf = config->GetPressure_FreeStreamND(); + TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); + const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { @@ -4019,8 +4021,10 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) // Calculate tn in the fluid nodes for the viscous term if (viscous_flow) { const su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); + const su2double Density = base_nodes->GetDensity(iPoint); su2double Tau[3][3]; - CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity); + // Here I do not care for modified version of SST since TKE at wall is 0 + CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity, Density, 0.0, SSTFullProduction); for (unsigned short iDim = 0; iDim < nDim; iDim++) { auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); } From a957ec7c775adf4f2680f2b26c3fc8af15705376 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 3 Sep 2024 13:01:16 +0200 Subject: [PATCH 26/77] Updated the freestream values for the print out --- SU2_CFD/src/solvers/CEulerSolver.cpp | 25 ++++++++++++++++----- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 25 ++++++++++++++++----- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 25 ++++++++++++++++----- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 25 ++++++++++++++++----- 4 files changed, 80 insertions(+), 20 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index b1791925cf53..2a17456f11cc 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1039,15 +1039,30 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStream(Tke_FreeStream); - Tke_FreeStreamND = 3.0/2.0*(ModVel_FreeStreamND*ModVel_FreeStreamND*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStreamND(Tke_FreeStreamND); Omega_FreeStream = Density_FreeStream*Tke_FreeStream/(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream()); - config->SetOmega_FreeStream(Omega_FreeStream); - Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream()); + + if (config->GetSSTParsedOptions().newBC) { + Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + + Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; + Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; + } else if (config->GetSSTParsedOptions().sust) { + Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); + Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s + + /*--- not good ---*/ + Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + } + + config->SetTke_FreeStream(Tke_FreeStream); + config->SetTke_FreeStreamND(Tke_FreeStreamND); + + config->SetOmega_FreeStream(Omega_FreeStream); config->SetOmega_FreeStreamND(Omega_FreeStreamND); if (config->GetTurbulenceIntensity_FreeStream() *100 <= 1.3) { diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 73b04c709eb8..1788644e3eea 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1055,15 +1055,30 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStream(Tke_FreeStream); - Tke_FreeStreamND = 3.0/2.0*(ModVel_FreeStreamND*ModVel_FreeStreamND*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); + + Omega_FreeStream = Density_FreeStream*Tke_FreeStream/(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream()); + Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream()); + + if (config->GetSSTParsedOptions().newBC) { + Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + + Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; + Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; + } else if (config->GetSSTParsedOptions().sust) { + Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); + Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s + + /*--- not good ---*/ + Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + } + + config->SetTke_FreeStream(Tke_FreeStream); config->SetTke_FreeStreamND(Tke_FreeStreamND); - Omega_FreeStream = Density_FreeStream*Tke_FreeStream/max((Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream()), 1.e-25); config->SetOmega_FreeStream(Omega_FreeStream); - - Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/max((Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream()), 1.e-25); config->SetOmega_FreeStreamND(Omega_FreeStreamND); /*--- Initialize the dimensionless Fluid Model that will be used to solve the dimensionless problem ---*/ diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 5b81394bd9a3..1e1e5931c4de 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -448,15 +448,30 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStream(Tke_FreeStream); - Tke_FreeStreamND = 3.0/2.0*(ModVel_FreeStreamND*ModVel_FreeStreamND*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStreamND(Tke_FreeStreamND); Omega_FreeStream = Density_FreeStream*Tke_FreeStream/(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream()); - config->SetOmega_FreeStream(Omega_FreeStream); - Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream()); + + if (config->GetSSTParsedOptions().newBC) { + Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + + Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; + Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; + } else if (config->GetSSTParsedOptions().sust) { + Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); + Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s + + /*--- not good ---*/ + Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + } + + config->SetTke_FreeStream(Tke_FreeStream); + config->SetTke_FreeStreamND(Tke_FreeStreamND); + + config->SetOmega_FreeStream(Omega_FreeStream); config->SetOmega_FreeStreamND(Omega_FreeStreamND); const su2double MassDiffusivityND = config->GetDiffusivity_Constant() / (Velocity_Ref * Length_Ref); diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 776a3baaafdf..2ec6f77f2cce 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1187,15 +1187,30 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStream(Tke_FreeStream); - Tke_FreeStreamND = 3.0/2.0*(ModVel_FreeStreamND*ModVel_FreeStreamND*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - config->SetTke_FreeStreamND(Tke_FreeStreamND); Omega_FreeStream = Density_FreeStream*Tke_FreeStream/(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream()); - config->SetOmega_FreeStream(Omega_FreeStream); - Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream()); + + if (config->GetSSTParsedOptions().newBC) { + Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + + Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; + Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; + } else if (config->GetSSTParsedOptions().sust) { + Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); + Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s + + /*--- not good ---*/ + Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + } + + config->SetTke_FreeStream(Tke_FreeStream); + config->SetTke_FreeStreamND(Tke_FreeStreamND); + + config->SetOmega_FreeStream(Omega_FreeStream); config->SetOmega_FreeStreamND(Omega_FreeStreamND); /*--- Initialize the dimensionless Fluid Model that will be used to solve the dimensionless problem ---*/ From 554693686d9064f4182fc474dbae73bb511abc8d Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 3 Sep 2024 15:37:52 +0200 Subject: [PATCH 27/77] - Removed unused variables in turb_sources --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 662d1d211787..53ee039c36ad 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -881,9 +881,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); - const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; - const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); - /*--- Production limiter only for V2003, recompute for V1994. ---*/ su2double pw; if (sstParsedOptions.version == SST_OPTIONS::V1994) { From 1b8ee5bbae72beeadaf3add93258b8d91f2e6c26 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 3 Sep 2024 17:44:56 +0200 Subject: [PATCH 28/77] - Added F2 blending function as output --- SU2_CFD/src/output/CFlowOutput.cpp | 2 ++ SU2_CFD/src/variables/CTurbSSTVariable.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index a55134a5066b..0a50e6b7521d 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1259,6 +1259,7 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ AddVolumeOutput("DESTR_W", "Destr_W", "SOLUTION", "Destruction of rate of dissipation"); AddVolumeOutput("CDkw", "CDkw", "SOLUTION", "Cross-Diffusion term"); AddVolumeOutput("F1", "F1", "SOLUTION", "F1 blending function"); + AddVolumeOutput("F2", "F2", "SOLUTION", "F2 blending function"); break; case TURB_FAMILY::NONE: @@ -1546,6 +1547,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("DESTR_W", iPoint, Node_Turb->GetDestrW(iPoint)); SetVolumeOutputValue("CDkw", iPoint, Node_Turb->GetCrossDiff(iPoint)); SetVolumeOutputValue("F1", iPoint, Node_Turb->GetF1blending(iPoint)); + SetVolumeOutputValue("F2", iPoint, Node_Turb->GetF2blending(iPoint)); SetVolumeOutputValue("RES_TKE", iPoint, turb_solver->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, turb_solver->LinSysRes(iPoint, 1)); if (limiter) { diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index 8fa03688303e..378f3ebc246d 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -69,7 +69,6 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco for (unsigned long iDim = 0; iDim < nDim; iDim++) CDkw(iPoint) += Gradient(iPoint,0,iDim)*Gradient(iPoint,1,iDim); CDkw(iPoint) *= 2.0*val_density*sigma_om2/Solution(iPoint,1); - // CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const)); su2double exponent = 20.0; if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; CDkw(iPoint)= max(CDkw(iPoint), pow(10.0, -exponent)); From 6d3586f91956f4217e10fd1a329118972d55f90e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 3 Sep 2024 17:50:01 +0200 Subject: [PATCH 29/77] - Restore previously removed variables --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 53ee039c36ad..662d1d211787 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -881,6 +881,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); + const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; + const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); + /*--- Production limiter only for V2003, recompute for V1994. ---*/ su2double pw; if (sstParsedOptions.version == SST_OPTIONS::V1994) { From f27a7cbfdefe7a8c3df1746d3b097bf124c47b7c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 4 Sep 2024 11:28:25 +0200 Subject: [PATCH 30/77] - clean up of variables for Reynolds Stress Tensor computation --- SU2_CFD/include/numerics/CNumerics.hpp | 10 +++--- .../include/numerics/flow/flow_diffusion.hpp | 4 +-- .../numerics/turbulent/turb_sources.hpp | 3 +- .../numerics_simd/flow/diffusion/common.hpp | 4 +-- .../flow/diffusion/viscous_fluxes.hpp | 5 +-- .../include/solvers/CFVMFlowSolverBase.inl | 3 +- .../interfaces/fsi/CFlowTractionInterface.cpp | 3 +- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 32 +++++++++---------- SU2_CFD/src/numerics/flow/flow_sources.cpp | 5 +-- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 6 ++-- SU2_CFD/src/solvers/CIncNSSolver.cpp | 4 +-- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 11 +------ SU2_CFD/src/solvers/CNSSolver.cpp | 6 ++-- 13 files changed, 32 insertions(+), 64 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 050a945b8184..151bcdc2404c 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -479,14 +479,12 @@ class CNumerics { template FORCEINLINE static void ComputeStressTensor(size_t nDim, Mat1& stress, const Mat2& velgrad, Scalar viscosity, Scalar density=0.0, - Scalar turb_ke=0.0, bool fullProd=false, bool modified=false, bool reynolds3x3=false){ + Scalar turb_ke=0.0, bool reynolds3x3=false){ Scalar divVel = 0.0; for (size_t iDim = 0; iDim < nDim; iDim++) { divVel += velgrad[iDim][iDim]; } - Scalar pTerm = 0.0; - if (!modified) pTerm += 2./3. * density * turb_ke; - if (fullProd) pTerm += 2./3. * divVel * viscosity; + Scalar pTerm = 2./3. * (divVel * viscosity + density * turb_ke); for (size_t iDim = 0; iDim < nDim; iDim++){ for (size_t jDim = 0; jDim < nDim; jDim++){ @@ -560,9 +558,9 @@ class CNumerics { template NEVERINLINE static void ComputePerturbedRSM(size_t nDim, size_t uq_eigval_comp, bool uq_permute, su2double uq_delta_b, su2double uq_urlx, const Mat1& velgrad, Scalar density, - Scalar viscosity, Scalar turb_ke, bool fullProd, bool modified, Mat2& MeanPerturbedRSM) { + Scalar viscosity, Scalar turb_ke, Mat2& MeanPerturbedRSM) { Scalar MeanReynoldsStress[3][3]; - ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, fullProd, modified, true); + ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, true); for (size_t iDim = 0; iDim < 3; iDim++) for (size_t jDim = 0; jDim < 3; jDim++) MeanReynoldsStress[iDim][jDim] /= -density; diff --git a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp index 6612a90fd79a..a78c23bd2701 100644 --- a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp +++ b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp @@ -203,9 +203,7 @@ class CAvgGrad_Base : public CNumerics { const su2double* const *val_gradprimvar, su2double val_turb_ke, su2double val_laminar_viscosity, - su2double val_eddy_viscosity, - bool SSTFullProduction, - bool SSTm); + su2double val_eddy_viscosity); /*! * \brief Get a component of the viscous stress tensor. diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 662d1d211787..759af205e3d2 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -837,8 +837,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { switch (sstParsedOptions.production) { case SST_OPTIONS::UQ: ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, PrimVar_Grad_i + idx.Velocity(), - Density_i, Eddy_Viscosity_i, ScalarVar_i[0], sstParsedOptions.fullProd, - sstParsedOptions.modified, MeanPerturbedRSM); + Density_i, Eddy_Viscosity_i, ScalarVar_i[0], MeanPerturbedRSM); P_Base = PerturbedStrainMag(ScalarVar_i[0]); break; diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index 81e1060cb3f7..29c3f82a54da 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -98,8 +98,6 @@ template NEVERINLINE void addPerturbedRSM(const PrimitiveType& V, const MatrixType& grad, const Double& turb_ke, - const bool FullProd, - const bool modified, MatrixDbl& tau, Ts... uq_args) { /*--- Handle SIMD dimensions 1 by 1. ---*/ @@ -111,7 +109,7 @@ NEVERINLINE void addPerturbedRSM(const PrimitiveType& V, su2double rsm[3][3]; CNumerics::ComputePerturbedRSM(nDim, uq_args..., velgrad, V.density()[k], - V.eddyVisc()[k], turb_ke[k], FullProd, modified, rsm); + V.eddyVisc()[k], turb_ke[k], rsm); for (size_t iDim = 0; iDim < nDim; ++iDim) for (size_t jDim = 0; jDim < nDim; ++jDim) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index a517d0d2d37d..9b34873fcdda 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -140,9 +140,6 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const auto& solution = static_cast(solution_); const auto& gradient = solution.GetGradient_Primitive(); - const bool SSTm = config.GetSSTParsedOptions().modified; - const bool SSTFullProduction = config.GetSSTParsedOptions().fullProd; - /*--- Compute distance and handle zero without "ifs" by making it large. ---*/ auto dist2_ij = squaredNorm(vector_ij); @@ -161,7 +158,7 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { if(uq) { Double turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + gatherVariables(jPoint, turbVars->GetSolution())); - addPerturbedRSM(avgV, avgGrad, turb_ke, SSTFullProduction, SSTm, tau, + addPerturbedRSM(avgV, avgGrad, turb_ke, tau, uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx); } diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index 616910bd62c9..d084cd62c0e1 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2366,7 +2366,6 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr const bool QCR = config->GetSAParsedOptions().qcr2000; TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; const bool axisymmetric = config->GetAxisymmetric(); const bool roughwall = (config->GetnRoughWall() > 0); const bool nemo = config->GetNEMOProblem(); @@ -2455,7 +2454,7 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr // } // Don't knowhow to retrieve the TKE yet - CNumerics::ComputeStressTensor(nDim, Tau, Grad_Vel, Viscosity, Density, tke, SSTFullProduction, SSTm); + CNumerics::ComputeStressTensor(nDim, Tau, Grad_Vel, Viscosity, Density, tke); /*--- If necessary evaluate the QCR contribution to Tau ---*/ diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index 1c542bb0460a..45131b653b10 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -181,7 +181,6 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry const auto Point_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNode(); TURB_FAMILY TurbFamily = TurbModelFamily(flow_config->GetKind_Turb_Model()); const bool SSTm = flow_config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = flow_config->GetSSTParsedOptions().fullProd; // Get the normal at the vertex: this normal goes inside the fluid domain. const su2double* Normal_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNormal(); @@ -213,7 +212,7 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry TKE = 0.0; // Have to find out how to pass the tke value if needed Density = 0.0; } - CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity, Density, TKE, SSTFullProduction, SSTm); + CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity, Density, TKE); for (auto iVar = 0u; iVar < nVar; iVar++) { for (auto jVar = 0u; jVar < nVar; jVar++) { // Viscous component in the tn vector --> Units of force (non-dimensional). diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index 0780dfaaebbb..b1acc6dad9d8 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -122,9 +122,7 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, const su2double* const *val_gradprimvar, const su2double val_turb_ke, const su2double val_laminar_viscosity, - const su2double val_eddy_viscosity, - bool SSTFullProduction, - bool SSTm) { + const su2double val_eddy_viscosity) { const su2double Density = val_primvar[nDim+2]; @@ -134,7 +132,7 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, if (sstParsedOptions.uq) { // laminar part - ComputeStressTensor(nDim, tau, val_gradprimvar+1, val_laminar_viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); + ComputeStressTensor(nDim, tau, val_gradprimvar+1, val_laminar_viscosity, Density, val_turb_ke); // add turbulent part which was perturbed for (unsigned short iDim = 0 ; iDim < nDim; iDim++) for (unsigned short jDim = 0 ; jDim < nDim; jDim++) @@ -142,7 +140,7 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, } else { const su2double total_viscosity = val_laminar_viscosity + val_eddy_viscosity; // turb_ke is not considered in the stress tensor, see #797 - ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); + ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, val_turb_ke); } } @@ -373,7 +371,6 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) unsigned short iVar, jVar, iDim; const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -407,6 +404,7 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) Mean_Laminar_Viscosity = 0.5*(Laminar_Viscosity_i + Laminar_Viscosity_j); Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); + const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -433,13 +431,13 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); + Mean_turb_ke, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); @@ -560,7 +558,6 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi unsigned short iVar, jVar, iDim; const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -596,6 +593,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); + const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -620,12 +618,12 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); + Mean_turb_ke, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); @@ -880,7 +878,6 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c unsigned short iVar, jVar, iDim; const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; /*--- Normalized normal vector ---*/ @@ -926,6 +923,7 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); Mean_Cp = 0.5*(Cp_i + Cp_j); + const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -952,13 +950,13 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c if (sstParsedOptions.uq) { ComputePerturbedRSM(nDim, Eig_Val_Comp, uq_permute, uq_delta_b, uq_urlx, Mean_GradPrimVar+1, Mean_PrimVar[nDim+2], Mean_Eddy_Viscosity, - Mean_turb_ke, SSTFullProduction, SSTm, MeanPerturbedRSM); + Mean_turb_ke, MeanPerturbedRSM); } /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, - Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, SSTFullProduction, SSTm); + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + Mean_Laminar_Viscosity, Mean_Eddy_Viscosity); if (config->GetSAParsedOptions().qcr2000) AddQCR(nDim, &Mean_GradPrimVar[1], tau); if (Mean_TauWall > 0) AddTauWall(UnitNormal, Mean_TauWall); diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 9e63716f9752..51908bd814f7 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -253,9 +253,6 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo su2double yinv, Velocity_i[3]; unsigned short iDim, iVar, jVar; - // I don't know how to pass the tke yet - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - if (Coord_i[1] > EPS) { yinv = 1.0/Coord_i[1]; @@ -320,7 +317,7 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo total_viscosity = (Laminar_Viscosity_i + Eddy_Viscosity_i); /*--- The full stress tensor is needed for variable density ---*/ - ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity, 0.0, 0.0, SSTFullProduction); + ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity, 0.0, 0.0); /*--- Viscous terms. ---*/ diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index bb40e1dbd310..8068cd50bd14 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -594,9 +594,7 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - const auto* turb_solver = solver_container[TURB_SOL]; - const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; + const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? solver_container[TURB_SOL]->GetNodes() : nullptr; auto *USens = new su2double[nVar]; auto *UnitNormal = new su2double[nDim]; @@ -769,7 +767,7 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con // turb_ke is not considered in the stress tensor, see #797 val_turb_ke = 0.0; if (TurbFamily == TURB_FAMILY::KW && !SSTm) val_turb_ke = Node_Turb->GetSolution(iPoint, 0); - CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke, SSTFullProduction, SSTm); + CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke); /*--- Form normal_grad_gridvel = \partial_n (u_omega) ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 856e0d5eedd0..006c8fff098a 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -632,8 +632,6 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe const su2double kappa = config->GetwallModel_Kappa(); const su2double B = config->GetwallModel_B(); - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { if (!config->GetViscous_Wall(iMarker)) continue; @@ -705,7 +703,7 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe const su2double Lam_Visc_Wall = nodes->GetLaminarViscosity(iPoint); su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, 0.0, 0.0, SSTFullProduction); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, 0.0); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 653f43372c15..d22e0f956ac0 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -875,13 +875,6 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, const unsigned short VEL_INDEX = nodes->GetVelIndex(); const unsigned short TVE_INDEX = nodes->GetTveIndex(); - // Is this only at the wall? - TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); - const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - const auto* turb_solver = solver_container[TURB_SOL]; - const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; - /*--- Loop over boundary points to calculate energy flux ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for(auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { @@ -965,9 +958,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Compute wall shear stress (using the stress tensor) ---*/ su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; - su2double tke = 0.0; - if (TurbFamily == TURB_FAMILY::KW && !SSTm) tke = Node_Turb->GetSolution(iPoint, 0); - CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity, Density, tke, SSTFullProduction, SSTm); + CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity, Density); // no need for TKE as it is on the wall su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim,Tau,UnitNormal,TauTangent); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index 7d419c635b33..b8eec754f4db 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -806,9 +806,7 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); const bool SSTm = config->GetSSTParsedOptions().modified; - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - const auto* turb_solver = solver_container[TURB_SOL]; - const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? turb_solver->GetNodes() : nullptr; + const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? solver_container[TURB_SOL]->GetNodes() : nullptr; /*--- Compute the recovery factor * use Molecular (Laminar) Prandtl number (see Nichols & Nelson, nomenclature ) ---*/ @@ -917,7 +915,7 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, su2double tke = 0.0; if (TurbFamily == TURB_FAMILY::KW && !SSTm) tke = Node_Turb->GetSolution(iPoint, 0); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, nodes->GetDensity(iPoint), tke, SSTFullProduction, SSTm); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, nodes->GetDensity(iPoint), tke); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); From 448a532387b1291815cea6320f43af6e54ee3af5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 4 Sep 2024 19:28:39 +0200 Subject: [PATCH 31/77] - Use full tke production term in Pw instead of only P_base --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 759af205e3d2..be2615c5e2f4 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -886,7 +886,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Production limiter only for V2003, recompute for V1994. ---*/ su2double pw; if (sstParsedOptions.version == SST_OPTIONS::V1994) { - pw = alfa_blended * Density_i * pow(P_Base, 2); + pw = alfa_blended * Density_i * P / Eddy_Viscosity_i; } else { pw = (alfa_blended * Density_i / Eddy_Viscosity_i) * pk; } From e9fa4e7c28b7f5dba0563d590e91284ff633b932 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 6 Sep 2024 18:11:23 +0200 Subject: [PATCH 32/77] - Fixed Errors in AD compiling --- SU2_CFD/src/numerics/flow/flow_sources.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 51908bd814f7..9ed1305f3cef 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -317,7 +317,7 @@ CNumerics::ResidualType<> CSourceIncAxisymmetric_Flow::ComputeResidual(const CCo total_viscosity = (Laminar_Viscosity_i + Eddy_Viscosity_i); /*--- The full stress tensor is needed for variable density ---*/ - ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity, 0.0, 0.0); + ComputeStressTensor(nDim, tau, PrimVar_Grad_i+1, total_viscosity); /*--- Viscous terms. ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index 006c8fff098a..d8327f1297a7 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -703,7 +703,7 @@ void CIncNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_containe const su2double Lam_Visc_Wall = nodes->GetLaminarViscosity(iPoint); su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, 0.0); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 6a417b41bca5..6bd045c62b31 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -4024,7 +4024,8 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) const su2double Density = base_nodes->GetDensity(iPoint); su2double Tau[3][3]; // Here I do not care for modified version of SST since TKE at wall is 0 - CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity, Density, 0.0, SSTFullProduction); + su2double tke = 0.0; + CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity, Density, tke, SSTFullProduction); for (unsigned short iDim = 0; iDim < nDim; iDim++) { auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); } From c2462e80bb661bec442abd65ce2758df5244265b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 9 Sep 2024 11:48:02 +0200 Subject: [PATCH 33/77] - added tke to the numerics simd computations - TODO: change the jacobian of the stress tensor --- SU2_CFD/include/numerics/CNumerics.hpp | 2 +- .../include/numerics_simd/flow/diffusion/common.hpp | 5 +++-- .../numerics_simd/flow/diffusion/viscous_fluxes.hpp | 11 +++++++---- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 4 ++-- SU2_CFD/src/solvers/CNSSolver.cpp | 9 +++++---- SU2_CFD/src/solvers/CSolver.cpp | 4 +--- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 151bcdc2404c..55d214698c6d 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -560,7 +560,7 @@ class CNumerics { su2double uq_urlx, const Mat1& velgrad, Scalar density, Scalar viscosity, Scalar turb_ke, Mat2& MeanPerturbedRSM) { Scalar MeanReynoldsStress[3][3]; - ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, true); + ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke); for (size_t iDim = 0; iDim < 3; iDim++) for (size_t jDim = 0; jDim < 3; jDim++) MeanReynoldsStress[iDim][jDim] /= -density; diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index 29c3f82a54da..d4da1f61cf60 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -71,13 +71,13 @@ FORCEINLINE void correctGradient(const PrimitiveType& V, */ template FORCEINLINE MatrixDbl stressTensor(Double viscosity, - const MatrixDbl& grad) { + const MatrixDbl& grad, Double density=0.0, Double tke=0.0) { /*--- Hydrostatic term. ---*/ Double velDiv = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { velDiv += grad(iDim+1,iDim); } - Double pTerm = 2.0/3.0 * viscosity * velDiv; + Double pTerm = 2.0/3.0 * (viscosity * velDiv + density * tke); MatrixDbl tau; for (size_t iDim = 0; iDim < nDim; ++iDim) { @@ -186,6 +186,7 @@ template FORCEINLINE MatrixDbl stressTensorJacobian(const PrimitiveType& V, const VectorDbl& normal, Double dist_ij) { + /// TODO: include tke if the SST model is used. Double viscosity = V.laminarVisc() + V.eddyVisc(); Double xi = viscosity / (V.density() * dist_ij); MatrixDbl jac; diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 9b34873fcdda..de32485d1ed5 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -140,6 +140,8 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const auto& solution = static_cast(solution_); const auto& gradient = solution.GetGradient_Primitive(); + const bool tkeNeeded = (config.GetKind_Turb_Model() == TURB_MODEL::SST) && !(config.GetSSTParsedOptions().modified); + /*--- Compute distance and handle zero without "ifs" by making it large. ---*/ auto dist2_ij = squaredNorm(vector_ij); @@ -152,12 +154,13 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { if(correct) correctGradient(V, vector_ij, dist2_ij, avgGrad); /*--- Stress and heat flux tensors. ---*/ - - auto tau = stressTensor(avgV.laminarVisc() + (uq? Double(0.0) : avgV.eddyVisc()), avgGrad); + Double turb_ke = 0.0; + Double density = avgV.density(); + if (tkeNeeded) turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + + gatherVariables(jPoint, turbVars->GetSolution())); + auto tau = stressTensor(avgV.laminarVisc() + (uq? Double(0.0) : avgV.eddyVisc()), avgGrad, density, turb_ke); if(useSA_QCR) addQCR(avgGrad, tau); if(uq) { - Double turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + - gatherVariables(jPoint, turbVars->GetSolution())); addPerturbedRSM(avgV, avgGrad, turb_ke, tau, uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx); } diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index b1acc6dad9d8..8c3984b2f512 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -370,7 +370,7 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; - const bool SSTm = config->GetSSTParsedOptions().modified; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -404,7 +404,7 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) Mean_Laminar_Viscosity = 0.5*(Laminar_Viscosity_i + Laminar_Viscosity_j); Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); - const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; + const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index b8eec754f4db..fda3e1af3903 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -340,7 +340,8 @@ void CNSSolver::AddDynamicGridResidualContribution(unsigned long iPoint, unsigne /*--- Compute the viscous stress tensor ---*/ su2double tau[MAXNDIM][MAXNDIM] = {{0.0}}; - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), total_viscosity); + su2double tke=0.0, density=0.0; + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), total_viscosity, density, tke); /*--- Dot product of the stress tensor with the grid velocity ---*/ @@ -804,9 +805,9 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, const unsigned short max_iter = config->GetwallModel_MaxIter(); const su2double relax = config->GetwallModel_RelFac(); - TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); const bool SSTm = config->GetSSTParsedOptions().modified; - const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? solver_container[TURB_SOL]->GetNodes() : nullptr; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !SSTm; + const auto* Node_Turb = (tkeNeeded) ? solver_container[TURB_SOL]->GetNodes() : nullptr; /*--- Compute the recovery factor * use Molecular (Laminar) Prandtl number (see Nichols & Nelson, nomenclature ) ---*/ @@ -914,7 +915,7 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); su2double tke = 0.0; - if (TurbFamily == TURB_FAMILY::KW && !SSTm) tke = Node_Turb->GetSolution(iPoint, 0); + if (tkeNeeded) tke = Node_Turb->GetSolution(iPoint, 0); CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, nodes->GetDensity(iPoint), tke); su2double TauTangent[MAXNDIM] = {0.0}; diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 6bd045c62b31..25da1e0155a0 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -4021,11 +4021,9 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) // Calculate tn in the fluid nodes for the viscous term if (viscous_flow) { const su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); - const su2double Density = base_nodes->GetDensity(iPoint); su2double Tau[3][3]; // Here I do not care for modified version of SST since TKE at wall is 0 - su2double tke = 0.0; - CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity, Density, tke, SSTFullProduction); + CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity); for (unsigned short iDim = 0; iDim < nDim; iDim++) { auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); } From 51112feb9604217fa9cb1f329d5552c2a7578a3c Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 9 Sep 2024 13:54:09 +0200 Subject: [PATCH 34/77] - Fixed UQ problem --- SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index de32485d1ed5..667f1a6fa615 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -161,6 +161,8 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { auto tau = stressTensor(avgV.laminarVisc() + (uq? Double(0.0) : avgV.eddyVisc()), avgGrad, density, turb_ke); if(useSA_QCR) addQCR(avgGrad, tau); if(uq) { + turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + + gatherVariables(jPoint, turbVars->GetSolution())); addPerturbedRSM(avgV, avgGrad, turb_ke, tau, uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx); } From 576e8ee9c4e0b28acaf7b731df099b558fe93bde Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 9 Sep 2024 18:41:00 +0200 Subject: [PATCH 35/77] - fix UQ implementation --- SU2_CFD/include/numerics/CNumerics.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 55d214698c6d..151bcdc2404c 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -560,7 +560,7 @@ class CNumerics { su2double uq_urlx, const Mat1& velgrad, Scalar density, Scalar viscosity, Scalar turb_ke, Mat2& MeanPerturbedRSM) { Scalar MeanReynoldsStress[3][3]; - ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke); + ComputeStressTensor(nDim, MeanReynoldsStress, velgrad, viscosity, density, turb_ke, true); for (size_t iDim = 0; iDim < 3; iDim++) for (size_t jDim = 0; jDim < 3; jDim++) MeanReynoldsStress[iDim][jDim] /= -density; From acc21ec0ae4f40d6b4648b065a62250997442894 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 9 Sep 2024 19:27:34 +0200 Subject: [PATCH 36/77] - Removed unused variables --- SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp | 2 +- SU2_CFD/src/solvers/CAdjNSSolver.cpp | 6 +++--- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 2 +- SU2_CFD/src/solvers/CNSSolver.cpp | 8 +------- SU2_CFD/src/solvers/CSolver.cpp | 2 -- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index d4da1f61cf60..cabb7f5c793e 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -97,7 +97,7 @@ FORCEINLINE MatrixDbl stressTensor(Double viscosity, template NEVERINLINE void addPerturbedRSM(const PrimitiveType& V, const MatrixType& grad, - const Double& turb_ke, + const Double& turb_ke, MatrixDbl& tau, Ts... uq_args) { /*--- Handle SIMD dimensions 1 by 1. ---*/ diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 8068cd50bd14..8cf8c23f1daa 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -592,9 +592,9 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con dp_drv, dp_drw, dp_drE, dH_dr, dH_dru, dH_drv, dH_drw, dH_drE, H, D[3][3], Dd[3], Mach_Inf, eps, scale = 1.0, RefVel2, RefDensity, Mach2Vel, *Velocity_Inf, factor; - TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); const bool SSTm = config->GetSSTParsedOptions().modified; - const auto* Node_Turb = (TurbFamily == TURB_FAMILY::KW) ? solver_container[TURB_SOL]->GetNodes() : nullptr; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !SSTm; + const auto* Node_Turb = (tkeNeeded) ? solver_container[TURB_SOL]->GetNodes() : nullptr; auto *USens = new su2double[nVar]; auto *UnitNormal = new su2double[nDim]; @@ -766,7 +766,7 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con /*--- Turbulent kinetic energy ---*/ // turb_ke is not considered in the stress tensor, see #797 val_turb_ke = 0.0; - if (TurbFamily == TURB_FAMILY::KW && !SSTm) val_turb_ke = Node_Turb->GetSolution(iPoint, 0); + if (tkeNeeded) val_turb_ke = Node_Turb->GetSolution(iPoint, 0); CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke); /*--- Form normal_grad_gridvel = \partial_n (u_omega) ---*/ diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index d22e0f956ac0..2183ae32fb1a 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -958,7 +958,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Compute wall shear stress (using the stress tensor) ---*/ su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; - CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity, Density); // no need for TKE as it is on the wall + CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity); // no need for TKE as it is on the wall su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim,Tau,UnitNormal,TauTangent); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index fda3e1af3903..f2f1d6f4c4e1 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -332,16 +332,10 @@ void CNSSolver::AddDynamicGridResidualContribution(unsigned long iPoint, unsigne su2double eddy_viscosity = nodes->GetEddyViscosity(iPoint); su2double total_viscosity = laminar_viscosity + eddy_viscosity; - // No config variable here. How to do it? - // TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); - // const bool SSTm = config->GetSSTParsedOptions().modified; - // const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; - /*--- Compute the viscous stress tensor ---*/ su2double tau[MAXNDIM][MAXNDIM] = {{0.0}}; - su2double tke=0.0, density=0.0; - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), total_viscosity, density, tke); + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), total_viscosity); /*--- Dot product of the stress tensor with the grid velocity ---*/ diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 25da1e0155a0..227692d0b830 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -3989,8 +3989,6 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) const bool viscous_flow = config->GetViscous(); const su2double Pressure_Inf = config->GetPressure_FreeStreamND(); - TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); - const bool SSTFullProduction = config->GetSSTParsedOptions().fullProd; for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { From c6376cd2f671fd88c9db12f1bf94ce2603ed6ed9 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 12 Sep 2024 17:31:21 +0200 Subject: [PATCH 37/77] - Started including tke when computing the speed of sound --- .../flow/convection/centered.hpp | 11 ++++++++++ .../numerics_simd/flow/convection/common.hpp | 15 +++++++++++-- .../numerics_simd/flow/convection/roe.hpp | 21 +++++++++++++++++-- .../numerics_simd/flow/diffusion/common.hpp | 1 - .../flow/diffusion/viscous_fluxes.hpp | 4 ++++ .../include/numerics_simd/flow/variables.hpp | 14 ++++++++++++- 6 files changed, 60 insertions(+), 6 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp index ae5c23c259c1..9b37f976d9a2 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp @@ -53,6 +53,8 @@ class CCenteredBase : public Base { const bool dynamicGrid; const su2double stretchParam = 0.3; + using Base::turbVars; + /*! * \brief Constructor, store some constants and forward args to base. */ @@ -96,6 +98,8 @@ class CCenteredBase : public Base { const bool implicit = (config.GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto& solution = static_cast(solution_); + const bool tkeNeeded = config.GetKind_Turb_Model() == TURB_MODEL::SST; + const auto iPoint = geometry.edges->GetNode(iEdge,0); const auto jPoint = geometry.edges->GetNode(iEdge,1); @@ -119,6 +123,13 @@ class CCenteredBase : public Base { avgV.all(iVar) = 0.5 * (V.i.all(iVar) + V.j.all(iVar)); } + if (tkeNeeded) { + V.i.allTurb = gatherVariables<1>(iPoint, turbVars->GetSolution()); + V.j.allTurb = gatherVariables<1>(jPoint, turbVars->GetSolution()); + + avgV.allTurb(0) = 0.5*(V.i.allTurb(0)+V.j.allTurb(0)); + } + /*--- Compute conservative variables. ---*/ CPair > U; diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index e1807f99f6b6..e3781a0c09d4 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -103,20 +103,30 @@ FORCEINLINE void musclEdgeLimited(Int iPoint, template FORCEINLINE CPair reconstructPrimitives(Int iEdge, Int iPoint, Int jPoint, bool muscl, LIMITER limiterType, + bool musclTurb, LIMITER limiterTypeTurb, const CPair& V1st, const VectorDbl& vector_ij, - const VariableType& solution) { + const VariableType& solution, + const bool tkeNeeded) { static_assert(ReconVarType::nVar <= PrimVarType::nVar,""); const auto& gradients = solution.GetGradient_Reconstruction(); const auto& limiters = solution.GetLimiter_Primitive(); + // const auto& gradientsTurb = turbSolution.GetGradient_Reconstruction(); + // const auto& limitersTurb = turbSolution.GetLimiter_Primitive(); + CPair V; for (size_t iVar = 0; iVar < ReconVarType::nVar; ++iVar) { V.i.all(iVar) = V1st.i.all(iVar); V.j.all(iVar) = V1st.j.all(iVar); } + // Only first order for turbulence + if (tkeNeeded) { + V.i.allTurb(0) = V1st.i.allTurb(0); + V.j.allTurb(0) = V1st.j.allTurb(0); + } if (muscl) { switch (limiterType) { @@ -143,9 +153,10 @@ FORCEINLINE CPair reconstructPrimitives(Int iEdge, Int iPoint, Int for (size_t iDim = 0; iDim < nDim; ++iDim) { v_squared += pow(R*V.j.velocity(iDim) + V.i.velocity(iDim), 2); } + Double tke = R*V1st.j.allTurb(0) + V1st.i.allTurb(0); /*--- Multiply enthalpy by R+1 since v^2 was not divided by (R+1)^2. * Note: a = sqrt((gamma-1) * (H - 0.5 * v^2)) ---*/ - const Double neg_sound_speed = enthalpy * (R+1) < 0.5 * v_squared; + const Double neg_sound_speed = enthalpy * (R+1) < (0.5 * v_squared - tke); /*--- Revert to first order if the state is non-physical. ---*/ Double bad_recon = fmax(neg_p_or_rho, neg_sound_speed); diff --git a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp index d128ae4cbcaa..dabb24837cf4 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp @@ -60,7 +60,11 @@ class CRoeBase : public Base { const bool finestGrid; const bool dynamicGrid; const bool muscl; + const bool musclTurb; const LIMITER typeLimiter; + const LIMITER typeLimiterTurb; + + using Base::turbVars; /*! * \brief Constructor, store some constants and forward args to base. @@ -73,7 +77,9 @@ class CRoeBase : public Base { finestGrid(iMesh == MESH_0), dynamicGrid(config.GetDynamic_Grid()), muscl(finestGrid && config.GetMUSCL_Flow()), - typeLimiter(config.GetKind_SlopeLimit_Flow()) { + musclTurb(finestGrid && config.GetMUSCL_Turb()), + typeLimiter(config.GetKind_SlopeLimit_Flow()), + typeLimiterTurb(config.GetKind_SlopeLimit_Turb()) { } public: @@ -96,9 +102,13 @@ class CRoeBase : public Base { const bool implicit = (config.GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto& solution = static_cast(solution_); + const bool tkeNeeded = config.GetKind_Turb_Model() == TURB_MODEL::SST; + const auto iPoint = geometry.edges->GetNode(iEdge,0); const auto jPoint = geometry.edges->GetNode(iEdge,1); + // cout << gatherVariables(iPoint, turbVars->GetSolution()) << endl; + /*--- Geometric properties. ---*/ const auto vector_ij = distanceVector(iPoint, jPoint, geometry.nodes->GetCoord()); @@ -116,8 +126,13 @@ class CRoeBase : public Base { V1st.i.all = gatherVariables(iPoint, solution.GetPrimitive()); V1st.j.all = gatherVariables(jPoint, solution.GetPrimitive()); + if (tkeNeeded) { + V1st.i.allTurb = gatherVariables(iPoint, turbVars->GetSolution()); + V1st.j.allTurb = gatherVariables(jPoint, turbVars->GetSolution()); + } + auto V = reconstructPrimitives >( - iEdge, iPoint, jPoint, muscl, typeLimiter, V1st, vector_ij, solution); + iEdge, iPoint, jPoint, muscl, typeLimiter, musclTurb, typeLimiterTurb, V1st, vector_ij, solution, tkeNeeded); /*--- Compute conservative variables. ---*/ @@ -229,6 +244,8 @@ class CRoeScheme : public CRoeBase,Decorator> { using Base::kappa; const ENUM_ROELOWDISS typeDissip; + using Base::turbVars; + public: /*! * \brief Constructor, store some constants and forward to base. diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index cabb7f5c793e..5555ca89d2e4 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -186,7 +186,6 @@ template FORCEINLINE MatrixDbl stressTensorJacobian(const PrimitiveType& V, const VectorDbl& normal, Double dist_ij) { - /// TODO: include tke if the SST model is used. Double viscosity = V.laminarVisc() + V.eddyVisc(); Double xi = viscosity / (V.density() * dist_ij); MatrixDbl jac; diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 667f1a6fa615..d20edd4eefcd 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -50,6 +50,7 @@ class CNoViscousFlux : public CNumericsSIMD { protected: static constexpr size_t nDim = NDIM; static constexpr size_t nPrimVar = 0; + const CVariable* turbVars = nullptr; template CNoViscousFlux(Ts&...) {} @@ -268,6 +269,7 @@ class CCompressibleViscousFlux : public CCompressibleViscousFluxBase >; using Base::prandtlTurb; + using Base::turbVars; +; /*! * \brief Constructor, initialize constants and booleans. diff --git a/SU2_CFD/include/numerics_simd/flow/variables.hpp b/SU2_CFD/include/numerics_simd/flow/variables.hpp index 17e6f4a090f5..44fd815911df 100644 --- a/SU2_CFD/include/numerics_simd/flow/variables.hpp +++ b/SU2_CFD/include/numerics_simd/flow/variables.hpp @@ -50,12 +50,16 @@ struct CCompressiblePrimitives { FORCEINLINE const Double& velocity(size_t iDim) const { return all(iDim+1); } FORCEINLINE const Double* velocity() const { return &velocity(0); } + VectorDbl<1> allTurb; + FORCEINLINE const Double& tke() const { return allTurb(0); } + /*--- Un-reconstructed variables. ---*/ FORCEINLINE Double& speedSound() { return all(nDim+4); } FORCEINLINE Double& laminarVisc() { return all(nDim+5); } FORCEINLINE Double& eddyVisc() { return all(nDim+6); } FORCEINLINE Double& thermalCond() { return all(nDim+7); } FORCEINLINE Double& cp() { return all(nDim+8); } + FORCEINLINE Double& tke() { return all(nDim+9); } FORCEINLINE const Double& speedSound() const { return all(nDim+4); } FORCEINLINE const Double& laminarVisc() const { return all(nDim+5); } FORCEINLINE const Double& eddyVisc() const { return all(nDim+6); } @@ -70,17 +74,22 @@ template struct CCompressibleConservatives { static constexpr size_t nDim = nDim_; static constexpr size_t nVar = nDim+2; + static constexpr size_t nVarTurb = 1; VectorDbl all; + VectorDbl allTurb; FORCEINLINE Double& density() { return all(0); } FORCEINLINE Double& rhoEnergy() { return all(nDim+1); } FORCEINLINE Double& momentum(size_t iDim) { return all(iDim+1); } + FORCEINLINE Double& rhoTke() { return allTurb(0); } FORCEINLINE const Double& density() const { return all(0); } FORCEINLINE const Double& rhoEnergy() const { return all(nDim+1); } FORCEINLINE const Double& momentum(size_t iDim) const { return all(iDim+1); } + FORCEINLINE const Double& rhoTke() const { return allTurb(0); } FORCEINLINE Double energy() const { return rhoEnergy() / density(); } FORCEINLINE const Double* momentum() const { return &momentum(0); } + FORCEINLINE Double tke() const { return rhoTke() / density(); } }; /*! @@ -94,6 +103,7 @@ FORCEINLINE CCompressibleConservatives compressibleConservatives(const CCo U.momentum(iDim) = V.density() * V.velocity(iDim); } U.rhoEnergy() = V.density() * V.enthalpy() - V.pressure(); + U.rhoTke() = V.density() * V.tke(); return U; } @@ -105,6 +115,7 @@ struct CRoeVariables { Double density; VectorDbl velocity; Double enthalpy; + Double tke; Double speedSound; Double projVel; }; @@ -124,7 +135,8 @@ FORCEINLINE CRoeVariables roeAveragedVariables(Double gamma, roeAvg.velocity(iDim) = (R*V.j.velocity(iDim) + V.i.velocity(iDim)) * D; } roeAvg.enthalpy = (R*V.j.enthalpy() + V.i.enthalpy()) * D; - roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity))); + roeAvg.tke = (R*V.j.tke() + V.i.tke()) * D; + roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity) - roeAvg.tke)); roeAvg.projVel = dot(roeAvg.velocity, normal); return roeAvg; } From c5aeb5af13797b31cf87df17307787c4a0e24b60 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Mon, 16 Sep 2024 20:42:15 +0200 Subject: [PATCH 38/77] - Start to include tke only when not m version of SST is used --- Common/include/CConfig.hpp | 2 +- .../include/solvers/CFVMFlowSolverBase.inl | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 50 +++++++++++++------ SU2_CFD/src/solvers/CNSSolver.cpp | 5 +- 4 files changed, 39 insertions(+), 20 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 7a46555c8a60..deac682f12f7 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1961,7 +1961,7 @@ class CConfig { * \brief Get the value of the non-dimensionalized freestream energy. * \return Non-dimensionalized freestream energy. */ - su2double GetEnergy_FreeStreamND(void) const { return Energy_FreeStreamND; } + su2double GetEnergy_FreeStreamND(void) const { cout << "La chiedo non-dimensionale " << endl; return Energy_FreeStreamND; } /*! * \brief Get the value of the non-dimensionalized freestream viscosity. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index d084cd62c0e1..da5f2cc7e78f 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -432,7 +432,7 @@ 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() == TURB_MODEL::SST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 0069db731303..1a2b494eea12 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -64,6 +64,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); + bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); int Unst_RestartIter = 0; unsigned long iPoint, iMarker, counter_local = 0, counter_global = 0; @@ -240,6 +241,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Density_Inf = config->GetDensity_FreeStreamND(); Energy_Inf = config->GetEnergy_FreeStreamND(); Mach_Inf = config->GetMach(); + const su2double TKE_Inf = config->GetTke_FreeStreamND(); /*--- Initialize the secondary values for direct derivative approxiations ---*/ @@ -307,6 +309,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Velocity2 += pow(nodes->GetSolution(iPoint,iDim+1)/Density,2); StaticEnergy= nodes->GetEnergy(iPoint) - 0.5*Velocity2; + if (tkeNeeded) StaticEnergy -= TKE_Inf; GetFluidModel()->SetTDState_rhoe(Density, StaticEnergy); Pressure= GetFluidModel()->GetPressure(); @@ -319,7 +322,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Solution[0] = Density_Inf; for (iDim = 0; iDim < nDim; iDim++) Solution[iDim+1] = Velocity_Inf[iDim]*Density_Inf; - Solution[nDim+1] = Energy_Inf*Density_Inf; + Solution[nDim+1] = Energy_Inf*Density_Inf; nodes->SetSolution(iPoint,Solution); nodes->SetSolution_Old(iPoint,Solution); counter_local++; @@ -801,7 +804,8 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes bool viscous = config->GetViscous(); bool gravity = config->GetGravityForce(); bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); - bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST); + bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + // bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST); bool free_stream_temp = (config->GetKind_FreeStreamOption() == FREESTREAM_OPTION::TEMPERATURE_FS); bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); bool aeroelastic = config->GetAeroelastic_Simulation(); @@ -966,6 +970,19 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); + if (config->GetSSTParsedOptions().newBC) { + su2double Omega_Freestream = 10 * ModVel_FreeStream / config->GetLDomain(); + Tke_FreeStream = Omega_Freestream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; + } else if (config->GetSSTParsedOptions().sust) { + su2double Omega_Freestream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); + /*--- not good ---*/ + Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + } + + /*-- Compute the freestream energy. ---*/ + + if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; + } else { @@ -976,9 +993,8 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes } - /*-- Compute the freestream energy. ---*/ - - if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream); + /*-- Set the freestream energy. ---*/ + config->SetEnergy_FreeStream(Energy_FreeStream); /*--- Compute non dimensional quantities. By definition, Lref is one because we have converted the grid to meters. ---*/ @@ -4783,7 +4799,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() == TURB_MODEL::SST; + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -5029,7 +5045,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const bool viscous = config->GetViscous(), implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT), gravity = config->GetGravityForce(), - tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -5077,7 +5093,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const auto Density_i = nodes->GetDensity(iPoint); const auto Energy_i = nodes->GetEnergy(iPoint); - const su2double StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + su2double StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + if (tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -5158,7 +5175,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); + // if (tkeNeeded) Energy_e += GetTke_Inf(); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case STATIC_SUPERSONIC_INFLOW_PD: @@ -5185,7 +5203,8 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); + // if (tkeNeeded) Energy_e += GetTke_Inf(); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case DENSITY_VELOCITY: @@ -5218,6 +5237,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Velocity2_e = GeometryToolbox::SquaredNorm(nDim, Velocity_e); Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; default: @@ -5422,7 +5442,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, /*--- Turbulent kinetic energy ---*/ - if (config->GetKind_Turb_Model() == TURB_MODEL::SST) + if (tkeNeeded) visc_numerics->SetTurbKineticEnergy(solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0), solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0)); @@ -7196,7 +7216,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() == TURB_MODEL::SST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -7282,8 +7302,8 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = P_Exit/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); - // if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); + // if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Conservative variables, using the derived quantities ---*/ V_outlet[0] = Pressure / ( Gas_Constant * Density); @@ -7366,7 +7386,7 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con const su2double Gas_Constant = config->GetGas_ConstantND(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index f2f1d6f4c4e1..4156ae90a039 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -133,7 +133,7 @@ unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, cons unsigned long nonPhysicalPoints = 0; const TURB_MODEL turb_model = config->GetKind_Turb_Model(); - const bool tkeNeeded = (turb_model == TURB_MODEL::SST); + const bool tkeNeeded = (turb_model == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); AD::StartNoSharedReading(); @@ -799,8 +799,7 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, const unsigned short max_iter = config->GetwallModel_MaxIter(); const su2double relax = config->GetwallModel_RelFac(); - const bool SSTm = config->GetSSTParsedOptions().modified; - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !SSTm; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); const auto* Node_Turb = (tkeNeeded) ? solver_container[TURB_SOL]->GetNodes() : nullptr; /*--- Compute the recovery factor From 317f5639781184a5ab19f794c955b5d3b687f535 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 20 Sep 2024 19:59:31 +0200 Subject: [PATCH 39/77] - Fixed tke integration in thermodynamic variables --- Common/include/CConfig.hpp | 2 +- .../numerics_simd/flow/convection/common.hpp | 7 +------ .../include/numerics_simd/flow/convection/roe.hpp | 8 ++------ SU2_CFD/include/numerics_simd/flow/variables.hpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 15 ++++++++++++--- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index deac682f12f7..7a46555c8a60 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1961,7 +1961,7 @@ class CConfig { * \brief Get the value of the non-dimensionalized freestream energy. * \return Non-dimensionalized freestream energy. */ - su2double GetEnergy_FreeStreamND(void) const { cout << "La chiedo non-dimensionale " << endl; return Energy_FreeStreamND; } + su2double GetEnergy_FreeStreamND(void) const { return Energy_FreeStreamND; } /*! * \brief Get the value of the non-dimensionalized freestream viscosity. diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index e3781a0c09d4..0ca03b9a9620 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -103,7 +103,6 @@ FORCEINLINE void musclEdgeLimited(Int iPoint, template FORCEINLINE CPair reconstructPrimitives(Int iEdge, Int iPoint, Int jPoint, bool muscl, LIMITER limiterType, - bool musclTurb, LIMITER limiterTypeTurb, const CPair& V1st, const VectorDbl& vector_ij, const VariableType& solution, @@ -113,9 +112,6 @@ FORCEINLINE CPair reconstructPrimitives(Int iEdge, Int iPoint, Int const auto& gradients = solution.GetGradient_Reconstruction(); const auto& limiters = solution.GetLimiter_Primitive(); - // const auto& gradientsTurb = turbSolution.GetGradient_Reconstruction(); - // const auto& limitersTurb = turbSolution.GetLimiter_Primitive(); - CPair V; for (size_t iVar = 0; iVar < ReconVarType::nVar; ++iVar) { @@ -153,10 +149,9 @@ FORCEINLINE CPair reconstructPrimitives(Int iEdge, Int iPoint, Int for (size_t iDim = 0; iDim < nDim; ++iDim) { v_squared += pow(R*V.j.velocity(iDim) + V.i.velocity(iDim), 2); } - Double tke = R*V1st.j.allTurb(0) + V1st.i.allTurb(0); /*--- Multiply enthalpy by R+1 since v^2 was not divided by (R+1)^2. * Note: a = sqrt((gamma-1) * (H - 0.5 * v^2)) ---*/ - const Double neg_sound_speed = enthalpy * (R+1) < (0.5 * v_squared - tke); + const Double neg_sound_speed = enthalpy * (R+1) < 0.5 * v_squared; /*--- Revert to first order if the state is non-physical. ---*/ Double bad_recon = fmax(neg_p_or_rho, neg_sound_speed); diff --git a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp index dabb24837cf4..c0dbc2fb8cad 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp @@ -60,9 +60,7 @@ class CRoeBase : public Base { const bool finestGrid; const bool dynamicGrid; const bool muscl; - const bool musclTurb; const LIMITER typeLimiter; - const LIMITER typeLimiterTurb; using Base::turbVars; @@ -77,9 +75,7 @@ class CRoeBase : public Base { finestGrid(iMesh == MESH_0), dynamicGrid(config.GetDynamic_Grid()), muscl(finestGrid && config.GetMUSCL_Flow()), - musclTurb(finestGrid && config.GetMUSCL_Turb()), - typeLimiter(config.GetKind_SlopeLimit_Flow()), - typeLimiterTurb(config.GetKind_SlopeLimit_Turb()) { + typeLimiter(config.GetKind_SlopeLimit_Flow()) { } public: @@ -132,7 +128,7 @@ class CRoeBase : public Base { } auto V = reconstructPrimitives >( - iEdge, iPoint, jPoint, muscl, typeLimiter, musclTurb, typeLimiterTurb, V1st, vector_ij, solution, tkeNeeded); + iEdge, iPoint, jPoint, muscl, typeLimiter, V1st, vector_ij, solution, tkeNeeded); /*--- Compute conservative variables. ---*/ diff --git a/SU2_CFD/include/numerics_simd/flow/variables.hpp b/SU2_CFD/include/numerics_simd/flow/variables.hpp index 44fd815911df..028b26de2fef 100644 --- a/SU2_CFD/include/numerics_simd/flow/variables.hpp +++ b/SU2_CFD/include/numerics_simd/flow/variables.hpp @@ -136,7 +136,7 @@ FORCEINLINE CRoeVariables roeAveragedVariables(Double gamma, } roeAvg.enthalpy = (R*V.j.enthalpy() + V.i.enthalpy()) * D; roeAvg.tke = (R*V.j.tke() + V.i.tke()) * D; - roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity) - roeAvg.tke)); + roeAvg.speedSound = sqrt((gamma-1) * (roeAvg.enthalpy - 0.5*squaredNorm(roeAvg.velocity))); roeAvg.projVel = dot(roeAvg.velocity, normal); return roeAvg; } diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 1a2b494eea12..79a25cc18dcb 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5494,7 +5494,9 @@ 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() == TURB_MODEL::SST); + bool tkeNeeded = ((config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified)); + CVariable* turbNodes = nullptr; + if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); su2double *Normal, *turboNormal, *UnitNormal, *FlowDirMix, FlowDirMixMag, *turboVelocity; Normal = new su2double[nDim]; @@ -5568,6 +5570,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Energy_i = nodes->GetEnergy(iPoint); StaticEnergy_i = Energy_i - 0.5*Velocity2_i; + if(tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -5613,11 +5616,12 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain turboVelocity[iDim] = sqrt(Velocity2_e)*Flow_Dir[iDim]; ComputeBackVelocity(turboVelocity,turboNormal, Velocity_e, config->GetMarker_All_TurbomachineryFlag(val_marker),config->GetKind_TurboMachinery(iZone)); StaticEnthalpy_e = Enthalpy_e - 0.5 * Velocity2_e; + if(tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_hs(StaticEnthalpy_e, Entropy_e); Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if (tkeNeeded) Energy_e += GetTke_Inf(); + if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case MIXING_IN: @@ -5648,10 +5652,12 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain ComputeBackVelocity(turboVelocity,turboNormal, Velocity_e, config->GetMarker_All_TurbomachineryFlag(val_marker),config->GetKind_TurboMachinery(iZone)); StaticEnthalpy_e = Enthalpy_e - 0.5 * Velocity2_e; + if(tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_hs(StaticEnthalpy_e, Entropy_e); Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; + if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); // if (tkeNeeded) Energy_e += GetTke_Inf(); break; @@ -5670,6 +5676,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case STATIC_PRESSURE: @@ -5687,6 +5694,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; @@ -5704,6 +5712,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; + if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; default: @@ -6915,7 +6924,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, const su2double Gas_Constant = config->GetGas_ConstantND(); const auto Kind_Inlet = config->GetKind_Inlet(); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); /*--- Loop over all the vertices on this boundary marker ---*/ diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index d8327f1297a7..e5a24427eaaf 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -287,7 +287,7 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c const TURB_MODEL turb_model = config->GetKind_Turb_Model(); const SPECIES_MODEL species_model = config->GetKind_Species_Model(); - bool tkeNeeded = (turb_model == TURB_MODEL::SST); + bool tkeNeeded = (turb_model == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); AD::StartNoSharedReading(); From d6af7021814671fdcda38c569d0ba08079136e15 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 2 Oct 2024 19:15:45 +0200 Subject: [PATCH 40/77] - Code improvements --- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index 8c3984b2f512..a8a7788353b9 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -557,7 +557,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; - const bool SSTm = config->GetSSTParsedOptions().modified; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -593,7 +593,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); - const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; + const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -877,7 +877,7 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; - const bool SSTm = config->GetSSTParsedOptions().modified; + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -923,7 +923,7 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); Mean_Cp = 0.5*(Cp_i + Cp_j); - const su2double Mean_turb_ke_ForStressTensor = !SSTm ? Mean_turb_ke : 0.0; + const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ From 8f97a162c09ba02d6bcd4e1bcbca07cd0b06e472 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Oct 2024 11:56:09 +0200 Subject: [PATCH 41/77] - minor changes --- Common/include/option_structure.hpp | 1 - SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index b8be96692b19..e7cab6e7bd37 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1002,7 +1002,6 @@ static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) MakePair("V1994m", SST_OPTIONS::V1994m) MakePair("V2003m", SST_OPTIONS::V2003m) - /// TODO: For now we do not support "unmodified" versions of SST. MakePair("V1994", SST_OPTIONS::V1994) MakePair("V2003", SST_OPTIONS::V2003) MakePair("SUSTAINING", SST_OPTIONS::SUST) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index be2615c5e2f4..c1478f2e2ab1 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -880,7 +880,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); - const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; + const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); /*--- Production limiter only for V2003, recompute for V1994. ---*/ diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 58fbee558b1c..59f2e2593b61 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -251,7 +251,7 @@ void CTurbSSTSolver::Postprocessing(CGeometry *geometry, CSolver **solver_contai const su2double kine = nodes->GetSolution(iPoint,0); const su2double omega = nodes->GetSolution(iPoint,1); - const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag; + const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag; const su2double muT = max(0.0, rho * a1 * kine / max(a1 * omega, eddy_visc_var * F2)); nodes->SetmuT(iPoint, muT); From a8a603e37a431bf6c09fb35139b3bf1f6abab959 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Oct 2024 12:39:10 +0200 Subject: [PATCH 42/77] - update externals --- SU2_CFD/include/numerics_simd/flow/convection/roe.hpp | 2 -- externals/codi | 2 +- externals/medi | 2 +- externals/opdi | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp index fdf11e7bec44..98be310304ce 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp @@ -105,8 +105,6 @@ class CRoeBase : public Base { const auto iPoint = geometry.edges->GetNode(iEdge,0); const auto jPoint = geometry.edges->GetNode(iEdge,1); - // cout << gatherVariables(iPoint, turbVars->GetSolution()) << endl; - /*--- Geometric properties. ---*/ const auto vector_ij = distanceVector(iPoint, jPoint, geometry.nodes->GetCoord()); diff --git a/externals/codi b/externals/codi index 762ba7698e3c..c6b039e5c9ed 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit 762ba7698e3ceaa1b17aa299421ddd418f00b823 +Subproject commit c6b039e5c9edb7675f90ffc725f9dd8e66571264 diff --git a/externals/medi b/externals/medi index 7d550831e0e2..ab3a7688f6d5 160000 --- a/externals/medi +++ b/externals/medi @@ -1 +1 @@ -Subproject commit 7d550831e0e233a85b9d9af9c181d7ecb2929946 +Subproject commit ab3a7688f6d518f8d940eb61a341d89f51922ba4 diff --git a/externals/opdi b/externals/opdi index a6b9655c240a..8c8979881725 160000 --- a/externals/opdi +++ b/externals/opdi @@ -1 +1 @@ -Subproject commit a6b9655c240af2a35454a61727e5bbbbaa3a425f +Subproject commit 8c89798817253abb017d857a0ae7f0520187645c From 340faa48533856fdcba6b897de5dd42ae4df61e4 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Oct 2024 18:55:46 +0200 Subject: [PATCH 43/77] - Fixed inlet BCs when new BCs are used --- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 991830a5f3bf..def030f630ca 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -645,8 +645,7 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); if (sstParsedOptions.newBC) { - su2double LDomain = 0.53; - Inlet_Vars[1] = 10 * sqrt(VelMag2) / LDomain; + Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; } else { Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); From c4f10fef4fbec3012d8cdb7f5813ef210f1a8cff Mon Sep 17 00:00:00 2001 From: rois1995 <43813346+rois1995@users.noreply.github.com> Date: Thu, 31 Oct 2024 09:53:29 +0100 Subject: [PATCH 44/77] Update Common/include/CConfig.hpp Co-authored-by: Nijso --- Common/include/CConfig.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index abb375fa9a46..ee47d4cacaf1 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -865,7 +865,7 @@ class CConfig { nMu_Temperature_Ref, /*!< \brief Number of species reference temperature for Sutherland model. */ nMu_S, /*!< \brief Number of species reference S for Sutherland model. */ nThermal_Conductivity_Constant,/*!< \brief Number of species constant thermal conductivity. */ - nPrandtl_Lam, /*!< \brief Prandtl number. */ + nPrandtl_Lam, /*!< \brief Number of species laminar Prandtl number. */ nPrandtl_Turb, /*!< \brief Number of species turbulent Prandtl number. */ nConstant_Lewis_Number; /*!< \brief Number of species Lewis Number. */ su2double Diffusivity_Constant; /*!< \brief Constant mass diffusivity for scalar transport. */ From f0e280ad6707f2460f0826b5666761e463f088f9 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 4 Mar 2025 11:59:29 +0100 Subject: [PATCH 45/77] changes to MLPCpp --- subprojects/MLPCpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/MLPCpp b/subprojects/MLPCpp index 6865a58b22f2..c19c53ea2b85 160000 --- a/subprojects/MLPCpp +++ b/subprojects/MLPCpp @@ -1 +1 @@ -Subproject commit 6865a58b22f21a92977839d9c93eae9522402f55 +Subproject commit c19c53ea2b85ccfb185f1c6c87044dc0b5bc7ae0 From 32a6eeae4b36fc118ed956f9dee378473783831b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 4 Mar 2025 12:06:50 +0100 Subject: [PATCH 46/77] - Fix output GetStrainMag bug --- SU2_CFD/src/output/CFlowOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index a4274758a622..2bfc5c64eb08 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1523,7 +1523,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con } SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); - SetVolumeOutputValue("STRAIN_MAG", iPoint, Node_Turb->GetStrainMag(iPoint)); + SetVolumeOutputValue("STRAIN_MAG", iPoint, Node_Flow->GetStrainMag(iPoint)); } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); From 89a559ad26e012e91b6639c7aab2ad2e5118d734 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 4 Mar 2025 12:10:02 +0100 Subject: [PATCH 47/77] - Try fixing output bug again --- SU2_CFD/src/output/CFlowOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 2bfc5c64eb08..6377a8f07c94 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1505,7 +1505,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con const unsigned long iPoint) { const auto* turb_solver = solver[TURB_SOL]; const auto* trans_solver = solver[TRANS_SOL]; - const auto* Node_Flow = solver[FLOW_SOL]->GetNodes(); + const auto* Node_Flow = su2staticcast_p(solver[FLOW_SOL]->GetNodes()); const auto* Node_Turb = (config->GetKind_Turb_Model() != TURB_MODEL::NONE) ? turb_solver->GetNodes() : nullptr; const auto* Node_Trans = (config->GetKind_Trans_Model() != TURB_TRANS_MODEL::NONE) ? trans_solver->GetNodes() : nullptr; const auto* Node_Geo = geometry->nodes; From d4ee84b9867a4a604f6ad3e54216832aa5614f8e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Tue, 4 Mar 2025 12:29:12 +0100 Subject: [PATCH 48/77] same fix --- SU2_CFD/include/variables/CFlowVariable.hpp | 4 ++-- SU2_CFD/include/variables/CVariable.hpp | 13 +++++++++++++ SU2_CFD/src/output/CFlowOutput.cpp | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/SU2_CFD/include/variables/CFlowVariable.hpp b/SU2_CFD/include/variables/CFlowVariable.hpp index d4d770f0ba8d..e705a18892f9 100644 --- a/SU2_CFD/include/variables/CFlowVariable.hpp +++ b/SU2_CFD/include/variables/CFlowVariable.hpp @@ -260,11 +260,11 @@ class CFlowVariable : public CVariable { * \param[in] iPoint - Point index. * \return Value of magnitude. */ - inline su2double GetStrainMag(unsigned long iPoint) const { return StrainMag(iPoint); } + inline su2double GetStrainMag(unsigned long iPoint) const final { return StrainMag(iPoint); } /*! * \brief Get the entire vector of the rate of strain magnitude. * \return Vector of magnitudes. */ - inline su2activevector& GetStrainMag() { return StrainMag; } + inline su2activevector& GetStrainMag() final { return StrainMag; } }; diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 4e56e86f44f9..6dda7f1f1013 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -1386,6 +1386,19 @@ class CVariable { */ inline virtual su2double *GetdTvedU(unsigned long iPoint) { return nullptr; } + /*! + * \brief Get the magnitude of rate of strain. + * \param[in] iPoint - Point index. + * \return Value of magnitude. + */ + inline virtual su2double GetStrainMag(unsigned long iPoint) const {} + + /*! + * \brief Get the entire vector of the rate of strain magnitude. + * \return Vector of magnitudes. + */ + inline virtual su2activevector& GetStrainMag() {} + /*! * \brief A virtual member. */ diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 6377a8f07c94..2bfc5c64eb08 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1505,7 +1505,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con const unsigned long iPoint) { const auto* turb_solver = solver[TURB_SOL]; const auto* trans_solver = solver[TRANS_SOL]; - const auto* Node_Flow = su2staticcast_p(solver[FLOW_SOL]->GetNodes()); + const auto* Node_Flow = solver[FLOW_SOL]->GetNodes(); const auto* Node_Turb = (config->GetKind_Turb_Model() != TURB_MODEL::NONE) ? turb_solver->GetNodes() : nullptr; const auto* Node_Trans = (config->GetKind_Trans_Model() != TURB_TRANS_MODEL::NONE) ? trans_solver->GetNodes() : nullptr; const auto* Node_Geo = geometry->nodes; From 5a40f57a6e6f99e11b432b45a7f83560f509f262 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 10 Apr 2025 12:53:17 +0200 Subject: [PATCH 49/77] - Added Shuzen and Hoffmann compressibility correction --- Common/include/option_structure.hpp | 39 +++++++++++-------- .../numerics/turbulent/turb_sources.hpp | 37 +++++++++++++++++- 2 files changed, 58 insertions(+), 18 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index b8be96692b19..56901bd7f151 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -982,21 +982,22 @@ inline TURB_FAMILY TurbModelFamily(TURB_MODEL model) { * \brief SST Options */ enum class SST_OPTIONS { - NONE, /*!< \brief No SST Turb model. */ - V1994, /*!< \brief 1994 Menter k-w SST model. */ - V2003, /*!< \brief 2003 Menter k-w SST model. */ - V1994m, /*!< \brief 1994m Menter k-w SST model. */ - V2003m, /*!< \brief 2003m Menter k-w SST model. */ - SUST, /*!< \brief Menter k-w SST model with sustaining terms. */ - V, /*!< \brief Menter k-w SST model with vorticity production terms. */ - KL, /*!< \brief Menter k-w SST model with Kato-Launder production terms. */ - UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */ - COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */ - COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ - DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ - FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ - PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ - NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ + NONE, /*!< \brief No SST Turb model. */ + V1994, /*!< \brief 1994 Menter k-w SST model. */ + V2003, /*!< \brief 2003 Menter k-w SST model. */ + V1994m, /*!< \brief 1994m Menter k-w SST model. */ + V2003m, /*!< \brief 2003m Menter k-w SST model. */ + SUST, /*!< \brief Menter k-w SST model with sustaining terms. */ + V, /*!< \brief Menter k-w SST model with vorticity production terms. */ + KL, /*!< \brief Menter k-w SST model with Kato-Launder production terms. */ + UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */ + COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */ + COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ + COMP_ShuzHoff, /*!< \brief Menter k-w SST model with Compressibility correction of Shuzen and Hoffmann. */ + DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ + FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ + PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ + NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1011,6 +1012,7 @@ static const MapType SST_Options_Map = { MakePair("UQ", SST_OPTIONS::UQ) MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox) MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) + MakePair("COMPRESSIBILITY-SH", SST_OPTIONS::COMP_ShuzHoff) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) MakePair("FULLPROD", SST_OPTIONS::FULLPROD) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) @@ -1028,6 +1030,7 @@ struct SST_ParsedOptions { bool modified = false; /*!< \brief Bool for modified (m) SST model. */ bool compWilcox = false; /*!< \brief Bool for compressibility correction of Wilcox. */ bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ + bool compSH = false; /*!< \brief Bool for compressibility correction of Shuzen and Hoffmann. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ bool fullProd = false; /*!< \brief Bool for full production term. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ @@ -1073,6 +1076,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool sst_uq = IsPresent(SST_OPTIONS::UQ); const bool sst_compWilcox = IsPresent(SST_OPTIONS::COMP_Wilcox); const bool sst_compSarkar = IsPresent(SST_OPTIONS::COMP_Sarkar); + const bool sst_compSH = IsPresent(SST_OPTIONS::COMP_ShuzHoff); const bool sst_dll = IsPresent(SST_OPTIONS::DLL); if (sst_1994 && sst_2003) { @@ -1095,12 +1099,14 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne } // Parse compressibility options - if (sst_compWilcox && sst_compSarkar) { + if (sst_compWilcox + sst_compSarkar + sst_compSH > 1) { SU2_MPI::Error("Please select only one compressibility correction (COMPRESSIBILITY-WILCOX or COMPRESSIBILITY-SARKAR).", CURRENT_FUNCTION); } else if (sst_compWilcox) { SSTParsedOptions.production = SST_OPTIONS::COMP_Wilcox; } else if (sst_compSarkar) { SSTParsedOptions.production = SST_OPTIONS::COMP_Sarkar; + } else if (sst_compSH) { + SSTParsedOptions.production = SST_OPTIONS::COMP_ShuzHoff; } SSTParsedOptions.sust = sst_sust; @@ -1108,6 +1114,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.uq = sst_uq; SSTParsedOptions.compWilcox = sst_compWilcox; SSTParsedOptions.compSarkar = sst_compSarkar; + SSTParsedOptions.compSH = sst_compSH; SSTParsedOptions.dll = sst_dll; SSTParsedOptions.fullProd = found_fullProd; diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index be2615c5e2f4..28793fd3932c 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -832,6 +832,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics { su2double P_Base = 0; su2double zetaFMt = 0.0; const su2double Mt = sqrt(2.0 * ScalarVar_i[0]) / V_i[idx.SoundSpeed()]; + su2double PDTerm = 0.0; + const su2double alpha1 = 1.0; /*--- Apply production term modifications ---*/ switch (sstParsedOptions.production) { @@ -863,6 +865,25 @@ class CSourcePieceWise_TurbSST final : public CNumerics { } break; + case SST_OPTIONS::COMP_ShuzHoff:{ + + // su2double MeanReynoldsStress[3][3]; + // ComputeStressTensor(nDim, MeanReynoldsStress, PrimVar_Grad_i + idx.Velocity(), Eddy_Viscosity_i, + // Density_i, ScalarVar_i[0]); + + // for (size_t iDim = 0.0; iDim < nDim; iDim++){ + // for (size_t jDim = 0.0; jDim < nDim; jDim++){ + // PDTerm += MeanReynoldsStress[iDim][jDim] * PrimVar_Grad_i[idx.Velocity() + iDim][jDim]; + // } + // } + // PDTerm = (-alpha2*PDTerm + alpha3 * epsilon * Density_i)*Mt*Mt; + + zetaFMt = alpha1 * Mt*Mt * (1-F1_i); + + P_Base = StrainMag_i; + } + break; + default: /*--- Base production term for SST-1994 and SST-2003 ---*/ P_Base = StrainMag_i; @@ -880,6 +901,14 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); + if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { + const su2double alpha2 = 0.4; + const su2double alpha3 = 0.2; + const su2double epsilon = beta_star * ScalarVar_i[1] * ScalarVar_i[0]; + + PDTerm = (-alpha2*pk + alpha3*Density_i*epsilon)*Mt*Mt; + } + const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); @@ -909,10 +938,14 @@ class CSourcePieceWise_TurbSST final : public CNumerics { pk += Dilatation_Sarkar; } + if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { + pk += (1-F1_i)*PDTerm; + } + /*--- Dissipation ---*/ su2double dk = beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0] * (1.0 + zetaFMt); - su2double dw = beta_blended * Density_i * ScalarVar_i[1] * ScalarVar_i[1] * (1.0 - 0.09/beta_blended * zetaFMt); + su2double dw = beta_blended * Density_i * ScalarVar_i[1] * ScalarVar_i[1] * (1.0 - beta_star/beta_blended * zetaFMt); /*--- LM model coupling with production and dissipation term for k transport equation---*/ if (config->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) { @@ -941,7 +974,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { ProdDistr[4] = PLim; /*--- Cross diffusion ---*/ - Residual[1] += (1.0 - F1_i) * CDkw_i * Volume; + Residual[1] += (1.0 - F1_i) * (CDkw_i - PDTerm / Eddy_Viscosity_i) * Volume; /*--- Contribution due to 2D axisymmetric formulation ---*/ From e8d4bf33eb048d6e3b83d7a7d7f66767018d8099 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 10 Apr 2025 15:53:54 +0200 Subject: [PATCH 50/77] - changed output for debug variables --- .../include/numerics/turbulent/turb_sources.hpp | 8 -------- SU2_CFD/src/output/CFlowOutput.cpp | 16 ++++++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index c075f862cf34..11c54862f2be 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -908,14 +908,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { PDTerm = (-alpha2*pk + alpha3*Density_i*epsilon)*Mt*Mt; } - if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { - const su2double alpha2 = 0.4; - const su2double alpha3 = 0.2; - const su2double epsilon = beta_star * ScalarVar_i[1] * ScalarVar_i[0]; - - PDTerm = (-alpha2*pk + alpha3*Density_i*epsilon)*Mt*Mt; - } - const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index d3292be750f3..49146b65df43 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1256,14 +1256,14 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ case TURB_FAMILY::KW: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); - AddVolumeOutput("PROD_TKE", "Prod_TKE", "SOLUTION", "Production of turbulent kinetic energy"); - AddVolumeOutput("DESTR_TKE", "Destr_TKE", "SOLUTION", "Destruction of turbulent kinetic energy"); - AddVolumeOutput("PROD_TKE_LIM", "Prod_TKE_Lim", "SOLUTION", "Check if production limiter has been used for TKE"); - AddVolumeOutput("PROD_W", "Prod_W", "SOLUTION", "Production of rate of dissipation"); - AddVolumeOutput("DESTR_W", "Destr_W", "SOLUTION", "Destruction of rate of dissipation"); - AddVolumeOutput("CDkw", "CDkw", "SOLUTION", "Cross-Diffusion term"); - AddVolumeOutput("F1", "F1", "SOLUTION", "F1 blending function"); - AddVolumeOutput("F2", "F2", "SOLUTION", "F2 blending function"); + AddVolumeOutput("PROD_TKE", "Prod_TKE", "DEBUG", "Production of turbulent kinetic energy"); + AddVolumeOutput("DESTR_TKE", "Destr_TKE", "DEBUG", "Destruction of turbulent kinetic energy"); + AddVolumeOutput("PROD_TKE_LIM", "Prod_TKE_Lim", "DEBUG", "Check if production limiter has been used for TKE"); + AddVolumeOutput("PROD_W", "Prod_W", "DEBUG", "Production of rate of dissipation"); + AddVolumeOutput("DESTR_W", "Destr_W", "DEBUG", "Destruction of rate of dissipation"); + AddVolumeOutput("CDkw", "CDkw", "DEBUG", "Cross-Diffusion term"); + AddVolumeOutput("F1", "F1", "DEBUG", "F1 blending function"); + AddVolumeOutput("F2", "F2", "DEBUG", "F2 blending function"); break; case TURB_FAMILY::NONE: From 4d2aba59d4f3269ea417c5083aff4aa9ecd975ce Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 10 Apr 2025 16:23:59 +0200 Subject: [PATCH 51/77] - Added term to jacobian of w --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 11c54862f2be..0858bbf75099 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -985,7 +985,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if (!sstParsedOptions.modified) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); + Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt) - (1-F1_i) * CDkw_i / (Density_i*ScalarVar_i[1]); } AD::SetPreaccOut(Residual, nVar); From e4ceb0e26a66dfaf9c8866f7a06620c782fe07b5 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Apr 2025 10:47:16 +0200 Subject: [PATCH 52/77] - Add neighbor wall distance as debug output --- SU2_CFD/src/output/CFlowCompOutput.cpp | 1 + SU2_CFD/src/output/CFlowOutput.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index d3c76e75a361..9cb227d27456 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -262,6 +262,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); + AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Non-dim. wall distance (Y-Plus)"); } SetVolumeOutputFieldsScalarPrimitive(config); diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 49146b65df43..3b1a03aa35f4 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1671,6 +1671,7 @@ void CFlowOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver SetVolumeOutputValue("SKIN_FRICTION-Z", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 2)); SetVolumeOutputValue("HEAT_FLUX", iPoint, solver[heat_sol]->GetHeatFlux(iMarker, iVertex)); SetVolumeOutputValue("Y_PLUS", iPoint, solver[FLOW_SOL]->GetYPlus(iMarker, iVertex)); + SetVolumeOutputValue("NEIGHBORDIST", iPoint, geometry->vertex[iMarker][iVertex]->GetNearestNeighborDistance()); } void CFlowOutput::AddAerodynamicCoefficients(const CConfig* config) { From 0d754655909163897266533aca473e416b121b77 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Apr 2025 10:48:52 +0200 Subject: [PATCH 53/77] - Remove Jacobian changes --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 0858bbf75099..11c54862f2be 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -985,7 +985,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if (!sstParsedOptions.modified) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt) - (1-F1_i) * CDkw_i / (Density_i*ScalarVar_i[1]); + Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); } AD::SetPreaccOut(Residual, nVar); From f159412507f54aba3fe71956e81846aa9bf4d301 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Apr 2025 11:26:23 +0200 Subject: [PATCH 54/77] - Add grad vel as output --- SU2_CFD/src/output/CFlowOutput.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 3b1a03aa35f4..ee0a1fdfc8df 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1497,6 +1497,17 @@ void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "MISC", "Wall distance value"); AddVolumeOutput("STRAIN_MAG", "Strain_Magnitude", "MISC", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_XX", "Grad_Vel_xx", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_XY", "Grad_Vel_xy", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_YX", "Grad_Vel_yx", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_YY", "Grad_Vel_yy", "DEBUG", "Strain magnitude value"); + if (nDim == 3) { + AddVolumeOutput("GRAD_VEL_XZ", "Grad_Vel_xz", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_YZ", "Grad_Vel_yz", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_ZX", "Grad_Vel_zx", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_ZY", "Grad_Vel_zy", "DEBUG", "Strain magnitude value"); + AddVolumeOutput("GRAD_VEL_ZZ", "Grad_Vel_zz", "DEBUG", "Strain magnitude value"); + } } // Timestep info @@ -1522,6 +1533,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("CFL", iPoint, Node_Flow->GetLocalCFL(iPoint)); if (config->GetViscous()) { + const auto VelGrad = Node_Flow->GetVelocityGradient(iPoint); if (nDim == 3){ SetVolumeOutputValue("VORTICITY_X", iPoint, Node_Flow->GetVorticity(iPoint)[0]); SetVolumeOutputValue("VORTICITY_Y", iPoint, Node_Flow->GetVorticity(iPoint)[1]); @@ -1529,9 +1541,20 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con } else { SetVolumeOutputValue("VORTICITY", iPoint, Node_Flow->GetVorticity(iPoint)[2]); } - SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); + SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(VelGrad)); SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); SetVolumeOutputValue("STRAIN_MAG", iPoint, Node_Flow->GetStrainMag(iPoint)); + SetVolumeOutputValue("GRAD_VEL_XX", iPoint, VelGrad(0,0)); + SetVolumeOutputValue("GRAD_VEL_XY", iPoint, VelGrad(0,1)); + SetVolumeOutputValue("GRAD_VEL_YX", iPoint, VelGrad(1,0)); + SetVolumeOutputValue("GRAD_VEL_YY", iPoint, VelGrad(1,1)); + if (nDim == 3) { + SetVolumeOutputValue("GRAD_VEL_XZ", iPoint, VelGrad(0,2)); + SetVolumeOutputValue("GRAD_VEL_YZ", iPoint, VelGrad(1,2)); + SetVolumeOutputValue("GRAD_VEL_ZX", iPoint, VelGrad(2,0)); + SetVolumeOutputValue("GRAD_VEL_ZY", iPoint, VelGrad(2,1)); + SetVolumeOutputValue("GRAD_VEL_ZZ", iPoint, VelGrad(2,2)); + } } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); From 939faa175352700c6c3da2d7448f8feca51edd96 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 11 Apr 2025 18:00:29 +0200 Subject: [PATCH 55/77] - add upper bound into BCs --- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 3fb6a68c6346..77d6e08cab2c 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -487,7 +487,7 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont su2double beta_1 = constants[4]; su2double solution[MAXNVAR]; solution[0] = 0.0; - solution[1] = 60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)); + solution[1] = min(60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)), upperlimit[1]); /*--- Set the solution values and zero the residual ---*/ nodes->SetSolution_Old(iPoint,solution); From 0b1cf18e6879d1f2cbe89d2d58358b063e9850cb Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 23 Sep 2026 17:16:46 +0200 Subject: [PATCH 56/77] Fix the build after merging develop - Remove the GetStrainMag overloads added to CVariable: one duplicated the one of develop, and both had no return statement (undefined behavior if called); CFlowVariable provides them for the flow variables. - Remove the using declaration of cp, no longer a member of the SIMD viscous flux base class. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- .../numerics_simd/flow/diffusion/viscous_fluxes.hpp | 1 - SU2_CFD/include/variables/CVariable.hpp | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 4bb10594250e..182420953d31 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -265,7 +265,6 @@ class CCompressibleViscousFlux : public CCompressibleViscousFluxBase Date: Wed, 23 Sep 2026 17:18:24 +0200 Subject: [PATCH 57/77] Reset the SST production and destruction outputs at every point ProdDistr was only set when the wall distance is larger than 1e-10, so the points on the wall kept the values of the previous point. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 88f15e76c4b8..818dafd42b45 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -890,6 +890,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { Residual[0] = 0.0; Residual[1] = 0.0; + for (auto& val : ProdDistr) val = 0.0; Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; Jacobian_i[1][0] = 0.0; From 5c650186fa3e4b240850762d08397c1a65a0ca30 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 23 Sep 2026 17:18:24 +0200 Subject: [PATCH 58/77] Divide the Suzen-Hoffmann omega correction by the kinematic eddy viscosity The pressure-dilatation term of the omega equation, -(1-F1) p'd'/nu_t, was divided by the dynamic eddy viscosity, which has the wrong units (a factor of density is missing). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 818dafd42b45..f25269f17fd2 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -1067,9 +1067,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Cross diffusion is included in the viscous fluxes, not this source term. ---*/ - /*--- Compressibility correction of the omega equation (Suzen and Hoffmann). ---*/ + /*--- Compressibility correction of the omega equation (Suzen and Hoffmann), divided by the kinematic eddy viscosity. ---*/ if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { - Residual[1] -= (1.0 - F1_i) * PDTerm / Eddy_Viscosity_i * Volume; + Residual[1] -= (1.0 - F1_i) * Density_i * PDTerm / Eddy_Viscosity_i * Volume; } /*--- Contribution due to 2D axisymmetric formulation ---*/ From 9aa1e8010bb566b084e50e81bf91d2a1c15e7dab Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 23 Sep 2026 17:20:05 +0200 Subject: [PATCH 59/77] Leave k out of the energy of the modified SST versions everywhere The modified (m) SST versions ignore k in the total energy, but the free stream energy of the incompressible, NEMO and FEM-DG solvers and the energy of the engine inflow/exhaust and actuator disk boundaries still added it. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/solvers/CEulerSolver.cpp | 8 ++++---- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e82e3454d36c..e565ce97cb92 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -7903,7 +7903,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() == TURB_MODEL::SST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); bool Engine_HalfModel = config->GetEngine_HalfModel(); @@ -8131,7 +8131,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() == TURB_MODEL::SST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); su2double DampingFactor = config->GetDamp_Engine_Exhaust(); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); @@ -8424,7 +8424,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() == TURB_MODEL::SST); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); bool ratio = (config->GetActDisk_Jump() == RATIO); su2double SecondaryFlow = config->GetSecondaryFlow_ActDisk(); @@ -8851,7 +8851,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() == TURB_MODEL::SST); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); unsigned short Kind_ActDisk = config->GetKind_ActDisk(); diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 2ad3fce6a152..0cf107146291 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -805,7 +805,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == MAIN_SOLVER::FEM_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::FEM_LES); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) )); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified))); 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 b37ce3f04a9d..f715382809b6 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -283,7 +283,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i bool viscous = config->GetViscous(); bool turbulent = ((config->GetKind_Solver() == MAIN_SOLVER::INC_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_INC_RANS)); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified))); bool energy = config->GetEnergy_Equation(); bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); bool density_init = (config->GetKind_InitOption_Inc() == INIT_OPTION_INC::DENSITY_INIT); diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 7da1af45687a..3d766eeb67a2 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1016,7 +1016,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short const bool viscous = config->GetViscous(); const bool gravity = config->GetGravityForce(); const bool turbulent = false; - const bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST)); + const bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified)); const bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); /*--- The dimensional viscosity is needed to determine the free-stream conditions. From db13b53fa2ca3a0b6c89caa3998343af52ae3606 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Wed, 23 Sep 2026 17:22:23 +0200 Subject: [PATCH 60/77] Register the NEIGHBORDIST output for all the flow solvers LoadSurfaceData, shared by the compressible, incompressible and NEMO outputs, sets NEIGHBORDIST, but it was only registered by the compressible one, so incompressible and NEMO runs with viscous walls stopped with "Cannot find output field with name NEIGHBORDIST". Also fix its description. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/src/output/CFlowCompOutput.cpp | 2 +- SU2_CFD/src/output/CFlowIncOutput.cpp | 1 + SU2_CFD/src/output/CNEMOCompOutput.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index df7c56b3234f..66b48c534106 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -262,7 +262,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); - AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Non-dim. wall distance (Y-Plus)"); + AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } SetVolumeOutputFieldsScalarPrimitive(config); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index 674df02946ba..cbaf585d91f9 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -365,6 +365,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); + AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index c28736296bea..907a145e7800 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -261,6 +261,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("THERMAL_CONDUCTIVITY_VE", "Thermal_Conductivity_ve", "PRIMITIVE", "Vibrational-electronic thermal conductivity"); AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); + AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } From ae4c9fb6d330f0b5764bc2607e95c205bb61c6c4 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 24 Sep 2026 13:01:25 +0200 Subject: [PATCH 61/77] Add options for the ambient values of the SST sustaining terms SST_SUST_TKE_AMB and SST_SUST_OMEGA_AMB set the ambient k and omega of the sustaining terms, which are also the free-stream values. By default (<= 0) they are those of Spalart and Rumsey (2007) used by the NASA TMR SST-sust, k = 1e-6 U^2 and omega = 5 U / L with L = REYNOLDS_LENGTH, as before. The values were hard-coded in the four flow solvers and in the SST solver; they are now computed by CConfig, non-dimensionalized with the reference velocity and omega, and the SST solver takes the free-stream values set by the flow solver. The default results are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/CConfig.hpp | 21 +++++++++++++++++++++ Common/src/CConfig.cpp | 4 ++++ SU2_CFD/src/solvers/CEulerSolver.cpp | 15 ++++++--------- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 11 +++++------ SU2_CFD/src/solvers/CIncEulerSolver.cpp | 11 +++++------ SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 11 +++++------ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 6 +++--- config_template.cfg | 7 +++++++ 8 files changed, 56 insertions(+), 30 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index c964f5067a99..7c438c8960b8 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1282,6 +1282,8 @@ class CConfig { SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */ su2double prodLimConst; su2double LDomain; + su2double sstSustTkeAmb; /*!< \brief Ambient k of the SST sustaining terms (dimensional), <= 0 for the default. */ + su2double sstSustOmegaAmb; /*!< \brief Ambient omega of the SST sustaining terms (dimensional), <= 0 for the default. */ SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */ LM_ParsedOptions lmParsedOptions; /*!< \brief Additional parameters for the LM transition model. */ su2double uq_delta_b; /*!< \brief Parameter used to perturb eigenvalues of Reynolds Stress Matrix */ @@ -10366,6 +10368,25 @@ class CConfig { su2double GetProdLimConst() const { return prodLimConst; } su2double GetLDomain() const { return LDomain; } + /*! + * \brief Ambient (free-stream) k of the SST sustaining terms, dimensional. + * \note Default of Spalart and Rumsey (AIAA J 45(10), 2007), as in the NASA TMR SST-sust: 1e-6 U^2. + * \param[in] velMag - Free-stream velocity magnitude (dimensional). + */ + su2double GetSSTSust_TkeAmb(su2double velMag) const { + return sstSustTkeAmb > 0.0 ? sstSustTkeAmb : 1e-6 * velMag * velMag; + } + + /*! + * \brief Ambient (free-stream) omega of the SST sustaining terms, dimensional. + * \note Default of Spalart and Rumsey (AIAA J 45(10), 2007), as in the NASA TMR SST-sust: 5 U / L, with L the + * defining length of the problem, taken as REYNOLDS_LENGTH. + * \param[in] velMag - Free-stream velocity magnitude (dimensional). + */ + su2double GetSSTSust_OmegaAmb(su2double velMag) const { + return sstSustOmegaAmb > 0.0 ? sstSustOmegaAmb : 5.0 * velMag / Length_Reynolds; + } + /*! * \brief Get parsed SA option data structure. * \return SA option data structure. diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index ea2d2ee92970..4839818efc3c 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1204,6 +1204,10 @@ void CConfig::SetConfig_Options() { addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); addDoubleOption("L_DOMAIN", LDomain, 1.0); + /*!\brief SST_SUST_TKE_AMB \n DESCRIPTION: Ambient k of the SST sustaining terms (m^2/s^2), <= 0 for 1e-6 U^2. \ingroup Config*/ + addDoubleOption("SST_SUST_TKE_AMB", sstSustTkeAmb, 0.0); + /*!\brief SST_SUST_OMEGA_AMB \n DESCRIPTION: Ambient omega of the SST sustaining terms (1/s), <= 0 for 5 U / REYNOLDS_LENGTH. \ingroup Config*/ + addDoubleOption("SST_SUST_OMEGA_AMB", sstSustOmegaAmb, 0.0); /*!\brief KIND_INCOMP_SYSTEM \n DESCRIPTION: Incomp type \n OPTIONS: see \link Incomp_Map \endlink DEFAULT: NONE \ingroup Config*/ addEnumOption("KIND_INCOMP_SYSTEM", Kind_Incomp_System, Incomp_Map, INCOMP_SYSTEM::DENSITY_BASED); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index e565ce97cb92..b4e741a16d2c 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1017,9 +1017,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes su2double Omega_Freestream = 10 * ModVel_FreeStream / config->GetLDomain(); Tke_FreeStream = Omega_Freestream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; } else if (config->GetSSTParsedOptions().sust) { - su2double Omega_Freestream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); - /*--- not good ---*/ - Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + Tke_FreeStream = config->GetSSTSust_TkeAmb(ModVel_FreeStream); } /*-- Compute the freestream energy. ---*/ @@ -1114,12 +1112,11 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; } else if (config->GetSSTParsedOptions().sust) { - Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); - Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s - - /*--- not good ---*/ - Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ - Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + /*--- Ambient values of the sustaining terms, also used as free-stream values. ---*/ + Omega_FreeStream = config->GetSSTSust_OmegaAmb(ModVel_FreeStream); + Omega_FreeStreamND = Omega_FreeStream / Omega_Ref; + Tke_FreeStream = config->GetSSTSust_TkeAmb(ModVel_FreeStream); + Tke_FreeStreamND = Tke_FreeStream / pow(Velocity_Ref, 2); } config->SetTke_FreeStream(Tke_FreeStream); diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 0cf107146291..6e9de2805d14 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1088,12 +1088,11 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; } else if (config->GetSSTParsedOptions().sust) { - Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); - Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s - - /*--- not good ---*/ - Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ - Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + /*--- Ambient values of the sustaining terms, also used as free-stream values. ---*/ + Omega_FreeStream = config->GetSSTSust_OmegaAmb(ModVel_FreeStream); + Omega_FreeStreamND = Omega_FreeStream / Omega_Ref; + Tke_FreeStream = config->GetSSTSust_TkeAmb(ModVel_FreeStream); + Tke_FreeStreamND = Tke_FreeStream / pow(Velocity_Ref, 2); } config->SetTke_FreeStream(Tke_FreeStream); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index f715382809b6..2ac51de3564e 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -506,12 +506,11 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; } else if (config->GetSSTParsedOptions().sust) { - Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); - Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s - - /*--- not good ---*/ - Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ - Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + /*--- Ambient values of the sustaining terms, also used as free-stream values. ---*/ + Omega_FreeStream = config->GetSSTSust_OmegaAmb(ModVel_FreeStream); + Omega_FreeStreamND = Omega_FreeStream / Omega_Ref; + Tke_FreeStream = config->GetSSTSust_TkeAmb(ModVel_FreeStream); + Tke_FreeStreamND = Tke_FreeStream / pow(Velocity_Ref, 2); } config->SetTke_FreeStream(Tke_FreeStream); diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 3d766eeb67a2..b2768daef78c 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1204,12 +1204,11 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; } else if (config->GetSSTParsedOptions().sust) { - Omega_FreeStream = 5*ModVel_FreeStream/config->GetLength_Reynolds(); - Omega_FreeStreamND = 5*ModVel_FreeStreamND / config->GetLength_Reynolds(); // Should it be non-dimensionalized by what? Dimensions are 1/s - - /*--- not good ---*/ - Tke_FreeStream = pow(10.0, -6) * ModVel_FreeStream*ModVel_FreeStream; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ - Tke_FreeStreamND = pow(10.0, -6) * ModVel_FreeStreamND*ModVel_FreeStreamND; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + /*--- Ambient values of the sustaining terms, also used as free-stream values. ---*/ + Omega_FreeStream = config->GetSSTSust_OmegaAmb(ModVel_FreeStream); + Omega_FreeStreamND = Omega_FreeStream / Omega_Ref; + Tke_FreeStream = config->GetSSTSust_TkeAmb(ModVel_FreeStream); + Tke_FreeStreamND = Tke_FreeStream / pow(Velocity_Ref, 2); } config->SetTke_FreeStream(Tke_FreeStream); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 4830955c8b58..313598009d81 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -130,9 +130,9 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, const CSolv omega_Inf = 10 * sqrt(VelMag2) / config->GetLDomain(); kine_Inf = omega_Inf*(muLamInf*viscRatio)/rhoInf; } else if (sstParsedOptions.sust) { - omega_Inf = 5*sqrt(VelMag2)/config->GetLength_Reynolds(); - /*--- not good ---*/ - kine_Inf = pow(10.0, -6) * VelMag2; /*--- Equals a freestream turbulence intensity of 0.08165%. This should be the default one, not hard-coding the freestream TI. ---*/ + /*--- Ambient values of the sustaining terms, set by the flow solver (SST_SUST_TKE_AMB, SST_SUST_OMEGA_AMB). ---*/ + kine_Inf = config->GetTke_FreeStreamND(); + omega_Inf = config->GetOmega_FreeStreamND(); } Solution_Inf[0] = kine_Inf; diff --git a/config_template.cfg b/config_template.cfg index 7fefa98aa6f4..07697ba4fc05 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -24,6 +24,13 @@ KIND_TURB_MODEL= NONE % Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT) SST_OPTIONS= NONE % +% Ambient values of the SST sustaining terms (SST_OPTIONS= SUSTAINING), also used as free-stream +% values of k (m^2/s^2) and omega (1/s). Values <= 0 select the defaults of Spalart and Rumsey +% (AIAA J 45(10), 2007) used by the NASA TMR SST-sust: k = 1e-6 U^2 (Tu = 0.08165%) and +% omega = 5 U / L, with U the free-stream velocity and L = REYNOLDS_LENGTH. +SST_SUST_TKE_AMB= 0.0 +SST_SUST_OMEGA_AMB= 0.0 +% % Specify versions/corrections of the SA model (NEGATIVE, EDWARDS, WITHFT2, QCR2000, COMPRESSIBILITY, ROTATION, BCM, EXPERIMENTAL) SA_OPTIONS= NONE % From d1fe4b2893fab52248976571eed8cef7f6d44b8a Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 24 Sep 2026 13:02:20 +0200 Subject: [PATCH 62/77] Avoid 0/0 in the omega production of SST-1994 where mu_t = 0 The production of omega, gamma/nu_t * P, was computed as P / mu_t, which is 0/0 where the eddy viscosity vanishes (e.g. k = 0). Expand P / mu_t term by term: the strain (or vorticity) squared, the full-production divergence term and -2/3 rho k div(u) / mu_t, which is bounded because mu_t is proportional to k. The modified (m) versions are again identical to develop. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index f25269f17fd2..947c90bca26f 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -1007,7 +1007,12 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Production limiter only for V2003, recompute for V1994. ---*/ su2double pw; if (sstParsedOptions.version == SST_OPTIONS::V1994) { - pw = alfa_blended * Density_i * P / Eddy_Viscosity_i; + /*--- gamma/nu_t * P, with P/mu_t expanded so that it is defined where mu_t = 0. The last term, + * rho k / mu_t, is bounded since mu_t is proportional to k (it vanishes with k). ---*/ + su2double P_over_muT = pow(P_Base, 2); + if (sstParsedOptions.fullProd) P_over_muT -= diverg * diverg * 2.0/3.0; + if (!sstParsedOptions.modified) P_over_muT -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0 / max(Eddy_Viscosity_i, EPS); + pw = alfa_blended * Density_i * P_over_muT; } else { pw = (alfa_blended * Density_i / Eddy_Viscosity_i) * pk; } From fd1bbbd7a689264c41094d8c60d385d65f83f079 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 24 Sep 2026 13:02:20 +0200 Subject: [PATCH 63/77] Keep the k Jacobian of the non-modified SST versions diagonally dominant The derivative of -2/3 rho k div(u) was added to the diagonal of the k equation, which reduces it in compression (div(u) < 0) and can make the implicit system unstable. Add it only where it increases the diagonal; the residual is unchanged, so the converged solution is the same. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics/turbulent/turb_sources.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 947c90bca26f..eb3caac769ea 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -1084,7 +1084,9 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Implicit part ---*/ Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume * (1.0 + zetaFMt); - if (!sstParsedOptions.modified) Jacobian_i[0][0] -= diverg * Volume*2.0/3.0; + /*--- Derivative of -2/3 rho k div(u), only where it adds to the diagonal (compression is left out + * of the Jacobian but kept in the residual, so that the linear system does not lose diagonal dominance). ---*/ + if (!sstParsedOptions.modified) Jacobian_i[0][0] -= max(diverg, 0.0) * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); From 16b44bc141bd68409bb7031eb89b4cae14de3649 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Thu, 24 Sep 2026 16:04:12 +0200 Subject: [PATCH 64/77] Remove the Suzen-Hoffmann compressibility correction from this branch This PR only aligns SST with the NASA TMR. The COMPRESSIBILITY-SH option and its terms are moved to the local branch feature_SST_SuzenHoffmann (based on develop). Also set the codi and medi submodules back to those of develop. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/option_structure.hpp | 9 +---- .../numerics/turbulent/turb_sources.hpp | 38 ------------------- externals/codi | 2 +- externals/medi | 2 +- 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 103146bf277a..cd549ab27db7 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1112,7 +1112,6 @@ enum class SST_OPTIONS { UQ, /*!< \brief Menter k-w SST model with uncertainty quantification modifications. */ COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */ COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ - COMP_ShuzHoff, /*!< \brief Menter k-w SST model with Compressibility correction of Shuzen and Hoffmann. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ @@ -1130,7 +1129,6 @@ static const MapType SST_Options_Map = { MakePair("UQ", SST_OPTIONS::UQ) MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox) MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) - MakePair("COMPRESSIBILITY-SH", SST_OPTIONS::COMP_ShuzHoff) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) MakePair("FULLPROD", SST_OPTIONS::FULLPROD) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) @@ -1148,7 +1146,6 @@ struct SST_ParsedOptions { bool modified = false; /*!< \brief Bool for modified (m) SST model. */ bool compWilcox = false; /*!< \brief Bool for compressibility correction of Wilcox. */ bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ - bool compSH = false; /*!< \brief Bool for compressibility correction of Shuzen and Hoffmann. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ bool fullProd = false; /*!< \brief Bool for full production term. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ @@ -1194,7 +1191,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool sst_uq = IsPresent(SST_OPTIONS::UQ); const bool sst_compWilcox = IsPresent(SST_OPTIONS::COMP_Wilcox); const bool sst_compSarkar = IsPresent(SST_OPTIONS::COMP_Sarkar); - const bool sst_compSH = IsPresent(SST_OPTIONS::COMP_ShuzHoff); const bool sst_dll = IsPresent(SST_OPTIONS::DLL); if (sst_1994 && sst_2003) { @@ -1217,14 +1213,12 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne } // Parse compressibility options - if (sst_compWilcox + sst_compSarkar + sst_compSH > 1) { + if (sst_compWilcox && sst_compSarkar) { SU2_MPI::Error("Please select only one compressibility correction (COMPRESSIBILITY-WILCOX or COMPRESSIBILITY-SARKAR).", CURRENT_FUNCTION); } else if (sst_compWilcox) { SSTParsedOptions.production = SST_OPTIONS::COMP_Wilcox; } else if (sst_compSarkar) { SSTParsedOptions.production = SST_OPTIONS::COMP_Sarkar; - } else if (sst_compSH) { - SSTParsedOptions.production = SST_OPTIONS::COMP_ShuzHoff; } SSTParsedOptions.sust = sst_sust; @@ -1232,7 +1226,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.uq = sst_uq; SSTParsedOptions.compWilcox = sst_compWilcox; SSTParsedOptions.compSarkar = sst_compSarkar; - SSTParsedOptions.compSH = sst_compSH; SSTParsedOptions.dll = sst_dll; SSTParsedOptions.fullProd = found_fullProd; diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index eb3caac769ea..594414d46ec5 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -924,8 +924,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { su2double P_Base = 0; su2double zetaFMt = 0.0; const su2double Mt = sqrt(2.0 * ScalarVar_i[0]) / V_i[idx.SoundSpeed()]; - su2double PDTerm = 0.0; - const su2double alpha1 = 1.0; /*--- Apply production term modifications ---*/ switch (sstParsedOptions.production) { @@ -957,25 +955,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { } break; - case SST_OPTIONS::COMP_ShuzHoff:{ - - // su2double MeanReynoldsStress[3][3]; - // ComputeStressTensor(nDim, MeanReynoldsStress, PrimVar_Grad_i + idx.Velocity(), Eddy_Viscosity_i, - // Density_i, ScalarVar_i[0]); - - // for (size_t iDim = 0.0; iDim < nDim; iDim++){ - // for (size_t jDim = 0.0; jDim < nDim; jDim++){ - // PDTerm += MeanReynoldsStress[iDim][jDim] * PrimVar_Grad_i[idx.Velocity() + iDim][jDim]; - // } - // } - // PDTerm = (-alpha2*PDTerm + alpha3 * epsilon * Density_i)*Mt*Mt; - - zetaFMt = alpha1 * Mt*Mt * (1-F1_i); - - P_Base = StrainMag_i; - } - break; - default: /*--- Base production term for SST-1994 and SST-2003 ---*/ P_Base = StrainMag_i; @@ -993,14 +972,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); - if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { - const su2double alpha2 = 0.4; - const su2double alpha3 = 0.2; - const su2double epsilon = beta_star * ScalarVar_i[1] * ScalarVar_i[0]; - - PDTerm = (-alpha2*pk + alpha3*Density_i*epsilon)*Mt*Mt; - } - const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; const su2double zeta = max(ScalarVar_i[1], eddy_visc_var * F2_i / a1); @@ -1035,10 +1006,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { pk += Dilatation_Sarkar; } - if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { - pk += (1-F1_i)*PDTerm; - } - /*--- Dissipation ---*/ su2double dk = beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0] * (1.0 + zetaFMt); @@ -1072,11 +1039,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Cross diffusion is included in the viscous fluxes, not this source term. ---*/ - /*--- Compressibility correction of the omega equation (Suzen and Hoffmann), divided by the kinematic eddy viscosity. ---*/ - if (sstParsedOptions.production == SST_OPTIONS::COMP_ShuzHoff) { - Residual[1] -= (1.0 - F1_i) * Density_i * PDTerm / Eddy_Viscosity_i * Volume; - } - /*--- Contribution due to 2D axisymmetric formulation ---*/ if (axisymmetric) ResidualAxisymmetricConvectionDiffusion(alfa_blended, zeta); diff --git a/externals/codi b/externals/codi index c6b039e5c9ed..a0725b2bfd17 160000 --- a/externals/codi +++ b/externals/codi @@ -1 +1 @@ -Subproject commit c6b039e5c9edb7675f90ffc725f9dd8e66571264 +Subproject commit a0725b2bfd172e741a07f96b041a5ddf88d441d7 diff --git a/externals/medi b/externals/medi index ab3a7688f6d5..0cfaf96e7a31 160000 --- a/externals/medi +++ b/externals/medi @@ -1 +1 @@ -Subproject commit ab3a7688f6d518f8d940eb61a341d89f51922ba4 +Subproject commit 0cfaf96e7a31a5a8941b97f84198da03a8f8bd7a From b6f221eaf3b8404dd3684252cccd2618dbc431ab Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:35:16 +0200 Subject: [PATCH 65/77] Keep k in the energy of all SST versions and impose it consistently at boundaries The NASA TMR "m" versions only ignore 2/3 rho k in tau_ij and approximate P = mu_t S^2; they say nothing about k in the energy, which develop includes for all SST versions. Restore that (free streams, boundary conditions and primitive variables of all flow solvers), keeping the 2/3 rho k term in tau_ij only for the standard versions. The k added to the energy of a boundary state is now the one the turbulence boundary condition imposes: - far field: free-stream k at inflow, interior k at outflow; - inlet and supersonic inlet: the k of the turbulence inlet (profile, or intensity and viscosity ratio of the marker) for the same inlet state, computed by CTurbSSTSolver::GetInletTke, shared with its BC_Inlet; - Riemann: the inlet k of the exterior state at inflows, the interior k at STATIC_PRESSURE; k is also removed from the static energy of the interior and boundary states (it was not); - outlet: interior k (the turbulence outlet is Neumann). Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/solvers/CSolver.hpp | 12 +++ SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 23 ++++++ SU2_CFD/src/solvers/CEulerSolver.cpp | 84 +++++++++++---------- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNSSolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 83 ++++++++++---------- 9 files changed, 130 insertions(+), 82 deletions(-) diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 7a7b6c726021..3e3b9e237dbe 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -3249,6 +3249,18 @@ class CSolver { */ inline virtual su2double GetTke_Inf(void) const { return 0; } + /*! + * \brief A virtual member. + * \param[in] flowSolver - Flow solver, for the fluid model. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Inlet marker. + * \param[in] val_vertex - Vertex of the marker. + * \param[in] V_inlet - Primitive variables of the inlet state (temperature, velocity, pressure and density). + * \return Turbulent kinetic energy imposed by the turbulence inlet boundary condition for this state. + */ + inline virtual su2double GetInletTke(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, + unsigned long val_vertex, const su2double* V_inlet) const { return 0; } + /*! * \brief A virtual member. * \return Value of the turbulent frequency. diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 2729f014c129..dc0a15173574 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -184,6 +184,29 @@ class CTurbSSTSolver final : public CTurbSolver { CConfig *config, unsigned short val_marker) override; + /*! + * \brief Turbulence variables imposed at an inlet for a given inlet state (profile from file, or intensity + * and viscosity ratio of the marker). + * \param[in] flowSolver - Flow solver, for the fluid model. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Inlet marker. + * \param[in] val_vertex - Vertex of the marker. + * \param[in] V_inlet - Primitive variables of the inlet state. + * \param[out] Inlet_Vars - k and omega. + */ + void ComputeInletTurbVars(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, + unsigned long val_vertex, const su2double* V_inlet, su2double* Inlet_Vars) const; + + /*! + * \brief Turbulent kinetic energy imposed by the inlet boundary condition, see ComputeInletTurbVars. + */ + su2double GetInletTke(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, + unsigned long val_vertex, const su2double* V_inlet) const override { + su2double Inlet_Vars[MAXNVAR]; + ComputeInletTurbVars(flowSolver, config, val_marker, val_vertex, V_inlet, Inlet_Vars); + return Inlet_Vars[0]; + } + /*! * \brief Impose the inlet boundary condition. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index b4e741a16d2c..ea7b89adba41 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -65,7 +65,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST); int Unst_RestartIter = 0; unsigned long iPoint, iMarker, counter_local = 0, counter_global = 0; @@ -330,7 +330,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, Solution[0] = Density_Inf; for (iDim = 0; iDim < nDim; iDim++) Solution[iDim+1] = Velocity_Inf[iDim]*Density_Inf; - Solution[nDim+1] = Energy_Inf*Density_Inf; + Solution[nDim+1] = Energy_Inf*Density_Inf; nodes->SetSolution(iPoint,Solution); nodes->SetSolution_Old(iPoint,Solution); counter_local++; @@ -836,8 +836,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes bool viscous = config->GetViscous(); bool gravity = config->GetGravityForce(); bool turbulent = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); - bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); - // bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST); + bool tkeNeeded = (turbulent && config->GetKind_Turb_Model() == TURB_MODEL::SST); bool free_stream_temp = (config->GetKind_FreeStreamOption() == FREESTREAM_OPTION::TEMPERATURE_FS); bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); bool aeroelastic = config->GetAeroelastic_Simulation(); @@ -5044,7 +5043,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -5196,8 +5195,8 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, } Pressure = Density*SoundSpeed*SoundSpeed/Gamma; Energy = Pressure/(Gamma_Minus_One*Density) + 0.5*Velocity2; - // if (tkeNeeded) Energy += GetTke_Inf(); - if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); + /*--- k of the state the turbulence boundary condition imposes: free stream at inflow, interior at outflow. ---*/ + if (tkeNeeded) Energy += (Qn_Infty > 0.0) ? turbNodes->GetSolution(iPoint,0) : GetTke_Inf(); /*--- Store new primitive state for computing the flux. ---*/ @@ -5291,7 +5290,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const bool viscous = config->GetViscous(), implicit = config->GetKind_TimeIntScheme() == EULER_IMPLICIT, gravity = config->GetGravityForce(), - tkeNeeded = config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified), + tkeNeeded = config->GetKind_Turb_Model() == TURB_MODEL::SST, ideal_gas = config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS; CVariable* turbNodes = nullptr; @@ -5396,8 +5395,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - // if (tkeNeeded) Energy_e += GetTke_Inf(); - if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case STATIC_SUPERSONIC_INFLOW_PT: @@ -5423,8 +5420,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - // if (tkeNeeded) Energy_e += GetTke_Inf(); - if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case STATIC_SUPERSONIC_INFLOW_PD: @@ -5451,8 +5446,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - // if (tkeNeeded) Energy_e += GetTke_Inf(); - if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; case DENSITY_VELOCITY: @@ -5485,7 +5478,6 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Velocity2_e = GeometryToolbox::SquaredNorm(nDim, Velocity_e); Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; - if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint,0); break; default: @@ -5493,6 +5485,24 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, break; } + /*--- k of the exterior state, the one the turbulence boundary condition imposes: the inlet value (from the + exterior state) at inflows, the interior value at outlets. It is also used for the boundary state. ---*/ + su2double Tke_e = 0.0; + if (tkeNeeded) { + if (config->GetKind_Data_Riemann(Marker_Tag) == STATIC_PRESSURE) { + Tke_e = turbNodes->GetSolution(iPoint, 0); + } else { + GetFluidModel()->SetTDState_rhoe(Density_e, Energy_e - 0.5*Velocity2_e); + su2double V_e[32] = {0.0}; + V_e[prim_idx.Temperature()] = GetFluidModel()->GetTemperature(); + V_e[prim_idx.Pressure()] = GetFluidModel()->GetPressure(); + V_e[prim_idx.Density()] = Density_e; + for (auto iDim = 0u; iDim < nDim; iDim++) V_e[prim_idx.Velocity() + iDim] = Velocity_e[iDim]; + Tke_e = solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_e); + } + Energy_e += Tke_e; + } + /*--- Compute P (matrix of right eigenvectors) ---*/ conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor); @@ -5546,7 +5556,7 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, const auto Velocity2_b = GeometryToolbox::SquaredNorm(nDim, Velocity_b); const su2double Energy_b = u_b[nVar-1]/Density_b; - const su2double StaticEnergy_b = Energy_b - 0.5*Velocity2_b; + const su2double StaticEnergy_b = Energy_b - 0.5*Velocity2_b - Tke_e; GetFluidModel()->SetTDState_rhoe(Density_b, StaticEnergy_b); /*--- Store number of Newton iterations at BC ---*/ @@ -5743,7 +5753,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() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); const bool ideal_gas = config->GetKind_FluidModel() == STANDARD_AIR || config->GetKind_FluidModel() == IDEAL_GAS; CVariable* turbNodes = nullptr; @@ -5923,7 +5933,6 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); - // if (tkeNeeded) Energy_e += GetTke_Inf(); break; @@ -7216,7 +7225,7 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, const su2double Gas_Constant = config->GetGas_ConstantND(); const auto Kind_Inlet_Cfg = config->GetKind_Inlet(); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); /*--- Loop over all the vertices on this boundary marker ---*/ @@ -7377,7 +7386,6 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); /*--- Primitive variables, using the derived quantities ---*/ @@ -7388,6 +7396,9 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; + /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + break; } /*--- Mass flow has been specified at the inlet. ---*/ @@ -7449,7 +7460,6 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Energy for the fictitious inlet state ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Vel_Mag*Vel_Mag; - if (tkeNeeded) Energy += GetTke_Inf(); /*--- Primitive variables, using the derived quantities ---*/ Temperature = Pressure / ( Gas_Constant * Density); @@ -7460,6 +7470,9 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; + /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + break; } default: @@ -7506,7 +7519,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); CVariable* turbNodes = nullptr; if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); @@ -7592,7 +7605,6 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = P_Exit/(Density*Gamma_Minus_One) + 0.5*Velocity2; - // if (tkeNeeded) Energy += GetTke_Inf(); if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Conservative variables, using the derived quantities ---*/ @@ -7677,14 +7689,11 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con const su2double Gas_Constant = config->GetGas_ConstantND(); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); - CVariable* turbNodes = nullptr; - if (tkeNeeded) turbNodes = solver_container[TURB_SOL]->GetNodes(); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); /*--- Supersonic inlet flow: there are no outgoing characteristics, so all flow variables can be imposed at the inlet. ---*/ - /*--- Loop over all the vertices on this boundary marker ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -7707,15 +7716,9 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con /*--- Compute the energy from the specified state. ---*/ const su2double Velocity2 = GeometryToolbox::SquaredNorm(int(MAXNDIM), Velocity); - su2double Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; - if (tkeNeeded) { - const su2double* Turb_Properties = config->GetInlet_TurbVal(Marker_Tag); - const su2double Intensity = Turb_Properties[0]; - const su2double Tke = 3.0 / 2.0 * (Velocity2 * pow(Intensity, 2)); - Energy += Tke; - } + const su2double Energy = Pressure / (Density * Gamma_Minus_One) + 0.5 * Velocity2; - /*--- Allocate the value at the inlet ---*/ + /*--- Primitive variables, using the derived quantities. ---*/ auto* V_inlet = GetCharacPrimVar(val_marker, iVertex); V_inlet[prim_idx.Temperature()] = Temperature; @@ -7725,6 +7728,9 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con for (unsigned short iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+prim_idx.Velocity()] = Velocity[iDim]; + /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ + if (tkeNeeded) V_inlet[prim_idx.Enthalpy()] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + /*--- Current solution at this boundary node. ---*/ const auto* V_domain = nodes->GetPrimitive(iPoint); @@ -7900,7 +7906,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); bool Engine_HalfModel = config->GetEngine_HalfModel(); @@ -8128,7 +8134,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); su2double DampingFactor = config->GetDamp_Engine_Exhaust(); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); @@ -8421,7 +8427,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); bool ratio = (config->GetActDisk_Jump() == RATIO); su2double SecondaryFlow = config->GetSecondaryFlow_ActDisk(); @@ -8848,7 +8854,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() == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); unsigned short Kind_ActDisk = config->GetKind_ActDisk(); diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 6e9de2805d14..8b6fe5e5c19c 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -805,7 +805,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == MAIN_SOLVER::FEM_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::FEM_LES); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST))); 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 2ac51de3564e..0ae4cdf54092 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -283,7 +283,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i bool viscous = config->GetViscous(); bool turbulent = ((config->GetKind_Solver() == MAIN_SOLVER::INC_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_INC_RANS)); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST))); bool energy = config->GetEnergy_Equation(); bool boussinesq = (config->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); bool density_init = (config->GetKind_InitOption_Inc() == INIT_OPTION_INC::DENSITY_INIT); diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index f480058530a3..ec1b78935e1f 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -371,7 +371,7 @@ unsigned long CIncNSSolver::SetPrimitive_Variables(CSolver **solver_container, c const TURB_MODEL turb_model = config->GetKind_Turb_Model(); const SPECIES_MODEL species_model = config->GetKind_Species_Model(); - bool tkeNeeded = (turb_model == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + bool tkeNeeded = (turb_model == TURB_MODEL::SST); AD::StartNoSharedReading(); diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index b2768daef78c..15c909e31b62 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1016,7 +1016,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short const bool viscous = config->GetViscous(); const bool gravity = config->GetGravityForce(); const bool turbulent = false; - const bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified)); + const bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST)); const bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); /*--- The dimensional viscosity is needed to determine the free-stream conditions. diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index b72a0ac7fa21..e3d952faf285 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -137,7 +137,7 @@ unsigned long CNSSolver::SetPrimitive_Variables(CSolver **solver_container, cons unsigned long nonPhysicalPoints = 0; const TURB_MODEL turb_model = config->GetKind_Turb_Model(); - const bool tkeNeeded = (turb_model == TURB_MODEL::SST && !(config->GetSSTParsedOptions().modified)); + const bool tkeNeeded = (turb_model == TURB_MODEL::SST); AD::StartNoSharedReading(); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 313598009d81..dd0d621acd57 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -619,6 +619,49 @@ void CTurbSSTSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_co } +void CTurbSSTSolver::ComputeInletTurbVars(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, + unsigned long val_vertex, const su2double* V_inlet, + su2double* Inlet_Vars) const { + if (config->GetInlet_Profile_From_File()) { + /*--- Non-dimensionalize Inlet_TurbVars if Inlet-Files are used. ---*/ + Inlet_Vars[0] = Inlet_TurbVars[val_marker][val_vertex][0] / pow(config->GetVelocity_Ref(), 2); + Inlet_Vars[1] = Inlet_TurbVars[val_marker][val_vertex][1] * config->GetViscosity_Ref() / + (config->GetDensity_Ref() * pow(config->GetVelocity_Ref(), 2)); + } else { + /*--- Obtain fluid model for computing the kine and omega to impose at the inlet boundary. ---*/ + CFluidModel* FluidModel = flowSolver->GetFluidModel(); + + /*--- Obtain flow velocity vector at inlet boundary node ---*/ + + const su2double* Velocity_Inlet = &V_inlet[prim_idx.Velocity()]; + su2double Density_Inlet; + if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { + Density_Inlet = V_inlet[prim_idx.Density()]; + FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet); + } else { + const su2double* Scalar_Inlet = nullptr; + if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); + } + FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet); + Density_Inlet = FluidModel->GetDensity(); + } + const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity(); + const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker)); + const su2double Intensity = Turb_Properties[0]; + const su2double viscRatio = Turb_Properties[1]; + const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); + + if (sstParsedOptions.newBC) { + Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); + Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; + } else { + Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); + Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); + } + } +} + void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics*, CNumerics*, CConfig *config, unsigned short val_marker) { SU2_ZONE_SCOPED @@ -630,44 +673,8 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C const auto* V_inlet = flowSolver->GetCharacPrimVar(val_marker, iVertex); su2double Inlet_Vars[MAXNVAR]; - if (config->GetInlet_Profile_From_File()) { - /*--- Non-dimensionalize Inlet_TurbVars if Inlet-Files are used. ---*/ - Inlet_Vars[0] = Inlet_TurbVars[val_marker][iVertex][0] / pow(config->GetVelocity_Ref(), 2); - Inlet_Vars[1] = Inlet_TurbVars[val_marker][iVertex][1] * config->GetViscosity_Ref() / - (config->GetDensity_Ref() * pow(config->GetVelocity_Ref(), 2)); - } else { - /*--- Obtain fluid model for computing the kine and omega to impose at the inlet boundary. ---*/ - CFluidModel* FluidModel = flowSolver->GetFluidModel(); - - /*--- Obtain flow velocity vector at inlet boundary node ---*/ - - const su2double* Velocity_Inlet = &V_inlet[prim_idx.Velocity()]; - su2double Density_Inlet; - if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { - Density_Inlet = V_inlet[prim_idx.Density()]; - FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet); - } else { - const su2double* Scalar_Inlet = nullptr; - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); - } - FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet); - Density_Inlet = FluidModel->GetDensity(); - } - const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity(); - const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker)); - const su2double Intensity = Turb_Properties[0]; - const su2double viscRatio = Turb_Properties[1]; - const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); - - if (sstParsedOptions.newBC) { - Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); - Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; - } else { - Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); - Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); - } - } + ComputeInletTurbVars(flowSolver, config, val_marker, iVertex, V_inlet, Inlet_Vars); + for (auto iVar = 0u; iVar < nVar; iVar++) ghostNodes->SetSolution(iVertex, iVar, Inlet_Vars[iVar]); SetGhostPrimitives(iVertex, V_inlet); From 9ebd5e6b5d454047f7ad7d8b9f40bf02a8294552 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:35:16 +0200 Subject: [PATCH 66/77] Use the exact production for the standard SST versions and remove FULLPROD NASA TMR: the standard SST uses the exact production P = tau_ij du_i/dx_j = mu_t (S^2 - 2/3 div(u)^2) - 2/3 rho k div(u); the "m" versions use P = mu_t S^2. With the vorticity and Kato-Launder forms only the -2/3 rho k div(u) term is added. The FULLPROD option, which selected the -2/3 mu_t div(u)^2 term, is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/option_structure.hpp | 9 ++------- .../include/numerics/turbulent/turb_sources.hpp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index cd549ab27db7..e42433d4dc93 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1113,9 +1113,8 @@ enum class SST_OPTIONS { COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */ COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ - FULLPROD, /*!< \brief Menter k-w SST model with full production term. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ - NEWBC, /*!< \brief Menter k-w SST model with new boundary conditions. */ + NEWBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1130,7 +1129,6 @@ static const MapType SST_Options_Map = { MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox) MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) - MakePair("FULLPROD", SST_OPTIONS::FULLPROD) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) }; @@ -1147,9 +1145,8 @@ struct SST_ParsedOptions { bool compWilcox = false; /*!< \brief Bool for compressibility correction of Wilcox. */ bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ - bool fullProd = false; /*!< \brief Bool for full production term. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ - bool newBC = false; /*!< \brief Bool for new boundary conditions. */ + bool newBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (NEWBC). */ }; /*! @@ -1167,7 +1164,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne return std::find(SST_Options, sst_options_end, option) != sst_options_end; }; - const bool found_fullProd = IsPresent(SST_OPTIONS::FULLPROD); const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); @@ -1228,7 +1224,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.compSarkar = sst_compSarkar; SSTParsedOptions.dll = sst_dll; - SSTParsedOptions.fullProd = found_fullProd; SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; return SSTParsedOptions; diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 594414d46ec5..edf93d3c34f9 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -964,9 +964,16 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Production limiter. ---*/ const su2double prod_limit = prod_lim_const * beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0]; + /*--- The modified (m) versions use P = mu_t S^2 (NASA TMR). The standard versions use the exact production, + P = tau_ij du_i/dx_j = mu_t (S^2 - 2/3 div(u)^2) - 2/3 rho k div(u); with the vorticity (V) and Kato-Launder (KL) + forms of mu_t S^2 only the -2/3 rho k div(u) term is added. ---*/ + const bool strainProduction = sstParsedOptions.production != SST_OPTIONS::V && + sstParsedOptions.production != SST_OPTIONS::KL; su2double P = Eddy_Viscosity_i * pow(P_Base, 2); - if (sstParsedOptions.fullProd) P -= Eddy_Viscosity_i * diverg*diverg * 2.0/3.0; - if (!sstParsedOptions.modified) P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; + if (!sstParsedOptions.modified) { + if (strainProduction) P -= Eddy_Viscosity_i * diverg * diverg * 2.0/3.0; + P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; + } su2double PLim = 0.0; if ( P > prod_limit ) PLim = 1.0; @@ -981,8 +988,10 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- gamma/nu_t * P, with P/mu_t expanded so that it is defined where mu_t = 0. The last term, * rho k / mu_t, is bounded since mu_t is proportional to k (it vanishes with k). ---*/ su2double P_over_muT = pow(P_Base, 2); - if (sstParsedOptions.fullProd) P_over_muT -= diverg * diverg * 2.0/3.0; - if (!sstParsedOptions.modified) P_over_muT -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0 / max(Eddy_Viscosity_i, EPS); + if (!sstParsedOptions.modified) { + if (strainProduction) P_over_muT -= diverg * diverg * 2.0/3.0; + P_over_muT -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0 / max(Eddy_Viscosity_i, EPS); + } pw = alfa_blended * Density_i * P_over_muT; } else { pw = (alfa_blended * Density_i / Eddy_Viscosity_i) * pk; From 8c18e3e59cb6759af0be862edc852ee6f4515d05 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:35:17 +0200 Subject: [PATCH 67/77] Document the SST versions, NEWBC and the TMR far-field viscosity ratio Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/src/CConfig.cpp | 1 + config_template.cfg | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 4839818efc3c..7e2153acd25b 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1203,6 +1203,7 @@ void CConfig::SetConfig_Options() { addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); + /*!\brief L_DOMAIN \n DESCRIPTION: Approximate length of the computational domain, for the far-field omega of SST_OPTIONS= NEWBC (NASA TMR). \ingroup Config*/ addDoubleOption("L_DOMAIN", LDomain, 1.0); /*!\brief SST_SUST_TKE_AMB \n DESCRIPTION: Ambient k of the SST sustaining terms (m^2/s^2), <= 0 for 1e-6 U^2. \ingroup Config*/ addDoubleOption("SST_SUST_TKE_AMB", sstSustTkeAmb, 0.0); diff --git a/config_template.cfg b/config_template.cfg index 07697ba4fc05..141c5be375a9 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -21,9 +21,16 @@ SOLVER= EULER % Specify turbulence model (NONE, SA, SST) KIND_TURB_MODEL= NONE % -% Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT) +% Specify versions/corrections of the SST model (V2003m, V1994m, V2003, V1994, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, +% COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT, NEWBC). The "m" versions ignore 2/3 rho k in the +% stress tensor and use P = mu_t S^2 (NASA TMR); V2003 and V1994 are the standard versions with the exact production. +% NEWBC sets the far-field (and inlet) omega as in the original reference of the NASA TMR, omega = 10 U / L_DOMAIN, +% with k from FREESTREAM_TURB2LAMVISCRATIO (or the inlet viscosity ratio). SST_OPTIONS= NONE % +% Approximate length of the computational domain for NEWBC (m) +L_DOMAIN= 1.0 +% % Ambient values of the SST sustaining terms (SST_OPTIONS= SUSTAINING), also used as free-stream % values of k (m^2/s^2) and omega (1/s). Values <= 0 select the defaults of Spalart and Rumsey % (AIAA J 45(10), 2007) used by the NASA TMR SST-sust: k = 1e-6 U^2 (Tu = 0.08165%) and @@ -284,7 +291,8 @@ TURB_FIXED_VALUES= NO % normalized far-field velocity is less than this parameter. TURB_FIXED_VALUES_DOMAIN= -1.0 % -% Free-stream ratio between turbulent and laminar viscosity +% Free-stream ratio between turbulent and laminar viscosity. For the SST model the NASA TMR (original reference +% of Menter) recommends far-field values giving mu_t/mu between 1e-5 and 1e-2. FREESTREAM_TURB2LAMVISCRATIO= 10.0 % % Compressible flow non-dimensionalization (DIMENSIONAL, FREESTREAM_PRESS_EQ_ONE, From 8e376353adf969450102fd3b5380588bab963d7f Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:35:59 +0200 Subject: [PATCH 68/77] Make the clipping of the omega wall value an SST option, off by default SST_OPTIONS= WALL_OMEGA_LIMIT clips Menter's wall value 60 nu / (beta_1 d^2) to the upper limit of omega used in the rest of the domain. By default the wall value is not clipped, as in develop. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/option_structure.hpp | 5 +++++ SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 8 +++++++- config_template.cfg | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index e42433d4dc93..942ab464c79d 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1114,6 +1114,7 @@ enum class SST_OPTIONS { COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ + WALL_OMEGA_LIMIT, /*!< \brief Clip the omega wall value to the upper limit of omega. */ NEWBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */ }; static const MapType SST_Options_Map = { @@ -1131,6 +1132,7 @@ static const MapType SST_Options_Map = { MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) + MakePair("WALL_OMEGA_LIMIT", SST_OPTIONS::WALL_OMEGA_LIMIT) }; /*! @@ -1146,6 +1148,7 @@ struct SST_ParsedOptions { bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ + bool wallOmegaLimit = false; /*!< \brief Bool for clipping the omega wall value (WALL_OMEGA_LIMIT). */ bool newBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (NEWBC). */ }; @@ -1166,6 +1169,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); + const bool found_wallOmegaLimit = IsPresent(SST_OPTIONS::WALL_OMEGA_LIMIT); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); const bool found_2003 = IsPresent(SST_OPTIONS::V2003); @@ -1226,6 +1230,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; + SSTParsedOptions.wallOmegaLimit = found_wallOmegaLimit; return SSTParsedOptions; } diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index dd0d621acd57..0e4feb93bdaa 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -531,7 +531,13 @@ void CTurbSSTSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_cont su2double beta_1 = constants[4]; solution[0] = 0.0; - solution[1] = min(60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)), upperlimit[1]); + solution[1] = 60.0*laminar_viscosity/(density*beta_1*pow(wall_dist,2)); + + /*--- Menter's wall value, omega_w = 10 * 6 nu / (beta_1 d^2) (AIAA J 32(8), 1994), grows as 1/d^2 with the + distance d of the first point off the wall, so on very fine wall grids it can exceed the upper limit used + to clip omega in the rest of the domain (upperlimit[1]). SST_OPTIONS= WALL_OMEGA_LIMIT clips it to the + same limit, so that the wall and the interior values stay consistent. Off by default. ---*/ + if (sstParsedOptions.wallOmegaLimit) solution[1] = min(solution[1], upperlimit[1]); } /*--- Set the solution values and zero the residual ---*/ diff --git a/config_template.cfg b/config_template.cfg index 141c5be375a9..869274c53f96 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -22,10 +22,11 @@ SOLVER= EULER KIND_TURB_MODEL= NONE % % Specify versions/corrections of the SST model (V2003m, V1994m, V2003, V1994, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, -% COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT, NEWBC). The "m" versions ignore 2/3 rho k in the +% COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT, NEWBC, WALL_OMEGA_LIMIT). The "m" versions ignore 2/3 rho k in the % stress tensor and use P = mu_t S^2 (NASA TMR); V2003 and V1994 are the standard versions with the exact production. % NEWBC sets the far-field (and inlet) omega as in the original reference of the NASA TMR, omega = 10 U / L_DOMAIN, % with k from FREESTREAM_TURB2LAMVISCRATIO (or the inlet viscosity ratio). +% WALL_OMEGA_LIMIT clips the omega wall value 60 nu / (beta_1 d^2) to the upper limit of omega (off by default). SST_OPTIONS= NONE % % Approximate length of the computational domain for NEWBC (m) From 3fccc07f57e35bf359eef045abd1b413dd968893 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:42:41 +0200 Subject: [PATCH 69/77] Move the changes that are not alignment with the NASA TMR out of this branch This PR only aligns SST with the NASA TMR. Moved to the local branch feature_SST_extras: the user-defined production limiter (PRODLIM, PROD_LIM_CONST), the debug volume outputs (production and destruction of k and omega, production limiter flag, CDkw, F1, F2, wall distance, strain magnitude, velocity gradient, NEIGHBORDIST) and their storage, and unused code in CFlowTractionInterface. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/CConfig.hpp | 2 - Common/include/option_structure.hpp | 5 -- Common/src/CConfig.cpp | 3 -- SU2_CFD/include/numerics/CNumerics.hpp | 4 -- .../numerics/turbulent/turb_sources.hpp | 15 ------ SU2_CFD/include/variables/CTurbVariable.hpp | 39 ---------------- SU2_CFD/include/variables/CVariable.hpp | 19 +++----- .../interfaces/fsi/CFlowTractionInterface.cpp | 9 +--- SU2_CFD/src/output/CFlowCompOutput.cpp | 1 - SU2_CFD/src/output/CFlowIncOutput.cpp | 1 - SU2_CFD/src/output/CFlowOutput.cpp | 46 +------------------ SU2_CFD/src/output/CNEMOCompOutput.cpp | 1 - SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 9 ---- SU2_CFD/src/variables/CTurbVariable.cpp | 8 ---- 14 files changed, 8 insertions(+), 154 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index 7c438c8960b8..a96318f50fbd 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -1280,7 +1280,6 @@ class CConfig { nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */ bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */ SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */ - su2double prodLimConst; su2double LDomain; su2double sstSustTkeAmb; /*!< \brief Ambient k of the SST sustaining terms (dimensional), <= 0 for the default. */ su2double sstSustOmegaAmb; /*!< \brief Ambient omega of the SST sustaining terms (dimensional), <= 0 for the default. */ @@ -10365,7 +10364,6 @@ class CConfig { */ SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; } - su2double GetProdLimConst() const { return prodLimConst; } su2double GetLDomain() const { return LDomain; } /*! diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 942ab464c79d..787cb78e2200 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1113,7 +1113,6 @@ enum class SST_OPTIONS { COMP_Wilcox, /*!< \brief Menter k-w SST model with Compressibility correction of Wilcox. */ COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ - PRODLIM, /*!< \brief Menter k-w SST model with user-defined production limiter constant. */ WALL_OMEGA_LIMIT, /*!< \brief Clip the omega wall value to the upper limit of omega. */ NEWBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */ }; @@ -1130,7 +1129,6 @@ static const MapType SST_Options_Map = { MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox) MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) - MakePair("PRODLIM", SST_OPTIONS::PRODLIM) MakePair("NEWBC", SST_OPTIONS::NEWBC) MakePair("WALL_OMEGA_LIMIT", SST_OPTIONS::WALL_OMEGA_LIMIT) }; @@ -1147,7 +1145,6 @@ struct SST_ParsedOptions { bool compWilcox = false; /*!< \brief Bool for compressibility correction of Wilcox. */ bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ - bool prodLim = false; /*!< \brief Bool for user-defined production limiter constant. */ bool wallOmegaLimit = false; /*!< \brief Bool for clipping the omega wall value (WALL_OMEGA_LIMIT). */ bool newBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (NEWBC). */ }; @@ -1167,7 +1164,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne return std::find(SST_Options, sst_options_end, option) != sst_options_end; }; - const bool found_prodLim = IsPresent(SST_OPTIONS::PRODLIM); const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); const bool found_wallOmegaLimit = IsPresent(SST_OPTIONS::WALL_OMEGA_LIMIT); @@ -1228,7 +1224,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.compSarkar = sst_compSarkar; SSTParsedOptions.dll = sst_dll; - SSTParsedOptions.prodLim = found_prodLim; SSTParsedOptions.newBC = found_newBC; SSTParsedOptions.wallOmegaLimit = found_wallOmegaLimit; return SSTParsedOptions; diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index 7e2153acd25b..9f84520ecb7e 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1202,7 +1202,6 @@ void CConfig::SetConfig_Options() { /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); - addDoubleOption("PROD_LIM_CONST", prodLimConst, 20.0); /*!\brief L_DOMAIN \n DESCRIPTION: Approximate length of the computational domain, for the far-field omega of SST_OPTIONS= NEWBC (NASA TMR). \ingroup Config*/ addDoubleOption("L_DOMAIN", LDomain, 1.0); /*!\brief SST_SUST_TKE_AMB \n DESCRIPTION: Ambient k of the SST sustaining terms (m^2/s^2), <= 0 for 1e-6 U^2. \ingroup Config*/ @@ -6701,8 +6700,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "." << endl; - if (sstParsedOptions.prodLim) cout << "Changing the value of the TKE production limiter constant to " << prodLimConst << endl; - break; } switch (Kind_Trans_Model) { diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index 9f444d670b98..ec511a3fa1db 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -206,8 +206,6 @@ class CNumerics { bool bounded_scalar = false; /*!< \brief Flag for bounded scalar problem */ - su2double ProdDistr[5]; - public: /*! * \brief Return type used in some "ComputeResidual" overloads to give a @@ -1864,8 +1862,6 @@ class CNumerics { * \return is_bounded_scalar : scalar solver uses bounded scalar convective transport */ inline bool GetBoundedScalar() const { return bounded_scalar;} - - inline su2double GetProdDest(int index) const {return ProdDistr[index];} }; /*! diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index edf93d3c34f9..da3e75240bfd 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -750,8 +750,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Ambient values for SST-SUST. ---*/ const su2double kAmb, omegaAmb; - su2double Pk, Dk, Pw, Dw; - su2double F1_i, F2_i, CDkw_i; su2double Residual[2]; su2double* Jacobian_i[2]; @@ -890,7 +888,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { Residual[0] = 0.0; Residual[1] = 0.0; - for (auto& val : ProdDistr) val = 0.0; Jacobian_i[0][0] = 0.0; Jacobian_i[0][1] = 0.0; Jacobian_i[1][0] = 0.0; @@ -975,8 +972,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { P -= Density_i * ScalarVar_i[0] * diverg * 2.0/3.0; } - su2double PLim = 0.0; - if ( P > prod_limit ) PLim = 1.0; su2double pk = max(0.0, min(P, prod_limit)); const su2double eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; @@ -1027,25 +1022,15 @@ class CSourcePieceWise_TurbSST final : public CNumerics { } /*--- Add the production terms to the residuals. ---*/ - Pk = pk; - Pw = pw; Residual[0] += pk * Volume; Residual[1] += pw * Volume; /*--- Add the dissipation terms to the residuals.---*/ - Dk = dk; - Dw = dw; Residual[0] -= dk * Volume; Residual[1] -= dw * Volume; - ProdDistr[0] = Pk; - ProdDistr[1] = Dk; - ProdDistr[2] = Pw; - ProdDistr[3] = Dw; - ProdDistr[4] = PLim; - /*--- Cross diffusion is included in the viscous fluxes, not this source term. ---*/ /*--- Contribution due to 2D axisymmetric formulation ---*/ diff --git a/SU2_CFD/include/variables/CTurbVariable.hpp b/SU2_CFD/include/variables/CTurbVariable.hpp index 4b584964aba7..dc6858002849 100644 --- a/SU2_CFD/include/variables/CTurbVariable.hpp +++ b/SU2_CFD/include/variables/CTurbVariable.hpp @@ -43,11 +43,6 @@ class CTurbVariable : public CScalarVariable { static constexpr size_t MAXNVAR = 4; VectorType turb_index; VectorType intermittency; /*!< \brief Value of the intermittency for the trans. model. */ - VectorType Pk; - VectorType Pw; - VectorType Dk; - VectorType Dw; - VectorType PkLim; /*! * \brief Constructor of the class. @@ -105,40 +100,6 @@ class CTurbVariable : public CScalarVariable { */ inline void SetIntermittency(unsigned long iPoint, su2double val_intermittency) final { intermittency(iPoint) = val_intermittency; } - /*! - * \brief Set the intermittency of the transition model. - * \param[in] iPoint - Point index. - * \param[in] val_intermittency - New value of the intermittency. - */ - inline void SetProdDestr(unsigned long iPoint, su2double* val_ProdDestr) final { - Pk(iPoint) = val_ProdDestr[0]; - Dk(iPoint) = val_ProdDestr[1]; - Pw(iPoint) = val_ProdDestr[2]; - Dw(iPoint) = val_ProdDestr[3]; - PkLim(iPoint) = val_ProdDestr[4]; - } - - /*! - * \brief Set the intermittency of the transition model. - * \param[in] iPoint - Point index. - * \param[in] val_intermittency - New value of the intermittency. - */ - inline su2double GetProdTKE(unsigned long iPoint) const final { - return Pk(iPoint); - } - inline su2double GetDestrTKE(unsigned long iPoint) const final { - return Dk(iPoint); - } - inline su2double GetProdW(unsigned long iPoint) const final { - return Pw(iPoint); - } - inline su2double GetDestrW(unsigned long iPoint) const final { - return Dw(iPoint); - } - inline su2double GetPkLim(unsigned long iPoint) const final { - return PkLim(iPoint); - } - /*! * \brief Set the Diffusion Coefficients of TKE and omega equations. * \param[in] iPoint - Point index. diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index 6b15b55f4ca4..739a1af75fa5 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -1656,12 +1656,6 @@ class CVariable { */ inline virtual su2double GetGradient_Primitive(unsigned long iPoint, unsigned long iVar, unsigned long iDim) const { return 0.0; } - /*! - * \brief A virtual member. - * \return Value of the primitive variables gradient. - */ - inline virtual CMatrixView GetGradient_Primitive(unsigned long iPoint, unsigned long iVar=0) { return nullptr; } - /*! * \brief Get the primitive variable gradients for all points. * \return Reference to primitive variable gradient. @@ -1683,6 +1677,12 @@ class CVariable { */ inline virtual su2double GetLimiter_Primitive(unsigned long iPoint, unsigned long iVar) const { return 0.0; } + /*! + * \brief A virtual member. + * \return Value of the primitive variables gradient. + */ + inline virtual CMatrixView GetGradient_Primitive(unsigned long iPoint, unsigned long iVar=0) { return nullptr; } + /*! * \brief A virtual member. * \return Value of the primitive variables gradient. @@ -2424,13 +2424,6 @@ class CVariable { inline virtual const su2double *GetScalarSources(unsigned long iPoint) const { return nullptr; } inline virtual const su2double *GetScalarLookups(unsigned long iPoint) const { return nullptr; } - inline virtual void SetProdDestr(unsigned long iPoint, su2double* val_ProdDestr) { } - inline virtual su2double GetProdTKE(unsigned long iPoint) const { return 0.0; } - inline virtual su2double GetDestrTKE(unsigned long iPoint) const { return 0.0; } - inline virtual su2double GetProdW(unsigned long iPoint) const { return 0.0; } - inline virtual su2double GetDestrW(unsigned long iPoint) const { return 0.0; } - inline virtual su2double GetPkLim(unsigned long iPoint) const { return 0.0; } - inline virtual su2double GetMomCoeff(unsigned long iPoint) { return 0.0; } inline virtual void SetMomCoeff(unsigned long iPoint, su2double val_Mom_Coeff) { } diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index 4d91f2b60289..6a78e0d5713e 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -180,8 +180,6 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry unsigned long Vertex_Flow, unsigned long Point_Struct) { const auto Point_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNode(); - TURB_FAMILY TurbFamily = TurbModelFamily(flow_config->GetKind_Turb_Model()); - const bool SSTm = flow_config->GetSSTParsedOptions().modified; // Get the normal at the vertex: this normal goes inside the fluid domain. const su2double* Normal_Flow = flow_geometry->vertex[Marker_Flow][Vertex_Flow]->GetNormal(); @@ -208,12 +206,7 @@ void CFlowTractionInterface::GetDonor_Variable(CSolver *flow_solution, CGeometry su2double Viscosity = flow_nodes->GetLaminarViscosity(Point_Flow); su2double tau[3][3]; - su2double TKE = 0.0, Density = 0.0; - if (TurbFamily == TURB_FAMILY::KW && !SSTm) { - TKE = 0.0; // Have to find out how to pass the tke value if needed - Density = 0.0; - } - CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity, Density, TKE); + CNumerics::ComputeStressTensor(nVar, tau, flow_nodes->GetVelocityGradient(Point_Flow), Viscosity); for (auto iVar = 0u; iVar < nVar; iVar++) { for (auto jVar = 0u; jVar < nVar; jVar++) { // Viscous component in the tn vector --> Units of force (non-dimensional). diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 66b48c534106..fd9bd5356b03 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -262,7 +262,6 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); - AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } SetVolumeOutputFieldsScalarPrimitive(config); diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index cbaf585d91f9..674df02946ba 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -365,7 +365,6 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); - AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 905dc85b7638..2ac2693b9952 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1369,14 +1369,6 @@ void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ case TURB_FAMILY::KW: AddVolumeOutput("TKE", "Turb_Kin_Energy", "SOLUTION", "Turbulent kinetic energy"); AddVolumeOutput("DISSIPATION", "Omega", "SOLUTION", "Rate of dissipation"); - AddVolumeOutput("PROD_TKE", "Prod_TKE", "DEBUG", "Production of turbulent kinetic energy"); - AddVolumeOutput("DESTR_TKE", "Destr_TKE", "DEBUG", "Destruction of turbulent kinetic energy"); - AddVolumeOutput("PROD_TKE_LIM", "Prod_TKE_Lim", "DEBUG", "Check if production limiter has been used for TKE"); - AddVolumeOutput("PROD_W", "Prod_W", "DEBUG", "Production of rate of dissipation"); - AddVolumeOutput("DESTR_W", "Destr_W", "DEBUG", "Destruction of rate of dissipation"); - AddVolumeOutput("CDkw", "CDkw", "DEBUG", "Cross-Diffusion term"); - AddVolumeOutput("F1", "F1", "DEBUG", "F1 blending function"); - AddVolumeOutput("F2", "F2", "DEBUG", "F2 blending function"); break; case TURB_FAMILY::NONE: @@ -1631,19 +1623,6 @@ void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { AddVolumeOutput("VORTICITY", "Vorticity", "VORTEX_IDENTIFICATION", "Value of the vorticity"); } AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); - AddVolumeOutput("WALL_DISTANCE", "Wall_Distance", "MISC", "Wall distance value"); - AddVolumeOutput("STRAIN_MAG", "Strain_Magnitude", "MISC", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_XX", "Grad_Vel_xx", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_XY", "Grad_Vel_xy", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_YX", "Grad_Vel_yx", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_YY", "Grad_Vel_yy", "DEBUG", "Strain magnitude value"); - if (nDim == 3) { - AddVolumeOutput("GRAD_VEL_XZ", "Grad_Vel_xz", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_YZ", "Grad_Vel_yz", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_ZX", "Grad_Vel_zx", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_ZY", "Grad_Vel_zy", "DEBUG", "Strain magnitude value"); - AddVolumeOutput("GRAD_VEL_ZZ", "Grad_Vel_zz", "DEBUG", "Strain magnitude value"); - } } // Timestep info @@ -1669,7 +1648,6 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con SetVolumeOutputValue("CFL", iPoint, Node_Flow->GetLocalCFL(iPoint)); if (config->GetViscous()) { - const auto VelGrad = Node_Flow->GetVelocityGradient(iPoint); if (nDim == 3){ SetVolumeOutputValue("VORTICITY_X", iPoint, Node_Flow->GetVorticity(iPoint)[0]); SetVolumeOutputValue("VORTICITY_Y", iPoint, Node_Flow->GetVorticity(iPoint)[1]); @@ -1677,20 +1655,7 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con } else { SetVolumeOutputValue("VORTICITY", iPoint, Node_Flow->GetVorticity(iPoint)[2]); } - SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(VelGrad)); - SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); - SetVolumeOutputValue("STRAIN_MAG", iPoint, Node_Flow->GetStrainMag(iPoint)); - SetVolumeOutputValue("GRAD_VEL_XX", iPoint, VelGrad(0,0)); - SetVolumeOutputValue("GRAD_VEL_XY", iPoint, VelGrad(0,1)); - SetVolumeOutputValue("GRAD_VEL_YX", iPoint, VelGrad(1,0)); - SetVolumeOutputValue("GRAD_VEL_YY", iPoint, VelGrad(1,1)); - if (nDim == 3) { - SetVolumeOutputValue("GRAD_VEL_XZ", iPoint, VelGrad(0,2)); - SetVolumeOutputValue("GRAD_VEL_YZ", iPoint, VelGrad(1,2)); - SetVolumeOutputValue("GRAD_VEL_ZX", iPoint, VelGrad(2,0)); - SetVolumeOutputValue("GRAD_VEL_ZY", iPoint, VelGrad(2,1)); - SetVolumeOutputValue("GRAD_VEL_ZZ", iPoint, VelGrad(2,2)); - } + SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); @@ -1707,14 +1672,6 @@ void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* con case TURB_FAMILY::KW: SetVolumeOutputValue("TKE", iPoint, Node_Turb->GetSolution(iPoint, 0)); SetVolumeOutputValue("DISSIPATION", iPoint, Node_Turb->GetSolution(iPoint, 1)); - SetVolumeOutputValue("PROD_TKE", iPoint, Node_Turb->GetProdTKE(iPoint)); - SetVolumeOutputValue("DESTR_TKE", iPoint, Node_Turb->GetDestrTKE(iPoint)); - SetVolumeOutputValue("PROD_TKE_LIM", iPoint, Node_Turb->GetPkLim(iPoint)); - SetVolumeOutputValue("PROD_W", iPoint, Node_Turb->GetProdW(iPoint)); - SetVolumeOutputValue("DESTR_W", iPoint, Node_Turb->GetDestrW(iPoint)); - SetVolumeOutputValue("CDkw", iPoint, Node_Turb->GetCrossDiff(iPoint)); - SetVolumeOutputValue("F1", iPoint, Node_Turb->GetF1blending(iPoint)); - SetVolumeOutputValue("F2", iPoint, Node_Turb->GetF2blending(iPoint)); SetVolumeOutputValue("RES_TKE", iPoint, turb_solver->LinSysRes(iPoint, 0)); SetVolumeOutputValue("RES_DISSIPATION", iPoint, turb_solver->LinSysRes(iPoint, 1)); if (limiter) { @@ -1848,7 +1805,6 @@ void CFlowOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver SetVolumeOutputValue("SKIN_FRICTION-Z", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 2)); SetVolumeOutputValue("HEAT_FLUX", iPoint, solver[heat_sol]->GetHeatFlux(iMarker, iVertex)); SetVolumeOutputValue("Y_PLUS", iPoint, solver[FLOW_SOL]->GetYPlus(iMarker, iVertex)); - SetVolumeOutputValue("NEIGHBORDIST", iPoint, geometry->vertex[iMarker][iVertex]->GetNearestNeighborDistance()); if (config->GetTime_Domain()) { SetAvgVolumeOutputValue("MEAN_SKIN_FRICTION-X", iPoint, solver[FLOW_SOL]->GetCSkinFriction(iMarker, iVertex, 0)); diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index 907a145e7800..c28736296bea 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -261,7 +261,6 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("THERMAL_CONDUCTIVITY_VE", "Thermal_Conductivity_ve", "PRIMITIVE", "Vibrational-electronic thermal conductivity"); AddVolumeOutput("HEAT_FLUX", "Heat_Flux", "PRIMITIVE", "Heat-flux"); AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); - AddVolumeOutput("NEIGHBORDIST", "NeighborDistance", "DEBUG", "Distance of the wall point to its nearest neighbor"); } diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 0e4feb93bdaa..4baa474d078b 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -103,13 +103,11 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, const CSolv constants[8] = constants[4]/constants[6] - constants[2]*0.41*0.41/sqrt(constants[6]); //alfa_1 constants[9] = constants[5]/constants[6] - constants[3]*0.41*0.41/sqrt(constants[6]); //alfa_2 constants[10] = 20.0; // production limiter constant - if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } else { /* SST-V2003 */ constants[8] = 5.0 / 9.0; //gamma_1 constants[9] = 0.44; //gamma_2 constants[10] = 10.0; // production limiter constant - if (sstParsedOptions.prodLim) constants[10] = config->GetProdLimConst(); } /*--- Far-field flow state quantities and initialization. ---*/ @@ -405,13 +403,6 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta nodes->SetIntermittency(iPoint, numerics->GetIntermittencyEff()); } - su2double ProdDestr[5]; - ProdDestr[0] = numerics->GetProdDest(0); - ProdDestr[1] = numerics->GetProdDest(1); - ProdDestr[2] = numerics->GetProdDest(2); - ProdDestr[3] = numerics->GetProdDest(3); - ProdDestr[4] = numerics->GetProdDest(4); - nodes->SetProdDestr(iPoint, ProdDestr); /*--- Subtract residual and the Jacobian ---*/ diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 3fac520d3dd2..139223055a42 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -35,14 +35,6 @@ CTurbVariable::CTurbVariable(unsigned long npoint, unsigned long ndim, unsigned turb_index.resize(nPoint) = su2double(1.0); intermittency.resize(nPoint) = su2double(1.0); - if (TurbModelFamily(config->GetKind_Turb_Model()) == TURB_FAMILY::KW) { - Pk.resize(nPoint) = su2double(1.0); - Pw.resize(nPoint) = su2double(1.0); - Dk.resize(nPoint) = su2double(1.0); - Dw.resize(nPoint) = su2double(1.0); - PkLim.resize(nPoint) = su2double(1.0); - } - } void CTurbVariable::RegisterEddyViscosity(bool input) { From 184fe0043334a32e80da3a2f717cbd21664cd905 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 10:42:41 +0200 Subject: [PATCH 70/77] Remove comment-only changes and unused variables Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/solvers/CFVMFlowSolverBase.inl | 2 -- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMONSSolver.cpp | 2 +- SU2_CFD/src/solvers/CSolver.cpp | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index d3396bb80760..aea0dc1d6a26 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -2470,8 +2470,6 @@ void CFVMFlowSolverBase::Friction_Forces(const CGeometry* geometr const bool energy = config->GetEnergy_Equation(); const bool QCR = config->GetSAParsedOptions().qcr2000; - TURB_FAMILY TurbFamily = TurbModelFamily(config->GetKind_Turb_Model()); - const bool SSTm = config->GetSSTParsedOptions().modified; const bool axisymmetric = config->GetAxisymmetric(); const bool roughwall = (config->GetnRoughWall() > 0); const bool nemo = config->GetNEMOProblem(); diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 8b6fe5e5c19c..8262008eed64 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -805,7 +805,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, bool viscous = config->GetViscous(); bool grid_movement = config->GetGrid_Movement(); bool turbulent = (config->GetKind_Solver() == MAIN_SOLVER::FEM_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::FEM_LES); - bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST))); + bool tkeNeeded = ((turbulent) && ((config->GetKind_Turb_Model() == TURB_MODEL::SST) )); 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/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index b57a1e8f32b9..e29934e88032 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -967,7 +967,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Compute wall shear stress (using the stress tensor) ---*/ su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; - CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity); // no need for TKE as it is on the wall + CNumerics::ComputeStressTensor(nDim, Tau, Grad_PrimVar+VEL_INDEX, Viscosity); su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim,Tau,UnitNormal,TauTangent); diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 4f8ea05f970c..270293101081 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -4167,7 +4167,6 @@ void CSolver::ComputeVertexTractions(CGeometry *geometry, const CConfig *config) if (viscous_flow) { const su2double Viscosity = base_nodes->GetLaminarViscosity(iPoint); su2double Tau[3][3] = {{}}; - // Here I do not care for modified version of SST since TKE at wall is 0 CNumerics::ComputeStressTensor(nDim, Tau, base_nodes->GetVelocityGradient(iPoint), Viscosity); for (unsigned short iDim = 0; iDim < nDim; iDim++) { auxForce[iDim] += GeometryToolbox::DotProduct(nDim, Tau[iDim], Normal); From 444eeeb928ab38a4cf0758942267bb5e70f8fbd9 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 11:39:26 +0200 Subject: [PATCH 71/77] Keep the rounding of the SIMD stress tensor when k is not included Write the 2/3 rho k term as a separate addend, so that without it (all models but the standard SST versions) the result is bit-identical to develop. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index d62f63424aa6..a9868555b9f3 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -77,7 +77,7 @@ FORCEINLINE MatrixDbl stressTensor(const Double& viscosity, const MatrixDb for (size_t iDim = 0; iDim < nDim; ++iDim) { velDiv += grad(iDim+1,iDim); } - Double pTerm = 2.0/3.0 * (viscosity * velDiv + density * tke); + Double pTerm = 2.0/3.0 * viscosity * velDiv + 2.0/3.0 * density * tke; MatrixDbl tau; for (size_t iDim = 0; iDim < nDim; ++iDim) { From d1c4d357b3c02e6fc9306cd67bcd0ee1c190e77b Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 11:58:36 +0200 Subject: [PATCH 72/77] Keep develop's SIMD stress tensor and add 2/3 rho k separately The standard (non-m) SST versions add 2/3 rho k to the normal stresses after the stress tensor of develop, which is otherwise unchanged; the overload of stressTensor with density and k is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- .../numerics_simd/flow/diffusion/common.hpp | 6 ++--- .../flow/diffusion/viscous_fluxes.hpp | 27 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index a9868555b9f3..78b391d8a2fe 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -70,14 +70,14 @@ FORCEINLINE void correctGradient(const PrimitiveType& V, * \note Second viscosity term ignored. */ template -FORCEINLINE MatrixDbl stressTensor(const Double& viscosity, const MatrixDbl& grad, - const Double& density = Double(0.0), const Double& tke = Double(0.0)) { +FORCEINLINE MatrixDbl stressTensor(const Double& viscosity, + const MatrixDbl& grad) { /*--- Hydrostatic term. ---*/ Double velDiv = 0.0; for (size_t iDim = 0; iDim < nDim; ++iDim) { velDiv += grad(iDim+1,iDim); } - Double pTerm = 2.0/3.0 * viscosity * velDiv + 2.0/3.0 * density * tke; + Double pTerm = 2.0/3.0 * viscosity * velDiv; MatrixDbl tau; for (size_t iDim = 0; iDim < nDim; ++iDim) { diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 182420953d31..57466b20068b 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -50,7 +50,6 @@ class CNoViscousFlux : public CNumericsSIMD { protected: static constexpr size_t nDim = NDIM; static constexpr size_t nPrimVar = 0; - const CVariable* turbVars = nullptr; template CNoViscousFlux(Ts&...) {} @@ -81,6 +80,7 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const bool useSA_QCR; const bool wallFun; const bool uq; + const bool tkeInStress; /*!< \brief 2/3 rho k in the stress tensor (standard, non-m, SST versions). */ const bool uq_permute; const size_t uq_eigval_comp; const su2double uq_delta_b; @@ -101,6 +101,8 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { useSA_QCR(config.GetSAParsedOptions().qcr2000), wallFun(config.GetWall_Functions()), uq(config.GetSSTParsedOptions().uq), + tkeInStress(config.GetKind_Turb_Model() == TURB_MODEL::SST && !config.GetSSTParsedOptions().modified && + !config.GetSSTParsedOptions().uq), uq_permute(config.GetUQ_Permute()), uq_eigval_comp(config.GetEig_Val_Comp()), uq_delta_b(config.GetUQ_Delta_B()), @@ -137,8 +139,6 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { const auto& solution = static_cast(solution_); const auto& gradient = solution.GetGradient_Primitive(); - const bool tkeNeeded = (config.GetKind_Turb_Model() == TURB_MODEL::SST) && !(config.GetSSTParsedOptions().modified); - /*--- Compute distance and handle zero without "ifs" by making it large. ---*/ auto dist2_ij = squaredNorm(vector_ij); @@ -153,15 +153,19 @@ class CCompressibleViscousFluxBase : public CNumericsSIMD { /*--- Stress and heat flux tensors. ---*/ const Double eddyVisc = uq? Double(0.0) : avgV.eddyVisc(); - /*--- The 2/3 rho k term of the non-modified SST versions, already in the perturbed Reynolds stress with UQ. ---*/ - Double turb_ke = 0.0; - if (tkeNeeded && !uq) turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + - gatherVariables(jPoint, turbVars->GetSolution())); - auto tau = stressTensor(avgV.laminarVisc() + eddyVisc, avgGrad, avgV.density(), turb_ke); + auto tau = stressTensor(avgV.laminarVisc() + eddyVisc, avgGrad); if(useSA_QCR) addQCR(avgGrad, tau, eddyVisc / (avgV.laminarVisc() + eddyVisc)); + if(tkeInStress) { + /*--- 2/3 rho k term of the Boussinesq approximation, ignored by the modified (m) SST versions (with UQ it is + * part of the perturbed Reynolds stress). ---*/ + const Double turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + + gatherVariables(jPoint, turbVars->GetSolution())); + const Double kTerm = 2.0/3.0 * avgV.density() * turb_ke; + for (size_t iDim = 0; iDim < nDim; ++iDim) tau(iDim,iDim) -= kTerm; + } if(uq) { - turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + - gatherVariables(jPoint, turbVars->GetSolution())); + Double turb_ke = 0.5*(gatherVariables(iPoint, turbVars->GetSolution()) + + gatherVariables(jPoint, turbVars->GetSolution())); addPerturbedRSM(avgV, avgGrad, turb_ke, tau, uq_eigval_comp, uq_permute, uq_delta_b, uq_urlx); } @@ -265,7 +269,6 @@ class CCompressibleViscousFlux : public CCompressibleViscousFluxBase >; using Base::prandtlTurb; - using Base::turbVars; -; /*! * \brief Constructor, initialize constants and booleans. From d5f040eec6e4f6e8d641df20232926291ccc179e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 12:36:34 +0200 Subject: [PATCH 73/77] Use the k of the boundary node in the energy of all flow boundary states (#1851) As diagnosed in su2code/SU2#1851, adding the free-stream k to the total energy of a boundary state gives the flow too much energy, because k decays right after the boundary (SST destruction): at inflows the static temperature is too high and the Mach number too low, most visibly at high Mach number and high turbulence intensity. Following the fix proposed there, read k from the turbulence solver at the boundary node in every flow boundary condition that builds a total energy: far field, inlet (total conditions and mass flow), supersonic inlet, Riemann (also removed from the static energy of the boundary state), outlet, engine inflow and exhaust, actuator disks. This replaces the previous choice of the free-stream or inlet k at inflows, which had the same problem; the shared GetInletTke is no longer needed. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- SU2_CFD/include/solvers/CSolver.hpp | 12 ---- SU2_CFD/include/solvers/CTurbSSTSolver.hpp | 23 ------ SU2_CFD/src/solvers/CEulerSolver.cpp | 49 +++++-------- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 83 ++++++++++------------ 4 files changed, 56 insertions(+), 111 deletions(-) diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index 3e3b9e237dbe..7a7b6c726021 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -3249,18 +3249,6 @@ class CSolver { */ inline virtual su2double GetTke_Inf(void) const { return 0; } - /*! - * \brief A virtual member. - * \param[in] flowSolver - Flow solver, for the fluid model. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Inlet marker. - * \param[in] val_vertex - Vertex of the marker. - * \param[in] V_inlet - Primitive variables of the inlet state (temperature, velocity, pressure and density). - * \return Turbulent kinetic energy imposed by the turbulence inlet boundary condition for this state. - */ - inline virtual su2double GetInletTke(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, - unsigned long val_vertex, const su2double* V_inlet) const { return 0; } - /*! * \brief A virtual member. * \return Value of the turbulent frequency. diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index dc0a15173574..2729f014c129 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -184,29 +184,6 @@ class CTurbSSTSolver final : public CTurbSolver { CConfig *config, unsigned short val_marker) override; - /*! - * \brief Turbulence variables imposed at an inlet for a given inlet state (profile from file, or intensity - * and viscosity ratio of the marker). - * \param[in] flowSolver - Flow solver, for the fluid model. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Inlet marker. - * \param[in] val_vertex - Vertex of the marker. - * \param[in] V_inlet - Primitive variables of the inlet state. - * \param[out] Inlet_Vars - k and omega. - */ - void ComputeInletTurbVars(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, - unsigned long val_vertex, const su2double* V_inlet, su2double* Inlet_Vars) const; - - /*! - * \brief Turbulent kinetic energy imposed by the inlet boundary condition, see ComputeInletTurbVars. - */ - su2double GetInletTke(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, - unsigned long val_vertex, const su2double* V_inlet) const override { - su2double Inlet_Vars[MAXNVAR]; - ComputeInletTurbVars(flowSolver, config, val_marker, val_vertex, V_inlet, Inlet_Vars); - return Inlet_Vars[0]; - } - /*! * \brief Impose the inlet boundary condition. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index ea7b89adba41..cb2e6dae87fd 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -5195,8 +5195,8 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, } Pressure = Density*SoundSpeed*SoundSpeed/Gamma; Energy = Pressure/(Gamma_Minus_One*Density) + 0.5*Velocity2; - /*--- k of the state the turbulence boundary condition imposes: free stream at inflow, interior at outflow. ---*/ - if (tkeNeeded) Energy += (Qn_Infty > 0.0) ? turbNodes->GetSolution(iPoint,0) : GetTke_Inf(); + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) Energy += turbNodes->GetSolution(iPoint,0); /*--- Store new primitive state for computing the flux. ---*/ @@ -5485,23 +5485,10 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, break; } - /*--- k of the exterior state, the one the turbulence boundary condition imposes: the inlet value (from the - exterior state) at inflows, the interior value at outlets. It is also used for the boundary state. ---*/ - su2double Tke_e = 0.0; - if (tkeNeeded) { - if (config->GetKind_Data_Riemann(Marker_Tag) == STATIC_PRESSURE) { - Tke_e = turbNodes->GetSolution(iPoint, 0); - } else { - GetFluidModel()->SetTDState_rhoe(Density_e, Energy_e - 0.5*Velocity2_e); - su2double V_e[32] = {0.0}; - V_e[prim_idx.Temperature()] = GetFluidModel()->GetTemperature(); - V_e[prim_idx.Pressure()] = GetFluidModel()->GetPressure(); - V_e[prim_idx.Density()] = Density_e; - for (auto iDim = 0u; iDim < nDim; iDim++) V_e[prim_idx.Velocity() + iDim] = Velocity_e[iDim]; - Tke_e = solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_e); - } - Energy_e += Tke_e; - } + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). + It is also removed from the static energy of the boundary state. ---*/ + const su2double Tke_e = tkeNeeded ? turbNodes->GetSolution(iPoint, 0) : 0.0; + Energy_e += Tke_e; /*--- Compute P (matrix of right eigenvectors) ---*/ conv_numerics->GetPMatrix(&Density_i, Velocity_i, &SoundSpeed_i, &Enthalpy_i, &Chi_i, &Kappa_i, UnitNormal, P_Tensor); @@ -7396,8 +7383,8 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; - /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ - if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); break; } @@ -7470,8 +7457,8 @@ void CEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, V_inlet[nDim+2] = Density; V_inlet[nDim+3] = Energy + Pressure/Density; - /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ - if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[nDim+3] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); break; } @@ -7728,8 +7715,8 @@ void CEulerSolver::BC_Supersonic_Inlet(CGeometry *geometry, CSolver **solver_con for (unsigned short iDim = 0; iDim < nDim; iDim++) V_inlet[iDim+prim_idx.Velocity()] = Velocity[iDim]; - /*--- Add the k imposed by the turbulence inlet boundary condition for this state. ---*/ - if (tkeNeeded) V_inlet[prim_idx.Enthalpy()] += solver_container[TURB_SOL]->GetInletTke(this, config, val_marker, iVertex, V_inlet); + /*--- k of the boundary node, not the free-stream value, which decays right away in the domain (#1851). ---*/ + if (tkeNeeded) V_inlet[prim_idx.Enthalpy()] += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); /*--- Current solution at this boundary node. ---*/ @@ -8042,7 +8029,7 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai } Energy = Inflow_Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -8279,7 +8266,7 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Primitive variables, using the derived quantities ---*/ @@ -8571,7 +8558,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -8726,7 +8713,7 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C /*--- Using pressure, density, & velocity, compute the energy ---*/ Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Primitive variables, using the derived quantities ---*/ @@ -8974,7 +8961,7 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver Velocity2 += Velocity[iDim]*Velocity[iDim]; } Energy = Pressure/(Density*Gamma_Minus_One) + 0.5*Velocity2; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 /*--- Conservative variables, using the derived quantities ---*/ @@ -9022,7 +9009,7 @@ void CEulerSolver::BC_ActDisk_VariableLoad(CGeometry *geometry, CSolver **solver /*--- Computation of the enthalpy, total energy, temperature and speed of sound. ---*/ H_out = H_in/Density_in + Fa/Density_out; Energy = H_out - Pressure_out/Density_out; - if (tkeNeeded) Energy += GetTke_Inf(); + if (tkeNeeded) Energy += solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); // node k, see #1851 Temperature_out = (Energy-0.5*Velocity2/(pow(Density_out,2)))*(Gamma_Minus_One/Gas_Constant); SoS_out = sqrt(Gamma*Gas_Constant*Temperature_out); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 4baa474d078b..ffca12d22e2f 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -616,49 +616,6 @@ void CTurbSSTSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_co } -void CTurbSSTSolver::ComputeInletTurbVars(const CSolver* flowSolver, const CConfig* config, unsigned short val_marker, - unsigned long val_vertex, const su2double* V_inlet, - su2double* Inlet_Vars) const { - if (config->GetInlet_Profile_From_File()) { - /*--- Non-dimensionalize Inlet_TurbVars if Inlet-Files are used. ---*/ - Inlet_Vars[0] = Inlet_TurbVars[val_marker][val_vertex][0] / pow(config->GetVelocity_Ref(), 2); - Inlet_Vars[1] = Inlet_TurbVars[val_marker][val_vertex][1] * config->GetViscosity_Ref() / - (config->GetDensity_Ref() * pow(config->GetVelocity_Ref(), 2)); - } else { - /*--- Obtain fluid model for computing the kine and omega to impose at the inlet boundary. ---*/ - CFluidModel* FluidModel = flowSolver->GetFluidModel(); - - /*--- Obtain flow velocity vector at inlet boundary node ---*/ - - const su2double* Velocity_Inlet = &V_inlet[prim_idx.Velocity()]; - su2double Density_Inlet; - if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { - Density_Inlet = V_inlet[prim_idx.Density()]; - FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet); - } else { - const su2double* Scalar_Inlet = nullptr; - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); - } - FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet); - Density_Inlet = FluidModel->GetDensity(); - } - const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity(); - const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker)); - const su2double Intensity = Turb_Properties[0]; - const su2double viscRatio = Turb_Properties[1]; - const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); - - if (sstParsedOptions.newBC) { - Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); - Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; - } else { - Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); - Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); - } - } -} - void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics*, CNumerics*, CConfig *config, unsigned short val_marker) { SU2_ZONE_SCOPED @@ -670,8 +627,44 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C const auto* V_inlet = flowSolver->GetCharacPrimVar(val_marker, iVertex); su2double Inlet_Vars[MAXNVAR]; - ComputeInletTurbVars(flowSolver, config, val_marker, iVertex, V_inlet, Inlet_Vars); - + if (config->GetInlet_Profile_From_File()) { + /*--- Non-dimensionalize Inlet_TurbVars if Inlet-Files are used. ---*/ + Inlet_Vars[0] = Inlet_TurbVars[val_marker][iVertex][0] / pow(config->GetVelocity_Ref(), 2); + Inlet_Vars[1] = Inlet_TurbVars[val_marker][iVertex][1] * config->GetViscosity_Ref() / + (config->GetDensity_Ref() * pow(config->GetVelocity_Ref(), 2)); + } else { + /*--- Obtain fluid model for computing the kine and omega to impose at the inlet boundary. ---*/ + CFluidModel* FluidModel = flowSolver->GetFluidModel(); + + /*--- Obtain flow velocity vector at inlet boundary node ---*/ + + const su2double* Velocity_Inlet = &V_inlet[prim_idx.Velocity()]; + su2double Density_Inlet; + if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { + Density_Inlet = V_inlet[prim_idx.Density()]; + FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet); + } else { + const su2double* Scalar_Inlet = nullptr; + if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); + } + FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet); + Density_Inlet = FluidModel->GetDensity(); + } + const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity(); + const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker)); + const su2double Intensity = Turb_Properties[0]; + const su2double viscRatio = Turb_Properties[1]; + const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); + + if (sstParsedOptions.newBC) { + Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); + Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; + } else { + Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2)); + Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio); + } + } for (auto iVar = 0u; iVar < nVar; iVar++) ghostNodes->SetSolution(iVertex, iVar, Inlet_Vars[iVar]); SetGhostPrimitives(iVertex, V_inlet); From 89c7aaa940355b49cd1dfa047149f1d8b6bb165e Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 12:47:35 +0200 Subject: [PATCH 74/77] Update the reference values of the SST regression tests Serial, parallel, hybrid, AD, tutorials and V&V SST tests. The values change because of the k of the boundary node in the boundary energy (#1851), the NASA TMR SST-sust free stream, the exact production of the standard versions, and UQ no longer counting 2/3 rho k twice. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- TestCases/hybrid_regression.py | 30 +++++++++++------------ TestCases/parallel_regression.py | 38 ++++++++++++++--------------- TestCases/parallel_regression_AD.py | 6 ++--- TestCases/serial_regression.py | 34 +++++++++++++------------- TestCases/serial_regression_AD.py | 4 +-- TestCases/tutorials.py | 4 +-- TestCases/vandv.py | 8 +++--- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index cb34f9a48528..90c765f6be27 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -186,7 +186,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.487683, 5.870614, 0.370417, 0.074982] + rae2822_sst_sust.test_vals = [-3.077901, 4.648657, 0.389111, 0.074709] test_list.append(rae2822_sst_sust) # Flat plate @@ -219,7 +219,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094026, -15.250728, -5.906323, 1.070413, 0.015775, -2.854334, 0.000000] + turb_naca0012_sst.test_vals = [-5.948944, -10.295370, -3.739562, 1.069316, 0.015855, -3.048239, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.075928, -15.246732, -5.861249, 1.070036, 0.015841, -2.835263, 0] test_list.append(turb_naca0012_sst) @@ -228,7 +228,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-12.080919, -14.837175, -5.732906, 1.000893, 0.019109, -2.119961] + turb_naca0012_sst_sust.test_vals = [-7.626753, -9.772172, -2.145343, 1.006222, 0.019331, -1.350065] turb_naca0012_sst_sust.test_vals_aarch64 = [-12.073210, -14.836724, -5.732627, 1.000050, 0.019144, -2.629689] test_list.append(turb_naca0012_sst_sust) @@ -237,7 +237,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.192391, -10.448219, 0.773965, 1.022535, 0.040529, -2.383381] + turb_naca0012_sst_fixedvalues.test_vals = [-5.192392, -10.448079, 0.773965, 1.022535, 0.040529, -2.383370] test_list.append(turb_naca0012_sst_fixedvalues) # NACA0012 (SST, explicit Euler for flow and turbulence equations) @@ -245,7 +245,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532365, -3.157224, 3.743381, 1.124798, 0.501715, -16.000000] + turb_naca0012_sst_expliciteuler.test_vals = [-3.408564, -3.157224, 3.743383, 1.124798, 0.501715, -16.000000] test_list.append(turb_naca0012_sst_expliciteuler) # PROPELLER @@ -265,7 +265,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-11.083068, -5.374686, -8.880093, -4.073548, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-4.875434, 0.608496, -4.040017, 0.185569, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.140441, -9.154674, -10.886121, -5.806594, 0.000000] test_list.append(axi_rans_air_nozzle_restart) @@ -279,7 +279,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.589092, -5.057151, 0.830239, -0.008809, 0.078148] + turb_naca0012_sst_restart_mg.test_vals = [-3.738862, -5.056955, 0.830574, -0.008645, 0.077940] test_list.append(turb_naca0012_sst_restart_mg) ############################# @@ -291,7 +291,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.978722, 1.343530, 0.443909, -0.029125] + turb_naca0012_1c.test_vals = [-5.021907, 1.337718, 0.489529, -0.010558] turb_naca0012_1c.test_vals_aarch64 = [-4.976620, 1.345983, 0.433171, -0.033685] test_list.append(turb_naca0012_1c) @@ -300,7 +300,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482844, 1.260870, 0.404376, -0.040361] + turb_naca0012_2c.test_vals = [-5.482903, 1.260881, 0.405402, -0.040054] turb_naca0012_2c.test_vals_aarch64 = [-5.485484, 1.263406, 0.411442, -0.040859] test_list.append(turb_naca0012_2c) @@ -309,7 +309,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583730, 1.228732, 0.381967, -0.046233] + turb_naca0012_3c.test_vals = [-5.583739, 1.228713, 0.379593, -0.047067] turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305] test_list.append(turb_naca0012_3c) @@ -318,7 +318,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.134181, 1.283464, 0.553971, 0.011916] + turb_naca0012_p1c1.test_vals = [-5.124123, 1.284616, 0.555627, 0.012213] turb_naca0012_p1c1.test_vals_aarch64 = [-5.114189, 1.285037, 0.406851, -0.043003] test_list.append(turb_naca0012_p1c1) @@ -327,7 +327,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.553988, 1.234031, 0.424168, -0.033501] + turb_naca0012_p1c2.test_vals = [-5.552624, 1.234172, 0.424723, -0.033369] turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337] test_list.append(turb_naca0012_p1c2) @@ -460,7 +460,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.170018, 0.332638, 0.000002, 0.312117] + inc_turb_naca0012_sst_sust.test_vals = [-9.784873, 3.354565, 0.000008, 0.309470] test_list.append(inc_turb_naca0012_sst_sust) # Weakly coupled heat equation @@ -602,7 +602,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.907561, -12.214137, -19.151426, -13.451780, -19.085218, -13.450796, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.944845, -12.202690, -19.234414, -13.518577, -19.032823, -13.398159, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -711,7 +711,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.391571, -1.460869] + bars_SST_2D.test_vals = [13.000000, -0.391593, -1.460768] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 87edd6666a17..caf43cb2318b 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -446,7 +446,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.484221, 5.861926, 0.362143, 0.073809] + rae2822_sst_sust.test_vals = [-3.074837, 4.634926, 0.399337, 0.073606] test_list.append(rae2822_sst_sust) # Flat plate @@ -486,7 +486,7 @@ def main(): turb_flatplate_sst_roughBCKnopp.cfg_dir = "rans/flatplate/roughness/bc_knopp" turb_flatplate_sst_roughBCKnopp.cfg_file = "turb_SST_flatplate_roughBCKnopp.cfg" turb_flatplate_sst_roughBCKnopp.test_iter = 10 - turb_flatplate_sst_roughBCKnopp.test_vals = [-5.058634, -2.460850, -2.847064, 0.447200, -2.595042, 1.497149, -0.188079, 0.004571] + turb_flatplate_sst_roughBCKnopp.test_vals = [-4.843998, -2.247185, -2.637470, 0.662708, -2.565774, 1.507195, -0.188018, 0.004571] test_list.append(turb_flatplate_sst_roughBCKnopp) # FLAT PLATE, ROUGHNESS BC AUPOIX SST @@ -494,7 +494,7 @@ def main(): turb_flatplate_sst_roughBCAupoix.cfg_dir = "rans/flatplate/roughness/bc_aupoix" turb_flatplate_sst_roughBCAupoix.cfg_file = "turb_SST_flatplate_roughBCAupoix.cfg" turb_flatplate_sst_roughBCAupoix.test_iter = 10 - turb_flatplate_sst_roughBCAupoix.test_vals = [-5.278728, -2.302982, -2.890419, 0.227585, -1.393786, 3.192601, -0.188729, 0.0071821] + turb_flatplate_sst_roughBCAupoix.test_vals = [-5.069751, -2.238097, -2.717921, 0.438657, -1.393740, 3.192608, -0.188736, 0.007182] test_list.append(turb_flatplate_sst_roughBCAupoix) # ONERA M6 Wing @@ -540,7 +540,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094692, -15.251093, -5.906365, 1.070413, 0.015775, -2.376043, 0.000000] + turb_naca0012_sst.test_vals = [-5.949126, -10.294721, -3.763091, 1.069311, 0.015852, -3.462062, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.075620, -15.246688, -5.861276, 1.070036, 0.015841, -1.991001, 0.000000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -550,7 +550,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-12.081966, -14.837177, -5.733436, 1.000893, 0.019109, -2.241123] + turb_naca0012_sst_sust.test_vals = [-7.620992, -9.772595, -2.145273, 1.006174, 0.019314, -1.562485] turb_naca0012_sst_sust.test_vals_aarch64 = [-12.073964, -14.836726, -5.732390, 1.000050, 0.019144, -2.229074] turb_naca0012_sst_sust.timeout = 3200 test_list.append(turb_naca0012_sst_sust) @@ -560,7 +560,7 @@ def main(): turb_naca0012_sst_2003_Vm.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003_Vm.cfg_file = "turb_NACA0012_sst_2003-Vm.cfg" turb_naca0012_sst_2003_Vm.test_iter = 10 - turb_naca0012_sst_2003_Vm.test_vals = [-10.168739, -3.668709, 1.060563, 0.019147, -2.282800] + turb_naca0012_sst_2003_Vm.test_vals = [-10.082677, -3.584114, 1.059491, 0.019212, -3.091163] turb_naca0012_sst_2003_Vm.timeout = 3200 test_list.append(turb_naca0012_sst_2003_Vm) @@ -569,7 +569,7 @@ def main(): turb_naca0012_sst_1994_KLm.cfg_dir = "rans/naca0012" turb_naca0012_sst_1994_KLm.cfg_file = "turb_NACA0012_sst_1994-KLm.cfg" turb_naca0012_sst_1994_KLm.test_iter = 10 - turb_naca0012_sst_1994_KLm.test_vals = [-10.390871, -3.701584, 1.062164, 0.019076, -2.426123] + turb_naca0012_sst_1994_KLm.test_vals = [-10.202368, -3.596058, 1.061073, 0.019145, -3.189038] turb_naca0012_sst_1994_KLm.timeout = 3200 test_list.append(turb_naca0012_sst_1994_KLm) @@ -587,7 +587,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532365, -3.157224, 3.743381, 1.124798, 0.501715, -16.000000] + turb_naca0012_sst_expliciteuler.test_vals = [-3.408564, -3.157224, 3.743383, 1.124798, 0.501715, -16.000000] turb_naca0012_sst_expliciteuler.timeout = 3200 test_list.append(turb_naca0012_sst_expliciteuler) @@ -619,7 +619,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-11.056236, -5.334116, -8.842310, -4.067917, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-4.875217, 0.608350, -4.006405, 0.187713, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143310, -9.163287, -10.858232, -5.787715, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -634,7 +634,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.566317, -5.057149, 0.830238, -0.008702, 0.078154] + turb_naca0012_sst_restart_mg.test_vals = [-3.737525, -5.056934, 0.830606, -0.008579, 0.077961] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -797,7 +797,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.169837, 0.332730, -0.000001, 0.312131] + inc_turb_naca0012_sst_sust.test_vals = [-9.784857, 3.354566, -0.000002, 0.309484] test_list.append(inc_turb_naca0012_sst_sust) # Flat plate, pressure-based @@ -1041,7 +1041,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.979554, 1.344291, 0.666805, 0.010247] + turb_naca0012_1c.test_vals = [-5.019853, 1.338557, 0.674994, 0.012626] turb_naca0012_1c.test_vals_aarch64 = [-4.981036, 1.345868, 0.673232, 0.010091] test_list.append(turb_naca0012_1c) @@ -1050,7 +1050,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482691, 1.262918, 0.529450, -0.023537] + turb_naca0012_2c.test_vals = [-5.482710, 1.262929, 0.536020, -0.021682] turb_naca0012_2c.test_vals_aarch64 = [-5.484365, 1.264701, 0.501741, -0.033109] test_list.append(turb_naca0012_2c) @@ -1059,7 +1059,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583617, 1.229594, 0.463384, -0.035444] + turb_naca0012_3c.test_vals = [-5.583618, 1.229581, 0.465402, -0.035057] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -1067,7 +1067,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.129555, 1.283892, 0.808074, 0.047784] + turb_naca0012_p1c1.test_vals = [-5.119372, 1.284797, 0.808582, 0.048191] turb_naca0012_p1c1.test_vals_aarch64 = [-5.122100, 1.284478, 0.608744, -0.008593] test_list.append(turb_naca0012_p1c1) @@ -1076,7 +1076,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.554045, 1.234446, 0.603731, -0.008717] + turb_naca0012_p1c2.test_vals = [-5.552837, 1.234409, 0.608413, -0.007582] test_list.append(turb_naca0012_p1c2) ###################################### @@ -1137,7 +1137,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-1.175979, 0.062203, 1.399352, 2.219226, 1.399298, 2.217472, 0.000000] + square_cylinder.test_vals = [-1.175978, 0.062220, 1.399352, 2.219226, 1.399298, 2.217472, 0.000000] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -1252,7 +1252,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.941917, -12.212515, -19.254664, -13.545311, -19.087161, -13.454459, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.924428, -12.203366, -19.179995, -13.468776, -19.035084, -13.399644, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1360,7 +1360,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.395917, -1.480210] + bars_SST_2D.test_vals = [13.000000, -0.395943, -1.480113] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 2e145789e9ee..9183baf08c40 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -91,7 +91,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.226820, -0.256327, -2.299900, -0.003171] + discadj_rans_naca0012_sst.test_vals = [-2.226859, -0.256181, -2.298600, -0.003183] discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.226852, -0.253100, -2.299300, -0.003164] test_list.append(discadj_rans_naca0012_sst) @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.909657, 5.078045, 7.129068, 2.490955] + discadj_axisymmetric_rans_nozzle.test_vals = [9.909640, 5.078072, 7.132311, 2.490930] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) @@ -251,7 +251,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.555663, -10.335501, -10.356934, -13.629559] + discadj_trans_stator.test_vals = [79.000000, -7.555050, -10.335490, -10.357063, -13.629079] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] test_list.append(discadj_trans_stator) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 1479f3f11cc7..a97fbd65abd0 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -244,7 +244,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.486848, 5.868998, 0.367576, 0.075890] + rae2822_sst_sust.test_vals = [-3.083167, 4.642649, 0.389535, 0.074722] test_list.append(rae2822_sst_sust) # Flat plate @@ -260,7 +260,7 @@ def main(): turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/compressible_SST" turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg" turb_wallfunction_flatplate_sst.test_iter = 10 - turb_wallfunction_flatplate_sst.test_vals = [-4.036300, -1.916264, -1.821790, 1.443878, -1.579554, 1.521535, 10.000000, -2.351460, 0.030011, 0.002409] + turb_wallfunction_flatplate_sst.test_vals = [-4.037523, -1.925464, -1.823711, 1.442524, -1.579599, 1.519008, 10.000000, -2.403318, 0.030004, 0.002409] test_list.append(turb_wallfunction_flatplate_sst) # FLAT PLATE, ROUGHNESS BC WILCOX2006 SST @@ -268,7 +268,7 @@ def main(): turb_flatplate_sst_roughBCWilcox2006.cfg_dir = "rans/flatplate/roughness/bc_wilcox2006" turb_flatplate_sst_roughBCWilcox2006.cfg_file = "turb_SST_flatplate_roughBCWilcox2006.cfg" turb_flatplate_sst_roughBCWilcox2006.test_iter = 10 - turb_flatplate_sst_roughBCWilcox2006.test_vals = [-5.117900, -2.534224, -2.904279, 0.381710, -3.100346, 1.180161, -0.188797, 0.004029] + turb_flatplate_sst_roughBCWilcox2006.test_vals = [-5.235113, -2.562052, -2.931476, 0.265993, -3.126054, 1.259616, -0.188832, 0.004029] test_list.append(turb_flatplate_sst_roughBCWilcox2006) # FLAT PLATE, WALL FUNCTIONS, COMPRESSIBLE SA @@ -303,7 +303,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-12.094431, -15.251082, -5.906366, 1.070413, 0.015775, -3.178469, 0.000000] + turb_naca0012_sst.test_vals = [-5.948762, -10.293853, -3.762064, 1.069291, 0.015853, -3.348638, 0.000000] turb_naca0012_sst.test_vals_aarch64 = [-12.076068, -15.246740, -5.861280, 1.070036, 0.015841, -3.297854, 0.000000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -326,7 +326,7 @@ def main(): turb_naca0012_sst_2003m.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003m.cfg_file = "turb_NACA0012_sst_2003m.cfg" turb_naca0012_sst_2003m.test_iter = 10 - turb_naca0012_sst_2003m.test_vals = [-7.129622, -10.410728, -3.699440, 1.061671, 0.019047, -2.435494, 0.000000] + turb_naca0012_sst_2003m.test_vals = [-5.953752, -10.211152, -3.594485, 1.060530, 0.019121, -3.188773, 0.000000] turb_naca0012_sst_2003m.timeout = 3200 test_list.append(turb_naca0012_sst_2003m) @@ -335,7 +335,7 @@ def main(): turb_naca0012_sst_sust_restart.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust_restart.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust_restart.test_iter = 10 - turb_naca0012_sst_sust_restart.test_vals = [-12.080496, -14.837169, -5.733461, 1.000893, 0.019109, -2.634008] + turb_naca0012_sst_sust_restart.test_vals = [-7.626856, -9.773425, -2.145353, 1.006177, 0.019310, -1.684024] turb_naca0012_sst_sust_restart.test_vals_aarch64 = [-12.074189, -14.836725, -5.732398, 1.000050, 0.019144, -3.315560] turb_naca0012_sst_sust_restart.timeout = 3200 test_list.append(turb_naca0012_sst_sust_restart) @@ -367,7 +367,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-11.054281, -5.328905, -8.835591, -4.056830, 0.000000] + axi_rans_air_nozzle_restart.test_vals = [-4.875503, 0.608561, -4.031599, 0.232810, 0.000000] axi_rans_air_nozzle_restart.test_vals_aarch64 = [-14.143715, -9.170705, -10.848554, -5.776746, 0.000000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -391,7 +391,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 50 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.610405, -5.081422, 0.810881, -0.008846, 0.077934] + turb_naca0012_sst_restart_mg.test_vals = [-3.569433, -5.081768, 0.810343, -0.009069, 0.078688] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -508,7 +508,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.169704, 0.332779, 0.000021, 0.312114] + inc_turb_naca0012_sst_sust.test_vals = [-9.784804, 3.354566, 0.000023, 0.309468] test_list.append(inc_turb_naca0012_sst_sust) # Flat plate, pressure-based @@ -744,7 +744,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.981181, 1.343583, 0.597121, 0.017223] + turb_naca0012_1c.test_vals = [-5.021674, 1.337926, 0.603892, 0.019471] turb_naca0012_1c.test_vals_aarch64 = [-4.992791, 1.342873, 0.557941, 0.003269] test_list.append(turb_naca0012_1c) @@ -753,7 +753,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482907, 1.262063, 0.459671, -0.026410] + turb_naca0012_2c.test_vals = [-5.482899, 1.262062, 0.464050, -0.025067] test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -761,7 +761,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583768, 1.229824, 0.426258, -0.033150] + turb_naca0012_3c.test_vals = [-5.583769, 1.229839, 0.426520, -0.033213] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -769,7 +769,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.127701, 1.284875, 0.779301, 0.086111] + turb_naca0012_p1c1.test_vals = [-5.130090, 1.284042, 0.790860, 0.090004] turb_naca0012_p1c1.test_vals_aarch64 = [-5.119942, 1.283920, 0.486264, -0.021518] test_list.append(turb_naca0012_p1c1) @@ -778,7 +778,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.553987, 1.235071, 0.521197, -0.004487] + turb_naca0012_p1c2.test_vals = [-5.552566, 1.235156, 0.576899, 0.017942] test_list.append(turb_naca0012_p1c2) ###################################### @@ -838,7 +838,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + square_cylinder.test_vals = [-2.560698, -1.175978, 0.062220, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -958,7 +958,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.944235, -12.212620, -19.261137, -13.549357, -19.083828, -13.444697, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.924922, -12.203258, -19.179435, -13.466827, -19.026493, -13.392226, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1078,7 +1078,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.393225, -1.462251] + bars_SST_2D.test_vals = [13.000000, -0.393251, -1.461537] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index 8c556a3eef14..3afeeda77d8f 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -96,7 +96,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.096075, -0.181237, 0.350380, -0.023435] + discadj_rans_naca0012_sst.test_vals = [-2.096080, -0.181131, 0.352000, -0.023451] test_list.append(discadj_rans_naca0012_sst) ####################################### @@ -200,7 +200,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.308168, -9.891121, -10.038669, -13.368502] + discadj_trans_stator.test_vals = [79.000000, -7.308278, -9.893294, -10.039103, -13.368529] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.308167, -9.891117, -10.038669, -13.368501] test_list.append(discadj_trans_stator) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index 664acf01cad3..c60eed4e2389 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -249,7 +249,7 @@ def main(): tutorial_trans_flatplate_T3A.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A" tutorial_trans_flatplate_T3A.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3A.test_iter = 20 - tutorial_trans_flatplate_T3A.test_vals = [-5.790137, -2.054834, -3.894659, -0.255074, -1.747220, 5.119341, -3.493237, 0.393262] + tutorial_trans_flatplate_T3A.test_vals = [-5.790251, -2.054841, -3.895394, -0.255140, -1.750418, 5.119342, -3.493255, 0.392596] tutorial_trans_flatplate_T3A.test_vals_aarch64 = [-5.808996, -2.070606, -3.969765, -0.277943, -1.953289, 1.708472, -3.514943, 0.357411] tutorial_trans_flatplate_T3A.no_restart = True test_list.append(tutorial_trans_flatplate_T3A) @@ -259,7 +259,7 @@ def main(): tutorial_trans_flatplate_T3Am.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A-" tutorial_trans_flatplate_T3Am.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3Am.test_iter = 20 - tutorial_trans_flatplate_T3Am.test_vals = [-5.587389, -1.700868, -3.093935, -0.102834, -3.750523, 3.287643, -2.394575, 1.119623] + tutorial_trans_flatplate_T3Am.test_vals = [-5.582032, -1.700868, -3.083799, -0.098145, -3.750523, 3.287639, -2.394575, 1.119623] tutorial_trans_flatplate_T3Am.test_vals_aarch64 = [-5.540938, -1.681627, -2.878831, -0.058224, -3.695533, 3.413628, -2.385345, 1.103633] tutorial_trans_flatplate_T3Am.no_restart = True test_list.append(tutorial_trans_flatplate_T3Am) diff --git a/TestCases/vandv.py b/TestCases/vandv.py index 516f51cc5ebd..0c9c9723d3b3 100644 --- a/TestCases/vandv.py +++ b/TestCases/vandv.py @@ -63,7 +63,7 @@ def main(): flatplate_sst1994m.cfg_dir = "vandv/rans/flatplate" flatplate_sst1994m.cfg_file = "turb_flatplate_sst.cfg" flatplate_sst1994m.test_iter = 5 - flatplate_sst1994m.test_vals = [-13.040943, -10.136971, -10.942764, -7.985181, -10.323857, -4.732487, 0.002801] + flatplate_sst1994m.test_vals = [-6.758709, -3.881664, -4.245031, -1.294380, -4.474846, -0.677798, 0.002801] flatplate_sst1994m.test_vals_aarch64 = [-13.021715, -9.534786, -10.401912, -7.501836, -9.750800, -4.850665, 0.002807] test_list.append(flatplate_sst1994m) @@ -72,7 +72,7 @@ def main(): bump_sst1994m.cfg_dir = "vandv/rans/bump_in_channel" bump_sst1994m.cfg_file = "turb_bump_sst.cfg" bump_sst1994m.test_iter = 5 - bump_sst1994m.test_vals = [-11.928292, -10.095796, -9.512953, -6.445652, -11.774088, -6.988752, 0.004931] + bump_sst1994m.test_vals = [-8.014868, -5.138354, -6.180378, -2.558011, -6.570741, -2.603570, 0.004931] bump_sst1994m.test_vals_aarch64 = [-13.042689, -10.812982, -10.604523, -7.655547, -10.816257, -5.308083, 0.004911] test_list.append(bump_sst1994m) @@ -91,7 +91,7 @@ def main(): swbli_sst.cfg_dir = "vandv/rans/swbli" swbli_sst.cfg_file = "config_sst.cfg" swbli_sst.test_iter = 5 - swbli_sst.test_vals = [-11.319578, -10.641523, -11.224600, -10.150215, -11.407538, -2.637660, 0.001816, -1.839484, -3.514593, 11.136000] + swbli_sst.test_vals = [-10.620096, -9.467013, -10.489091, -9.162510, -10.530142, -2.612181, 0.001816, -1.568660, -3.540055, 8.615300] test_list.append(swbli_sst) # DSMA661 - SA @@ -108,7 +108,7 @@ def main(): dsma661_sst.cfg_dir = "vandv/rans/dsma661" dsma661_sst.cfg_file = "dsma661_sst_config.cfg" dsma661_sst.test_iter = 5 - dsma661_sst.test_vals = [-11.025153, -8.156995, -9.057021, -5.947228, -10.650874, -7.884423, 0.155882, 0.023344] + dsma661_sst.test_vals = [-2.616553, 0.009594, -0.244123, 2.840416, -2.180298, 1.413440, 0.156003, 0.023336] dsma661_sst.test_vals_aarch64 = [-10.977195, -8.403731, -8.747068, -5.808899, -10.522786, -7.369851, 0.155875, 0.023353] test_list.append(dsma661_sst) From 95de110503066e0422a9fd441fdaccddd340e609 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 13:00:24 +0200 Subject: [PATCH 75/77] Rename the SST option NEWBC to TMRBC It sets the far-field values of the NASA TMR, so the name says where they come from. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/option_structure.hpp | 10 +++++----- Common/src/CConfig.cpp | 2 +- SU2_CFD/src/solvers/CEulerSolver.cpp | 4 ++-- SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNEMOEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 4 ++-- config_template.cfg | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index c17285039012..d285f56cd6de 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -1114,7 +1114,7 @@ enum class SST_OPTIONS { COMP_Sarkar, /*!< \brief Menter k-w SST model with Compressibility correction of Sarkar. */ DLL, /*!< \brief Menter k-w SST model with dimensionless lower limit clipping of turbulence variables. */ WALL_OMEGA_LIMIT, /*!< \brief Clip the omega wall value to the upper limit of omega. */ - NEWBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */ + TMRBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */ }; static const MapType SST_Options_Map = { MakePair("NONE", SST_OPTIONS::NONE) @@ -1129,7 +1129,7 @@ static const MapType SST_Options_Map = { MakePair("COMPRESSIBILITY-WILCOX", SST_OPTIONS::COMP_Wilcox) MakePair("COMPRESSIBILITY-SARKAR", SST_OPTIONS::COMP_Sarkar) MakePair("DIMENSIONLESS_LIMIT", SST_OPTIONS::DLL) - MakePair("NEWBC", SST_OPTIONS::NEWBC) + MakePair("TMRBC", SST_OPTIONS::TMRBC) MakePair("WALL_OMEGA_LIMIT", SST_OPTIONS::WALL_OMEGA_LIMIT) }; @@ -1146,7 +1146,7 @@ struct SST_ParsedOptions { bool compSarkar = false; /*!< \brief Bool for compressibility correction of Sarkar. */ bool dll = false; /*!< \brief Bool dimensionless lower limit. */ bool wallOmegaLimit = false; /*!< \brief Bool for clipping the omega wall value (WALL_OMEGA_LIMIT). */ - bool newBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (NEWBC). */ + bool tmrBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (TMRBC). */ }; /*! @@ -1164,7 +1164,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne return std::find(SST_Options, sst_options_end, option) != sst_options_end; }; - const bool found_newBC = IsPresent(SST_OPTIONS::NEWBC); + const bool found_tmrBC = IsPresent(SST_OPTIONS::TMRBC); const bool found_wallOmegaLimit = IsPresent(SST_OPTIONS::WALL_OMEGA_LIMIT); const bool found_1994 = IsPresent(SST_OPTIONS::V1994); @@ -1224,7 +1224,7 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.compSarkar = sst_compSarkar; SSTParsedOptions.dll = sst_dll; - SSTParsedOptions.newBC = found_newBC; + SSTParsedOptions.tmrBC = found_tmrBC; SSTParsedOptions.wallOmegaLimit = found_wallOmegaLimit; return SSTParsedOptions; } diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index fc11ea4c7d8a..ecfa10dbb94c 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -1202,7 +1202,7 @@ void CConfig::SetConfig_Options() { /*!\brief SST_OPTIONS \n DESCRIPTION: Specify SA turbulence model options/corrections. \n Options: see \link SA_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/ addEnumListOption("SA_OPTIONS", nSA_Options, SA_Options, SA_Options_Map); - /*!\brief L_DOMAIN \n DESCRIPTION: Approximate length of the computational domain, for the far-field omega of SST_OPTIONS= NEWBC (NASA TMR). \ingroup Config*/ + /*!\brief L_DOMAIN \n DESCRIPTION: Approximate length of the computational domain, for the far-field omega of SST_OPTIONS= TMRBC (NASA TMR). \ingroup Config*/ addDoubleOption("L_DOMAIN", LDomain, 1.0); /*!\brief SST_SUST_TKE_AMB \n DESCRIPTION: Ambient k of the SST sustaining terms (m^2/s^2), <= 0 for 1e-6 U^2. \ingroup Config*/ addDoubleOption("SST_SUST_TKE_AMB", sstSustTkeAmb, 0.0); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index cb2e6dae87fd..8f9c026af905 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -1012,7 +1012,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes Tke_FreeStream = 3.0/2.0*(ModVel_FreeStream*ModVel_FreeStream*config->GetTurbulenceIntensity_FreeStream()*config->GetTurbulenceIntensity_FreeStream()); - if (config->GetSSTParsedOptions().newBC) { + if (config->GetSSTParsedOptions().tmrBC) { su2double Omega_Freestream = 10 * ModVel_FreeStream / config->GetLDomain(); Tke_FreeStream = Omega_Freestream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; } else if (config->GetSSTParsedOptions().sust) { @@ -1104,7 +1104,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes Omega_FreeStream = Density_FreeStream*Tke_FreeStream/max(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream(), EPS); Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/max(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream(), EPS); - if (config->GetSSTParsedOptions().newBC) { + if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 8262008eed64..96955c3b6555 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -1081,7 +1081,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, Omega_FreeStream = Density_FreeStream*Tke_FreeStream/max(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream(), EPS); Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/max(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream(), EPS); - if (config->GetSSTParsedOptions().newBC) { + if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 0ae4cdf54092..3ac445fbcfa4 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -499,7 +499,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i Omega_FreeStream = Density_FreeStream*Tke_FreeStream/max(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream(), EPS); Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/max(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream(), EPS); - if (config->GetSSTParsedOptions().newBC) { + if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index 15c909e31b62..41252b6d8c13 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -1197,7 +1197,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short Omega_FreeStream = Density_FreeStream*Tke_FreeStream/max(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream(), EPS); Omega_FreeStreamND = Density_FreeStreamND*Tke_FreeStreamND/max(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream(), EPS); - if (config->GetSSTParsedOptions().newBC) { + if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index ffca12d22e2f..55491389d306 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -124,7 +124,7 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, const CSolv su2double kine_Inf = 3.0/2.0*(VelMag2*Intensity*Intensity); su2double omega_Inf = rhoInf*kine_Inf/(muLamInf*viscRatio); - if (sstParsedOptions.newBC) { + if (sstParsedOptions.tmrBC) { omega_Inf = 10 * sqrt(VelMag2) / config->GetLDomain(); kine_Inf = omega_Inf*(muLamInf*viscRatio)/rhoInf; } else if (sstParsedOptions.sust) { @@ -657,7 +657,7 @@ void CTurbSSTSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, C const su2double viscRatio = Turb_Properties[1]; const su2double VelMag2 = GeometryToolbox::SquaredNorm(nDim, Velocity_Inlet); - if (sstParsedOptions.newBC) { + if (sstParsedOptions.tmrBC) { Inlet_Vars[1] = 10 * sqrt(VelMag2) / config->GetLDomain(); Inlet_Vars[0] = Inlet_Vars[1]*(Laminar_Viscosity_Inlet*viscRatio)/Density_Inlet; } else { diff --git a/config_template.cfg b/config_template.cfg index a80949ac3bb6..938e9817af7e 100644 --- a/config_template.cfg +++ b/config_template.cfg @@ -22,14 +22,14 @@ SOLVER= EULER KIND_TURB_MODEL= NONE % % Specify versions/corrections of the SST model (V2003m, V1994m, V2003, V1994, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, -% COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT, NEWBC, WALL_OMEGA_LIMIT). The "m" versions ignore 2/3 rho k in the +% COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT, TMRBC, WALL_OMEGA_LIMIT). The "m" versions ignore 2/3 rho k in the % stress tensor and use P = mu_t S^2 (NASA TMR); V2003 and V1994 are the standard versions with the exact production. -% NEWBC sets the far-field (and inlet) omega as in the original reference of the NASA TMR, omega = 10 U / L_DOMAIN, +% TMRBC sets the far-field (and inlet) omega as in the original reference of the NASA TMR, omega = 10 U / L_DOMAIN, % with k from FREESTREAM_TURB2LAMVISCRATIO (or the inlet viscosity ratio). % WALL_OMEGA_LIMIT clips the omega wall value 60 nu / (beta_1 d^2) to the upper limit of omega (off by default). SST_OPTIONS= NONE % -% Approximate length of the computational domain for NEWBC (m) +% Approximate length of the computational domain for TMRBC (m) L_DOMAIN= 1.0 % % Ambient values of the SST sustaining terms (SST_OPTIONS= SUSTAINING), also used as free-stream From 3b6ab824d469dd76fd4c150c4e106b2605177ad0 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 16:56:53 +0200 Subject: [PATCH 76/77] Keep the develop stress tensor call for models without the k term, clean up whitespace The 2/3 rho k term is selected inside SetStressTensor, so the callers are as in develop. Remove stray blank lines and extra spaces, and use beta_star in the omega Jacobian. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- Common/include/CConfig.hpp | 3 +-- Common/src/CConfig.cpp | 1 - .../numerics/turbulent/turb_sources.hpp | 2 +- SU2_CFD/src/numerics/flow/flow_diffusion.cpp | 22 +++++++++---------- SU2_CFD/src/solvers/CEulerSolver.cpp | 22 +++++++++---------- SU2_CFD/src/solvers/CIncEulerSolver.cpp | 2 +- SU2_CFD/src/solvers/CNSSolver.cpp | 9 +++++--- SU2_CFD/src/solvers/CTurbSSTSolver.cpp | 1 - SU2_CFD/src/variables/CTurbSSTVariable.cpp | 2 +- TestCases/hybrid_regression.py | 4 ++-- TestCases/parallel_regression_AD.py | 4 ++-- TestCases/tutorials.py | 4 ++-- 12 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index a96318f50fbd..4a2128362e5b 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -933,7 +933,6 @@ class CConfig { array MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */ array KtPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for thermal conductivity. */ su2double TurbIntensityAndViscRatioFreeStream[2]; /*!< \brief Freestream turbulent intensity and viscosity ratio for turbulence and transition models. */ - su2double Energy_FreeStream, /*!< \brief Free-stream total energy of the fluid. */ ModVel_FreeStream, /*!< \brief Magnitude of the free-stream velocity of the fluid. */ ModVel_FreeStreamND, /*!< \brief Non-dimensional magnitude of the free-stream velocity of the fluid. */ @@ -1280,7 +1279,7 @@ class CConfig { nHistoryOutput, nVolumeOutput; /*!< \brief Number of variables printed to the history file. */ bool Multizone_Residual; /*!< \brief Determines if memory should be allocated for the multizone residual. */ SST_ParsedOptions sstParsedOptions; /*!< \brief Additional parameters for the SST turbulence model. */ - su2double LDomain; + su2double LDomain; /*!< \brief Approximate length of the domain, for the far-field omega of TMRBC. */ su2double sstSustTkeAmb; /*!< \brief Ambient k of the SST sustaining terms (dimensional), <= 0 for the default. */ su2double sstSustOmegaAmb; /*!< \brief Ambient omega of the SST sustaining terms (dimensional), <= 0 for the default. */ SA_ParsedOptions saParsedOptions; /*!< \brief Additional parameters for the SA turbulence model. */ diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index ecfa10dbb94c..0d345a29b272 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -6701,7 +6701,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else cout << "\nusing default hard coded lower limit clipping"; cout << "." << endl; - break; } switch (Kind_Trans_Model) { diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index da3e75240bfd..3aa7806b758e 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -1045,7 +1045,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { if (!sstParsedOptions.modified) Jacobian_i[0][0] -= max(diverg, 0.0) * Volume*2.0/3.0; Jacobian_i[0][1] = -beta_star * ScalarVar_i[0] * Volume * (1.0 + zetaFMt); Jacobian_i[1][0] = 0.0; - Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - 0.09/beta_blended * zetaFMt); + Jacobian_i[1][1] = -2.0 * beta_blended * ScalarVar_i[1] * Volume * (1.0 - beta_star/beta_blended * zetaFMt); } AD::SetPreaccOut(Residual, nVar); diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index 0d66054575c9..6ac65167c99b 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -139,8 +139,14 @@ void CAvgGrad_Base::SetStressTensor(const su2double *val_primvar, tau[iDim][jDim] += (-Density) * MeanPerturbedRSM[iDim][jDim]; } else { const su2double total_viscosity = val_laminar_viscosity + val_eddy_viscosity; - // turb_ke is zero for the modified (m) SST versions, see #797 - ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, val_turb_ke); + /*--- 2/3 rho k only for the standard (non-m) SST versions, see #797. The other models call the function + * without it, so that their results do not change with how the compiler rounds a zero k term. ---*/ + const bool tkeInStress = config->GetKind_Turb_Model() == TURB_MODEL::SST && !sstParsedOptions.modified; + if (tkeInStress) { + ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, val_turb_ke); + } else { + ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, su2double(0.0)); + } } /* --- If the Stochastic Backscatter Model is active, add random contribution to stress tensor ---*/ @@ -405,7 +411,6 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -442,7 +447,6 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); - const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; Mean_Cp = 0.5 * (Cp_i + Cp_j); /*--- Mean gradient approximation ---*/ @@ -479,7 +483,7 @@ CNumerics::ResidualType<> CAvgGrad_Flow::ComputeResidual(const CConfig* config) /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, config); if (config->GetSAParsedOptions().qcr2000) { const su2double total_viscosity = Mean_Laminar_Viscosity + Mean_Eddy_Viscosity; @@ -595,7 +599,6 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi } unsigned short iVar, jVar, iDim; - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -631,7 +634,6 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi Mean_Eddy_Viscosity = 0.5*(Eddy_Viscosity_i + Eddy_Viscosity_j); Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); - const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -665,7 +667,7 @@ CNumerics::ResidualType<> CAvgGradInc_Flow::ComputeResidual(const CConfig* confi /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, config); if (config->GetSAParsedOptions().qcr2000) { const su2double total_viscosity = Mean_Laminar_Viscosity + Mean_Eddy_Viscosity; @@ -919,7 +921,6 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c AD::SetPreaccIn(Normal, nDim); unsigned short iVar, jVar, iDim; - const bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST) && !(config->GetSSTParsedOptions().modified); /*--- Normalized normal vector ---*/ @@ -965,7 +966,6 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c Mean_turb_ke = 0.5*(turb_ke_i + turb_ke_j); Mean_Thermal_Conductivity = 0.5*(Thermal_Conductivity_i + Thermal_Conductivity_j); Mean_Cp = 0.5*(Cp_i + Cp_j); - const su2double Mean_turb_ke_ForStressTensor = tkeNeeded ? Mean_turb_ke : 0.0; /*--- Mean gradient approximation ---*/ @@ -1001,7 +1001,7 @@ CNumerics::ResidualType<> CGeneralAvgGrad_Flow::ComputeResidual(const CConfig* c /*--- Get projected flux tensor (viscous residual) ---*/ - SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke_ForStressTensor, + SetStressTensor(Mean_PrimVar, Mean_GradPrimVar, Mean_turb_ke, Mean_Laminar_Viscosity, Mean_Eddy_Viscosity, config); if (config->GetSAParsedOptions().qcr2000) { const su2double total_viscosity = Mean_Laminar_Viscosity + Mean_Eddy_Viscosity; diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index 8f9c026af905..9593a6497a60 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -65,7 +65,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND); const bool time_stepping = (config->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING); const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); - bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST); + const bool tkeNeeded = (rans && config->GetKind_Turb_Model() == TURB_MODEL::SST); int Unst_RestartIter = 0; unsigned long iPoint, iMarker, counter_local = 0, counter_global = 0; @@ -1021,7 +1021,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes /*-- Compute the freestream energy. ---*/ - if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; + if (tkeNeeded) Energy_FreeStream += Tke_FreeStream; } else { @@ -1106,7 +1106,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); - Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // the reference length is 1 Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; @@ -5818,7 +5818,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Energy_i = nodes->GetEnergy(iPoint); StaticEnergy_i = Energy_i - 0.5*Velocity2_i; - if(tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) StaticEnergy_i -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_rhoe(Density_i, StaticEnergy_i); @@ -5878,12 +5878,12 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain turboVelocity[iDim] = sqrt(Velocity2_e)*Flow_Dir[iDim]; ComputeBackVelocity(turboVelocity,turboNormal, Velocity_e, config->GetMarker_All_TurbomachineryFlag(val_marker),config->GetKind_TurboMachinery(iZone)); StaticEnthalpy_e = Enthalpy_e - 0.5 * Velocity2_e; - if(tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_hs(StaticEnthalpy_e, Entropy_e); Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case MIXING_IN: @@ -5914,12 +5914,12 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain ComputeBackVelocity(turboVelocity,turboNormal, Velocity_e, config->GetMarker_All_TurbomachineryFlag(val_marker),config->GetKind_TurboMachinery(iZone)); StaticEnthalpy_e = Enthalpy_e - 0.5 * Velocity2_e; - if(tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) StaticEnthalpy_e -= turbNodes->GetSolution(iPoint, 0); GetFluidModel()->SetTDState_hs(StaticEnthalpy_e, Entropy_e); Density_e = GetFluidModel()->GetDensity(); StaticEnergy_e = GetFluidModel()->GetStaticEnergy(); Energy_e = StaticEnergy_e + 0.5 * Velocity2_e; - if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; @@ -5937,7 +5937,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; - if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; case STATIC_PRESSURE: @@ -5955,7 +5955,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; - if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; @@ -5973,7 +5973,7 @@ void CEulerSolver::BC_TurboRiemann(CGeometry *geometry, CSolver **solver_contain Velocity2_e += Velocity_e[iDim]*Velocity_e[iDim]; } Energy_e = GetFluidModel()->GetStaticEnergy() + 0.5*Velocity2_e; - if(tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); + if (tkeNeeded) Energy_e += turbNodes->GetSolution(iPoint, 0); break; default: diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 3ac445fbcfa4..8feab8bc55be 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -501,7 +501,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i if (config->GetSSTParsedOptions().tmrBC) { Omega_FreeStream = 10 * ModVel_FreeStream / config->GetLDomain(); - Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // Should it be non-dimensionalized for the Reynolds length? + Omega_FreeStreamND = 10 * ModVel_FreeStreamND / config->GetLDomain(); // the reference length is 1 Tke_FreeStream = Omega_FreeStream*(Viscosity_FreeStream*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStream; Tke_FreeStreamND = Omega_FreeStreamND*(Viscosity_FreeStreamND*config->GetTurb2LamViscRatio_FreeStream())/Density_FreeStreamND; diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index e3d952faf285..860a6153d58d 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -912,9 +912,12 @@ void CNSSolver::SetTau_Wall_WF(CGeometry *geometry, CSolver **solver_container, const su2double Lam_Visc_Wall = nodes->GetLaminarViscosity(iPoint); su2double Eddy_Visc_Wall = nodes->GetEddyViscosity(iPoint); - su2double tke = 0.0; - if (tkeNeeded) tke = Node_Turb->GetSolution(iPoint, 0); - CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, nodes->GetDensity(iPoint), tke); + if (tkeNeeded) { + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall, + nodes->GetDensity(iPoint), Node_Turb->GetSolution(iPoint, 0)); + } else { + CNumerics::ComputeStressTensor(nDim, tau, nodes->GetVelocityGradient(iPoint), Lam_Visc_Wall); + } su2double TauTangent[MAXNDIM] = {0.0}; GeometryToolbox::TangentProjection(nDim, tau, UnitNormal, TauTangent); diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index 55491389d306..e396af268571 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -403,7 +403,6 @@ void CTurbSSTSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta nodes->SetIntermittency(iPoint, numerics->GetIntermittencyEff()); } - /*--- Subtract residual and the Jacobian ---*/ LinSysRes.SubtractBlock(iPoint, residual); diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index b725287aaf0b..6fc2d48ce147 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -71,7 +71,7 @@ void CTurbSSTVariable::SetBlendingFunc(unsigned long iPoint, su2double val_visco CDkw(iPoint) *= 2.0*val_density*sigma_om2/Solution(iPoint,1); su2double exponent = 20.0; if (sstParsedOptions.version == SST_OPTIONS::V2003) exponent = 10.0; - CDkw(iPoint)= max(CDkw(iPoint), pow(10.0, -exponent)); + CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -exponent)); /*--- F1 ---*/ diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 0213e4ab8cde..a06cf1fdf44f 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -309,7 +309,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583739, 1.228713, 0.379593, -0.047067] + turb_naca0012_3c.test_vals = [-5.583739, 1.228713, 0.379593, -0.047067] turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305] test_list.append(turb_naca0012_3c) @@ -327,7 +327,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.552624, 1.234172, 0.424723, -0.033369] + turb_naca0012_p1c2.test_vals = [-5.552624, 1.234172, 0.424723, -0.033369] turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337] test_list.append(turb_naca0012_p1c2) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 11563baefca2..5eac6af81403 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -91,7 +91,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.226859, -0.256181, -2.298600, -0.003183] + discadj_rans_naca0012_sst.test_vals = [-2.226859, -0.256181, -2.298600, -0.003183] discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.226852, -0.253100, -2.299300, -0.003164] test_list.append(discadj_rans_naca0012_sst) @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.909640, 5.078072, 7.132311, 2.490930] + discadj_axisymmetric_rans_nozzle.test_vals = [9.909640, 5.078072, 7.132311, 2.490930] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index c6ee0fcdddd3..ca092bddb6a6 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -249,7 +249,7 @@ def main(): tutorial_trans_flatplate_T3A.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A" tutorial_trans_flatplate_T3A.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3A.test_iter = 20 - tutorial_trans_flatplate_T3A.test_vals = [-5.790251, -2.054841, -3.895394, -0.255140, -1.750418, 5.119342, -3.493255, 0.392596] + tutorial_trans_flatplate_T3A.test_vals = [-5.790251, -2.054841, -3.895394, -0.255140, -1.750418, 5.119342, -3.493255, 0.392596] tutorial_trans_flatplate_T3A.test_vals_aarch64 = [-5.808996, -2.070606, -3.969765, -0.277943, -1.953289, 1.708472, -3.514943, 0.357411] tutorial_trans_flatplate_T3A.no_restart = True test_list.append(tutorial_trans_flatplate_T3A) @@ -259,7 +259,7 @@ def main(): tutorial_trans_flatplate_T3Am.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A-" tutorial_trans_flatplate_T3Am.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3Am.test_iter = 20 - tutorial_trans_flatplate_T3Am.test_vals = [-5.582032, -1.700868, -3.083799, -0.098145, -3.750523, 3.287639, -2.394575, 1.119623] + tutorial_trans_flatplate_T3Am.test_vals = [-5.582032, -1.700868, -3.083799, -0.098145, -3.750523, 3.287639, -2.394575, 1.119623] tutorial_trans_flatplate_T3Am.test_vals_aarch64 = [-5.540938, -1.681627, -2.878831, -0.058224, -3.695533, 3.413628, -2.385345, 1.103633] tutorial_trans_flatplate_T3Am.no_restart = True test_list.append(tutorial_trans_flatplate_T3Am) From 38c26964218a441da0c603c12c65866ade0d21b3 Mon Sep 17 00:00:00 2001 From: rois1995 Date: Fri, 25 Sep 2026 18:00:57 +0200 Subject: [PATCH 77/77] Update the reference values of the regression tests from CI SST cases change with the TMR alignment and the boundary k (#1851). The laminar, FSI and SA cases (poiseuille_profile, fsi_cht, pywrapper_unsteadyFSI, turb_naca0012_sa, turb_flatplate) move only in the last digits, from the rounding of the optimized build. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6 --- TestCases/hybrid_regression.py | 28 ++++++++++++++-------------- TestCases/hybrid_regression_AD.py | 2 +- TestCases/parallel_regression.py | 28 ++++++++++++++-------------- TestCases/parallel_regression_AD.py | 2 +- TestCases/serial_regression.py | 28 ++++++++++++++-------------- TestCases/serial_regression_AD.py | 2 +- TestCases/tutorials.py | 2 +- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index a06cf1fdf44f..b88f0988cfe9 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -149,7 +149,7 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.004080, -7.638116, -0.000000, 2.089953] + poiseuille_profile.test_vals = [-12.004082, -7.637491, -0.000000, 2.089953] poiseuille_profile.test_vals_aarch64 = [-12.004276, -7.636719, -0.000000, 2.089953] test_list.append(poiseuille_profile) @@ -178,7 +178,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.501958, 5.889330, 0.635453, 0.021771, 100.000000] + rae2822_sst.test_vals = [-1.479160, 5.898617, 0.678431, 0.024642, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -186,7 +186,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.465534, 5.844290, 0.496763, 0.041047] + rae2822_sst_sust.test_vals = [-2.942880, 5.054180, 0.509065, 0.043399] test_list.append(rae2822_sst_sust) # Flat plate @@ -194,7 +194,7 @@ def main(): turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 20 - turb_flatplate.test_vals = [-0.187373, 0.003723, 10.000000, -1.443902] + turb_flatplate.test_vals = [-0.187373, 0.003723, 10.000000, -1.444696] test_list.append(turb_flatplate) # ONERA M6 Wing @@ -210,7 +210,7 @@ def main(): turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" turb_naca0012_sa.test_iter = 5 - turb_naca0012_sa.test_vals = [-12.038075, -16.332088, 1.080346, 0.018385, 20.000000, -2.873507, 0.000000, -14.250270, 0.000000] + turb_naca0012_sa.test_vals = [-12.038059, -16.332088, 1.080346, 0.018385, 20.000000, -2.873343, 0.000000, -14.250270, 0.000000] turb_naca0012_sa.test_vals_aarch64 = [-12.038091, -16.332090, 1.080346, 0.018385, 20.000000, -2.873236, 0.000000, -14.250271, 0.000000] test_list.append(turb_naca0012_sa) @@ -228,7 +228,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-7.626753, -9.772172, -2.145343, 1.006222, 0.019331, -1.350065] + turb_naca0012_sst_sust.test_vals = [-7.626467, -9.698545, -2.145340, 1.006188, 0.019328, -1.353713] turb_naca0012_sst_sust.test_vals_aarch64 = [-12.073210, -14.836724, -5.732627, 1.000050, 0.019144, -2.629689] test_list.append(turb_naca0012_sst_sust) @@ -237,7 +237,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.192392, -10.448079, 0.773965, 1.022535, 0.040529, -2.383370] + turb_naca0012_sst_fixedvalues.test_vals = [-5.192392, -10.448218, 0.773965, 1.022535, 0.040529, -2.383336] test_list.append(turb_naca0012_sst_fixedvalues) # NACA0012 (SST, explicit Euler for flow and turbulence equations) @@ -279,7 +279,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.551665, -5.057150, 0.830240, -0.008811, 0.078187] + turb_naca0012_sst_restart_mg.test_vals = [-3.689602, -5.056964, 0.830559, -0.008732, 0.078126] test_list.append(turb_naca0012_sst_restart_mg) ############################# @@ -291,7 +291,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-5.021907, 1.337718, 0.489529, -0.010558] + turb_naca0012_1c.test_vals = [-4.964342, 1.345656, 0.446527, -0.028331] turb_naca0012_1c.test_vals_aarch64 = [-4.976620, 1.345983, 0.433171, -0.033685] test_list.append(turb_naca0012_1c) @@ -300,7 +300,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482903, 1.260881, 0.405402, -0.040054] + turb_naca0012_2c.test_vals = [-5.482844, 1.260888, 0.404947, -0.040154] turb_naca0012_2c.test_vals_aarch64 = [-5.485484, 1.263406, 0.411442, -0.040859] test_list.append(turb_naca0012_2c) @@ -309,7 +309,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.583739, 1.228713, 0.379593, -0.047067] + turb_naca0012_3c.test_vals = [-5.583731, 1.228717, 0.379824, -0.046992] turb_naca0012_3c.test_vals_aarch64 = [-5.583737, 1.232005, 0.390258, -0.046305] test_list.append(turb_naca0012_3c) @@ -318,7 +318,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.124123, 1.284616, 0.555627, 0.012213] + turb_naca0012_p1c1.test_vals = [-5.167299, 1.279420, 0.549536, 0.011043] turb_naca0012_p1c1.test_vals_aarch64 = [-5.114189, 1.285037, 0.406851, -0.043003] test_list.append(turb_naca0012_p1c1) @@ -327,7 +327,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.552624, 1.234172, 0.424723, -0.033369] + turb_naca0012_p1c2.test_vals = [-5.553265, 1.234113, 0.424941, -0.033285] turb_naca0012_p1c2.test_vals_aarch64 = [-5.548245, 1.236384, 0.381821, -0.050337] test_list.append(turb_naca0012_p1c2) @@ -602,7 +602,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.944845, -12.202690, -19.234414, -13.518577, -19.032823, -13.398159, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.907561, -12.214137, -19.151426, -13.451780, -19.085218, -13.450796, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index b2086915f9df..f5371bbe5200 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -87,7 +87,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.201555, -0.175213, 3.045200, -0.041846] + discadj_rans_naca0012_sst.test_vals = [-2.201612, -0.175090, 3.046200, -0.041861] discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.201855, -0.172443, 3.043400, -0.041820] test_list.append(discadj_rans_naca0012_sst) diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index 57209e5f4306..133b1aebbdd6 100755 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -438,7 +438,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.495621, 5.875629, 0.638353, 0.020410, 100.000000] + rae2822_sst.test_vals = [-1.505224, 5.876281, 0.639383, 0.020780, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -446,7 +446,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.465087, 5.851605, 0.496009, 0.041100] + rae2822_sst_sust.test_vals = [-2.939568, 5.056410, 0.509111, 0.042674] test_list.append(rae2822_sst_sust) # Flat plate @@ -634,7 +634,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.560190, -5.057149, 0.830238, -0.008812, 0.078167] + turb_naca0012_sst_restart_mg.test_vals = [-3.692233, -5.056998, 0.830505, -0.008795, 0.078083] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -1041,7 +1041,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-5.019853, 1.338557, 0.674994, 0.012626] + turb_naca0012_1c.test_vals = [-4.965784, 1.346107, 0.672718, 0.011889] turb_naca0012_1c.test_vals_aarch64 = [-4.981036, 1.345868, 0.673232, 0.010091] test_list.append(turb_naca0012_1c) @@ -1050,7 +1050,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482710, 1.262929, 0.536020, -0.021682] + turb_naca0012_2c.test_vals = [-5.482675, 1.262934, 0.535624, -0.021772] turb_naca0012_2c.test_vals_aarch64 = [-5.484365, 1.264701, 0.501741, -0.033109] test_list.append(turb_naca0012_2c) @@ -1067,7 +1067,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.119372, 1.284797, 0.808582, 0.048191] + turb_naca0012_p1c1.test_vals = [-5.164490, 1.279381, 0.810659, 0.048539] turb_naca0012_p1c1.test_vals_aarch64 = [-5.122100, 1.284478, 0.608744, -0.008593] test_list.append(turb_naca0012_p1c1) @@ -1076,7 +1076,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.552837, 1.234409, 0.608413, -0.007582] + turb_naca0012_p1c2.test_vals = [-5.553369, 1.234366, 0.608821, -0.007429] test_list.append(turb_naca0012_p1c2) ###################################### @@ -1231,7 +1231,7 @@ def main(): datadriven_fluidModel.cfg_dir = "nicf/datadriven" datadriven_fluidModel.cfg_file = "datadriven_nozzle.cfg" datadriven_fluidModel.test_iter = 50 - datadriven_fluidModel.test_vals = [-4.879421, -2.353319, -2.344004, 0.390613, -1.559800, 1.322761] + datadriven_fluidModel.test_vals = [-4.788556, -1.721315, -2.318534, 0.759228, -1.558870, 1.321951] test_list.append(datadriven_fluidModel) ###################################### @@ -1252,7 +1252,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.924428, -12.203366, -19.179995, -13.468776, -19.035084, -13.399644, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.941917, -12.212515, -19.254664, -13.545311, -19.087161, -13.454459, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1360,7 +1360,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.457912, -1.541047] + bars_SST_2D.test_vals = [13.000000, -0.457937, -1.540952] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1560,7 +1560,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.094692, -15.251093, -5.906365, 1.070413, 0.015775, -2.376043, 0.000000] + pywrapper_turb_naca0012_sst.test_vals = [-5.949126, -10.294721, -3.763091, 1.069311, 0.015852, -3.462062, 0.000000] pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.075620, -15.246688, -5.861276, 1.070036, 0.015841, -1.991001, 0.000000] pywrapper_turb_naca0012_sst.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_turb_naca0012_sst.timeout = 3200 @@ -1571,7 +1571,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 10 - pywrapper_square_cylinder.test_vals = [-1.178521, -0.349772, 1.401402, 2.359105, 1.401729, 2.300974, 0.000000] + pywrapper_square_cylinder.test_vals = [-1.178520, -0.349721, 1.401402, 2.359105, 1.401729, 2.300974, 0.000000] pywrapper_square_cylinder.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) @@ -1611,7 +1611,7 @@ def main(): pywrapper_unsteadyFSI.cfg_dir = "py_wrapper/dyn_fsi" pywrapper_unsteadyFSI.cfg_file = "config.cfg" pywrapper_unsteadyFSI.test_iter = 4 - pywrapper_unsteadyFSI.test_vals = [0, 31, 5, 47, -1.756677, -2.828286, -7.638545, -6.863930, 0.000156] + pywrapper_unsteadyFSI.test_vals = [0.000000, 31.000000, 5.000000, 48.000000, -1.756677, -2.828286, -7.638545, -6.863930, 0.000156] pywrapper_unsteadyFSI.command = TestCase.Command("mpirun -np 2", "python", "run.py") pywrapper_unsteadyFSI.unsteady = True pywrapper_unsteadyFSI.multizone = True @@ -1622,7 +1622,7 @@ def main(): pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" pywrapper_unsteadyCHT.test_iter = 5 - pywrapper_unsteadyCHT.test_vals = [-1.614168, 2.260203, -0.008065, 0.201068] + pywrapper_unsteadyCHT.test_vals = [-1.614169, 2.260208, -0.008127, 0.201931] pywrapper_unsteadyCHT.command = TestCase.Command("mpirun -np 2", "python", "launch_unsteady_CHT_FlatPlate.py --parallel -f") pywrapper_unsteadyCHT.unsteady = True test_list.append(pywrapper_unsteadyCHT) diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 5eac6af81403..24cd6087573a 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -251,7 +251,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.555050, -10.335490, -10.357063, -13.629079] + discadj_trans_stator.test_vals = [79.000000, -7.555663, -10.335501, -10.356934, -13.629559] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.555647, -10.335486, -10.356919, -13.629543] test_list.append(discadj_trans_stator) diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index 24ae0b72a56d..dc52774795fd 100755 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -208,7 +208,7 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.003115, -7.626023, -0.000000, 2.089953] + poiseuille_profile.test_vals = [-12.003113, -7.626005, -0.000000, 2.089953] poiseuille_profile.test_vals_aarch64 = [-12.009012, -7.262299, -0.000000, 2.089953] #last 4 columns test_list.append(poiseuille_profile) @@ -236,7 +236,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-1.745363, -1.484660, 5.883796, 0.579910, 0.017299, 100.000000] + rae2822_sst.test_vals = [-1.682306, -1.473692, 5.871878, 0.593725, 0.020638, 100.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -244,7 +244,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.464319, 5.852571, 0.490309, 0.042521] + rae2822_sst_sust.test_vals = [-2.941125, 5.058633, 0.507642, 0.044280] test_list.append(rae2822_sst_sust) # Flat plate @@ -377,7 +377,7 @@ def main(): axi_rans_air_nozzle_species.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_species.cfg_file = "air_nozzle_species.cfg" axi_rans_air_nozzle_species.test_iter = 10 - axi_rans_air_nozzle_species.test_vals = [-1.690665, 3.882506, -2.928702, 5.760933, -3.144560, 0.000000] + axi_rans_air_nozzle_species.test_vals = [-1.690622, 3.882548, -2.928703, 5.760932, -3.146519, 0.000000] axi_rans_air_nozzle_species.tol = 0.0001 test_list.append(axi_rans_air_nozzle_species) @@ -391,7 +391,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 50 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-6.570974, -5.081421, 0.810883, -0.008830, 0.077967] + turb_naca0012_sst_restart_mg.test_vals = [-3.649967, -5.081630, 0.810585, -0.009208, 0.078506] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -744,7 +744,7 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-5.021674, 1.337926, 0.603892, 0.019471] + turb_naca0012_1c.test_vals = [-4.963256, 1.346299, 0.604691, 0.019761] turb_naca0012_1c.test_vals_aarch64 = [-4.992791, 1.342873, 0.557941, 0.003269] test_list.append(turb_naca0012_1c) @@ -753,7 +753,7 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.482899, 1.262062, 0.464050, -0.025067] + turb_naca0012_2c.test_vals = [-5.482902, 1.262062, 0.464303, -0.024986] test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -769,7 +769,7 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.130090, 1.284042, 0.790860, 0.090004] + turb_naca0012_p1c1.test_vals = [-5.163879, 1.280584, 0.794994, 0.091481] turb_naca0012_p1c1.test_vals_aarch64 = [-5.119942, 1.283920, 0.486264, -0.021518] test_list.append(turb_naca0012_p1c1) @@ -778,7 +778,7 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.552566, 1.235156, 0.576899, 0.017942] + turb_naca0012_p1c2.test_vals = [-5.553241, 1.235093, 0.577763, 0.018264] test_list.append(turb_naca0012_p1c2) ###################################### @@ -958,7 +958,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-11.924922, -12.203258, -19.179435, -13.466827, -19.026493, -13.392226, 73286.000000, 73286.000000, 0.020056, 82.286000] + Jones_tc_restart.test_vals = [-11.944235, -12.212620, -19.261137, -13.549357, -19.083828, -13.444697, 73286.000000, 73286.000000, 0.020056, 82.286000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1078,7 +1078,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.456143, -1.541051] + bars_SST_2D.test_vals = [13.000000, -0.456168, -1.540956] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1156,7 +1156,7 @@ def main(): fsi_cht.cfg_dir = "fea_fsi/stat_fsi" fsi_cht.cfg_file = "config.cfg" fsi_cht.test_iter = 20 - fsi_cht.test_vals = [5.000000, -5.077002, -5.379450, -9.247804, -9.320014, -9.185034, 608.350000, -0.012973, 0.000000, 30.000000] + fsi_cht.test_vals = [5.000000, -5.077006, -5.379442, -9.247807, -9.319231, -9.184766, 608.350000, -0.012973, 0.000000, 30.000000] fsi_cht.multizone = True test_list.append(fsi_cht) @@ -1645,7 +1645,7 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-12.094431, -15.251082, -5.906366, 1.070413, 0.015775, -3.178469, 0.000000] + pywrapper_turb_naca0012_sst.test_vals = [-5.948762, -10.293853, -3.762064, 1.069291, 0.015853, -3.348638, 0.000000] pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.076068, -15.246740, -5.861280, 1.070036, 0.015841, -3.297854, 0.000000] pywrapper_turb_naca0012_sst.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_turb_naca0012_sst.timeout = 3200 @@ -1659,7 +1659,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 3 - pywrapper_square_cylinder.test_vals = [-2.560678, -1.175979, 0.062202, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] + pywrapper_square_cylinder.test_vals = [-2.560698, -1.175978, 0.062220, 1.399351, 2.219234, 1.399297, 2.217479, 0.000000] pywrapper_square_cylinder.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index bf18239ac055..ef2b21b9915d 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -200,7 +200,7 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -7.308278, -9.893294, -10.039103, -13.368529] + discadj_trans_stator.test_vals = [79.000000, -7.308168, -9.891121, -10.038669, -13.368502] discadj_trans_stator.test_vals_aarch64 = [79.000000, -7.308167, -9.891117, -10.038669, -13.368501] test_list.append(discadj_trans_stator) diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index ca092bddb6a6..cab0d9c23f48 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -259,7 +259,7 @@ def main(): tutorial_trans_flatplate_T3Am.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A-" tutorial_trans_flatplate_T3Am.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3Am.test_iter = 20 - tutorial_trans_flatplate_T3Am.test_vals = [-5.582032, -1.700868, -3.083799, -0.098145, -3.750523, 3.287639, -2.394575, 1.119623] + tutorial_trans_flatplate_T3Am.test_vals = [-5.585365, -1.700868, -3.089065, -0.101095, -3.750523, 3.287642, -2.394575, 1.119623] tutorial_trans_flatplate_T3Am.test_vals_aarch64 = [-5.540938, -1.681627, -2.878831, -0.058224, -3.695533, 3.413628, -2.385345, 1.103633] tutorial_trans_flatplate_T3Am.no_restart = True test_list.append(tutorial_trans_flatplate_T3Am)