Gyre/Mathematics & Numerical Methods
Turbulence closure (RANS, Spalart–Allmaras)
In one minuteTurbulent flows are computed with the Reynolds-averaged equations closed by the negative Spalart–Allmaras model. The model equation is one more row of the same discrete operator, so the Newton linearisation, the adjoint and the shape derivatives (including the wall distance) remain exact.
At flight Reynolds numbers the boundary layers on an aircraft are turbulent, and resolving the turbulence itself is out of reach for design work. Gyre therefore offers the Reynolds-averaged Navier–Stokes (RANS) equations with a one-equation closure: the Spalart–Allmaras model in its negative form (SA-neg), the variant written for discretizations, such as high-order DG, whose solution can undershoot at the edge of a boundary layer.
One extra transported quantity, , produces an eddy viscosity that is added to the molecular viscosity seen by the mean flow; everything else in the solver is unchanged.
flow:
mach: 0.2
reynolds: 5.0e6
turbulence: sa # 'none' (default) or 'sa'; needs reynolds
extra: {chi_inf: 3.0, prt: 0.9} # optional: free-stream nu_tilde/nu, turbulent Prandtl number
With turbulence: sa the state has one more variable per node, , stored after
the energy. No-slip walls impose and define the wall distance; the far field
and inlets supply . Outputs, gradients, error estimates and the
discipline interface work as for laminar flow; chi_inf and prt are ordinary
differentiable flow parameters.
The model is integrated to the wall (no wall functions), so the first element must be thin enough for the polynomial inside it to resolve the viscous sublayer: see the flat-plate study for the resolution used there.
- Included: SA-neg with the 2012 modifications of Allmaras, Johnson and Spalart (the limiter that keeps the modified vorticity positive, the negative branch, the laminar-suppression term), a constant turbulent Prandtl number, an exact curved wall distance that takes part in shape derivatives.
- Not included: trip terms and transition modelling (the flow is turbulent wherever the model produces eddy viscosity), rotation/curvature and compressibility corrections, the quadratic constitutive relation, the term of the Boussinesq stress (neglected as is usual for this model), wall functions, other models.
- Verified on a manufactured solution, a linearisation study, the zero-pressure-gradient flat plate of the NASA Turbulence Modeling Resource and adjoint-versus-finite-difference derivatives (verification); in three dimensions a spanwise extrusion of that plate reproduces its section. Separated flows, aerofoils at flight Reynolds number and turbulent flows that are three-dimensional in themselves have not been run.
Model equations#
The working variable is , with . Gyre solves the conservative form for ,
with production and destruction that depend on the sign of :
| , |
is the magnitude of the vorticity and the distance to the nearest no-slip wall. The mean flow sees the viscosity and the conductivity .
For the modified vorticity is
which is positive whenever is and has a continuous first derivative at the switch. The wall function of the destruction term is
and . Constants: , ,
, , ,
, , , , , ,
, , ; and
by default (prt, chi_inf).
A polynomial that represents the sharp edge of a boundary layer undershoots, so becomes slightly negative there. The original model then loses its footing: the eddy viscosity turns negative and the diffusion coefficient can change sign. SA-neg continues the equation to so that it stays well posed: no eddy viscosity, a diffusion coefficient that remains positive through , and source terms that drive back towards zero. The positive and the negative branch join with continuous first derivatives, which is what Newton’s method and the adjoint need.
Discretization#
Equation (1) goes through the machinery of the mean-flow equations (DGSEM, BR2):
- Convection. In the volume, the two-point mass flux of the mean flow times the arithmetic mean of ; on faces, upwinding of with the interface mass flux of the Riemann solver, .
- Diffusion. The conservative diffusion term is one more row of the viscous flux and takes the BR2 path unchanged. and join the velocity and the temperature as gradient variables.
- Sources. Production, destruction and the two non-conservative gradient terms are evaluated with the BR2 gradient , the same lifted gradient the viscous volume flux uses, so that they see the jumps between elements.
The Gauss–Lobatto solution nodes include points on the wall, where and is undefined for a discrete that satisfies its wall condition only weakly. The source is therefore integrated with Gauss quadrature: state and BR2 gradient are interpolated to the Gauss points of each element, where , the source is evaluated there, and the result is tested against the nodal basis,
A source that depends on the gradient of the solution is adjoint consistent only if it is evaluated with a gradient that includes the interface contributions (Oliver and Darmofal). Using the element-local gradient alone would leave the primal scheme consistent but make the discrete adjoint inconsistent with the continuous one, and functionals would lose their superconvergence. The BR2 gradient already contains the face liftings, so the same array serves the viscous flux and the source.
Newton’s method and the adjoint need a residual with continuous first derivatives. The model’s own switches (the limiter and the sign branch) have them by construction. The remaining kinks are smoothed:
| Quantity | Model | Gyre | Size of the change |
|---|---|---|---|
| vorticity magnitude | at most (units ); exactly zero in irrotational flow | ||
| limiter of | blend on | none for | |
| and at | none ( already) | ||
| interface upwinding | a dissipation floor |
| Condition | |
|---|---|
| no-slip walls | , in the convective flux and in the BR2 lifting (Dirichlet) |
farfield |
exterior state ; the mass-flux upwinding takes it on inflow and the interior value on outflow |
total_inlet |
at the boundary state |
slip walls, symmetry, pressure_outlet |
the interior value; no diffusive flux |
Wall distance#
The wall distance is computed once per discretization for every Gauss point: a k-d tree over samples of the wall faces proposes candidate faces, and a projected Gauss–Newton iteration on each candidate’s polynomial (of the geometry degree) finds the closest point. The result is stored as interpolation weights of the foot point on the geometry nodes of its wall face, not as a number.
Because the foot point is stored as weights on mesh nodes, the distance is re-evaluated inside the differentiable geometry,
whenever the node coordinates change. By the envelope theorem the derivative of a minimum with respect to a parameter is the partial derivative at the minimiser, so holding the foot-point parameters fixed gives the exact first derivative of the distance with respect to , as long as the closest face does not change. Shape derivatives of turbulent cases therefore include the wall-distance sensitivity; the adjoint study checks them against finite differences that recompute the distance.
Solver#
In the units of the solver the mean-flow equations are of order one and the turbulence equation of order , six or seven orders smaller at flight Reynolds number. Unweighted, an inexact Krylov solve and the convergence monitor would not see it. The rows of the turbulence equation are therefore weighted by with : the Newton residual norm is , the forward Krylov solver works on and the adjoint one on . The solutions are those of the unscaled systems; only the norm the tolerances refer to changes. The implicit solver, the block-Jacobi preconditioner and p-multigrid are otherwise the same as for laminar flow, with element blocks one variable larger.
- The eddy viscosity enters the stable time step and the block preconditioner, but there is no positivity enforcement for , or beyond what the model provides.
- Start-up from a uniform free stream relies on pseudo-transient continuation; there is no dedicated turbulence start-up strategy and no measured robustness on separated flows.
- Wall-resolved meshes have element aspect ratios of the order of a thousand at the wall.
Element-block Jacobi does not see that anisotropy: used alone it leaves linear solves on
such meshes slow or short of their tolerance. Two remedies exist. The piecewise-constant
coarse level of the p-multigrid hierarchy (
solver.levelsat its default, which includes ) makes them converge with block Jacobi (solver statistics of the adjoint study). The line smoother (solver.smoother: line, how it works) inverts the coupling along the wall-normal lines of elements exactly and needs a fraction of the Krylov iterations (measured). There is no incomplete-factorisation preconditioner, and nothing has been measured on a turbulent mesh larger than the flat plate of the preset. - The entropy analysis of the two-point fluxes covers the mean-flow convective terms only; nothing is proven for the model equation.
References: Allmaras, Johnson and Spalart (2012); Oliver and Darmofal (2009); see the bibliography.