Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
2a66c54
- Added TKE production limiter constant to config
Jun 10, 2024
7582590
- Added Production and Destruction terms of SST to output
Jun 17, 2024
edce8ee
- Added user-defined lower limits of TKE and W
Jul 19, 2024
41c61ca
- Changed the Cross-Diffusion term in F1 computations
Jul 22, 2024
7b11baa
- Removed obsolete changes to TKE prod limiter
Jul 22, 2024
9482f51
- Modified the config output
Jul 22, 2024
38a02d6
- Added lower limit changes for SST in config output
Jul 22, 2024
c3e0d4b
- Added wall distance output for mesh adaptation
Jul 22, 2024
0f7558b
- Added strain magnitude as output
Jul 22, 2024
3be370d
- added production limiter flag to output
Jul 22, 2024
125fd6d
- Changed the Cross-Diffusion term in the residual of Omega
Jul 24, 2024
91cc3b8
- Added clipping of the cross-diffusion term in SST residual
Jul 24, 2024
7b78756
- changed cross diffusion term clipping in Omega residual
Jul 24, 2024
076d471
- Added CDkw and F1 as output
Jul 24, 2024
2e73f77
- Fixed Supersonic inlet BC inclusion of TKE
Jul 25, 2024
c662daf
- Corrected Riemann BC for TKE
Jul 25, 2024
41e1c16
- Fixed more BCs
Jul 25, 2024
e9dfc27
- Fixed bug with Cross diffusion in W residual
Jul 26, 2024
9a6fc06
- changed default for cross diffusion
Jul 26, 2024
251ae27
- Restored old computation of Cross-Diffusion terms in the source res…
Aug 12, 2024
9c7c950
Added BCs for SST-SUST
Aug 30, 2024
2042017
Merge branch 'develop' into feature_SSTMod
Aug 30, 2024
9d82d51
- Removed duplicate SST options
Aug 30, 2024
c10b006
- Removed not used config variables
Aug 30, 2024
be98cdd
- fixed merge error
Aug 30, 2024
fc30f5d
- Include full production and SSTm into the computation of the Stress…
Sep 2, 2024
a957ec7
Updated the freestream values for the print out
Sep 3, 2024
5546936
- Removed unused variables in turb_sources
Sep 3, 2024
1b8ee5b
- Added F2 blending function as output
Sep 3, 2024
6d3586f
- Restore previously removed variables
Sep 3, 2024
f27a7cb
- clean up of variables for Reynolds Stress Tensor computation
Sep 4, 2024
448a532
- Use full tke production term in Pw instead of only P_base
Sep 4, 2024
e9fa4e7
- Fixed Errors in AD compiling
Sep 6, 2024
c2462e8
- added tke to the numerics simd computations
Sep 9, 2024
51112fe
- Fixed UQ problem
Sep 9, 2024
576e8ee
- fix UQ implementation
Sep 9, 2024
acc21ec
- Removed unused variables
Sep 9, 2024
b5ca6ea
Merge branch 'develop' into feature_SSTMod
Sep 11, 2024
c6376cd
- Started including tke when computing the speed of sound
Sep 12, 2024
27175f8
Merge branch 'develop' into feature_SSTMod
Sep 16, 2024
d54cd39
Merge branch 'feature_SSTMod' of https://github.com/su2code/SU2 into …
Sep 16, 2024
c5aeb5a
- Start to include tke only when not m version of SST is used
Sep 16, 2024
6441eb8
Merge branch 'tmp' into HEAD
Sep 16, 2024
317f563
- Fixed tke integration in thermodynamic variables
Sep 20, 2024
d6af702
- Code improvements
Oct 2, 2024
8f97a16
- minor changes
Oct 11, 2024
fd43746
Merge branch 'develop' into feature_SSTMod
Oct 11, 2024
a8a603e
- update externals
Oct 11, 2024
340faa4
- Fixed inlet BCs when new BCs are used
Oct 11, 2024
f4cb207
Merge branch 'develop' into feature_SSTMod
Oct 22, 2024
16cac0a
Merge branch 'develop' into feature_SSTMod
bigfooted Oct 30, 2024
c4f10fe
Update Common/include/CConfig.hpp
rois1995 Oct 31, 2024
6eb02da
Merge branch 'develop' into feature_SSTMod
bigfooted Feb 3, 2025
f0e280a
changes to MLPCpp
Mar 4, 2025
3ca65bf
Merge branch 'develop' into feature_SSTMod
Mar 4, 2025
32a6eea
- Fix output GetStrainMag bug
Mar 4, 2025
89a559a
- Try fixing output bug again
Mar 4, 2025
d4ee84b
same fix
Mar 4, 2025
5a40f57
- Added Shuzen and Hoffmann compressibility correction
Apr 10, 2025
c370f41
Merge branch 'feature_SSTMod' of https://github.com/su2code/SU2 into …
Apr 10, 2025
e9eb7ad
Merge remote-tracking branch 'origin/develop' into feature_SSTMod
Apr 10, 2025
e8d4bf3
- changed output for debug variables
Apr 10, 2025
4d2aba5
- Added term to jacobian of w
Apr 10, 2025
e4ceb0e
- Add neighbor wall distance as debug output
Apr 11, 2025
0d75465
- Remove Jacobian changes
Apr 11, 2025
f159412
- Add grad vel as output
Apr 11, 2025
939faa1
- add upper bound into BCs
Apr 11, 2025
99ac333
Merge remote-tracking branch 'origin/symmetry_jacobian' into feature_…
Apr 11, 2025
ee1d5fa
Merge branch 'develop' into feature_SSTMod
Sep 23, 2026
0b1cf18
Fix the build after merging develop
Sep 23, 2026
5630863
Reset the SST production and destruction outputs at every point
Sep 23, 2026
5c65018
Divide the Suzen-Hoffmann omega correction by the kinematic eddy visc…
Sep 23, 2026
9aa1e80
Leave k out of the energy of the modified SST versions everywhere
Sep 23, 2026
db13b53
Register the NEIGHBORDIST output for all the flow solvers
Sep 23, 2026
ae4c9fb
Add options for the ambient values of the SST sustaining terms
Sep 24, 2026
d1fe4b2
Avoid 0/0 in the omega production of SST-1994 where mu_t = 0
Sep 24, 2026
fd1bbbd
Keep the k Jacobian of the non-modified SST versions diagonally dominant
Sep 24, 2026
16b44bc
Remove the Suzen-Hoffmann compressibility correction from this branch
Sep 24, 2026
b6f221e
Keep k in the energy of all SST versions and impose it consistently a…
Sep 25, 2026
9ebd5e6
Use the exact production for the standard SST versions and remove FUL…
Sep 25, 2026
8c18e3e
Document the SST versions, NEWBC and the TMR far-field viscosity ratio
Sep 25, 2026
8e37635
Make the clipping of the omega wall value an SST option, off by default
Sep 25, 2026
3fccc07
Move the changes that are not alignment with the NASA TMR out of this…
Sep 25, 2026
184fe00
Remove comment-only changes and unused variables
Sep 25, 2026
444eeeb
Keep the rounding of the SIMD stress tensor when k is not included
Sep 25, 2026
d1c4d35
Keep develop's SIMD stress tensor and add 2/3 rho k separately
Sep 25, 2026
d5f040e
Use the k of the boundary node in the energy of all flow boundary sta…
Sep 25, 2026
89c7aaa
Update the reference values of the SST regression tests
Sep 25, 2026
81739de
Merge branch 'develop' into feature_SSTMod
Sep 25, 2026
95de110
Rename the SST option NEWBC to TMRBC
Sep 25, 2026
3b6ab82
Keep the develop stress tensor call for models without the k term, cl…
Sep 25, 2026
38c2696
Update the reference values of the regression tests from CI
Sep 25, 2026
d81a597
Do not add k twice in the Riemann DENSITY_VELOCITY boundary state
Sep 28, 2026
b95f74a
Keep the SST production modifier when a compressibility correction is…
Sep 28, 2026
771b26e
Treat the SST k in the total energy consistently in the convective fl…
Sep 28, 2026
e3e4fc9
Hold the SST k fixed in the pressure derivatives of the convective Ja…
Sep 28, 2026
906692a
Include the SST k in the energy row of the eigenvector matrices, chec…
Sep 28, 2026
a30458a
Apply clang-format to the Roe k unit test
Sep 28, 2026
5687a3e
Treat a jump of the SST k as a contact in Roe and JST-mat, include k …
Sep 28, 2026
048b10a
Remove k from the SLAU/AUSM speed of sound, stop on a zero SST free s…
Sep 29, 2026
05edc44
Hold the SST k out of the AUSM+up speed of sound and the accurate AUS…
Sep 29, 2026
b3ae2c7
Reject SST with engine and actuator-disk markers, remove a dead write…
Sep 29, 2026
de0255d
Remove k from the MSW speed of sound, check SST engine/actuator-disk …
Sep 29, 2026
7aaad3f
Include the SST k in the interior pressure and the boundary enthalpy …
Sep 29, 2026
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
24 changes: 24 additions & 0 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,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 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. */
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 @@ -10360,6 +10363,27 @@ class CConfig {
*/
SST_ParsedOptions GetSSTParsedOptions() const { return sstParsedOptions; }

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.
Expand Down
47 changes: 27 additions & 20 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1101,33 +1101,36 @@ 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. */
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. */
WALL_OMEGA_LIMIT, /*!< \brief Clip the omega wall value to the upper limit of omega. */
TMRBC, /*!< \brief Far-field omega = 10 U / L_DOMAIN, original reference of the NASA TMR SST page. */
};
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("TMRBC", SST_OPTIONS::TMRBC)
MakePair("WALL_OMEGA_LIMIT", SST_OPTIONS::WALL_OMEGA_LIMIT)
};

/*!
Expand All @@ -1142,6 +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 wallOmegaLimit = false; /*!< \brief Bool for clipping the omega wall value (WALL_OMEGA_LIMIT). */
bool tmrBC = false; /*!< \brief Bool for the far-field values of the NASA TMR (TMRBC). */
};

/*!
Expand All @@ -1159,6 +1164,9 @@ 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_tmrBC = IsPresent(SST_OPTIONS::TMRBC);
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);
const bool found_1994m = IsPresent(SST_OPTIONS::V1994m);
Expand Down Expand Up @@ -1200,13 +1208,10 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
SSTParsedOptions.production = SST_OPTIONS::UQ;
}

// Parse compressibility options
// Parse compressibility options, stored in compWilcox and compSarkar so that they can be combined with a
// production modifier
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;
}

SSTParsedOptions.sust = sst_sust;
Expand All @@ -1216,6 +1221,8 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne
SSTParsedOptions.compSarkar = sst_compSarkar;
SSTParsedOptions.dll = sst_dll;

SSTParsedOptions.tmrBC = found_tmrBC;
SSTParsedOptions.wallOmegaLimit = found_wallOmegaLimit;
return SSTParsedOptions;
}

Expand Down
23 changes: 17 additions & 6 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,13 @@ 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= 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);
/*!\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);
/*!\brief KIND_PB_ITER \n DESCRIPTION: Kind_PBIter \n OPTIONS: see \link PBIter_Map \endlink \ingroup Config*/
Expand Down Expand Up @@ -4974,6 +4981,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
Kind_Solver == MAIN_SOLVER::FEM_EULER)
Kind_Turb_Model = TURB_MODEL::NONE;

/*--- SST has no engine or actuator-disk boundary conditions: the faces would get no turbulence flux at all.
Checked after the turbulence model of Euler zones is cleared (multizone). ---*/
if (Kind_Turb_Model == TURB_MODEL::SST &&
(nMarker_EngineInflow + nMarker_EngineExhaust + nMarker_ActDiskInlet + nMarker_ActDiskOutlet) > 0) {
SU2_MPI::Error("MARKER_ENGINE_INFLOW, MARKER_ENGINE_EXHAUST and MARKER_ACTDISK are not supported with the SST model.",
CURRENT_FUNCTION);
}

Kappa_2nd_Flow = jst_coeff[0];
Kappa_4th_Flow = jst_coeff[1];
Kappa_2nd_AdjFlow = jst_adj_coeff[0];
Expand Down Expand Up @@ -6676,16 +6691,12 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {
cout << "\nperturbing the Reynold's Stress Matrix towards " << eig_val_comp << " component turbulence";
if (uq_permute) cout << " (permuting eigenvectors)";
break;
case SST_OPTIONS::COMP_Wilcox:
cout << " with compressibility correction of Wilcox";
break;
case SST_OPTIONS::COMP_Sarkar:
cout << " with compressibility correction of Sarkar";
break;
default:
cout << " with no production modification";
break;
}
if (sstParsedOptions.compWilcox) cout << ", with compressibility correction of Wilcox";
if (sstParsedOptions.compSarkar) cout << ", with compressibility correction of Sarkar";

if (sstParsedOptions.dll){
cout << "\nusing non dimensional lower limits relative to infinity values clipping by Coefficients:" ;
Expand Down
24 changes: 14 additions & 10 deletions SU2_CFD/include/numerics/CNumerics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,10 +1146,11 @@ class CNumerics {
* \param[in] val_normal - Normal vector, the norm of the vector is the area of the face.
* \param[in] val_scale - Scale of the projection.
* \param[out] val_Proj_Jac_tensor - Pointer to the projected inviscid Jacobian.
* \param[in] val_tke - Turbulent kinetic energy contained in the total energy (SST), held fixed.
*/
void GetInviscidProjJac(const su2double *val_velocity, const su2double *val_energy,
const su2double *val_normal, su2double val_scale,
su2double **val_Proj_Jac_tensor) const;
su2double **val_Proj_Jac_tensor, su2double val_tke = 0.0) const;

/*!
* \brief Compute the projection of the inviscid Jacobian matrices (incompressible).
Expand Down Expand Up @@ -1222,11 +1223,12 @@ class CNumerics {
* \param[in] val_normal - Normal vector, the norm of the vector is the area of the face.
* \param[in] val_scale - Scale of the projection.
* \param[out] val_Proj_Jac_tensor - Pointer to the projected inviscid Jacobian.
* \param[in] val_tke - Turbulent kinetic energy contained in the total energy (SST), held fixed.
*/
void GetInviscidProjJac(const su2double *val_velocity, const su2double *val_enthalphy,
const su2double *val_chi, const su2double *val_kappa,
const su2double *val_normal, su2double val_scale,
su2double **val_Proj_Jac_tensor) const;
su2double **val_Proj_Jac_tensor, su2double val_tke = 0.0) const;

/*!
* \brief Mapping between primitives variables P and conservatives variables C.
Expand All @@ -1253,7 +1255,7 @@ class CNumerics {
void GetPMatrix(const su2double *val_density, const su2double *val_velocity,
const su2double *val_soundspeed, const su2double *val_enthalpy,
const su2double *val_chi, const su2double *val_kappa,
const su2double *val_normal, su2double **val_p_tensor) const;
const su2double *val_normal, su2double **val_p_tensor, su2double val_tke = 0.0) const;

/*!
* \brief Computation of the matrix P, this matrix diagonalize the conservative Jacobians in
Expand All @@ -1267,12 +1269,13 @@ class CNumerics {
template <typename Matrix>
void GetPMatrix(const su2double& density, const su2double* velocity,
const su2double& soundspeed, const su2double* normal,
Matrix& p_tensor) const {
Matrix& p_tensor, su2double tke = 0.0) const {
/*--- With SST the total energy contains k (tke): it is added to the kinetic energy of the energy row. ---*/
const su2double rhooc = density / soundspeed;
const su2double rhoxc = density * soundspeed;

if (nDim == 2) {
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity);
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity) + tke;
const su2double projvel = GeometryToolbox::DotProduct(2, velocity, normal);

p_tensor[0][0] = 1.0;
Expand All @@ -1295,7 +1298,7 @@ class CNumerics {
p_tensor[3][2] = 0.5 * (ke * rhooc + density * projvel + rhoxc / Gamma_Minus_One);
p_tensor[3][3] = 0.5 * (ke * rhooc - density * projvel + rhoxc / Gamma_Minus_One);
} else {
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity);
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity) + tke;
const su2double projvel = GeometryToolbox::DotProduct(3, velocity, normal);

p_tensor[0][0] = normal[0];
Expand Down Expand Up @@ -1430,7 +1433,7 @@ class CNumerics {
void GetPMatrix_inv(su2double **val_invp_tensor, const su2double *val_density,
const su2double *val_velocity, const su2double *val_soundspeed,
const su2double *val_chi, const su2double *val_kappa,
const su2double *val_normal) const;
const su2double *val_normal, su2double val_tke = 0.0) const;

/*!
* \brief Computation of the matrix P^{-1}, this matrix diagonalize the conservative Jacobians
Expand All @@ -1444,7 +1447,8 @@ class CNumerics {
template <typename Matrix>
void GetPMatrix_inv(const su2double& density, const su2double* velocity,
const su2double& soundspeed, const su2double* normal,
Matrix& inv_p_tensor) const {
Matrix& inv_p_tensor, su2double tke = 0.0) const {
/*--- With SST the total energy contains k (tke), dp/drho = (gamma-1) (|u|^2/2 - k). ---*/
const su2double rhoxc = density * soundspeed;
const su2double c2 = pow(soundspeed, 2);
const su2double gm1 = Gamma_Minus_One;
Expand All @@ -1455,7 +1459,7 @@ class CNumerics {

if (nDim == 3) {
const su2double k2orho = normal[2] / density;
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity);
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(3, velocity) - tke;
const su2double projvel_o_rho = GeometryToolbox::DotProduct(3, velocity, normal) / density;

inv_p_tensor[0][0] = normal[0] + k1orho * velocity[2] - k2orho * velocity[1] - normal[0] * gm1_o_c2 * ke;
Expand Down Expand Up @@ -1488,7 +1492,7 @@ class CNumerics {
inv_p_tensor[4][3] = -k2orho - gm1_o_rhoxc * velocity[2];
inv_p_tensor[4][4] = gm1_o_rhoxc;
} else {
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity);
const su2double ke = 0.5 * GeometryToolbox::SquaredNorm(2, velocity) - tke;
const su2double projvel_o_rho = GeometryToolbox::DotProduct(2, velocity, normal) / density;

inv_p_tensor[0][0] = 1 - gm1_o_c2 * ke;
Expand Down
1 change: 1 addition & 0 deletions SU2_CFD/include/numerics/flow/convection/roe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class CUpwRoeBase_Flow : public CNumerics {
su2double *ProjFlux_j = nullptr, *Conservatives_j = nullptr;
su2double **P_Tensor = nullptr, **invP_Tensor = nullptr;
su2double RoeDensity, RoeEnthalpy, RoeSoundSpeed, ProjVelocity, RoeSoundSpeed2, kappa;
su2double RoeTke = 0.0; /*!< \brief Roe-averaged k (SST, contained in the total energy). */

su2double* Flux = nullptr; /*!< \brief The flux accross the face. */
su2double** Jacobian_i = nullptr; /*!< \brief The Jacobian w.r.t. point i after computation. */
Expand Down
4 changes: 3 additions & 1 deletion SU2_CFD/include/numerics/flow/flow_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ class CSourceBase_Flow : public CNumerics {
*/
class CSourceAxisymmetric_Flow : public CSourceBase_Flow {
protected:
bool implicit, viscous, rans;
bool implicit, viscous;
bool tkeInEnergy; /*!< \brief SST: k is part of the total energy (turb_ke_i is set by the solver). */
bool tkeInStress; /*!< \brief Standard (non-m) SST versions: -2/3 rho k is part of the stress tensor. */
su2double yinv{0.0};

/*!
Expand Down
Loading
Loading