Skip to content

EGLM reflux leaves B alone ​

IDGroupMilestoneBackendsFigureRegression
G3bSeam studiesM6 (#68), #78CPU, FNLyesblast-amr-limiter

Case and scope ​

G3a showed that #78, EGLM's ⟨|Bz|⟩ 70 times its uniform level on a static 2:1 grid, is caused by the reflux. G3b looked for the fix, and checked that it does not break the regressions, the MV-5 orders and the multirealm suite.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD with EGLM (Derigs sources), γ=5/3; GLM for comparisonEGLM; add_eglm_sources, adam_flume_cpu_mhd_eglm_kernels.F90
Reflux under EGLM (the fix)the flux mismatch of B is zeroed: the EGLM reflux corrects ρ, ρu, E and ψ only; GLM unchanged (refluxes B); no input key (owner decision)apply_reflux_to_stage_forest, reflux_stage, adam_flume_cpu_object.F90 and adam_flume_fnl_object.F90
First attempt (not kept)the Derigs source's ∇⋅B from the ψ face fluxes, ∑d(Fψ(i+12)−Fψ(i−12))/(chΔxd), the divergence of the interface field, with the matching source correction at the reflux—
Space, timeWENO5 flux splitting on characteristic variables; SSP Runge–Kutta 5 stages, CFL 0.4 (field loop)as in AD
Seam operatorsdefault (mean + tricubic), reflux onnumerics

Initial and boundary conditions ​

RunSetup
Field loopthe A2 field loop of AD: refined N=64 (box [0,1]×[−0.5,0.5]) against uniform N=128, t=1, 2 ranks, default seam operators, reflux on; CPU and FNL
MV-5the linear-wave orders of order of accuracy under EGLM
Regressionsthe FLUME regression suite on CPU and FNL; the one case with EGLM across 2:1 seams is blast-amr-limiter
Multirealmthe multi-realm suite

Input files ​

FileRole
src/tests/flume/verification/amr-divb/check.sh --legs loopthe field loop, GLM and EGLM, refined against uniform
src/tests/flume/regression/blast-amr-limiter/input.inithe regression case with EGLM across 2:1 seams (golden digest, rtol 10−6)
src/tests/flume/regression/run.shthe regression suite
src/tests/flume/verification/make_doc_runs.sh <runs> divb (FNL), make_doc_figures.py --only field-loop-seamsre-runs the six field loops with a checkpoint every 20 steps
bash
cd src/tests/flume/verification/amr-divb && ./check.sh --legs loop
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --legs loop

Results ​

G3a and G3b: the field loop across the 2:1 box

FNL, today's code (after G3b): the A2 field loop under GLM and EGLM, refined N=64 with and without reflux, and uniform N=128, a checkpoint every 20 steps. Left: the magnetic energy; right: ⟨|Bz|⟩/A0. The re-runs end at exactly the values of the tables (EGLM 9.11⋅10−6 with the reflux, 9.31⋅10−6 without, 2.72⋅10−6 uniform; GLM 1.10⋅10−3, 1.18⋅10−3, 6.86⋅10−4). The pre-G3b reflux of B (70 times the uniform level) is a code state that no longer exists, so it is not drawn.

The first attempt, the source divergence from the face fluxes, keeps the MV-5 orders (4.96 to 4.97 on every wave) but raises EGLM's uniform ⟨|Bz|⟩ from 2.72⋅10−6 to 1.28⋅10−4 (47 times; refined N=64: 2.64⋅10−4). The code was not kept.

The fix. The field loop (refined N=64, default seam operators, reflux on) with the reflux of B removed, the rest refluxed:

EGLM, reflux⟨|Bz|⟩/A0× uniform
all components (before)1.91⋅10−470
all but B (G3b)9.11⋅10−63.3
all but B and ψ9.31⋅10−63.4
none9.31⋅10−63.4

The field loop on FNL confirms the table: EGLM 9.11⋅10−6, GLM 1.10⋅10−3 (unchanged). MV-5 under EGLM keeps its orders (4.96 to 4.97 on every wave), and the multirealm suite passes.

Gate. The FLUME regressions pass unchanged on CPU and FNL (35 of 35 each at the time). blast-amr-limiter moves but stays inside its digest tolerance (rtol 10−6), so its golden is kept:

  • step 0 is identical, and Bz (zero in 2D) does not move;
  • at step 100 seven of 26 digest rows differ (r, ru, rv, rE, bx, by, psi), the largest by 2.4⋅10−7 relative on CPU and 9.8⋅10−8 on FNL;
  • the integrals drift exactly as in the golden: ρ to round-off (3⋅10−16), the rest at the golden's levels (ρu 2.5⋅10−4, E 1.9⋅10−2, B 4.5⋅10−4, ψ 1.3⋅10−4, all set by the blast's boundaries and EGLM's non-conservative sources, not by the reflux).

Related cases: G3a located the cause; AD is the A2 case; the uniform-grid EGLM is EGLM cleaning.

Findings ​

  • EGLM's cancellation needs the centred derivative. EGLM's cancellation of the Bz the flux splitting generates needs the centred derivative of the cell values, not the face divergence: the source divergence from the face fluxes makes the uniform Bz 47 times worse.
  • Refluxing B is the whole of #78. Under EGLM the induction equation carries the Derigs source −u∇⋅B, so ∫B is not a conserved integral: refluxing B buys a conservation the model does not have and breaks the source/flux cancellation it is built on.
  • Since G3b (owner decision, no key) the EGLM reflux corrects ρ, ρu, E and ψ and leaves B alone, on CPU and FNL; GLM is unchanged (it refluxes B, and its ⟨|Bz|⟩ does not depend on it, G3a). #78 drops from 70 to 3.3 times the uniform level.