Appearance
Orszag–Tang vortex
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| MV-12 | Ideal MHD | M2 (#41) | CPU, FNL | yes | orszag-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-
- symmetry: the 180° rotation about
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 ( ); a correct scheme leaves a round-off seed amplified by the flow; - conservation: the periodic box conserves the integrals of
, , and ; - 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
| Item | Choice | Code |
|---|---|---|
| Equations | ideal MHD, | models |
| Space | WENO5 flux splitting on characteristic variables | compute_residuals_weno, adam_flume_cpu_object.F90; mhd_glm_face_split_fluxes, adam_flume_mhd_library.F90 |
| Divergence control | GLM, glm_ch_check = error), glm_alpha = 0.18, glm_damping_length = 1.0 | models |
| Floors | disabled | models |
| Time | SSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.4 | adam_rk_object.F90 |
AMR (--amr) | geometric primitive-box marker at initialisation, no regrid; 2:1 restriction, tricubic ghost fill, reflux | interp_seam_ghost, adam_field_object.F90; apply_reflux_corrections, adam_forest_object.F90; numerics |
| Diagnostics | conservation history every step; div(B) history (seam-local column on AMR) | compute_conservation, compute_divb_history, adam_flume_cpu_object.F90 |
| Boundaries | periodic | boundary conditions |
| FNL backend | the same kernels on the device | adam_flume_fnl_object.F90 |
Initial and boundary conditions
| Item | Value |
|---|---|
| Domain | |
| Grid, uniform | the vortex grid of V2 (quadtree, |
Grid, --amr | nk = 4 (mhd/amr_box.py); plus the uniform |
| Ranks | 2 |
| Initial condition | orszag-tang, evaluated as odd functions of |
| Boundaries | periodic on |
| Final time |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/mhd/orszag-tang/make_orszag_tang.py | writes the input from vortex/vortex-n064.ini (--cells, --refine-box, --ratio, --nk, --divergence-control, --it-save) |
src/tests/flume/verification/mhd/amr_box.py | refines a box by one 2:1 level at initialisation |
src/tests/flume/verification/mhd/orszag-tang/check.sh | runs the uniform leg, or --amr, or --divergence-control eglm (--numerics SPEC, --legs mv12) |
src/tests/flume/verification/mhd/orszag-tang/orszag_tang_oracle.py | the 180° symmetry, the conservation, the positivity |
src/tests/flume/verification/mhd/seam_divb_oracle.py | the seam div(B) against the uniform reference (--amr) |
src/tests/flume/verification/make_doc_figures.py fig_orszag_tang | draws 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: <runs>/orszag-tang-amr: make_doc_figures.py --runs <runs> draws it.
Results

Density and pressure at

Density on the
| Check | Bound | CPU | FNL |
|---|---|---|---|
| 180° rotational symmetry at | pass | ||
| integrals of | pass | ||
| positivity (floors disabled) | run completes | pass | pass |
--amr: symmetry | pass | ||
--amr: conservation | pass | ||
--amr: peak seam | 1.0 | 0.76 ( | pass |
The symmetry defect of the uniform run grows from
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 (
) and conservation ( ) 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
and nk = 4because, before #46, a quadtree seam produced a spuriousdependence; the comparison with a quadtree is MV-15.