v2026.11.16174
Guide / Choosing… / Choosing a spatial scheme

Choosing a spatial scheme

Which spatial order, reconstruction and inviscid flux scheme should the compressible solver use?

Keep the defaults for general work: second order, muscl reconstruction from Green–Gauss gradients, and the roe flux. Use first order only to start a difficult case, through first_order_cycles. Use hllc or rusanov for strong shocks, and a low-diss variant for scale-resolving simulations.

These settings are all in numerical_scheme:

{
  "numerical_scheme": {
    "order": "second",
    "reconstruction": "muscl",
    "gradient": "green-gauss",
    "inviscid_flux_scheme": "roe"
  }
}

A finite-volume solver stores one value of each variable per cell. The flux through a face needs a state on each side. The spatial order sets the accuracy of those states. The reconstruction sets how they are built from cell values and gradients. The inviscid flux scheme turns the pair into a flux. A slope limiter bounds the reconstruction near discontinuities; see Choosing a limiter.

Spatial order

order sets the order of accuracy of the face states.

orderFace states
firstthe cell values; stable but diffusive
second (the default)reconstructed from the cell values and gradients, for every variable
euler_seconddensity, velocity and pressure reconstructed at second order; turbulence variables first order

At first order a discontinuity spreads over several cells, and the error falls only linearly with mesh spacing. Second order halves the error on the shock tube below. Use it for production work. The incompressible solver also accepts central.

first_order_cycles runs that number of cycles at first order, then switches to the chosen order. It helps a case that diverges from a uniform initial state.

Demonstration: what order does From the shocktube case
Density along a shock tube at first and second order, against the analytic solution

Both runs use the Roe scheme and explicit three-stage Runge–Kutta on the same mesh; only the spatial order changes.

setting ordervalues first, secondcase shocktube

Reconstruction

At second order each side of a face takes its cell value plus an increment. For the left cell LL of face ff, with right neighbour RR:

uL,f=uL+ϕL[(1−κ) ∇uL⋅(xf−xL)+12κ (uR−uL)]u_{L,f} = u_L + \phi_L \left[ (1 - \kappa)\, \nabla u_L \cdot (\mathbf{x}_f - \mathbf{x}_L) + \tfrac{1}{2}\kappa\, (u_R - u_L) \right]

and the right side is built in the same way from cell RR. The first term extrapolates the cell gradient to the face. The second is the jump between the two cells. The blend weight κ\kappa is 1/3. The limiter value ϕ\phi lies between 0 and 1. ϕ=1\phi = 1 gives the full reconstruction. ϕ=0\phi = 0 gives first order on that side of the face. The reconstructed variables are density, velocity and pressure, and the turbulence variables when they are solved.

reconstruction selects how the backward difference for a one-dimensional limiter is formed. Without limiting, all options give the same face states.

reconstructionBackward difference for the limiter
muscl (the default)the cell gradient along twice the cell-to-face vector
umusclthe cell gradient along the full vector between the two cell centres
lpumusclas muscl

The two forms differ only where a face does not lie midway between the cell centres, and only with the one-dimensional limiters. The cell-based limiters compute their own bound, so the reconstruction does not affect them.

permit_backward_difference_during_reconstruction switches the one-dimensional limiters to a backward difference taken from the cell gradient alone, on faces where the two cell-to-face vectors lie within 45° of each other. It is off by default.

Gradients

The reconstruction and the cell-based limiters read the cell gradients. gradient selects how they are computed.

gradientMethod
green-gauss (the default)the sum of face values times face areas, divided by the cell volume
least-squaresthe least-squares fit to the differences between a cell and its neighbours

The face values in the Green–Gauss sum are weighted by inverse distance from the two cell centres. linear_gradients replaces that weighting with a plain average. It has no effect with least-squares.

Inviscid flux scheme

inviscid_flux_scheme selects the approximate Riemann solver that turns the two face states into a flux.

inviscid_flux_schemeScheme
roe (the default)Roe's linearised solver; each wave has its own dissipation
hllcthe HLLC solver, which resolves the contact and shear waves
rusanovlocal Lax–Friedrichs: one dissipation scaled by the fastest wave speed; the most diffusive
roe low-dissroe with its dissipation scaled down by a sensor
hllc low-disshllc with its dissipation scaled down by a sensor

entropy_fix floors the Roe wave speeds at that fraction of the largest. This adds dissipation where a wave speed passes through zero. It is zero by default. The other schemes ignore it.

The low-diss variants reduce the upwind dissipation where the flow is resolved. This stops resolved turbulence in a DES or LES being damped. roe_low_dissipation_sensor selects the sensor: FD, NTS or DES. The default, NONE, keeps the full dissipation. A low-diss scheme therefore needs a sensor to differ from its base scheme. roe_dissipation_sensor_minimum is the floor on the scaled dissipation. roe_low_dissipation_sensor_parameter is the field the sensor reads.

Demonstration: what inviscid flux scheme does From the shocktube case
Density along a shock tube for the Roe and Rusanov flux schemes, against the analytic solution

Both runs are second order with the van Albada limiter and explicit three-stage Runge–Kutta on the same mesh; only the flux scheme changes.

setting inviscid flux schemevalues roe, rusanovcase shocktube

Reference entries