Appearance
Isothermal and barotropic MHD
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| EO (em1 to em10) | Ideal MHD | M13 (#100), P5a (CPU), P5b (FNL) | CPU, FNL | yes | iso-mhd-tube2, baro-mhd-glm-hlld |
Case and scope
The isothermal and barotropic gases gain a magnetic field. The result is ideal MHD without an energy equation, the total pressure
- the six-wave eigensystem of Kim et al. (1999), with
, for the characteristic projection; - the isothermal HLLD of Mignone (2007), on any
.
eos/mhd_oracle.py selftest checks both papers before any run. It checks
What the legs catch:
- a wrong eigenvector: a linear wave of one family excites the others; its error stops converging at
instead of at fifth order (em1, em2); - the sound speed taken as
: the barotropic waves on , where and , would lag after one period by 12 % of a wavelength (fast) and 4 % (slow), an error (em1); - a wrong HLLD: the Alfvén waves of the circularly polarised wave (em3), Mignone's tubes and their convergence (em4), the rotational discontinuities that HLL smears (em6);
- an axis-dependent frame: tube 2 along x, y and z (em5);
- the barotropic path drifting from the isothermal one: a one-segment table with exponent 1 is the isothermal gas (em7);
- the energy slot written: every leg checks
rEexactly 0, gravity included (em10); - an input that would silently run wrong: EGLM, the floors, the gamma-law initial conditions (em8);
- a backend that disagrees: one case per model, scheme and solver on CPU and FNL (em9).
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Models | mhd-ideal with [eos] type = isothermal or barotropic: MODEL_MHD_ISO, MODEL_MHD_BARO, and with divergence_control = glm MODEL_MHD_GLM_ISO, MODEL_MHD_GLM_BARO | adam_flume_physics_object.F90 |
| Library | one body behind the EOS hooks of the isothermal and barotropic modules | adam_flume_mhd_iso_library_body.INC, adam_flume_mhd_{iso,baro}_library.F90 |
| Kernels | the model-agnostic MHD kernel bodies on these libraries (16 CPU and 16 FNL modules; the barotropic table read from the device registry on FNL) | adam_flume_{cpu,fnl}_mhd[_glm]_{iso,baro}[_{llf,hll,hlld}]_kernels.F90 |
| Space, time | WENO5, characteristic flux splitting (weno) or weno-riemann with HLLD and the 6th-order correction; SSP-RK(3,3), CFL 0.5 | — |
Initial and boundary conditions
The barotropic cases use POLY of eos_oracle.py (
| Leg | Setup |
|---|---|
| em1 | one wavelength of a fast, Alfvén or slow wave on the periodic box (the background of Stone et al. 2008, |
| em2 | the em1 isothermal waves along x on weno-riemann HLLD |
| em3 | the circularly polarised Alfvén wave (Tóth 2000, |
| em4 | tubes 1–3 on weno-riemann HLLD, 200, 400, 800 and 3200 cells (one transverse cell per block); tube 3 at 400 cells with positivity_limiter = cell |
| em5 | tube 2 along x, y and z (the states permuted cyclically), 200 cells, weno and weno-riemann |
| em6 | tube 2 at 400 cells, HLLD and HLL, against the 3200-cell HLLD run |
| em7 | tube 2 with |
| em8 | eglm; p_floor = 1e-6; orszag-tang; the entropy wave |
| em9 | the last checkpoints of CPU and FNL: em1-iso-2d-fast-64, em1-baro-1d-slow-32, em1-iso-glm-1d-fast-32, em2-iso-hlld-1d-alfven-32, em3-cpaw-right-64, em4-tube2-400, em5-weno-y, em7-baro, em10-barotropic (not the limited tube 3: the limiter is not bitwise across backends) |
| em10 | the em1 box with amplitude 0 under |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/eos/make_eos_mhd.py | writes the cases: tube (from the Sod inputs), wave (from mhd/linear-wave/make_linear_wave.py, the period from the speed of the gas), cpaw (from mhd/cpaw/make_cpaw.py) |
src/tests/flume/verification/eos/mhd.sh | runs the legs (--legs em1,...,em10, default all but em9, which compares the two backends' runs; FLUME_EXE, EM_NP ranks) |
eos/mhd_oracle.py (selftest, rotation, selfconv, agree, hlld-gain, backends), mhd/linear-wave/linear_wave_oracle.py, mhd/cpaw/cpaw_oracle.py, eos/eos_oracle.py (freefall) | the checks |
src/tests/flume/regression/iso-mhd-tube2/input.ini, baro-mhd-glm-hlld/input.ini | the frozen tube 2 (isothermal, weno) and a barotropic GLM HLLD tube |
make_doc_runs.sh <runs> eosmhd, make_doc_figures.py --only barotropic-mhd | the figure |
bash
cd src/tests/flume/verification/eos && ../../../../../exe/.regression-venv/bin/python mhd_oracle.py selftest
./mhd.sh # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./mhd.sh # FNL
./mhd.sh --legs em9 # CPU against FNLResults

Top left: the linear waves along x on 16, 32 and 64 cells, the error after one period over the amplitude, isothermal and barotropic, the three families; the legend gives the order of the 32/64 pair, 4.97 to 5.05 (slope 5 dotted). Top right: tube 1,
| Leg | Asserted | Bound | CPU | FNL |
|---|---|---|---|---|
| — | mhd_oracle.py selftest: Kim's eigensystem, the embedding, the speeds, the HLLD (consistency, rotational discontinuity, hydro limit, positivity), the CPAW | round-off | 13 checks pass | — |
| em1 | the order of the finest pair: isothermal fast, Alfvén, slow along x; inclined; barotropic; GLM fast | 4.96, 4.96, 4.96; 4.97, 4.97, 5.00; 4.97, 4.96, 4.96; 4.96 | the same to the printed digits | |
| em2 | the same on weno-riemann HLLD: fast, Alfvén, slow | 4.96, 4.96, 4.96 | 4.96, 4.96, 4.96 | |
| em3 | the CPAW order, right and left; right against left | 4.89, 4.89; 0 | 4.89, 4.89; 0 | |
| em4 | the ladder order of the L1 distance of rE | 1.15, 1.03, 0.66 (pairs 1.09 and 1.22, 1.03 and 1.03, 0.17 and 1.15); positive, 0 | the same | |
| em4 | tube 3 with the limiter: rE; the L1 distance (reported) | 0 | positive, 0; | positive, 0; |
| em5 | tube 2 along x, y, z, weno and weno-riemann | 0 | 0, 0 | 0, 0 |
| em6 | the L1 distance of | HLLD < HLL | the same | |
| em7 | the one-segment table against the isothermal gas | 0 | ||
| em8 | the 4 invalid inputs | refused | refused | refused |
| em9 | CPU against FNL, the 9 cases: the largest gap over the fields | (the same comparison) | weno); the waves and the CPAW rE 0 | |
| em10 | rE: isothermal, barotropic (SSP(5,4), since #104) | 0, | 0, |
Related cases: the linear waves and the HLLD verification of the ideal gas.
Findings
- The literature, checked before the code. Kim et al. normalise the fast pair with
, which is the Ryu–Jones times . The printed set passes and at random and degenerate states, both gases. In Mignone's section 3, eq. 39 prints as a minimum: it must be the maximum, since it bounds both states' fast speeds. On his own tube 1 ( ) the first face has , a star region of negative width that the paper does not discuss, because is driven far off by a strong density jump. There FLUME's HLLD returns HLL's flux, as the adiabatic HLLD does. - The sound speed is
, and only there. The Jacobian holds the gas law only through , so one eigensystem serves both gases. On the barotropic waves converge at fifth order with ; with the fast and slow waves would lag by 12 % and 4 % of a wavelength per period. - HLLD's gain over HLL is modest at this resolution. On tube 2, 400 cells, its
is 16 % closer to the reference than HLL's (the leg asserts only that it is closer). - A collision with
keeps its start-up error. With no normal field, isothermal MHD has a zero-speed tangential mode: a density jump at rest, balanced by the magnetic pressure. Where the two streams of tube 3 meet, the start-up error of the collision falls into that mode and stays, the MHD analogue of Noh's wall heating (an isothermal hydrodynamic contact cannot carry a density jump, so there the error leaves as sound). At 400 cells the centre reaches withweno(flux splitting) against a plateau of 0.40, two cells wide;weno-riemannHLLD keeps it at 0.405. The positivity limiter does act there onweno-riemann(the limited and unlimited runs differ; the likely trigger is its kinetic chord, which bounds a limited cell's speed by about of the first-order backbone, not measured cell by cell), and it raises the centre to 1.42 (L1 distance , unlimited ). The same limiter on the isothermal hydrodynamic Mach-5 collision lowers the L1 error (from to ,weno-riemannHLLC), and onwenoit never acts. For magnetised collisions with , preferweno-riemannHLLD, and enable the limiter only where positivity is at risk. - The backends agree to round-off, the one-segment table only to
on FNL. On the CPU the one-segment table of exponent 1 and the isothermal gas give the same bits; on FNL they differ by . The table path evaluates through a power and the isothermal path directly, and the device rounds the two differently. Across backends the same input agrees to at most (em9). - The tube-3 criterion was changed after its first run. Tube 3 has shocks only, so its L1 distance is set by where each shock falls within its cell: the pair orders are 0.17 and 1.15. em4 asserts the order over the whole ladder (0.66) and prints the pairs.
- One transverse cell per block. The Sod inputs the tubes are built from carry four cells per block along each null axis: 16 copies of the same 1-D solution.
make_eos_mhd.pysets one, bitwise the same profile (tube 2 at 400 cells, checked), and the 3200-cell references take minutes instead of hours. - The free fall found a defect of the library's SSP(5,4), now fixed. Its former weights, printed with 14 digits, summed to
, so the free fall on SSP(5,4) gave of after ; em10 ran on SSP(3,3) until the tableau was rebuilt from its Shu–Osher form (#104, time integration). On SSP(5,4) em10 now gives and , and runs there as the solver-level regression of that fix.