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.
order | Face states |
|---|---|
first | the cell values; stable but diffusive |
second (the default) | reconstructed from the cell values and gradients, for every variable |
euler_second | density, 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.
order does From the shocktube caseBoth runs use the Roe scheme and explicit three-stage Runge–Kutta on the same mesh; only the spatial order changes.
Reconstruction
At second order each side of a face takes its cell value plus an increment. For the left cell of face , with right neighbour :
and the right side is built in the same way from cell . The first term extrapolates the cell gradient to the face. The second is the jump between the two cells. The blend weight is 1/3. The limiter value lies between 0 and 1. gives the full reconstruction. 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.
reconstruction | Backward difference for the limiter |
|---|---|
muscl (the default) | the cell gradient along twice the cell-to-face vector |
umuscl | the cell gradient along the full vector between the two cell centres |
lpumuscl | as 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.
gradient | Method |
|---|---|
green-gauss (the default) | the sum of face values times face areas, divided by the cell volume |
least-squares | the 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_scheme | Scheme |
|---|---|
roe (the default) | Roe's linearised solver; each wave has its own dissipation |
hllc | the HLLC solver, which resolves the contact and shear waves |
rusanov | local Lax–Friedrichs: one dissipation scaled by the fastest wave speed; the most diffusive |
roe low-diss | roe with its dissipation scaled down by a sensor |
hllc low-diss | hllc 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.
inviscid flux scheme does From the shocktube caseBoth runs are second order with the van Albada limiter and explicit three-stage Runge–Kutta on the same mesh; only the flux scheme changes.