Skip to content

Orszag–Tang vortex ​

IDGroupMilestoneBackendsFigureRegression
MV-12Ideal MHDM2 (#41)CPU, 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_rk_object.F90
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); octree with null z and nk = 4 (mhd/amr_box.py); 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 4.5 min)
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl orszag-tang/check.sh    # FNL
orszag-tang/check.sh --amr                                               # 2:1 seams (about 6 min)

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−81.3⋅10−9pass
integrals of ρ, ρu, E, B, relative drift10−131.2⋅10−14pass
positivity (floors disabled)run completespasspass
--amr: symmetry10−89.1⋅10−13pass
--amr: conservation10−131.1⋅10−16pass
--amr: peak seam max|∇⋅B| / peak max|∇⋅B| of the uniform 322 run1.00.76 (0.887/1.170)pass

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). w and Bz stay exactly 0 on the CPU; on FNL they carry round-off noise (∼10−12 of the in-plane field), which the oracle scales by the vector magnitude. FNL ran every leg; the tables record the CPU values.

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 (9.1⋅10−13) and conservation (1.1⋅10−16) hold across the seams.
  • 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 an octree with null z and nk = 4 because, before #46, a quadtree seam produced a spurious z dependence; the comparison with a quadtree is MV-15.