Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
d1cf7ea
Fix the internal energy of the under-relaxation factor
rois1995 Sep 29, 2026
ffc5baf
Clear the whole Jacobian in the non-physical guard of the general-gas…
rois1995 Sep 29, 2026
a59d827
Compute HLLC on moving grids in the frame of the face, fix its Jacobians
rois1995 Sep 29, 2026
583c32a
Add the incompressible grid-motion Jacobian once, with the variable-d…
rois1995 Sep 29, 2026
ca7aee0
Reduce the minimum pressure with MPI_MIN
rois1995 Sep 29, 2026
b29368d
Reject combinations of source terms that share one numerics object
rois1995 Sep 29, 2026
df8f978
Read the Riemann boundary kind in BC_TurboRiemann
rois1995 Sep 29, 2026
f3bcaac
Check the number of variables in the Green-Gauss gradient
rois1995 Sep 29, 2026
99d861a
Clamp MGLEVEL to 10
rois1995 Sep 29, 2026
536c8d8
Use 0.5 instead of the integer division 1/2 in the axisymmetric sourc…
rois1995 Sep 29, 2026
a277f59
Use wave strengths that match the 3D P matrix in L2Roe, LMRoe and the…
rois1995 Sep 29, 2026
c333a18
Check the MUSCL face states before evaluating the fluid model
rois1995 Sep 29, 2026
c0dc0ce
Include the SST k of the total energy in the convective numerics
Sep 30, 2026
3eb9dc8
Use the k of the boundary node in the boundary states of the compress…
Sep 30, 2026
8536636
Include the SST k in the pressure of the axisymmetric source, remove …
Sep 30, 2026
580800a
Apply the SST compressibility corrections together with the productio…
Sep 30, 2026
a002e77
Check the SST free-stream values and markers, fix the omega of the tu…
Sep 30, 2026
37dcfed
Add a regression test of the Riemann DENSITY_VELOCITY inlet with SST
Sep 30, 2026
b2e8375
Update the reference values of the regression tests from CI
Sep 30, 2026
d875b76
Update the reference files of the gradient regression tests from CI
Sep 30, 2026
459113d
Merge develop into fix_underrelaxation_factor
rois1995 Oct 9, 2026
e323f4c
Merge fix_underrelaxation_factor into fix_hllc_moving_grids
rois1995 Oct 9, 2026
e7def4d
Merge fix_hllc_moving_grids into fix_roe_3d_wave_strengths
rois1995 Oct 9, 2026
c21bec6
Merge fix_roe_3d_wave_strengths into fix_meanflow_small
rois1995 Oct 9, 2026
41c699f
Merge fix_meanflow_small into fix_sst_k_consistency
rois1995 Oct 9, 2026
b365479
Merge branch 'develop' into fix_underrelaxation_factor
joshkellyjak Oct 12, 2026
2d0857d
Apply under-relaxation review style suggestions
rois1995 Oct 12, 2026
d2701a8
Merge remote-tracking branch 'origin/fix_underrelaxation_factor' into…
rois1995 Oct 12, 2026
73af49d
Merge commit 'd2701a8b25c35af5bbdfbae5b5e4622d5d9d69b5' into HEAD
rois1995 Oct 12, 2026
5ca9969
Merge commit '73af49df8ee4b34fb79716acdac61e2d5cab1d8d' into HEAD
rois1995 Oct 12, 2026
4960dd0
Fix HLLC supersonic Jacobians for reconstructed face enthalpy
rois1995 Oct 12, 2026
c4209c3
Merge HLLC face-enthalpy Jacobian fix from PR 2943
rois1995 Oct 12, 2026
371fcae
Merge propagated HLLC face-enthalpy Jacobian fix from PR 2944
rois1995 Oct 12, 2026
e0d3ee8
Correct compressible moving-wall projection and multigrid coupling
rois1995 Oct 12, 2026
211d177
Separate the HLLC Jacobian option and keep verification access private
rois1995 Oct 12, 2026
07760e6
Use deduced types for Roe entropy wave strengths
rois1995 Oct 12, 2026
a950f3d
Reject unsupported multigrid levels and align centered density handling
rois1995 Oct 12, 2026
6c571f3
Separate the HLLC Jacobian option and keep verification access private
rois1995 Oct 12, 2026
27fc175
Separate the HLLC Jacobian option and keep verification access private
rois1995 Oct 12, 2026
815aa5c
Use deduced types for Roe entropy wave strengths
rois1995 Oct 12, 2026
6c0b211
Merge approved HLLC review changes from PR 2943
rois1995 Oct 13, 2026
773bca5
Merge approved HLLC and Roe review changes from PR 2944
rois1995 Oct 13, 2026
3062a04
Materialize AD densities in compressible under-relaxation
rois1995 Oct 13, 2026
8b28ba8
Merge under-relaxation AD density lifetime fix from PR 2942
rois1995 Oct 13, 2026
e337669
Merge under-relaxation AD density lifetime fix through PR 2943
rois1995 Oct 13, 2026
d158729
Merge under-relaxation AD density lifetime fix through PR 2944
rois1995 Oct 13, 2026
bc5350d
Merge develop into fix_hllc_moving_grids
rois1995 Oct 20, 2026
ab5c080
Update the HLLC wedge references from CI run 39388009966
rois1995 Oct 20, 2026
5bd7f12
Merge fix_roe_3d_wave_strengths into fix_meanflow_small
rois1995 Oct 21, 2026
2ca3570
Merge fix_hllc_moving_grids into fix_roe_3d_wave_strengths
rois1995 Oct 21, 2026
48fcd03
Merge fix_meanflow_small into fix_sst_k_consistency
rois1995 Oct 21, 2026
5747cf7
Merge the parent branch into this one
rois1995 Oct 22, 2026
8152f7c
Update the reference values from the CI
rois1995 Oct 22, 2026
90e739b
Merge the parent branch into this one
rois1995 Oct 22, 2026
05187b6
Update the reference values from the CI
rois1995 Oct 22, 2026
bcdd766
Update the reference values from the CI
rois1995 Oct 22, 2026
d1eca26
Merge commit '2dc7b708dcc81fdc86b8e814e8efff0399a8799c' into HEAD
rois1995 Oct 27, 2026
3aac48f
Merge commit 'd1eca2685f2e3b410aa405bf2760bbe5c790beb5' into HEAD
rois1995 Oct 27, 2026
ea47b21
Merge commit '3aac48f230e847d3b499917556e6a819bd858e47' into HEAD
rois1995 Oct 27, 2026
5a7c5b0
Merge commit 'ea47b2173916cf804a7fb03921f2d13bf7c8444f' into HEAD
rois1995 Oct 27, 2026
d18cc7a
Merge commit 'e61e2e9674d15b07d8fa1f959588d5e55ad36551' into HEAD
rois1995 Oct 29, 2026
d0a872b
Merge commit 'd18cc7a7e9168b97330de31a315256924103d1ad' into HEAD
rois1995 Oct 29, 2026
2b08824
Merge remote-tracking branch 'origin/fix_roe_3d_wave_strengths' into …
rois1995 Oct 29, 2026
649d7a9
Restore regression files after develop merge
rois1995 Oct 29, 2026
aeeae94
Merge remote-tracking branch 'origin/fix_meanflow_small' into HEAD
rois1995 Oct 29, 2026
b6ce12d
Merge commit '7048fd35f56d4bf52e586429d6746a36a10255f8' into HEAD
rois1995 Oct 30, 2026
b7e6695
Merge commit 'b6ce12d2b1504794c62253257331bfb0ce4a6068' into HEAD
rois1995 Oct 30, 2026
7d9c44a
Merge commit 'b7e6695e586847b4d5874ac30100e6714312db02' into HEAD
rois1995 Oct 30, 2026
bf316f8
Merge commit '7d9c44aebea3ea3a6ff95291e5ffa97f399e52dc' into HEAD
rois1995 Oct 30, 2026
1fd11d2
Merge commit 'f4b67d23deaac22948cc8d2a2c0da3138ae804f6' into HEAD
rois1995 Oct 31, 2026
95ad876
Merge commit '1fd11d2c8c5659da9a45a643d41869d6c1a71e68' into HEAD
rois1995 Oct 31, 2026
de29b58
Merge commit '95ad8767ffbead81e5521a1c792e5f152409fc23' into HEAD
rois1995 Oct 31, 2026
84a4a6d
Merge commit 'de29b5852ac35eb2cb14a52d0ee20575315865c4' into HEAD
rois1995 Oct 31, 2026
1aa4951
Clarify HLLC Jacobian naming and tests
rois1995 Oct 31, 2026
e94eaff
Fix HLLC test formatting
rois1995 Nov 6, 2026
51b2494
Fix remaining SST k inconsistencies in flow numerics
rois1995 Nov 7, 2026
ee92156
Forward solver container through implicit Euler completion
rois1995 Nov 7, 2026
81801ff
Merge branch 'develop' into fix_hllc_moving_grids
Nov 16, 2026
cc0bf82
Merge branch 'stk-fix_hllc_moving_grids' into fix_roe_3d_wave_strengths
Nov 16, 2026
aa29b76
Merge branch 'stk-fix_roe_3d_wave_strengths' into fix_meanflow_small
Nov 16, 2026
42cfc6b
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
Nov 16, 2026
1127f91
Fix the AD build of the preconditioner k term and format the SST ener…
Nov 16, 2026
9c2b5b0
Update the axisymmetric RANS reference values from the CI
Nov 16, 2026
40a8435
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
Nov 16, 2026
a8ec173
Merge branch 'develop' into fix_roe_3d_wave_strengths
Nov 16, 2026
bf33ddf
Merge branch 'develop' into fix_roe_3d_wave_strengths
rois1995 Nov 17, 2026
ce76e9e
Merge branch 'fix_roe_3d_wave_strengths' into fix_meanflow_small
rois1995 Nov 17, 2026
21fd9f6
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
rois1995 Nov 17, 2026
a015db4
Merge branch 'develop' into fix_roe_3d_wave_strengths
rois1995 Nov 17, 2026
faed994
Merge branch 'fix_roe_3d_wave_strengths' into fix_meanflow_small
rois1995 Nov 17, 2026
17429c7
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
rois1995 Nov 17, 2026
27ac2a9
Update moving-frame reference files for the compressible slip-wall pr…
rois1995 Nov 17, 2026
3a9d8e2
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
rois1995 Nov 17, 2026
a0a0f39
Use the CI value for one sensitive force entry in updated_moving_fram…
rois1995 Nov 18, 2026
0be2f5a
Merge branch 'fix_meanflow_small' into fix_sst_k_consistency
rois1995 Nov 18, 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
7 changes: 2 additions & 5 deletions Common/include/option_structure.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1216,13 +1216,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 Down
51 changes: 45 additions & 6 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4705,6 +4705,36 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i

Rotating_Frame = (Kind_GridMovement == ROTATING_FRAME);

/*--- The finite volume flow solvers apply these source terms with a single numerics object, which is built
for only one of them: combinations would apply one source several times and ignore the others. Only these
solvers (and their discrete adjoints) are checked: e.g. elasticity uses BODY_FORCE and GRAVITY_FORCE together. ---*/

if (GetFluidProblem() && !GetNEMOProblem()) {
const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE);
const int nSources = int(Body_Force) + int(Rotating_Frame) + int(Axisymmetric) + int(GravityForce && !inc) +
int(inc && Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ) +
int(inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE);
if (nSources > 1) {
SU2_MPI::Error("Only one of BODY_FORCE, GRID_MOVEMENT= ROTATING_FRAME, AXISYMMETRIC, GRAVITY_FORCE (compressible), "
"INC_DENSITY_MODEL= BOUSSINESQ and KIND_STREAMWISE_PERIODIC (incompressible) can be used at a time.",
CURRENT_FUNCTION);
}
}

/*--- The second source object, for radiation, the energy correction of incompressible streamwise periodic flow
(without periodic temperature) or vorticity confinement, is also built for only one of them. ---*/

if (GetFluidProblem() && !GetNEMOProblem()) {
const bool inc = (Kind_Regime == ENUM_REGIME::INCOMPRESSIBLE);
const bool periodicOutlet = inc && Kind_Streamwise_Periodic != ENUM_STREAMWISE_PERIODIC::NONE && Energy_Equation &&
!Streamwise_Periodic_Temperature;
if (int(Radiation) + int(periodicOutlet) + int(VorticityConfinement) > 1) {
SU2_MPI::Error("Only one of RADIATION, the energy correction of KIND_STREAMWISE_PERIODIC (incompressible, "
"STREAMWISE_PERIODIC_TEMPERATURE= NO) and VORTICITY_CONFINEMENT can be used at a time.",
CURRENT_FUNCTION);
}
}

/*--- In case the grid movement parameters have not been declared in the
config file, set them equal to zero for safety. Also check to make sure
that for each option, a value has been declared for each moving marker. ---*/
Expand Down Expand Up @@ -5064,6 +5094,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i

if (Restart || ((Kind_MGCycle == MG_CYCLE::FULL) && ContinuousAdjoint)) Kind_MGCycle = MG_CYCLE::V;

/*--- The multigrid arrays hold at most 10 coarse levels (CMultiGridIntegration::MAX_MG_LEVELS). ---*/
if (nMGLevels > 10) {
SU2_MPI::Error("MGLEVEL must be between 0 and 10; larger multigrid hierarchies are not supported.", CURRENT_FUNCTION);
}

FinestMesh = MESH_0;
if (Kind_MGCycle == MG_CYCLE::FULL) FinestMesh = nMGLevels;

Expand All @@ -5081,6 +5116,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 @@ -6794,16 +6837,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
32 changes: 32 additions & 0 deletions Docs/SSTEnergy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# SST turbulent kinetic energy in the compressible solver

The compressible SST solver stores total energy per unit mass as
`E = e + |u|²/2 + k`. Thermodynamic pressure and temperature use `e`;
total enthalpy and its convective flux include `k`. Flow Jacobians hold `k`
fixed because it is advanced by the separate turbulence solver.

This energy convention does not imply that every term of the full
Favre-averaged energy equation is modeled. The current SSTm formulation:

- omits the isotropic `-2 rho k I/3` term from turbulent stress;
- uses approximate strain-based production `P = mu_t 2S:S` before applying
the production limiter (other production options modify this expression);
- omits molecular diffusion and turbulent transport of `k` from the total
energy flux. Temperature heat conduction is still present.

These are modeling approximations, distinct from interpreting `k` as
thermal energy inside a numerical flux or its Jacobian. The
[Turbulence Modeling Resource SST definitions](https://tmbwg.github.io/turbmodels/sst.html)
explicitly describe the SSTm production approximation, and its
[compressible RANS implementation notes](https://tmbwg.github.io/turbmodels/implementrans.html)
allow omission of the energy transport term involving the gradient of `k`.

For unmodified strain production, its difference from the contraction of
SU2's deviatoric turbulent stress with the velocity gradient is
`2 mu_t (div u)²/3`, before limiting. At fixed total energy, additional
production of `k` reduces thermal energy. This difference vanishes for
incompressible flow and can matter in shocks and strong expansions. The
production limiter, sustaining terms, transition coupling, and production
modifiers prevent interpreting this expression as the actual production
excess in every configuration. Changing these approximations requires
choosing and validating a different SST formulation.
9 changes: 8 additions & 1 deletion SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ void computeGradientsGreenGauss(CSolver* solver, MPI_QUANTITIES kindMpiComm, PER
const auto chunkSize = computeStaticChunkSize(nPointDomain, omp_get_max_threads(), OMP_MAX_CHUNK);
#endif

static constexpr size_t MAXNVAR = 20;
static constexpr size_t MAXNVAR = 32;

/*--- Called by all threads of a parallel region: only the master may call MPI (MPI_THREAD_FUNNELED). ---*/
if (varEnd > MAXNVAR) {
BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS
SU2_MPI::Error("Number of variables is too large, increase MAXNVAR.", CURRENT_FUNCTION);
END_SU2_OMP_SAFE_GLOBAL_ACCESS
}

/*--- For each (non-halo) volume integrate over its faces (edges). ---*/

Expand Down
6 changes: 5 additions & 1 deletion SU2_CFD/include/limiters/computeLimiters_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,12 @@ void computeLimiters_impl(CSolver* solver,
constexpr size_t MAXNVAR = 32;
static_assert(MAXNVAR >= MAX_TRANSPORTED_SPECIES, "MAXNVAR (size of the limiter work arrays) must be at least MAX_TRANSPORTED_SPECIES.");

if (varEnd > MAXNVAR)
/*--- Called by all threads of a parallel region: only the master may call MPI (MPI_THREAD_FUNNELED). ---*/
if (varEnd > MAXNVAR) {
BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS
SU2_MPI::Error("Number of variables is too large, increase MAXNVAR.", CURRENT_FUNCTION);
END_SU2_OMP_SAFE_GLOBAL_ACCESS
}

const size_t nPointDomain = geometry.GetnPointDomain();
const size_t nPoint = geometry.GetnPoint();
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 @@ -1160,10 +1160,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 @@ -1236,11 +1237,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 @@ -1267,7 +1269,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 @@ -1281,12 +1283,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 @@ -1309,7 +1312,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 @@ -1444,7 +1447,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 @@ -1458,7 +1461,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 @@ -1469,7 +1473,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 @@ -1502,7 +1506,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
3 changes: 2 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,8 @@ 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). */
su2double yinv{0.0};

/*!
Expand Down
31 changes: 13 additions & 18 deletions SU2_CFD/include/numerics/turbulent/turb_sources.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,33 +939,27 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
P_Base = sqrt(StrainMag_i*VorticityMag);
break;

case SST_OPTIONS::COMP_Wilcox:
P_Base = StrainMag_i;
if (Mt >= 0.25) {
zetaFMt = 2.0 * (Mt * Mt - 0.25 * 0.25);
}
break;

case SST_OPTIONS::COMP_Sarkar:
P_Base = StrainMag_i;
if (Mt >= 0.25) {
zetaFMt = 0.5 * (Mt * Mt);
}
break;

default:
/*--- Base production term for SST-1994 and SST-2003 ---*/
P_Base = StrainMag_i;
break;
}

/*--- Compressibility corrections, independent of the production modifier. ---*/
if (sstParsedOptions.compWilcox && Mt >= 0.25) {
zetaFMt = 2.0 * (Mt * Mt - 0.25 * 0.25);
}
if (sstParsedOptions.compSarkar && Mt >= 0.25) {
zetaFMt = 0.5 * (Mt * Mt);
}

/*--- Production limiter. ---*/
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);
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. ---*/
Expand All @@ -989,15 +983,15 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
pw = max(pw, sust_w);
}

if (sstParsedOptions.production == SST_OPTIONS::COMP_Sarkar) {
if (sstParsedOptions.compSarkar) {
const su2double Dilatation_Sarkar = -0.15 * pk * Mt + 0.2 * beta_star * (1.0 +zetaFMt) * Density_i * ScalarVar_i[1] * ScalarVar_i[0] * Mt * Mt;
pk += Dilatation_Sarkar;
}

/*--- 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) {
Expand All @@ -1022,7 +1016,8 @@ class CSourcePieceWise_TurbSST final : public CNumerics {
Jacobian_i[0][0] = -beta_star * ScalarVar_i[1] * Volume * (1.0 + zetaFMt);
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);


/*--- Contribution due to 2D axisymmetric formulation, after the implicit part since it
* adds to the Jacobian (which the assignments above would otherwise overwrite). ---*/
Expand Down
Loading