Skip to main content

Module choosing

Module choosing 

Source
Expand description

§Choosing a scheme

The validation pages measure each option; this page reads them as advice. Every statement links to the case that shows it. Nothing here is a default of the code: it is what the evidence supports.

§At a glance

You wantUseBecause
A robust scheme for gas flow with shocksmuscl with van_leer, hllc, SSP-RK3Positive and finite on all five of Toro’s tests; second order in $L_1$ on smooth data (1D)
More accuracy on shocks and smooth flow togetherweno5, primitive variablesBeats MUSCL on four of Toro’s five tests and on Shu and Osher’s; survives test 5 at Courant number 0.3 or less (high order)
The smallest error on smooth flow with weak shocksupwind5 or upwind11About twice as accurate as weno5 on Shu and Osher’s problem; but they oscillate at strong shocks and fail on every strong problem
A moving interfaceweno5 or upwind11First-order upwind loses 99.4% of Zalesak’s disk in one turn (high order)
A cylindrical or spherical gasfirst_order or musclThe stencil-rule schemes and Lax-Wendroff are refused there (limitations)

§Flux scheme and order in higher dimensions

The linear rules and Weno5 reach their design order in one dimension. In two and three the unsplit finite-volume operator uses the face-centre value as the face average, so they are second order there whatever the rule; the level set keeps its order in every dimension because it works on point values (methods). Pay for a wide stencil in 2D and 3D only for its smaller error, not for a higher order.

§Riemann flux

  • hllc for a gas: it keeps an isolated contact exactly and is robust (1D).
  • hll is as robust but smears a contact over 43 cells where HLLC has none (limitations). The difference is small once MUSCL sharpens the contact (Sod: 1.65e-3 against 1.73e-3).
  • exact solves the Riemann problem exactly at every face: the reference the approximate fluxes are judged against.
  • local_lax_friedrichs works for any equation and is diffusive: it smears a shock more than Godunov’s flux does.
  • godunov and engquist_osher are the scalar choices; roe_no_fix is kept to show an expansion shock and should not be used (limitations).

§Variables of the reconstruction

VariablesPick whenEvidence
primitivethe default for weno5 on strong problemssurvives tests 1 to 4, and test 5 at Courant number 0.3 or less
characteristicthe smooth part dominates12% to 24% better on Shu and Osher’s problem; fails near vacuum (test 2); costs 1.8 times the time of the conserved variables
conserveda linear rulefor a linear rule all three give the same answer to round-off, and conserved is cheapest; for weno5 it wins no case

§Time integrator and Courant number

  • SSP-RK3 is the integrator for everything above first order; the linear rules require it (or better) and a Courant number below their limit, 1.43 for fifth order and 1.04 for eleventh (stability limits).
  • SSP-RK2 is enough for MUSCL, with a Courant number of at most one half.
  • Forward Euler only with the first-order scheme.

§Dimensions and splitting

Unsplit treats the axes alike and is exactly symmetric under swapping them. Strang needs only the per-axis Courant limit and adds a splitting error, which is small on configuration 3 (mean density agrees to 1e-7). Lax-Wendroff needs Strang in 2D (2D).

§Reinitialising a level set

Do not, unless something needs a distance function (normals, curvature). The pseudo-time method is accurate near the interface but confined to its band and about 85 times dearer; fast sweeping is cheap and global but first order and runs on one thread. Both round the thin features they cannot resolve (comparison).