Skip to content

Orszag–Tang vortex ​

IDGroupMilestoneTypeBackendsFigureRegression
MV-12Ideal MHDM2 (#41) · P6aPCPU, FNLyesorszag-tang

Case and scope ​

The standard 2-D test of MHD turbulence and shock interactions (Stone et al. 2008, section 8.4): interacting shocks, a current sheet and low-β regions from a smooth, divergence-free, doubly periodic start. It has no exact solution, so the oracle checks what the equations guarantee:

  • symmetry: the 180° rotation about (1/2,1/2) maps the initial state to itself (scalars even, vectors odd), so the discrete solution must keep that symmetry. A wrong ghost fill or a sign error gives a truncation-level defect (∼10−3); a correct scheme leaves a round-off seed amplified by the flow;
  • conservation: the periodic box conserves the integrals of ρ, ρu, E and B;
  • positivity: the floors are disabled, so a non-positive density or pressure stops the run; a completed run has zero floored cells.

With --amr the centre box is refined once, so 2:1 seams are crossed by the shocks: symmetry and conservation must hold there too, and the seam must not be a larger div(B) source than the flow features themselves.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD, γ=5/3models
SpaceWENO5 flux splitting on characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90; mhd_glm_face_split_fluxes, adam_flume_mhd_library.F90
Divergence controlGLM, ch=4 (above the fastest signal, glm_ch_check = error), glm_alpha = 0.18, glm_damping_length = 1.0models
Floorsdisabledmodels
TimeSSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.4adam_stepper_object.F90 (SELAH)
AMR (--amr)geometric primitive-box marker at initialisation, no regrid; 2:1 restriction, tricubic ghost fill, refluxinterp_seam_ghost, adam_field_object.F90; apply_reflux_corrections, adam_forest_object.F90; numerics
Diagnosticsconservation history every step; div(B) history (seam-local column on AMR)compute_conservation, compute_divb_history, adam_flume_cpu_object.F90
Boundariesperiodicboundary conditions
FNL backendthe same kernels on the deviceadam_flume_fnl_object.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Grid, uniformthe vortex grid of V2 (quadtree, 4×4 blocks), 1282 cells (322 per block)
Grid, --amr322 base (82 per block), the blocks whose centroid lies in [0.25,0.75]2 refined once (2:1); quadtree with nk = 1 (mhd/amr_box.py; --ratio 8 gives the octree with null z and nk = 4 of the measurements before #142); plus the uniform 322 run as reference
Ranks2
Initial conditionorszag-tang, evaluated as odd functions of 2x−1, 2y−1 (bitwise symmetric)
Boundariesperiodic on x and y
Final timet=0.5 (1281 steps at 1282)

Input files ​

FileRole
src/tests/flume/verification/mhd/orszag-tang/make_orszag_tang.pywrites the input from vortex/vortex-n064.ini (--cells, --refine-box, --ratio, --nk, --divergence-control, --it-save)
src/tests/flume/verification/mhd/amr_box.pyrefines a box by one 2:1 level at initialisation
src/tests/flume/verification/mhd/orszag-tang/check.shruns the uniform leg, or --amr, or --divergence-control eglm (--numerics SPEC, --legs mv12)
src/tests/flume/verification/mhd/orszag-tang/orszag_tang_oracle.pythe 180° symmetry, the conservation, the positivity
src/tests/flume/verification/mhd/seam_divb_oracle.pythe seam div(B) against the uniform reference (--amr)
src/tests/flume/verification/make_doc_figures.py fig_orszag_tangdraws orszag-tang.png and orszag-tang-amr.png from <runs>/orszag-tang and <runs>/orszag-tang-amr (--only orszag-tang)
bash
cd src/tests/flume/verification/mhd
orszag-tang/check.sh                                                     # uniform 128^2, CPU (about 5 min)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl orszag-tang/check.sh    # FNL
orszag-tang/check.sh --amr                                               # 2:1 seams (about 30 s on the quadtree)

make_doc_runs.sh <runs> mhd writes the figure runs (<runs>/orszag-tang: 1282; <runs>/orszag-tang-amr: 322 with [0.25,0.75]2 refined); make_doc_figures.py --runs <runs> draws it.

Results ​

Orszag-Tang

Density and pressure at t=0.5, 1282.

Orszag-Tang on AMR

Density on the 322 base with the centre box refined; the block outlines show the 2:1 seams the shocks cross.

CheckBoundCPUFNL
180° rotational symmetry at t=0.5, relative defect10−82.7⋅10−96.4⋅10−9
integrals of ρ, ρu, E, B, relative drift10−131.4⋅10−171.1⋅10−16
positivity (floors disabled)run completespasspass
--amr: symmetry10−84.6⋅10−136.9⋅10−13
--amr: conservation10−135.6⋅10−171.1⋅10−16
--amr: peak seam max|∇⋅B| / peak max|∇⋅B| of the uniform 322 run1.00.76 (0.884/1.170)the same

Measured: ADAM 0bcdf870 + the night-2026-11-22 tree (the paper commit, tag pending), CPU gfortran 16.2.0 + Open MPI 5.0.11 (iac_gnu) on medooza (gnode22), FNL nvfortran 26.9, CUDA 12.9 (iac_nvf) on NVIDIA A30, 2026-11-23 (orszag-tang/check.sh, orszag-tang/check.sh --amr, jobs 1369376 CPU, 1369378 FNL).

The symmetry defect of the uniform run grows from 1.7⋅10−13 at step 100 to 3⋅10−11 at step 300, when the shocks form, and 1.3⋅10−9 at t=0.5 (CPU, M2-P6a); at the paper commit it ends at 2.7⋅10−9 (CPU) and 6.4⋅10−9 (FNL), a round-off seed amplified by the flow on both backends (FMA contraction on FNL), below the bound. w and Bz stay exactly 0 on both backends in these runs. The --amr rows run on the quadtree with nk = 1; the octree values of M2 (null z, nk = 4) were 9.1⋅10−13, 1.1⋅10−16 and 0.76: the trees agree to round-off, as MV-15 measures. The bounds are fixed tolerances, not octree baselines.

Symmetry defect against the grid (#145). The uniform leg at 322 and 642 (check.sh --cells N), and the defect at every 10th step of the uniform runs, the --amr run and two more layouts (checkpoints every 10 steps; orszag_tang_oracle.py at each):

RunCells, finest spacingSteps to t=0.5Defect at t=0.07Defect at t=0.1Defect at t=0.5
uniform 322 (--cells 32)1024, 1/323203.8⋅10−142.5⋅10−131.5⋅10−13
--amr: 322, [0.25,0.75]2 at 6421792, 1/646403.0⋅10−148.8⋅10−144.6⋅10−13
uniform 642 (--cells 64)4096, 1/646401.6⋅10−131.2⋅10−102.7⋅10−10
every block refined through the AMR path (322 base, box [0,1]2)4096, 1/646401.6⋅10−131.2⋅10−102.7⋅10−10 (bitwise the uniform 642)
642, [0.25,0.75]2 at 12827168, 1/12812812.3⋅10−132.0⋅10−111.8⋅10−10
uniform 128216384, 1/12812819.2⋅10−152.6⋅10−112.7⋅10−9

The columns at t=0.07 and 0.1 are the nearest checkpoints (322: t=0.0625 and 0.094). Measured: ADAM 0bcdf870 + the night-2026-11-22 tree (HEAD 95ffd728 with the working tree of 2026-11-23), CPU gfortran 16.2.0 + Open MPI 5.0.11 (iac_gnu) on medooza (gnode25), 2 ranks, 2026-11-23 (orszag-tang/check.sh --cells 32, --cells 64; the series with make_orszag_tang.py --it-save 10; jobs 1369617, 1369627).

The defect does not grow with the number of steps. It stays at 10−14–10−13 until t≈0.07 on every grid, then, on the grids that are fine outside the centre box, grows by three decades within 0.03 time units (642: 4.7⋅10−14 at t=0.0625, 9.3⋅10−11 at t=0.094; 1282: 9.2⋅10−15 at t=0.070, 2.3⋅10−11 at t=0.094), at cells near (0.48,0.96) and their images, outside [0.25,0.75]2; afterwards it changes by less than a factor 4 on 642, while 1282 keeps growing to 2.7⋅10−9. On 322 cells that growth does not happen. The --amr run has 322 cells there: at the same step count and the same finest spacing as the uniform 642 run its defect is 600 times smaller. Refining every block through the AMR path reproduces the uniform 642 run bit for bit, so the AMR machinery (seam fill, reflux) does not make the run more symmetric: the resolution outside the box does.

Related cases: rotor uses the same symmetry oracle; EGLM cleaning runs this problem under EGLM (EV-4); quadtree AMR runs the --amr problem on three trees; MHD on weno-riemann runs it on HLLD.

Findings ​

  • The initial state is bitwise symmetric and the scheme is symmetric in exact arithmetic, but its left- and right-biased reconstructions round differently: the defect is a round-off seed amplified by the flow, four to five decades below what a wrong fill or a sign error produces.
  • On AMR the refined box is symmetric about the centre and the reflux keeps the integrals: symmetry (4.6⋅10−13) and conservation (5.6⋅10−17) hold across the seams.
  • The adaptive run is more symmetric than the uniform one because it is coarse where the defect grows, not because it takes fewer steps (#145): the seed is amplified by three decades between t=0.07 and 0.1 near (0.48,0.96) and its image on 642 and finer cells, and not on 322 cells. With every block refined, the AMR path gives the uniform 642 run bit for bit.
  • The div(B) beside the seams stays below the uniform-grid peak: the shocks, not the seams, set the div(B) maximum.
  • The AMR variant runs on a quadtree with nk = 1, true 2-D, since #142 (A8). It ran on an octree with null z and nk = 4 (four times the cells) because, before #46, a quadtree seam produced a spurious z dependence. On this problem the two trees agree to round-off at t=0.2 (4.1⋅10−12); MV-15 keeps the octree as its reference.