Skip to content

MHD on weno-riemann ​

IDGroupMilestoneBackendsFigureRegression
RV-5, RV-6, RV-7Ideal MHDM3 (#47, M3-P3c)CPU, FNLyesrj2a-hlld

Case and scope ​

The MHD verifications of M2 were built on the WENO flux splitting. The weno-riemann scheme (WENO interpolation of the face states, an LLF, HLL or HLLD Riemann solver, a high-order flux correction) reuses their inputs and oracles through the shared --numerics option, which rewrites the [numerics] block of the generated inputs:

--numerics SOLVER[:RECON[:CORRECTION[:SENSOR]]]

with SOLVER = llf | hll | hlld, RECON = primitive | characteristic (default characteristic, the MHD default), CORRECTION = none | 4th | 6th (default 6th), SENSOR = weno | none (default weno). Seven scripts take it: linear-wave, cpaw, riemann, rj2a, orszag-tang, rotor and field-loop.

What the case catches:

  • a Riemann-solver path that loses accuracy: the specs hlld:primitive and hlld:characteristic (6th, weno) assert bounds measured on them in rj2a, linear-wave, cpaw and field-loop; HLLD must be at least as accurate as HLL on Ryu–Jones 2a (RV-6);
  • a scheme-dependent defect: every spec runs the scheme-independent checks (order, bitwise x/y/z and left/right, symmetry, conservation, positivity); the other specs are measurements.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD, no cleaning, GLM or EGLM, as in each verificationmodels
Spacescheme_space = weno-riemann: WENO interpolation of the face states (primitive or characteristic variables)compute_residuals_riemann, adam_flume_cpu_object.F90; mhd_face_interpolation_fields, mhd_face_states, adam_flume_mhd_riemann_library.F90; numerics
Riemann solversLLF, HLL, HLLD (with a fallback to HLL, reported in the log); GLM and EGLM variantsmhd_riemann_llf, mhd_riemann_hll, mhd_riemann_hlld, mhd_glm_riemann_hlld, mhd_eglm_riemann_hlld, adam_flume_mhd_riemann_library.F90; adam_flume_cpu_mhd_hlld_kernels.F90 (and the _llf, _hll, _glm_*, _eglm_* twins)
Flux correction6th with the WENO sensor (default)numerics
Time, boundaries, gridsas in each verification—
FNL backendthe same kernels on the devicecompute_residuals_riemann_dev, adam_flume_fnl_object.F90

Initial and boundary conditions ​

The inputs are those of the verifications, unchanged except for the [numerics] block:

ProblemSetup
Ryu–Jones 2a256 and 512 cells, t=0.2; RV-6 adds an HLL run at 256
linear waves, CPAWthe MV-5 and MV-6 ladders
Brio–Wu, Ryu–Jones 4d512 cells, floors armed at 10−10
field loopthe uniform 64/128 ladder
Orszag–Tang, rotoras in MV-12, MV-13

Input files ​

FileRole
src/tests/flume/verification/mhd/numerics.shnumerics_check, numerics_tag, numerics_apply: validates the spec and rewrites [numerics]
src/tests/flume/verification/make_doc_runs.sh <runs> rj2a mhd, make_doc_figures.py --only weno-riemannrj2a re-runs the splitting and HLLD-characteristic runs, mhd the HLLD-primitive run rj2a-hlld-prim
src/tests/flume/verification/mhd/{rj2a,linear-wave,cpaw,riemann,orszag-tang,rotor,field-loop}/check.shthe seven scripts that take --numerics
bash
cd src/tests/flume/verification/mhd
rj2a/check.sh --numerics hlld                     # HLLD, characteristic interpolation
rotor/check.sh --numerics hlld:primitive          # HLLD, primitive interpolation

Results ​

Ryu-Jones 2a on the splitting scheme and on HLLD

Ryu–Jones 2a at 256 cells, CPU, over the exact solution: the splitting scheme and weno-riemann with HLLD on characteristic and on primitive interpolation. The three agree at this scale; the primitive interpolation has the largest L1 sum of the three (table below).

Measured in issue #47, M3-P3c; CPU and FNL agree to the printed digits:

ProblemSplittingHLLD primitiveHLLD characteristic
Ryu–Jones 2a, L1 sum at 256 / 512 cells3.84/2.12⋅10−25.13/2.93⋅10−23.76/2.12⋅10−2
linear waves, CPAW: observed order4.96–5.024.96–5.004.96–4.99
Brio–Wu, Ryu–Jones 4d: floored cells, HLLD fallbacks00, 00, 0
field loop, magnetic energy kept at 64 / 128 cells0.872 / 0.9370.869 / 0.9360.887 / 0.944

Bounds asserted under the two HLLD specs (CPU M3-P3c + 2%; energies − 0.2%):

CheckHLLD primitiveHLLD characteristic
Ryu–Jones 2a, L1 sum at 256 / 5125.235/2.985⋅10−23.840/2.166⋅10−2
CPAW ϵ at 32 / 64 / 1281.124⋅10−3 / 3.774⋅10−5 / 1.176⋅10−61.098⋅10−3 / 3.726⋅10−5 / 1.174⋅10−6
linear waves, CPAW: observed order≥4.8≥4.8
field loop ⟨|Bz|⟩/A0 at 64 / 1289.950⋅10−4 / 5.546⋅10−41.083⋅10−3 / 5.923⋅10−4
field loop EB(T)/EB(0) at 64 / 128≥0.86757 / 0.93417≥0.88559 / 0.94189
Ryu–Jones 2a, GLM against no cleaning10−1110−11
rotor symmetry at step 100 / at the end10−8 / 10−410−8 / 10−4

The linear-wave bounds are per run, the larger of the two interpolations (linear-wave/check.sh).

Related cases: Sod, Lax and Shu–Osher compare the Euler Riemann solvers; EGLM cleaning runs on HLLD characteristic; positivity limiter runs HLLD and HLLC with the limiter.

Findings ​

  • On Ryu–Jones 2a HLLD is more accurate than HLL (5.98 and 4.32⋅10−2): RV-6 asserts the HLLD L1 sum at most the HLL one.
  • HLLD with characteristic interpolation matches the splitting scheme on Ryu–Jones 2a; primitive interpolation is about 35% less accurate there. On the smooth waves the two interpolations agree to 3 digits (linear WENO weights).
  • The GLM run differs from the run without cleaning by round-off (10−12; bitwise with the splitting), because the interpolated uniform Bn seeds ψ.
  • The rotor's symmetry defect is round-off amplified by the flow and grows as the dissipation decreases (final 5⋅10−9 to 6⋅10−6 depending on the interpolation and the backend), so under --numerics it is checked at step 100 within 10−8 and at the end within 10−4 (rotor).
  • The scripts glm-pulse, divb-peak, vortex and rotated-shock-tube do not take --numerics: MV-3, MV-7, MV-8 and MV-10 run on the splitting scheme only.