Skip to content

Rotated shock tube ​

IDGroupMilestoneBackendsFigureRegression
MV-8Ideal MHDM2 (#41)CPU, FNLyesrotated-shock-tube

Case and scope ​

Ryu–Jones 1a rotated in the x–y plane (Tóth 2000, section 6.3.2) makes the dimension-by-dimension scheme solve a 1-D problem on truly 2-D data. The exact normal field stays uniform, B∥=5/4π, so its deviation measures the divergence error of the base scheme with GLM, and the whole solution must match the same problem solved in 1-D.

What the case catches:

  • a divergence error of the multi-dimensional scheme: δB∥ (Tóth eq. 45, against the analytic value) under a bound, decreasing with N;
  • a 2-D solution that departs from the 1-D one: the mean relative L1 error of ρ, v∥, v⊥, p, B∥, B⊥ against a 1-D reference run, under a bound, decreasing with N.

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=24 (the fastest signal, $\sim$20–24 in the ramp; 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
Boundariesperiodic (FLUME has no shifted-periodic boundary)boundary conditions
FNL backendthe same kernels on the deviceadam_flume_fnl_object.F90

Initial and boundary conditions ​

ItemValue
ProblemRyu & Jones (1995) 1a in the frame of the normal: (ρ,v∥,v⊥,p,B∥,B⊥)=(1,10,0,20,5/4π,5/4π) left, (1,−10,0,1,5/4π,5/4π) right
Initial conditionrotated-riemann, s=nxx+nyy, period 1: the jump at s=1/4+1/(4N) (off every cell centre), a linear ramp of the primitive variables back to the left state over s∈(1/2,9/10]
Normals(1,2), Tóth's tan−1⁡2=63.4°; (1,1), 45°
2-D grid[0,1]2, the vortex grid of V2 (quadtree, 4×4 blocks), N2 cells, N=128,256, periodic
1-D referencethe same problem along x with normal (|n|,0) on [0,1/|n|], the Sod grid of V1 (4 blocks along x), 4×256=1024 cells per period (4 times the normal resolution of N=256), periodic
Ranks2
Final timet=0.04/|n|: the fan of the jump (fast speeds ∼5) stays within 0.2/|n| of it, as in Tóth (t=0.08cos⁡a on his strip; fast shocks at 0.1 and 0.9 at t=0.08)

Input files ​

FileRole
src/tests/flume/verification/mhd/rotated-shock-tube/make_rotated_shock_tube.pywrites the 2-D input from vortex/vortex-n064.ini or the 1-D reference from sod/sod-x.ini (--angle 45|63, --cells, --reference, --cfl, --glm-ch)
src/tests/flume/verification/mhd/rotated-shock-tube/check.shruns the reference and the ladder for both normals (--np N, --legs LIST: mv8-63, mv8-45; about 30 min)
src/tests/flume/verification/make_doc_runs.sh <runs> rotated, make_doc_figures.py --only rotated-shock-tubere-runs both normals at N=256 and their 1-D references with checkpoints kept (4 runs, about 40 min)
src/tests/flume/verification/mhd/rotated-shock-tube/rotated_shock_tube_oracle.pyδB∥ and the mean relative error against the reference
bash
cd src/tests/flume/verification/mhd
rotated-shock-tube/check.sh                                                     # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl rotated-shock-tube/check.sh    # FNL

Results ​

Rotated shock tube at 63.4 and 45 degrees

The 2562 runs at 63.4° (top) and 45° (bottom), CPU. Left: B∥/B0−1, the deviation of the normal field from its exact uniform value, at most 1.5 % (63.4°) and 2.5 % (45°), on the discontinuities. Centre and right: the density and the tangential field of every cell against s=n⋅x, over the 1-D reference; the 2-D runs smear the peaks of the fan the reference resolves, the source of the mean error in the table.

CheckBound (CPU baseline M2-P6d + 2%)CPUFNL
δB∥, 63.4°, N=128/2566.146⋅10−3 / 2.842⋅10−3below / 2.79⋅10−3pass
mean relative error, 63.4°, N=128/2568.989⋅10−2 / 4.095⋅10−2belowpass
δB∥, 45°, N=128/2566.424⋅10−3 / 4.252⋅10−3below / 4.17⋅10−3pass
mean relative error, 45°, N=128/2565.440⋅10−2 / 2.600⋅10−2belowpass
both measures decreasing with Nstrictpasspass

Reference values of Tóth's second-order base scheme at 63.4°, N=256 on his strip (twice the cells across the fan of N=256 here): δB∥=3.7⋅10−3, mean error 0.0238.

FNL ran both normals (work directories of both backends); the tables record the CPU values.

Related cases: Ryu–Jones 2a is the axis-aligned MHD Riemann problem; field loop measures the divergence error of a smooth field; GLM cleaning the cleaning itself.

Findings ​

  • δB∥ is below Tóth's base-scheme value at 63.4° (2.79⋅10−3 against 3.7⋅10−3) with half his cells across the fan.
  • The 45° normal is not degenerate for this scheme, unlike Tóth's CT and CD schemes: B∥ is conserved to truncation, not to round-off.
  • The convergence of δB∥ is about first order at 63.4° and slower at 45° (rates about 1.1 and 0.6 from 128 to 256, computed from the baselines behind the bounds).
  • A periodic line forces the velocity jump to be undone. A second jump would be the mirror problem, an expansion close to vacuum (density ∼2⋅10−4, Alfvén speed ∼100) where max(|u|+cf) grows with the resolution of the fan and no ch holds; the resolved ramp (density ∼1/3 at the final time) avoids it, and the 1-D reference solves the same problem, ramp and wave interactions included.