Skip to content

Ohmic heating and the divergence constraint ​

IDGroupMilestoneBackendsFigureRegression
VV-6Dissipative terms (M4)M4 (#65)CPU, FNLno—

Case and scope ​

The diagonal Ohmic wave of VV-5 with GLM and with EGLM, judged by its energy budget and by its divergence instead of its error.

What the case catches:

  • a wrong Ohmic energy flux: GdE=∑iBiGdBi must return to the gas, as heat, exactly the energy the field loses. A wrong (or wrong-signed) energy flux leaves the field equations right and shows only in this budget; the total energy, conserved by the flux form whatever the fluxes, would not see it either;
  • a resistive flux that feeds ∇⋅B: the curl form must not raise the constraint GLM and EGLM are there to keep.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD (mhd-ideal), γ=1.4, η=0.01, μ=0models
Divergence controlGLM (mhd-glm) and EGLM (mhd-eglm), ch=3, α=0GLM, EGLM; adam_flume_cpu_mhd_glm_kernels.F90, adam_flume_cpu_mhd_eglm_kernels.F90
Ohmic fluxcurl form with its energy flux, dissipative_order = 4add_resistive_fluxes_o4, adam_flume_cpu_dissipation_kernels.F90; compute_resistive_flux, adam_flume_dissipation_library.F90; numerics
Inviscid fluxesWENO5 flux splitting, characteristic variablescompute_residuals_weno, adam_flume_cpu_object.F90
Timerunge-kutta-ssp-54, CFL 0.2adam_rk_object.F90
FNL backendthe same fluxes as device kernelsadd_resistive_fluxes_o4_dev, adam_flume_fnl_dissipation_kernels.F90

Initial and boundary conditions ​

ItemValue
Domain[0,1]2, z null
Gridquadtree, 4×4 blocks of 122 cells (482), uniform
Ranks2
Initial conditionsine-wave, magnetic mode at 45°, A=10−4 (the budget compares energies of O(A2) with differences of the internal energy, so it needs the signal), ρ0=p0=1, wavelength 1/2
Boundariesperiodic on the x and y faces, extrapolation on the z faces
Final timet=0.2
Runsmhd-glm and mhd-eglm, each with its ideal twin (η=0)

Input files ​

FileRole
src/tests/flume/verification/viscous/waves.pymake writes the inputs; budget judges the energy budget and ∇⋅B against the ideal twin
src/tests/flume/verification/viscous/check.sh --legs vv6runs the four runs (--np N; FLUME_EXE selects the backend)
bash
cd src/tests/flume/verification/viscous && ./check.sh --legs vv6             # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --legs vv6       # FNL

No figure (#85 lists none for VV-6).

Results ​

Oracle (waves.py budget):

  • heat gained over field and kinetic energy lost within 10−3 of 1;
  • the drift of the total energy at most 10−13 of the total;
  • max|∇⋅B| (central differences) at most 1.05 times the ideal twin's plus 10−14.
CheckBoundCPUFNL
field energy lost (of 2.5⋅10−9)—6.770374⋅10−10the same
internal energy gained—6.770375⋅10−106.770384⋅10−10
heat / (field + kinetic loss)1±10−31.00000021.0000015
total energy drift, relative10−131.8⋅10−161.8⋅10−16
max|∇⋅B|, resistive / ideal (GLM; EGLM alike)1.05× ideal +10−142.1⋅10−18 / 2.6⋅10−181.6⋅10−18 / 2.3⋅10−18 (GLM)

Both models give the same budget.

Related cases: the wave itself is the diagonal Ohmic leg of VV-5; the divergence at 2:1 seams is exercised by VV-7 and VV-8.

Findings ​

  • The departures of the heat ratio from 1 are round-off: the internal energy is the total minus the kinetic and magnetic parts, and a difference of 6.8⋅10−10 out of a total of 2.5 keeps six digits.
  • What the divergence leg does not show. On a uniform periodic grid the diagonal field is discretely solenoidal from the start, and the curl-form flux keeps it so; both runs sit at round-off, so the leg checks only that the resistive flux adds no divergence there. The test with teeth is the 2:1 AMR seam, where the discrete operators no longer commute (PRISM's #29 floor): it belongs to M4 P4 (VV-7, VV-8).