Appearance
Ohmic heating and the divergence constraint
| ID | Group | Milestone | Backends | Figure | Regression |
|---|---|---|---|---|---|
| VV-6 | Dissipative terms (M4) | M4 (#65) | CPU, FNL | no | — |
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:
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
: the curl form must not raise the constraint GLM and EGLM are there to keep.
Models and numerics
| Item | Choice | Code |
|---|---|---|
| Equations | ideal MHD (mhd-ideal), | models |
| Divergence control | GLM (mhd-glm) and EGLM (mhd-eglm), | GLM, EGLM; adam_flume_cpu_mhd_glm_kernels.F90, adam_flume_cpu_mhd_eglm_kernels.F90 |
| Ohmic flux | curl form with its energy flux, dissipative_order = 4 | add_resistive_fluxes_o4, adam_flume_cpu_dissipation_kernels.F90; compute_resistive_flux, adam_flume_dissipation_library.F90; numerics |
| Inviscid fluxes | WENO5 flux splitting, characteristic variables | compute_residuals_weno, adam_flume_cpu_object.F90 |
| Time | runge-kutta-ssp-54, CFL 0.2 | adam_rk_object.F90 |
| FNL backend | the same fluxes as device kernels | add_resistive_fluxes_o4_dev, adam_flume_fnl_dissipation_kernels.F90 |
Initial and boundary conditions
| Item | Value |
|---|---|
| Domain | |
| Grid | quadtree, |
| Ranks | 2 |
| Initial condition | sine-wave, magnetic mode at 45°, |
| Boundaries | periodic on the extrapolation on the |
| Final time | |
| Runs | mhd-glm and mhd-eglm, each with its ideal twin ( |
Input files
| File | Role |
|---|---|
src/tests/flume/verification/viscous/waves.py | make writes the inputs; budget judges the energy budget and |
src/tests/flume/verification/viscous/check.sh --legs vv6 | runs 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 # FNLNo figure (#85 lists none for VV-6).
Results
Oracle (waves.py budget):
- heat gained over field and kinetic energy lost within
of 1; - the drift of the total energy at most
of the total; (central differences) at most 1.05 times the ideal twin's plus .
| Check | Bound | CPU | FNL |
|---|---|---|---|
| field energy lost (of | — | the same | |
| internal energy gained | — | ||
| heat / (field + kinetic loss) | 1.0000002 | 1.0000015 | |
| total energy drift, relative | |||
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
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).