Skip to content

Align the SST model with the NASA TMR definitions - #2948

Open
rois1995 wants to merge 149 commits into
developfrom
feature_sst_tmr_alignment
Open

rois1995 wants to merge 149 commits into
developfrom
feature_sst_tmr_alignment

Conversation

@rois1995

@rois1995 rois1995 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Changes

This PR aligns the SST model with the definitions of the NASA Turbulence Modeling Resource (TMR SST page) and with Menter's papers. The default version (V2003m) does not change.

  • SST versions. The TMR defines two kinds of versions.

    The "m" versions (V1994m, V2003m, the default) ignore $\frac{2}{3}\rho k$ in the stress tensor and use the production $P = \mu_t S^2$. This is what develop does. They are unchanged.

    The standard versions (V1994, V2003) keep the full stress tensor and the exact production. On develop they could not be selected:

    /// TODO: For now we do not support "unmodified" versions of SST.
    //MakePair("V1994", SST_OPTIONS::V1994)
    //MakePair("V2003", SST_OPTIONS::V2003)

    They are now enabled. The changes below apply only to them.

    • Stress tensor. The stress tensor never had $\frac{2}{3}\rho k$ (comment "see Pressure field near wall using SST  #797"):

      // turb_ke is not considered in the stress tensor, see #797
      ComputeStressTensor(nDim, tau, val_gradprimvar+1, total_viscosity, Density, su2double(0.0));

      const Double eddyVisc = uq? Double(0.0) : avgV.eddyVisc();
      auto tau = stressTensor(avgV.laminarVisc() + eddyVisc, avgGrad);

      With the standard versions it is now $\tau_{ij} = \mu_t \left(2 S_{ij} - \frac{2}{3} \nabla\cdot u , \delta_{ij}\right) - \frac{2}{3}\rho k , \delta_{ij}$. The term is added in the momentum and energy equations, in the scalar and vectorized viscous fluxes, in the axisymmetric source and in the wall stress of the continuous adjoint. With wall functions it is added after the wall-function scaling of the stress. With UQ the term is already part of the perturbed Reynolds stress, so it is not added again, and the production does not subtract $\frac{2}{3}\mu_t(\nabla\cdot u)^2$ twice. The other models call the stress tensor as before, so their results do not change.

    • Production. Develop uses $P = \mu_t S^2$ for all versions:

      su2double P = Eddy_Viscosity_i * pow(P_Base, 2);
      su2double pk = max(0.0, min(P, prod_limit));

      The standard versions now use the exact production, $P = \mu_t \left(S^2 - \frac{2}{3}(\nabla\cdot u)^2\right) - \frac{2}{3}\rho k , \nabla\cdot u$. With VORTICITY or KATO-LAUNDER, $S$ is replaced by another quantity, so only the $\rho k$ term is added.

    • SST-1994 omega production. Develop uses $\gamma \rho S^2$, which is the "m" form:

      if (sstParsedOptions.version == SST_OPTIONS::V1994) {
      pw = alfa_blended * Density_i * pow(P_Base, 2);

      The standard V1994 now uses $\frac{\gamma}{\nu_t} P$ (Menter 1994), with the exact $P$ above. $P/\mu_t$ is expanded, and a guard avoids a division by zero where $\mu_t = 0$.

    • Jacobian. The derivative of $-\frac{2}{3}\rho k , \nabla\cdot u$ is added to the diagonal only where it makes the diagonal larger (expansion, $\nabla\cdot u > 0$). The residual always has the full term.

    For every SST version, the total energy includes k, as on develop. The "m" and standard versions differ only in the stress tensor and the production above.

  • F1 cross-diffusion clip. The lower bound of the cross-diffusion term was taken from the production limiter constant:

    CDkw(iPoint) = max(CDkw(iPoint), pow(10.0, -prod_lim_const));

    if (sstParsedOptions.version == SST_OPTIONS::V1994){
    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
    } else {
    /* SST-V2003 */
    constants[8] = 5.0 / 9.0; //gamma_1
    constants[9] = 0.44; //gamma_2
    constants[10] = 10.0; // production limiter constant
    }

    The values were right by chance: 20 gives $10^{-20}$ for 1994, and 10 gives $10^{-10}$ for 2003, as in the TMR. But they were tied to an unrelated constant. The bound is now set by the version. Results do not change.

  • TMR_FREESTREAM (new option). Develop builds the free-stream k and omega from the turbulence intensity and the viscosity ratio. The inlet does the same:

    su2double kine_Inf = 3.0/2.0*(VelMag2*Intensity*Intensity);
    su2double omega_Inf = rhoInf*kine_Inf/(muLamInf*viscRatio);

    Inlet_Vars[0] = 3.0 / 2.0 * (VelMag2 * pow(Intensity, 2));
    Inlet_Vars[1] = Density_Inlet * Inlet_Vars[0] / (Laminar_Viscosity_Inlet * viscRatio);

    The TMR reports another rule, from Menter's original reference: $\omega = 10, U / L$, with $L$ the approximate length of the domain. SST_OPTIONS= TMR_FREESTREAM turns it on, and the new option SST_DOMAIN_LENGTH gives $L$. This omega is used at far fields, for the initial field and at all inlets. k follows from the viscosity ratio, $k = (\mu_t/\mu), \mu, \omega / \rho$. The same k goes into the free-stream energy of all flow solvers, NEMO and FEM-DG included. The rule is in one place, in CConfig. The run stops if SST_DOMAIN_LENGTH is not positive.

  • SST-sust ambient values. Develop uses the free-stream k and omega as the ambient values of the sustaining terms:

    constants = turb_solver->GetConstants();
    kine_Inf = turb_solver->GetTke_Inf();
    omega_Inf = turb_solver->GetOmega_Inf();

    if (sstParsedOptions.sust) {
    const su2double sust_k = beta_star * Density_i * kAmb * omegaAmb;
    const su2double sust_w = beta_blended * Density_i * omegaAmb * omegaAmb;
    pk = max(pk, sust_k);
    pw = max(pw, sust_w);

    By default nothing changes: the ambient values are the free-stream values, as on develop. Two new options, SST_SUST_TKE_AMB and SST_SUST_OMEGA_AMB, set them. Set both or neither; the run stops otherwise. When set, they are also the free-stream k and omega (far fields, initial field, inlets). The turbulence intensity and the viscosity ratio are then not used for k and omega. This also allows a zero free-stream velocity, for example MACH_NUMBER= 0 with grid motion. To reproduce the TMR SST-sust, set $k_{amb} = 10^{-6} U^2$ and $\omega_{amb} = 5, U / L$ (Spalart and Rumsey 2007). TMR_FREESTREAM and these two options cannot be used together.

  • config_template.cfg. The list of SST options was incomplete, and the viscosity ratio had no guidance:

    SU2/config_template.cfg

    Lines 24 to 25 in a6b7496

    % Specify versions/corrections of the SST model (V2003m, V1994m, VORTICITY, KATO_LAUNDER, UQ, SUSTAINING, COMPRESSIBILITY-WILCOX, COMPRESSIBILITY-SARKAR, DIMENSIONLESS_LIMIT)
    SST_OPTIONS= NONE

    SU2/config_template.cfg

    Lines 280 to 281 in a6b7496

    % Free-stream ratio between turbulent and laminar viscosity
    FREESTREAM_TURB2LAMVISCRATIO= 10.0

    It now explains the "m" and standard versions, TMR_FREESTREAM, SST_DOMAIN_LENGTH and the two ambient options, and says that V2003m is the default. It also gives the TMR range of the far-field $\mu_t/\mu$ for SST: $10^{-5}$ to $10^{-2}$. The default of 10 is not changed.

  • Continuous adjoint. It stays a frozen-turbulence approximation. With SST, develop already stops ADJ_RANS unless FROZEN_VISC_CONT= YES:

    if (config->GetKind_Turb_Model() != TURB_MODEL::SA)
    SU2_MPI::Error("Only the SA turbulence model can be used with the continuous adjoint solver.", CURRENT_FUNCTION);

    Only the wall stress of the sensitivities (used with grid motion) gains $\frac{2}{3}\rho k$ with the standard versions:

    // 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);

    At a smooth no-slip wall the SST wall condition sets k = 0, so the term is zero there. The interior adjoint equations have no $\frac{2}{3}\rho k$ term, like the other turbulence terms that the frozen approximation leaves out.

Tests. The test cases are in the comments: the NASA TMR flat plate and bump in channel against the CFL3D and FUN3D results of the TMR, and the flat plate of #1851 at Mach 6.1. The default "m" versions do not change. At Mach 0.2 the standard versions give the same results as the "m" versions, because 2/3 rho k and the divergence of the velocity are negligible there. At Mach 6.1 with 5 % turbulence intensity the standard SST-2003 gives about 5 % less skin friction and 6.5 % less wall heat flux.

Three regression tests cover the new options, and the unit test sst_standard_tests.cpp checks the production, UQ and the wall-function stress:

Test Setup
turb_flatplate_sst_tmr flat plate, V2003, TMR_FREESTREAM, SST_DOMAIN_LENGTH= 2.33333, viscosity ratio 0.009 (inlet)
turb_naca0012_sst_1994_sust_amb NACA 0012, V1994, SUSTAINING, ambient values of the TMR SST-sust (far field)
inc_turb_naca0012_sst_tmr NACA 0012, incompressible, V2003, TMR_FREESTREAM (far field)

Reference values: the SST-sust cases keep their develop values. The new tests are added, with values from the CI. A few laminar, SA and default SST cases (poiseuille_profile, turb_naca0012_sa, fsi_cht, dsma661_sa, discadj_trans_stator) change in the last digits. They run no new code; the build uses -ffast-math, so the new branches change how the compiler orders the operations.

Open point for the reviewers. The omega production of the standard SST-1994, $\frac{\gamma}{\nu_t} P$, is not clipped at zero (as in #2329). $\mu_t \left(S^2 - \frac{2}{3}(\nabla\cdot u)^2\right)$ is never negative, but $-\frac{2}{3}\rho k , \nabla\cdot u$ is negative in an expansion. So a strong expansion can make the omega production negative. The k production is clipped at zero, and SST-2003 uses the clipped k production, so only SST-1994 is affected. Should it be clipped too?

It is the second half of #2329; the first half, #2946, is merged.

Related Work

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

🤖 Generated with Claude Code

rois1995 and others added 25 commits September 30, 2026 13:46
The factor compares the old and new internal energy, computed as rho*E - 0.5*|rho*u|^2 without the division by
rho (the code comment already refers to the static energy). For dimensional cases this value can be negative,
and those points got a zero update: in the axisymmetric air nozzle 28 % of the points were frozen, and the case
could not re-converge from a restart.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… Roe scheme

Only the diagonal was zeroed (index [iVar][iVar] inside the jVar loop), so the off-diagonal entries kept the
values of the previous edge. The guard of CUpwRoeBase_Flow already clears all entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
- Moving grids: the wave speeds, the pressure work of the moving face in the supersonic branches and the term
  V_g (p* - p)/(s - S_M) of the star-state energy were missing or inconsistent, so HLLC was not Galilean
  invariant (NACA0012 M 0.8, fixed grid vs still air and a translating grid: CL -12 %). The flux is now
  computed in the frame of the face (u' = u - w n, H' = H - w u_n + w^2/2) and transformed back
  (F = B F', J = B J' T).
- Jacobians: sign of the velocity term of the general-gas dp/drho. The star-state Jacobians keep by default the
  density of the other state in dp*/dU (inexact, #2198), which was more robust with inexact linear solves in our
  tests; USE_ACCURATE_FLUX_JACOBIANS= YES now gives the exact derivative for fixed wave speeds.
- Unit test hllc_jacobian_tests.cpp: finite differences in 2D and 3D, fixed and moving faces, both sides of
  the contact, all branches, default and exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…ensity terms

FDS added the grid-motion term inside a loop over the variables (nVar times). The term is now added once, as
the exact derivative with respect to (p, u, h), including d(rho)/dh; the same terms are added to the
incompressible JST and Lax-Friedrichs schemes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
SetRangePressure reduced the local minima with MPI_MAX, so with more than one rank MinP was the largest of
the local minima (used by the mass-flow outlet).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The flow solvers build one numerics object per source slot, so two active sources of the same slot overwrote
each other (e.g. body force + gravity gave twice the body force). First slot: body force, rotating frame,
axisymmetric, gravity, Boussinesq, streamwise periodic. Second slot: radiation, periodic outlet, vorticity
confinement.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
It read the Giles kind of the marker (copied from BC_Giles), which reads past the end of the Giles list and
crashes when the case has no Giles marker.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The boundary flux array had 20 entries and no bound check (NEMO with 10 or more species in 3D). Use 32, as the
limiters, and stop with an error above it. The error of both checks is raised by the master thread only, since
these functions run inside OpenMP parallel regions (MPI_THREAD_FUNNELED).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The multigrid arrays hold at most 10 coarse levels (MAX_MG_LEVELS); MGLEVEL= 12 with MG_MIN_MESHSIZE= 1
crashed with stack smashing. Clamp with a warning, MG_MIN_MESHSIZE can still reduce the levels.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…e Jacobian

The term 1/2*(Gamma-1) of d(v (rho E + p))/d(rho v) was 0 (implicit Jacobian only).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… explicit general-gas Roe

In 3D the first three columns of the P matrix combine the entropy wave, weighted by n_j, with the shear waves.
Their strengths are n_j (Delta rho - Delta p / c^2) + (Delta u x n)_j; the entropy jump was used unweighted in the
first one only, so a contact or shear layer on a face not aligned with x got a wrong flux. The standard Roe scheme
already projects the jump with P^-1 since #299. Unit test roe_contact_tests.cpp: a contact and a shear layer give
the upwind flux in 2D and 3D.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The consistent extrapolation and the low-Mach correction called the fluid model with the reconstructed
pressure and density before checking that they are positive (possible NaN or fluid-model errors with real-gas
models at start-up). Check them first, also rejecting zero and NaN, and check again after the low-Mach
correction. Valid states give the same result as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
With SST the total energy contains k (CNSVariable subtracts it from the static energy, the free-stream and
boundary energies add it), but the convective schemes computed the speed of sound, the eigenvector matrices and
the Jacobians as if it did not. Add a k argument (held fixed, default 0) to GetPMatrix, GetPMatrix_inv and
GetInviscidProjJac, and to the SIMD pMatrix, pMatrixInv, inviscidProjJac and Roe average. Remove k from the speed
of sound of Roe, HLLC, AUSM-type and FVS schemes, use the Roe-averaged k in the Roe matrices, advect the part of
Delta(rho E) due to Delta k with the contact wave (Roe, JST-mat), and include k in the accurate AUSM and HLLC
Jacobians and in the preaccumulation inputs.

Upwind_Residual passes the k of the cells to the numerics, adds it to the total enthalpy of the consistent and
low-Mach extrapolations, and checks the speed of sound of each MUSCL face state as well as of the Roe average.

Unit tests for the Roe and AUSM contacts with a k jump and the HLLC Jacobians with k.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…ible solver

With SST the boundary states added the free-stream k to the total energy, while the domain next to the boundary
has its own k (the free-stream value decays right away, #1851): the Riemann problem at the boundary then sees a
jump of total energy that is not a jump of pressure. Use the k of the boundary node in the far-field, Riemann,
turbo Riemann, inlet, outlet, supersonic inlet, engine and actuator-disk states, and pass it to the convective
numerics of every boundary.

Where the interior state is used, remove k from it: static energy of the interior state in BC_Riemann,
BC_TurboRiemann and BC_Giles, energy of the DENSITY_VELOCITY Riemann state, total speed of sound at the inlet,
engine exhaust and actuator disk. The P, P^-1 and Jacobian matrices of the Riemann boundaries take k, and the
boundary total enthalpy of BC_Giles includes it.

The initial check for non-physical points also subtracts the free-stream k from the energy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…a wrong viscous term

The axisymmetric source computed the pressure from the total energy without removing k (SST). Subtract it in
the pressure and in the energy row of the Jacobian (k held fixed). The viscous part added mu_tot*v*2/3*rho*k/y to
the energy equation for every RANS model (with the SA variable in place of k): this term does not come from the
stress tensor of the flow solver, remove it. k is set only for SST.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…n modifiers

COMPRESSIBILITY-WILCOX and COMPRESSIBILITY-SARKAR were stored as the production option, overwriting
VORTICITY, KATO-LAUNDER or UQ when combined with them (and their switch cases used the strain production).
They are already stored in compWilcox and compSarkar: use these flags for the correction, independently of the
production modifier. Use beta_star in place of the literal 0.09 in the corrected dissipation of omega.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…rbo inlet

- Stop with an error if the free-stream k or omega of SST is not positive and finite (zero turbulence
  intensity, viscosity ratio or velocity), which gave mu_t = 0/0 in the whole field.
- Reject SST with engine and actuator-disk markers: the turbulence solver has no boundary condition for them
  (checked after the turbulence model of Euler zones is cleared).
- BC_Inlet_Turbo computed omega from the averaged k of the flow solver instead of the imposed k.
- Remove a dead write of the wall node solution in the SST wall function.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Axisymmetric air nozzle with the inlet as a Riemann DENSITY_VELOCITY boundary, whose boundary state takes the
energy of the node (containing k) and must remove k before adding it back with the other cases.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… ambient value options

- Accept V1994 and V2003 in SST_OPTIONS (the standard versions of the NASA TMR, with the exact production and
  2/3 rho k in the stress tensor), and add TMRBC (far-field omega of the original reference of the NASA TMR)
  and WALL_OMEGA_LIMIT (clip the omega wall value to the upper limit of omega).
- New options L_DOMAIN (approximate length of the domain, for TMRBC) and SST_SUST_TKE_AMB /
  SST_SUST_OMEGA_AMB (ambient values of the sustaining terms, <= 0 for the defaults of Spalart and Rumsey).
- Document the versions, the new options and the range of mu_t/mu of the NASA TMR in config_template.cfg.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…clip per version

- V1994 and V2003 use the exact production of the NASA TMR, P = mu_t (S^2 - 2/3 div(u)^2) - 2/3 rho k div(u)
  (with VORTICITY and KATO-LAUNDER only the k term is added); the m versions keep P = mu_t S^2.
- V1994 evaluates gamma/nu_t P with P/mu_t expanded, guarded by max(mu_t, EPS) where mu_t = 0.
- Add the derivative of -2/3 rho k div(u) to the Jacobian diagonal only where it increases it (div(u) > 0).
- Set the lower bound of CD_kw from the version (1e-20 for 1994, 1e-10 for 2003, as in the NASA TMR) instead
  of from the production limiter constant, which happens to have the same exponent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
The standard (non-m) versions of the NASA TMR keep -2/3 rho k in the Boussinesq stress tensor, which the m
versions (and #797) ignore. Add it, only for V1994 and V2003, in:
- the viscous fluxes (CAvgGrad_Base::SetStressTensor and the vectorized viscous fluxes; with UQ it is already
  part of the perturbed Reynolds stress),
- the viscous part of the axisymmetric source (radial normal stress in the energy equation),
- the wall shear stress of the wall functions (CNSSolver::SetTau_Wall_WF),
- the viscous sensitivities of the continuous adjoint (CAdjNSSolver::Viscous_Sensitivity).
The other models keep calling the stress tensor without k, so that their results do not change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
… and WALL_OMEGA_LIMIT

- SST_OPTIONS= TMRBC: far-field (and inlet) omega = 10 U / L_DOMAIN, the original reference of the NASA TMR
  SST page, with k from FREESTREAM_TURB2LAMVISCRATIO (or the inlet viscosity ratio), in the
  non-dimensionalization of all flow solvers (also in the k of the free-stream energy), in the far-field state
  of CTurbSSTSolver and in BC_Inlet.
- SST_OPTIONS= SUSTAINING: the ambient values of the sustaining terms, SST_SUST_TKE_AMB and
  SST_SUST_OMEGA_AMB (defaults 1e-6 U^2 and 5 U / REYNOLDS_LENGTH of Spalart and Rumsey, as the NASA TMR
  SST-sust), are also the free-stream values; mention them in the error for non-positive free-stream values.
- SST_OPTIONS= WALL_OMEGA_LIMIT: clip the omega wall value 60 nu / (beta_1 d^2), which grows as 1/d^2 on
  fine wall grids, to the upper limit of omega used in the rest of the domain.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
…values

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEL91DW5WPbPwgFtCvHga6
@rois1995

Copy link
Copy Markdown
Contributor Author

Test cases

All runs: 2 MPI ranks. "Before" = the build of the SST bug-fix PR below this one. Files and scripts: sstB (see its README).

NASA TMR flat plate (Mach 0.2, Re 5e6, TMR free stream: k = 9e-9 a^2, omega = 125 U/L), 137x97 grid, against the SST-Vm results of CFL3D and FUN3D. The "m" version gives the same history before and after this PR (to round-off), and the standard version gives the same result, because at Mach 0.2 the new terms are negligible.

Cf at x = 0.97 CD
TMR CFL3D / FUN3D, same grid 0.002665 / 0.002658 0.002826 / 0.002773
before, V1994m, VORTICITY 0.002691 0.002831
this PR, V1994m, VORTICITY 0.002691 0.002831
this PR, V1994, VORTICITY 0.002690 0.002830

TMR flat plate

NASA TMR bump in channel (Mach 0.2, Re 3e6, same free stream), 353x161 grid from su2code/VandV, against the SSTm results of CFL3D and FUN3D. Again the "m" version does not change, and the standard version differs by less than 0.3 %.

Cf at x = 0.75 CD
TMR CFL3D / FUN3D, same grid 0.005769 / 0.005764 0.003607 / 0.003573
before and this PR, V1994m 0.005541 0.003547
this PR, V1994 0.005534 0.003547

TMR bump

Where the standard version matters: the flat plate of #1851 (Mach 6.1, 800 K, turbulence intensity 5 %). Here 2/3 rho k is about 20 % of the pressure. The standard SST-2003 gives about 5 % less skin friction and 6.5 % less wall heat flux than SST-2003m. (6000 iterations; the density residual levels off at about -3.6.)

#1851 flat plate, SST versions

New regression test: turb_SST_flatplate_tmr.cfg (SST_OPTIONS= V2003, TMRBC, L_DOMAIN= 2.33333, mu_t/mu = 0.009).

rois1995 and others added 16 commits November 30, 2026 12:29
The TurboRiemann static-pressure outlet now holds the k of the node fixed
and removes it from the EOS energy, as the other Riemann kinds do in this
branch. The test helpers take k for the expected state, the flux and the
Jacobian check.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…update reference values from the CI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…version

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Cs, mixed-out average without k

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…T with non-ideal gas for JST_MAT/preconditioning, NEMO axisymmetric k term removed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, SST JST_MAT regression, test and doc cleanups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th; drop unused constructor packs (CodeQL)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… rounding changes under fast-math)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp
#	TestCases/hybrid_regression.py
#	TestCases/parallel_regression.py
#	TestCases/serial_regression.py
#	TestCases/serial_regression_AD.py
@rois1995

rois1995 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor Author

@bigfooted almost. This PR sits on #2946, which is now ready for review. I just merged the latest #2946 here. When CI is green, I will take this one out of draft too. It is easier to review #2946 first: this PR only adds the 2/3 rho k term in the stress tensor and the standard SST versions.

rois1995 and others added 5 commits December 3, 2026 09:59
…k/omega check only when used, tkeNeeded guards, shorter note, TestCases back to develop

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…bour solution)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	SU2_CFD/src/solvers/CTurbSSTSolver.cpp
…sor k branches)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eep the develop formatting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from fix_sst_k_consistency to develop December 4, 2026 05:53
rois1995 and others added 3 commits December 4, 2026 11:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- UQ with the standard versions: do not subtract 2/3 mu_t div(u)^2 twice.
- Add -2/3 rho k to the stress after the wall-function scaling; one
  tkeInStress flag for the five copies of the check.
- Keep the develop expressions when the new options are off, so laminar,
  SA and default SST results keep their develop values.
- SUSTAINING keeps the develop free stream by default. SST_SUST_TKE_AMB and
  SST_SUST_OMEGA_AMB (set both) make the free stream use the ambient values.
- TMRBC is now TMR_FREESTREAM, L_DOMAIN is now SST_DOMAIN_LENGTH. One CConfig
  helper sets the free-stream k and omega for all flow solvers and inlets.
- Config checks for the new options. WALL_OMEGA_LIMIT removed (no case needs it).
- New unit test sst_standard_tests.cpp; new regression tests for V1994 with
  the ambient options and incompressible TMR_FREESTREAM (values from CI).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Values from CI: the new tests, and small rounding changes (-ffast-math) in
laminar, SA and transonic_stator cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rois1995
rois1995 marked this pull request as ready for review December 4, 2026 18:25
@rois1995

rois1995 commented Dec 4, 2026

Copy link
Copy Markdown
Contributor Author

@bigfooted this is ready for review now. #2946 is merged, and this PR now sits on develop.

Changes since your last look, after a self-review:

  • SUSTAINING behaves as on develop by default. The TMR ambient values are opt-in with SST_SUST_TKE_AMB and SST_SUST_OMEGA_AMB.
  • TMRBC is now TMR_FREESTREAM, and L_DOMAIN is now SST_DOMAIN_LENGTH. One CConfig helper sets the free-stream k and omega for all solvers.
  • Fixed a double subtraction in the UQ production with the standard versions. WALL_OMEGA_LIMIT is removed; it needs its own test case.
  • New tests: V1994 with SUSTAINING, incompressible TMR_FREESTREAM, and a unit test. A few non-SST cases change in the last digits (-ffast-math rounding); details in the description.

@bigfooted

Copy link
Copy Markdown
Contributor

Review of #2948 (static review; not built or run locally)

Checked, no problems found

  • Stress term and axisymmetric source. AddTkeStress is in the right place, after the wall-function scaling, and is wired into the scalar and SIMD fluxes. The axisymmetric source is correct: the -2/3 rho k terms cancel in the radial momentum equation, so only the energy work term is needed.
  • Production. The exact P is right, including the UQ handling, where PerturbedStrainMag already contains S^2 - 2/3 div^2.
  • Free-stream k and omega. The unit conversion and ordering are right in the Euler, Inc and NEMO solvers, and the inlet BCs are covered.
  • AD, MPI and OpenMP. The AD preaccumulation inputs are complete. There are no new communications or shared writes, and the config setters run serially in the constructors.

1. Standard versions: the omega production sink is explicit
With the standard stress, P contains -2/3 rho k div. In the omega equation this becomes -2/3 alpha rho zeta div, because rho k / mu_t = zeta. It applies to V1994 (pw) and to V2003 (pw = alpha rho / mu_t * pk) whenever pk > 0. Where div > 0 and zeta = omega, the sink is linear in omega and explicit. The k equation gets a matching diagonal term but omega does not, and Jacobian_i[1][1] stays at -2 beta rho omega. At high CFL, CFL * du / (u + c) can exceed 1, so omega can overshoot negative and only the lower-limit clamp saves it.

For V1994, pw is also unclipped and can be negative when P < 0. TMR defines it that way: omega production is gamma / nu_t * P unlimited, and the limiter applies to k only. V2003's omega is zero when P < 0, through pk.

Options:

  • Matching diagonal term (preferred). Mirror the k term already added:
    Jacobian_i[1][1] -= alfa_blended * max(diverg, 0.0) * Volume * 2.0/3.0;
    applied when !modified and zeta = omega, that is ScalarVar_i[1] >= eddy_visc_var*F2_i/a1. This is the derivative of -2/3 alpha rho omega div with respect to rho omega. It keeps the explicit sink stable, stays literal TMR, and applies to V1994 and V2003 alike. It is harmless where pk or pw is clipped.
  • Clip. Use max(P, 0) in V1994 pw, matching V2003 and the k equation. This deviates from TMR only where P < 0.
  • Do nothing. Acceptable only if a strong-expansion run, such as the Mach 6.1 plate or a supersonic corner at high CFL, shows the omega lower clamp never activates. Please state that result.

2. Test gaps

  • The SIMD k-stress is untested. None of the new cfgs set USE_VECTORIZATION, and the unit test covers only the scalar CAvgGrad_Flow.
  • There is no discrete-adjoint test with V2003 or V1994.
  • The axisymmetric standard-SST path is untested.
  • The "zero free-stream velocity" claim for SST_SUST_*_AMB is untested.

3. Option interactions and docs

  • LM transition with TMR_FREESTREAM or SST_SUST_*_AMB makes k/omega inconsistent with FREESTREAM_TURBULENCEINTENSITY, which the Re_theta_t correlation still uses. Please add a check or document it.
  • TMR_FREESTREAM ignores the per-marker intensity from MARKER_INLET_TURBULENT. The ambient option ignores both per-marker values.
  • The config echo (CConfig.cpp, around line 7087) does not print TMR_FREESTREAM, the ambient values or the standard stress.
  • The far-field k and omega are constants in the discrete adjoint, as on develop. With TMR_FREESTREAM they now depend on U, so Mach sensitivities miss that dependence. Please document this.

4. Requested changes

  • Flow Jacobian: please add the density dependence of the new stress term. The residual is exact, but the implicit matrix has no entry for d(-2/3 rho_avg k_avg)/d rho. This does not change the converged solution; it affects convergence rate, mainly at high Mach, where rho k / p ~ gamma M^2 k / U^2 is no longer small. With k held fixed and rho_avg = (rho_i + rho_j)/2, the direct entries are -1/3 k_avg n_m A in momentum row m and -1/3 k_avg (u_avg . n) A in the energy row, for both i and j. The velocity dependence of the energy work is already covered by the existing non-symmetric terms, since they are built from the full viscous flux. Please add this to the scalar path (GetViscousProjJacs) and the SIMD jac_i/jac_j, with the sign convention of the neighbouring entries.
  • CFEM_DG_EulerSolver: please drop the k override. FEM-DG does not support SST, so the edit is dead code.
  • CIncEulerSolver: please set the member Tke_FreeStream from the config after SetSSTFreeStreamFromOptions. At the moment it stays intensity-based, and only the config copy is correct.
  • k override duplication. The override is copy-pasted into the Euler, Inc and NEMO solvers. Consider one helper.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants