Skip to content

MHD rotor ​

IDGroupMilestoneTypeBackendsFigureRegression
MV-13Ideal MHDM2 (#41) · P6bPCPU, FNLyesrotor

Case and scope ​

A dense disc spins in a magnetised ambient gas (Balsara & Spicer 1999; the first rotor of Tóth 2000) and launches torsional Alfvén waves that brake it, compresses the field and drives strong shocks: a stringent 2-D test of positivity and of the multi-dimensional field evolution. There is no exact solution; the oracle checks:

  • symmetry: the 180° rotation composed with B→−B (the ambient field is uniform) maps the solution to itself. A symmetry defect of the scheme is at truncation level (10−3) from the first steps; a correct scheme leaves a round-off seed amplified by the flow;
  • positivity: the floors are disabled, so a non-positive density or pressure stops the run.

There is no conservation check: the outflow boundaries do not conserve.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD, γ=1.4 (cp=3.5, cv=2.5)models
SpaceWENO5 flux splitting on characteristic variables; weno-riemann under --numericscompute_residuals_weno, compute_residuals_riemann, adam_flume_cpu_object.F90
Divergence controlGLM, ch=6 (glm_ch_check = error), glm_alpha = 0.18, glm_damping_length = 1.0mhd_glm_face_split_fluxes, adam_flume_mhd_library.F90; models
Floorsdisabledmodels
TimeSSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.4adam_stepper_object.F90 (SELAH)
Boundarieszeroth-order extrapolation (outflow)set_boundary_conditions, adam_flume_cpu_object.F90; boundary conditions
FNL backendthe same kernels on the deviceadam_flume_fnl_object.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Gridthe vortex grid of V2 (quadtree, 4×4 blocks), 2562 cells (642 per block); a power of two, so the cell centres are exact binary fractions and the initial state is bitwise symmetric (Tóth uses 2002)
Ranks2
Initial conditionmhd-rotor: ambient ρ=1 at rest, p=1, B=(5/4π,0,0); disc ρ=10 for r<0.1 around (0.5,0.5), rigid rotation at speed 2 at r=0.1, linear taper to r=0.115
Boundariesextrapolation on x and y
Final timet=0.15 (1152 steps)

Input files ​

FileRole
src/tests/flume/verification/mhd/rotor/make_rotor.pywrites the input from vortex/vortex-n064.ini (--cells, --cfl, --time-max, --glm-ch, --it-save)
src/tests/flume/verification/mhd/rotor/check.shruns the case (--np N, --numerics SPEC, --legs mv13)
src/tests/flume/verification/mhd/orszag-tang/orszag_tang_oracle.pythe symmetry check, --field-parity even (the B→−B composition)
src/tests/flume/verification/make_doc_figures.py fig_rotordraws rotor.png from <runs>/rotor (--only rotor)
bash
cd src/tests/flume/verification/mhd
rotor/check.sh                                                     # CPU (about 10 min)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl rotor/check.sh    # FNL
rotor/check.sh --numerics hlld:primitive                           # weno-riemann, HLLD, primitive interpolation

make_doc_runs.sh <runs> mhd writes the figure run (<runs>/rotor: 2562); make_doc_figures.py --runs <runs> draws it.

Results ​

MHD rotor

Density and magnetic pressure |B|2/2 of the rotor.

CheckBoundCPUFNL
symmetry (180° rotation with B→−B), splitting, t=0.1510−86.5⋅10−10 (2026-11-22; 1.8⋅10−9 at M3-P3c; 10−11 at step 100)6.4⋅10−10
positivity (floors disabled)run completespasspass
--numerics: symmetry at step 10010−8HLL 5.0⋅10−13, HLLD primitive 3.6⋅10−12 (without the sensor 3.0⋅10−12), HLLD characteristic 3.8⋅10−123.9⋅10−13, 4.2⋅10−12 (4.3⋅10−12), 3.2⋅10−12
--numerics: symmetry at the end, HLL5⋅10−104.4⋅10−111.2⋅10−11
--numerics: symmetry at the end, HLLD primitive7⋅10−4 (one sensor flip, see below)6.08⋅10−56.08⋅10−5
--numerics: symmetry at the end, HLLD primitive without the sensor4⋅10−63.4⋅10−71.8⋅10−8
--numerics: symmetry at the end, HLLD characteristic8⋅10−97.4⋅10−103.6⋅10−10
--numerics: symmetry at the end, any other spec10−4 (gross failures only)not measurednot measured

Measured: ADAM 0bcdf870, CPU gfortran 16.2.0 + Open MPI 5.0.11 (iac_gnu) on medooza, FNL nvfortran 26.9, CUDA 12.9 (iac_nvf) on NVIDIA A30, 2026-11-22 (rotor/check.sh --numerics <spec>, job 1369317): the --numerics rows at the end. Repeated on ADAM 0bcdf870 + the night-2026-11-22 tree (the paper commit, tag pending), medooza (gnode22) and A30, 2026-11-23 (rotor/check.sh, rotor/check.sh --numerics <spec> for the four specs, jobs 1369376 CPU, 1369378 FNL): every end value the same to the printed digits, plus the splitting row and the step-100 row. Repeated again on ADAM 95ffd728 + the night-2026-11-22 tree (part 3), medooza and A30, 2026-11-23 (rotor/check.sh --numerics <spec> for the four specs, job 1369637): the same to the printed digits. The positivity row is from M3-P3c (2026-10-01).

w and Bz stay exactly 0 on the CPU.

Related cases: Orszag–Tang shares the symmetry oracle; MHD on weno-riemann explains the two-point symmetry check; multi-realm runs split this rotor on a quadtree.

Findings ​

  • The final symmetry defect grows from round-off and orders by the dissipation of the solver and by the backend's round-off: the least dissipative interpolations amplify the seed most, and FNL contracts differently into FMAs. The exception is a flip of a switch, below.
  • A single end-of-run tolerance cannot separate a round-off seed from a defect across solvers, so under --numerics the symmetry is asserted twice: at step 100, before the flow amplifies the seed, within 10−8, and at the end within a bound per spec (rotor/check.sh): 10 times the larger of the CPU and FNL defects measured on 2026-11-22, rounded up to one digit; a spec never measured keeps 10−4, which catches only a truncation-level defect (10−3).
  • HLLD primitive with the sensor flips a switch. Its end defect is 6.08⋅10−5 on both backends, against 2.2⋅10−9 before a2258f41 ("FLUME CPU integrates with SELAH", #132). The commit changed only the order of the Runge–Kutta sums: SELAH adds Δt∑kaskRk to q once, the order of the former FNL kernels, where rk_object added each term to q in turn. With the former order restored in SELAH's two kernels (a scratch build), the run is bitwise that of a8f3fbd2, 2.22⋅10−9 at the end. The defect is a jump: the time series reads 6⋅10−10 at step 910 and 5⋅10−7 at step 920. At step 912, stage 5, the WENO sensor of the flux correction (minkwk/dk≥τ=0.2) reads τ−7.2⋅10−10 at the x face (0.371,0.693) and τ+3.4⋅10−10 at its image: the round-off seed, 10−9 by then, is larger than the distance to τ, so the correction is dropped on one side only. Both summation orders are a lottery on the seed: with the CFL moved by 10−8 (relative) the end defect is 3.4⋅10−7 or 2.5⋅10−4 with SELAH's order, 3.1⋅10−7 or 1.9⋅10−4 with the former one. CPU and FNL give the same value because they now sum in the same order and meet the same face. The end bound of this spec is therefore the rule's 7⋅10−4, which admits a flip; the step-100 check, before the seed reaches τ, is the one that catches a defect of the scheme. The other specs with the sensor flipped no face in the runs measured, and could on another seed. A sensor without a jump (a ramp of the correction weight around τ) would remove the lottery; it changes every case with the sensor and is not done here (medooza CPU, gfortran 16.2, 2026-11-23, jobs 1369623, 1369628).
  • The end defects moved since M3-P3c (the SSP(5,4) tableau fix #104 and SELAH #132 changed the round-off seed): HLLD characteristic 1.1⋅10−7→7.4⋅10−10, splitting 1.8⋅10−9→6.5⋅10−10, HLLD primitive without the sensor 7.4⋅10−8→3.4⋅10−7 (CPU).