Appearance
Divergence across seams
| ID | Group | Milestone | Type | Backends | Figure | Regression |
|---|---|---|---|---|---|---|
| AD (A2) | Seam accuracy and divergence | M6 (#68) · A2; #78 (follow-up) | P | FNL (tables); CPU for the loop leg and the D_flux cross-check | yes | — |
Case and scope
Every div(B) column of the MHD checks is the centred divergence of the cell values, which is not the divergence GLM and EGLM act on (#68 F4). [diagnostics] divb_flux adds D_flux, the divergence of the interface normal field read from the scheme's own
cpaw: a source-free, exact nonlinear solution withthat crosses two seams all the time: is the seam D_flux bounded or does it grow, and does it converge? loop: the field loop of MV-9 under GLM and EGLM, the case of #78 (EGLM's70 times its uniform level on a static 2:1 grid): is #78 a divergence difference?
What the case catches:
- a secular growth of the seam divergence under GLM (PRISM's centred GLM lets it run away, #29);
- a seam divergence that does not converge under refinement;
- a broken D_flux instrument: its signed integral over a periodic composite domain must be round-off.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | ideal MHD, cpaw, loop) or EGLM (loop); glm_alpha 0.18, glm_damping_length 1.0; glm_ch 2.0 (cpaw, above the fast speed, about 1.08) or 4.0 (loop) | GLM, EGLM; add_eglm_sources, adam_flume_cpu_mhd_eglm_kernels.F90 |
| Space | WENO5 (weno-u-5) flux splitting on characteristic variables | compute_residuals_weno, adam_flume_cpu_object.F90; mhd_glm_face_split_fluxes, mhd_eglm_face_split_fluxes, adam_flume_mhd_library.F90 |
| Time | SSP Runge–Kutta, 5 stages (runge-kutta-ssp-54), CFL 0.4 | adam_stepper_object.F90 (SELAH) |
| Seam operators | mean restriction, tricubic fill, reflux on (always) | numerics |
| D_flux | ngc of a seam; key [diagnostics] divb_flux | compute_dflux_norms, compute_divb_history, adam_flume_cpu_object.F90 and adam_flume_fnl_object.F90; adam_flume_diagnostics_object.F90 |
| Boundaries | periodic in extrapolation on the null | boundary conditions |
Initial and boundary conditions
| Item | cpaw | loop |
|---|---|---|
| Domain | ||
| Initial condition | MV-6 CPAW, right polarised, inclined at | MV-9 field loop, radius 0.3, |
| Grid | quadtree (ratio = 4), ngc = 3 | the same |
| Refined region | the two middle block columns, | the box |
| Ladder | refined and uniform --long adds 256) | refined |
| Boundaries | periodic in extrapolation in | the same |
| Final time | 10 periods ( | |
| History cadence | every 10 steps | every step |
| Ranks | 2 | 2 |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/amr-divb/make_amr_divb.py | writes the inputs from mhd/cpaw/make_cpaw.py and mhd/field-loop/make_field_loop.py; --uniform, --periods, --cleaning, --time-max, --history |
src/tests/flume/verification/mhd/amr_box.py | refine_box: the refined region, one 2:1 level at initialisation |
src/tests/flume/verification/amr-divb/amr_divb_oracle.py | growth (the cpaw floors, growth and orders) and loop (a report) |
src/tests/flume/verification/amr-divb/check.sh | runs the legs (--legs cpaw,loop, --long, --np N, --keep) |
src/tests/flume/verification/make_doc_runs.sh <runs> divb (FNL), make_doc_figures.py --only divergence-across-seams | re-runs the field loops (GLM, EGLM; refined, without reflux, uniform) with the history every step; the CPAW panel reads the histories of check.sh |
bash
cd src/tests/flume/verification/amr-divb
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh # FNL: about 12 min
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --long # adds N = 256 (30 more minutes)
./check.sh --legs loop # the loop leg on the CPUThe cpaw leg costs about 2 h on the CPU (
Oracle (amr_divb_oracle.py, reading the *-divb_history.dat columns). cpaw: per run the seam D_flux floor (the median over the second half of the run, the step-0 row excluded), its growth (the mean over the last quarter over the mean over the second quarter: about 1 when bounded) and the floor's order over the refined ladder; a uniform run has no seam, its floor is that of the global D_flux. Bounds: growth at most 1.5 on every refined run, floor order at least 1 on the finest pair. loop: the final seam and global D_flux and
Results

FNL, 2 ranks. Left: the seam maximum of D_flux on the source-free CPAW over 10 periods, refined check.sh keeps), against the global maximum of the uniform
The instrument: the signed integral of D_flux over the periodic composite domain is round-off,
cpaw (FNL, 2 ranks):
| N | Seam D_flux floor | Growth | Uniform floor | Seam / uniform |
|---|---|---|---|---|
| 64 | 0.95 | 54 | ||
| 128 | 0.72 | 119 | ||
| 256 | 0.80 | 3146 |
loop (FNL, 2 ranks),
| Field loop, | D_flux (seam, refined) | D_flux (max, uniform) | ⟨|B_z|⟩/A0 refined | uniform |
|---|---|---|---|---|
| GLM | ||||
| EGLM |
Related cases: G2 varies the GLM damping length on the same cpaw leg; EGLM reflux (G3a, G3b) reruns the loop leg and fixes #78; the uniform-grid cleaning is GLM divergence cleaning and EGLM cleaning.
Findings
- GLM keeps the seam divergence bounded. Over 10 periods of a source-free flow the seam D_flux has no secular growth at any resolution: the upwinded
pair of FLUME bounds what PRISM's centred GLM lets run away (#29; #68 F3). - The seam floor converges at first order (orders +3.31 then +1.36: the first pair is pre-asymptotic), the
divergence of the flux inconsistency of a 2:1 face (#68 F1), while the uniform floor converges at 4 to 6: the seams are the divergence error of a refined run, 3146 times the uniform level at . - #78 is not a divergence difference. GLM and EGLM leave the same D_flux, refined and uniform; EGLM's 250-fold smaller
on a uniform grid comes from its source term, whose centred divergence cancels the the flux generates. The rises 70 times on the refined grid, reproduced here to the printed digits of #78. - #78 is caused by the reflux of
, not by the restricted ghosts; G3b fixes it by not refluxing under EGLM (EGLM reflux).