Skip to content

EGLM cleaning ​

IDGroupMilestoneBackendsFigureRegression
EV-2, EV-3, EV-4Ideal MHDM3 (#47, M3-P4)CPU, FNLyesorszag-tang-eglm

Case and scope ​

The energy-consistent cleaning (divergence_control = eglm, Derigs et al. 2018) puts ψ2/2 in the total energy and adds nonconservative sources,

−(∇⋅B)(0,B,u⋅B,u,0)−(u⋅∇ψ)(0,0,ψ,0,1)

in the order (ρ,ρu,E,B,ψ). On a periodic box only the density integral is then conserved; the momentum, B and energy integrals move by the time integral of their sources. The legs run through the --divergence-control eglm option of the glm-pulse, Orszag–Tang and linear-wave scripts, and rj2a/check.sh compares EGLM with GLM:

  • EV-2: the GLM pulse against the telegraph solution, which EGLM shares with ψ in field units (the oracle compares chψ). It catches a wrong EGLM cleaning block or damping;
  • EV-3: Ryu–Jones 2a, EGLM against GLM. With ψ=0 the EGLM energy coupling and sources vanish, so the runs must agree bitwise on the 8 shared variables: it catches a source or an energy term that does not vanish;
  • EV-4: Orszag–Tang, the drifts bounded by their sources, and the 180° symmetry. It catches a source with a wrong magnitude or sign;
  • MV-5 under EGLM: the linear-wave orders;
  • the Balsara–Spicer blast without limiter and floors, the case EGLM was expected to help.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD with EGLM, ψ in field units, ψ2/2 in Emodels; mhd_eglm_conservative_to_auxiliary, mhd_eglm_eigenvectors, mhd_eglm_flux, adam_flume_mhd_library.F90
Space, splittingWENO5 flux splitting on characteristic variablesmhd_eglm_face_split_fluxes, adam_flume_mhd_library.F90
Space, weno-riemannHLLD, characteristic interpolation (and primitive on the blast)mhd_eglm_riemann_hlld, adam_flume_mhd_riemann_library.F90
Sources and dampingthe nonconservative sources above; the damped cleaning energy becomes heatadd_eglm_sources, add_glm_damping, adam_flume_cpu_mhd_eglm_kernels.F90
Time, boundariesas in each verification (SSP-33 for the pulse and Ryu–Jones 2a, SSP-54 for Orszag–Tang, the waves and the blast)adam_rk_object.F90
FNL backendthe same kernels on the deviceadam_flume_fnl_mhd_eglm_kernels.F90, adam_flume_fnl_object.F90

Initial and boundary conditions ​

LegSetup
EV-2the MV-3 legs of GLM cleaning (d'Alembert and damped at N=64,128,256, min-cell, walls) at pulse amplitude 10−3 instead of 0.1
EV-3Ryu–Jones 2a, N=256, x, glm_ch = 2.0, glm_alpha = 0.18
EV-4Orszag–Tang, 1282, t=0.5, a checkpoint every 25 steps (the oracle integrates the ψ source from them)
MV-5 under EGLMthe MV-5 ladders of order of accuracy, ch=1.1(|un|+cf), no damping
BlastBalsara–Spicer, β=2.5⋅10−4, 1282 (the positivity limiter PV-1 setup), no limiter, no floors

Input files ​

FileRole
src/tests/flume/verification/mhd/glm-pulse/check.sh --divergence-control eglmEV-2
src/tests/flume/verification/mhd/rj2a/check.shEV-3 (the EGLM leg ev3, which needs mv4, is part of the default run)
src/tests/flume/verification/mhd/orszag-tang/check.sh --divergence-control eglmEV-4 and the symmetry
src/tests/flume/verification/mhd/eglm_conservation_oracle.pythe EV-4 drift bounds
src/tests/flume/verification/mhd/linear-wave/check.sh --divergence-control eglmMV-5 under EGLM
src/tests/flume/verification/mhd/positivity-probe/make_blast.py --eglmthe blast input
src/tests/flume/verification/make_doc_figures.py fig_eglm_energydraws eglm-energy.png from the conservation histories of the orszag-tang work directories (--only eglm-energy)
bash
cd src/tests/flume/verification/mhd
glm-pulse/check.sh --divergence-control eglm                                  # EV-2
orszag-tang/check.sh --divergence-control eglm [--numerics hlld]              # EV-4, symmetry
linear-wave/check.sh --divergence-control eglm [--numerics hlld]              # MV-5 under EGLM
rj2a/check.sh [--numerics hlld]                                               # EV-3 (EGLM leg)

Results ​

Orszag-Tang, drift of the total energy under GLM and EGLM

The total energy of the periodic Orszag–Tang box, 1282: GLM keeps it to round-off; EGLM changes it through its nonconservative sources, by 3.0⋅10−4 (splitting) and 4.4⋅10−4 (HLLD) at t=0.5, within the EV-4 bound.

Measured in issue #47, M3-P4; CPU and FNL agree to the printed digits unless a cell says otherwise:

CheckBoundSplittingHLLD characteristic
EV-2, pulse against the telegraph solution (amplitude 10−3): L1 at 256 cells, d'Alembert / damped6.484⋅10−9 / 1.406⋅10−9 (CPU + 2%)6.36⋅10−9 / 1.38⋅10−9—
EV-2, ∫Bx drift10−143.7⋅10−16 (N=128)—
EV-3, Ryu–Jones 2a, EGLM against GLMbitwise (splitting); 10−11 (--numerics)bitwise, ψ=06.3⋅10−13 (FNL: bitwise)
EV-4, Orszag–Tang: ∫ρ drift; ∫E drift / its source boundround-off; ≤13⋅10−17; 2.8⋅10−30; 7.0⋅10−3
Orszag–Tang symmetry at step 100 / at t=0.510−8 / 10−45.4⋅10−13 / 4.3⋅10−71.2⋅10−12 / 1.1⋅10−11
linear waves, observed order≥4.74.96–4.984.96–4.97
Balsara–Spicer blast (β=2.5⋅10−4, 1282, no limiter, no floors)—non-positive pressure at step 3reaches t=0.01 (396 steps)

The EV-2 legs at 64 and 128 cells, min-cell and walls have their own bounds (CPU M3-P4c + 2%: 6.686⋅10−7, 5.789⋅10−8; damped 1.487⋅10−7, 1.266⋅10−8; min-cell1.201⋅10−9; walls 9.021⋅10−8). The linear-wave bounds under EGLM are per run, for the splitting scheme and for hlld:characteristic.

Related cases: GLM cleaning is the GLM version of EV-2; Orszag–Tang the GLM version of EV-4; positivity limiter makes the splitting scheme run the blast; G3b handles the EGLM reflux at 2:1 seams.

Findings ​

  • EV-2 runs at amplitude 10−3 because EGLM couples the (Bx,ψ) pair to the fluid: the damped cleaning energy becomes heat, the heat drives a flow, and the source −(∇⋅B)u moves Bx. At the GLM amplitude 0.1 this floors the damped legs at a relative L1 of 8⋅10−5 (against 7⋅10−6 for GLM); at 10−3 EGLM equals GLM to 3 digits (relative 6.6⋅10−6 both, on the damped leg at 256), so the telegraph oracle is exact for EGLM there. The ∫Bx drift scales as the amplitude cubed.
  • EV-4 asserts ∫ρ to round-off and bounds every other drift, at every step, by twice the time integral of its source magnitude: max|B|∫∥∇⋅B∥1 (momentum), max|u|∫∥∇⋅B∥1 (B), max|u⋅B|∫∥∇⋅B∥1+∫∥ψu⋅∇ψ∥1 (energy). It is a necessary bound, not a tight one: the signed sources largely cancel (energy drift 2.8⋅10−3 of its bound; ρu and B ∼10−11, where the 180° symmetry cancels their sources).
  • The symmetry defect is round-off amplified by the flow, more by the EGLM sources on the splitting scheme (4.3⋅10−7 against 5.9⋅10−10 for GLM at t=0.5), so it is checked at step 100 within 10−8 and at the end within 10−4, as for the rotor.
  • On the blast HLLD with primitive interpolation also reaches t=0.01; the splitting scheme needs the positivity limiter (M3-P5).
  • --amr is not combined with EGLM in orszag-tang/check.sh: the EGLM sources at 2:1 seams are out of scope there.