Skip to content

#78 is the reflux, not the restricted ghosts ​

IDGroupMilestoneBackendsFigureRegression
G3aSeam studiesM6 (#68), #78FNL onlyyes—

Case and scope ​

A2 traced EGLM's 70-fold ⟨|Bz|⟩ on a static 2:1 grid (#78) to the centred divergence of its Derigs source reading the second-order restricted ghosts. Phases C to E gave the seams sixth-order ghosts (C1, D1) and a reflux policy (E2), so G3a asks first whether #78 survives them, and so which of the two, the ghosts or the reflux, causes it.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD, γ=5/3, GLM or EGLM, glm_ch 4.0, glm_alpha 0.18, glm_damping_length 1.0GLM, EGLM; add_eglm_sources, adam_flume_cpu_mhd_eglm_kernels.F90; add_eglm_sources_dev, adam_flume_fnl_mhd_eglm_kernels.F90
Space, timeWENO5 flux splitting on characteristic variables; SSP Runge–Kutta 5 stages, CFL 0.4as in AD
Seam operatorsdefault (mean + tricubic) or lagrange6 + quinticC1, D1
Refluxon (always), troubled (flags no face of this smooth loop, so it equals the reflux off bit for bit), or offapply_reflux_to_stage_forest, flag_troubled_seam_cells, adam_flume_fnl_object.F90

Initial and boundary conditions ​

ItemValue
Casethe A2 field loop of AD: [−1,1]×[−0.5,0.5], quadtree, the box [0,1]×[−0.5,0.5] refined one 2:1 level
Initial conditionfield loop, radius 0.3, A0=10−3; (ρ,u,v,w,p)=(1,2,1,1,1)
Gridrefined N=64 against uniform N=128
Boundariesperiodic in x, y; extrapolation in z
Final timet=1
Ranks2, FNL

Input files ​

FileRole
src/tests/flume/verification/amr-divb/make_amr_divb.py loopthe field loop inputs (--cleaning glm or eglm, --seam-ghost-fill, --seam-restriction, --reflux-policy, --no-reflux)
src/tests/flume/verification/amr-divb/amr_divb_oracle.py loopthe ⟨|Bz|⟩/A0 report
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

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.

Seam operators, refluxEGLM ⟨|Bz|⟩/A0 (× uniform)GLM (× uniform)
uniform N = 1282.72⋅10−6 (1)6.86⋅10−4 (1)
default, always1.91⋅10−4 (70)1.10⋅10−3 (1.6)
default, off (= troubled)9.31⋅10−6 (3.4)1.18⋅10−3 (1.7)
lagrange6 + quintic, always2.89⋅10−4 (106)1.12⋅10−3 (1.6)
lagrange6 + quintic, off (= troubled)3.14⋅10−5 (11.5)1.56⋅10−3 (2.3, run with troubled)

Related cases: AD is the A2 attribution this corrects; G3b is the fix; the uniform-grid EGLM is EGLM cleaning; the loop itself is field loop.

Findings ​

  • The reflux causes #78. With the default operators and no reflux, EGLM's Bz is 3.4 times its uniform level instead of 70; higher-order ghosts do not help (106 with the reflux, 11.5 without). GLM does not care (1.6 to 2.3 times in every row). The A2 attribution to the restricted ghosts is wrong.
  • Mechanism (inferred, not measured directly): EGLM's Derigs source −∇⋅B(0,B,u⋅B,u,…) cancels, on a uniform grid, the Bz that the flux divergence generates. The reflux corrects a coarse skin cell's state by the flux mismatch Fc−∑Ff after the step, but the source that step used saw the coarse fluxes' divergence: the correction changes the discrete divergence the fluxes imply without the matching source term, so the cancellation fails exactly at the refluxed cells.
  • Workaround before G3b: EGLM with reflux_policy = troubled keeps #78 at 3.4 times on smooth fields (the reflux is applied only where a shock or the limiter flags a face), at the conservation price measured in E2.
  • The fix: G3b: the EGLM reflux leaves B alone (3.3 times).