Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Inconsistencies and improvements to SST model #2329

Open
wants to merge 43 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2a66c54
- Added TKE production limiter constant to config
rois1995 Jun 10, 2024
7582590
- Added Production and Destruction terms of SST to output
rois1995 Jun 17, 2024
edce8ee
- Added user-defined lower limits of TKE and W
rois1995 Jul 19, 2024
41c61ca
- Changed the Cross-Diffusion term in F1 computations
rois1995 Jul 22, 2024
7b11baa
- Removed obsolete changes to TKE prod limiter
rois1995 Jul 22, 2024
9482f51
- Modified the config output
rois1995 Jul 22, 2024
38a02d6
- Added lower limit changes for SST in config output
rois1995 Jul 22, 2024
c3e0d4b
- Added wall distance output for mesh adaptation
rois1995 Jul 22, 2024
0f7558b
- Added strain magnitude as output
rois1995 Jul 22, 2024
3be370d
- added production limiter flag to output
rois1995 Jul 22, 2024
125fd6d
- Changed the Cross-Diffusion term in the residual of Omega
rois1995 Jul 24, 2024
91cc3b8
- Added clipping of the cross-diffusion term in SST residual
rois1995 Jul 24, 2024
7b78756
- changed cross diffusion term clipping in Omega residual
rois1995 Jul 24, 2024
076d471
- Added CDkw and F1 as output
rois1995 Jul 24, 2024
2e73f77
- Fixed Supersonic inlet BC inclusion of TKE
rois1995 Jul 25, 2024
c662daf
- Corrected Riemann BC for TKE
rois1995 Jul 25, 2024
41e1c16
- Fixed more BCs
rois1995 Jul 25, 2024
e9dfc27
- Fixed bug with Cross diffusion in W residual
rois1995 Jul 26, 2024
9a6fc06
- changed default for cross diffusion
rois1995 Jul 26, 2024
251ae27
- Restored old computation of Cross-Diffusion terms in the source res…
rois1995 Aug 12, 2024
9c7c950
Added BCs for SST-SUST
rois1995 Aug 30, 2024
2042017
Merge branch 'develop' into feature_SSTMod
rois1995 Aug 30, 2024
9d82d51
- Removed duplicate SST options
rois1995 Aug 30, 2024
c10b006
- Removed not used config variables
rois1995 Aug 30, 2024
be98cdd
- fixed merge error
rois1995 Aug 30, 2024
fc30f5d
- Include full production and SSTm into the computation of the Stress…
rois1995 Sep 2, 2024
a957ec7
Updated the freestream values for the print out
rois1995 Sep 3, 2024
5546936
- Removed unused variables in turb_sources
rois1995 Sep 3, 2024
1b8ee5b
- Added F2 blending function as output
rois1995 Sep 3, 2024
6d3586f
- Restore previously removed variables
rois1995 Sep 3, 2024
f27a7cb
- clean up of variables for Reynolds Stress Tensor computation
rois1995 Sep 4, 2024
448a532
- Use full tke production term in Pw instead of only P_base
rois1995 Sep 4, 2024
e9fa4e7
- Fixed Errors in AD compiling
rois1995 Sep 6, 2024
c2462e8
- added tke to the numerics simd computations
rois1995 Sep 9, 2024
51112fe
- Fixed UQ problem
rois1995 Sep 9, 2024
576e8ee
- fix UQ implementation
rois1995 Sep 9, 2024
acc21ec
- Removed unused variables
rois1995 Sep 9, 2024
b5ca6ea
Merge branch 'develop' into feature_SSTMod
rois1995 Sep 11, 2024
c6376cd
- Started including tke when computing the speed of sound
rois1995 Sep 12, 2024
27175f8
Merge branch 'develop' into feature_SSTMod
rois1995 Sep 16, 2024
d54cd39
Merge branch 'feature_SSTMod' of https://github.com/su2code/SU2 into …
rois1995 Sep 16, 2024
c5aeb5a
- Start to include tke only when not m version of SST is used
rois1995 Sep 16, 2024
6441eb8
Merge branch 'tmp' into HEAD
rois1995 Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,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 laminar 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. */
Expand All @@ -872,6 +872,7 @@ class CConfig {
array<su2double, N_POLY_COEFFS> MuPolyCoefficientsND{{0.0}}; /*!< \brief Definition of the non-dimensional temperature polynomial coefficients for viscosity. */
array<su2double, N_POLY_COEFFS> 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. */
Expand Down Expand Up @@ -1171,6 +1172,8 @@ 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;
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 */
Expand Down Expand Up @@ -1958,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.
Expand Down Expand Up @@ -9877,6 +9880,9 @@ class CConfig {
*/
SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; }

su2double GetProdLimConst() const { return prodLimConst; }
su2double GetLDomain() const { return LDomain; }

/*!
* \brief Get parsed SA option data structure.
* \return SA option data structure.
Expand Down
20 changes: 18 additions & 2 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,21 +994,27 @@ 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. */
};
static const MapType<std::string, SST_OPTIONS> 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("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)
};

/*!
Expand All @@ -1023,6 +1029,9 @@ 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. */
};

/*!
Expand All @@ -1040,6 +1049,10 @@ 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);

const bool found_1994 = IsPresent(SST_OPTIONS::V1994);
const bool found_2003 = IsPresent(SST_OPTIONS::V2003);
const bool found_1994m = IsPresent(SST_OPTIONS::V1994m);
Expand Down Expand Up @@ -1097,6 +1110,9 @@ 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;
}

Expand Down
6 changes: 6 additions & 0 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,9 @@ 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);
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);
/*!\brief SST_OPTIONS \n DESCRIPTION: Specify LM transition model options/correlations. \n Options: see \link LM_Options_Map \endlink \n DEFAULT: NONE \ingroup Config*/
Expand Down Expand Up @@ -6225,6 +6228,9 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
else cout << "\nusing default hard coded lower limit clipping";

cout << "." << endl;

if (sstParsedOptions.prodLim) cout << "Changing the value of the TKE production limiter constant to " << prodLimConst << endl;

break;
}
switch (Kind_Trans_Model) {
Expand Down
4 changes: 4 additions & 0 deletions SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ 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
Expand Down Expand Up @@ -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];}
};

/*!
Expand Down
21 changes: 19 additions & 2 deletions SU2_CFD/include/numerics/turbulent/turb_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,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];
Expand Down Expand Up @@ -871,6 +873,11 @@ 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.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;
su2double pk = max(0.0, min(P, prod_limit));

const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i;
Expand All @@ -879,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;
}
Expand Down Expand Up @@ -914,17 +921,26 @@ 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;

/*--- Cross diffusion ---*/
ProdDistr[0] = Pk;
ProdDistr[1] = Dk;
ProdDistr[2] = Pw;
ProdDistr[3] = Dw;
ProdDistr[4] = PLim;

/*--- Cross diffusion ---*/
Residual[1] += (1.0 - F1_i) * CDkw_i * Volume;

/*--- Contribution due to 2D axisymmetric formulation ---*/
Expand All @@ -934,6 +950,7 @@ 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;
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);
Expand Down
11 changes: 11 additions & 0 deletions SU2_CFD/include/numerics_simd/flow/convection/centered.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -96,6 +98,8 @@ class CCenteredBase : public Base {
const bool implicit = (config.GetKind_TimeIntScheme() == EULER_IMPLICIT);
const auto& solution = static_cast<const CEulerVariable&>(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);

Expand All @@ -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<CCompressibleConservatives<nDim> > U;
Expand Down
15 changes: 13 additions & 2 deletions SU2_CFD/include/numerics_simd/flow/convection/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,30 @@
template<class ReconVarType, class PrimVarType, size_t nDim, class VariableType>
FORCEINLINE CPair<ReconVarType> reconstructPrimitives(Int iEdge, Int iPoint, Int jPoint,
bool muscl, LIMITER limiterType,
bool musclTurb, LIMITER limiterTypeTurb,
const CPair<PrimVarType>& V1st,
const VectorDbl<nDim>& 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();
Comment on lines +116 to +117

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

CPair<ReconVarType> 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) {
Expand All @@ -143,9 +153,10 @@
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);
Expand Down
21 changes: 19 additions & 2 deletions SU2_CFD/include/numerics_simd/flow/convection/roe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
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.
Expand All @@ -73,7 +77,9 @@
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:
Expand All @@ -96,9 +102,13 @@
const bool implicit = (config.GetKind_TimeIntScheme() == EULER_IMPLICIT);
const auto& solution = static_cast<const CEulerVariable&>(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;

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.

/*--- Geometric properties. ---*/

const auto vector_ij = distanceVector<nDim>(iPoint, jPoint, geometry.nodes->GetCoord());
Expand All @@ -116,8 +126,13 @@
V1st.i.all = gatherVariables<nPrimVar>(iPoint, solution.GetPrimitive());
V1st.j.all = gatherVariables<nPrimVar>(jPoint, solution.GetPrimitive());

if (tkeNeeded) {
V1st.i.allTurb = gatherVariables(iPoint, turbVars->GetSolution());
V1st.j.allTurb = gatherVariables(jPoint, turbVars->GetSolution());
}

auto V = reconstructPrimitives<CCompressiblePrimitives<nDim,nPrimVarGrad> >(
iEdge, iPoint, jPoint, muscl, typeLimiter, V1st, vector_ij, solution);
iEdge, iPoint, jPoint, muscl, typeLimiter, musclTurb, typeLimiterTurb, V1st, vector_ij, solution, tkeNeeded);

/*--- Compute conservative variables. ---*/

Expand Down Expand Up @@ -229,6 +244,8 @@
using Base::kappa;
const ENUM_ROELOWDISS typeDissip;

using Base::turbVars;

public:
/*!
* \brief Constructor, store some constants and forward to base.
Expand Down
4 changes: 2 additions & 2 deletions SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ FORCEINLINE void correctGradient(const PrimitiveType& V,
*/
template<size_t nVar, size_t nDim>
FORCEINLINE MatrixDbl<nDim> stressTensor(Double viscosity,
const MatrixDbl<nVar,nDim>& grad) {
const MatrixDbl<nVar,nDim>& 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<nDim> tau;
for (size_t iDim = 0; iDim < nDim; ++iDim) {
Expand Down
Loading
Loading