Appearance
Ryu–Jones 2a: all seven waves
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| MV-4 | Ideal MHD | M2 (#41) | CPU, FNL | yes | rj2a-x, rj2a-y, rj2a-z |
Case and scope
The 1-D Riemann problem of Ryu & Jones (1995), case 2a, produces the full MHD wave fan from one discontinuity: two fast shocks, two rotational discontinuities, two slow shocks and a contact. Its exact solution is known (7 states, Dai & Woodward 1994, Tables Ia and Ib, as used by the Athena++ problem generator shock_tube.cpp), so every conservative variable is compared with it, in the frame (normal, tangent 1, tangent 2).
What the case catches:
- defects anywhere on the MHD path: the eigensystem at the face average, the characteristic splitting, the fluxes and the rotation of the transverse components;
- direction-dependent defects: the problem runs along
, and ; the and runs must equal the run bitwise in the rotated frame; - loss of accuracy: the
sum over the 8 conservative variables under a recorded bound, and decreasing from 256 to 512 cells; - a leaking cleaning block: in 1-D
is uniform, so with GLM the block is inert; the GLM run must equal the run without cleaning bitwise, with exactly zero.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | ideal MHD, | models; adam_flume_mhd_library.F90 |
| Space | WENO5 (weno-u-5) flux splitting on characteristic variables | compute_residuals_weno, adam_flume_cpu_object.F90; mhd_face_split_fluxes, adam_flume_mhd_library.F90; numerics |
| Characteristic projection | the 7×7 Roe–Balsara core of Stone et al. (2008) at the arithmetic face average | mhd_face_average, mhd_eigenvectors, mhd_eigenvectors_core, adam_flume_mhd_library.F90 |
| Order-independent sums | mhd_sum3, adam_flume_mhd_library.F90 | |
| Divergence control | none (main legs); GLM leg: glm_ch = 2.0, glm_alpha = 0.18, glm_damping_length = 1.0, glm_ch_check = warning | mhd_glm_face_split_fluxes, adam_flume_mhd_library.F90; models |
| Floors | disabled (rho_floor = p_floor = 0) | models |
| Time | SSP Runge–Kutta, 3 stages (runge-kutta-ssp-33), CFL 0.5 | adam_rk_object.F90 |
| Boundaries | zeroth-order extrapolation | set_boundary_conditions, adam_flume_cpu_object.F90; boundary conditions |
| FNL backend | the same kernels on the device | compute_residuals_weno_dev, adam_flume_fnl_object.F90 |
The GLM leg sets
Initial and boundary conditions
| Item | Value |
|---|---|
| Domain | |
| Grid | the Sod grid of V1: 64 blocks (octree), 4 along the active axis, refined to ngc = 3 |
| Ranks | 2 |
| Initial condition | riemann-problem, two regions, discontinuity at |
| Left state | |
| Right state | |
| Frame | tangents cyclic as in FLUME and Athena++: axis |
| Boundaries | extrapolation on all six faces |
| Final time | |
| Legs |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/mhd/rj2a/make_rj2a.py | writes the input from sod/sod-{x,y,z}.ini (--axis, --cells, --divergence-control none|glm|eglm) |
src/tests/flume/verification/mhd/rj2a/check.sh | runs the legs (--np N, --numerics SPEC, --legs LIST: mv4, rv6 (with --numerics hlld[:...] only), ev3; rv6 and ev3 need mv4; FLUME_EXE selects the backend) |
src/tests/flume/verification/mhd/rj2a/rj2a_oracle.py | the exact 7-state solution, the |
src/tests/flume/verification/mhd/numerics.sh | the shared --numerics option (MHD on weno-riemann) |
src/tests/flume/verification/make_doc_runs.sh group rj2a | re-runs rj2a (splitting) and rj2a-hlld at 256 cells with checkpoints kept |
src/tests/flume/verification/make_doc_figures.py fig_mhd_riemann | draws rj2a.png (--only mhd-riemann) |
bash
cd src/tests/flume/verification/mhd
rj2a/check.sh # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl rj2a/check.sh # FNL
rj2a/check.sh --numerics hlld # weno-riemann, HLLD, characteristicResults

Density, normal velocity, pressure and the two tangential fields at weno-riemann HLLD (characteristic interpolation) against the exact solution; at this scale the two are indistinguishable.
| Check | Bound | CPU | FNL |
|---|---|---|---|
| strict | pass | pass | |
bitwise (DIR_TOL = 0) | bitwise | bitwise | |
| transverse copies and shared block columns | bitwise | bitwise | bitwise |
| GLM against no cleaning, 8 shared variables | bitwise, | bitwise | bitwise |
The baselines are the M2-P3b measurements, the same on both backends (check.sh). The
Related cases: Sod is the Euler problem on the same grid; Brio–Wu and Ryu–Jones 4d stress the eigensystem near its degeneracies; MHD on weno-riemann holds the HLL/HLLD measurements of this problem; EGLM cleaning runs the EV-3 leg of this script; multi-realm runs split this problem in two realms.
Findings
- The
and runs equal the run bit for bit. Before M2-P3d they differed by ; the order-independent three-term sums ( mhd_sum3) and the projections summed in the frame order of the direction made a cyclic rotation reproduce thearithmetic exactly. - In 1-D the
block of the splitting scheme is inert and block-diagonal, so GLM changes nothing. On weno-riemannthe interpolated uniformcarries a round-off seed into , so check.shrelaxes the pair tolerance tounder --numerics(measuredand shared variables , HLLD primitive). The same tolerance applies to the siWENO weights (WEIGHTS_EXE, issue #49), whose smoothness indicator of a uniform field is round-off, not zero. - The splitting scheme and HLLD with characteristic interpolation are indistinguishable on the figure; their
sums are in MHD on weno-riemann.