Skip to content

MHD rotor ​

IDGroupMilestoneBackendsFigureRegression
MV-13Ideal MHDM2 (#41)CPU, 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_rk_object.F90
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−81.8⋅10−9 (10−11 at step 100)pass
positivity (floors disabled)run completespasspass
--numerics: symmetry at step 10010−83.9⋅10−12 HLLD primitive, 4.9⋅10−10 HLLD characteristic2.1⋅10−12, 7.9⋅10−10
--numerics: symmetry at the end10−4 (gross failures only)3.4⋅10−11 HLL; 5.4⋅10−9 HLLD primitive; 7.4⋅10−8 HLLD primitive without the sensor; 1.1⋅10−7 HLLD characteristic2.3⋅10−7 and 6.1⋅10−6 for the two HLLD

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 smoothly from round-off (the time series has no jump, so no switch flips) 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.
  • 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 10−4.