Skip to content

Ohmic decay and the visco-resistive Alfvén wave ​

IDGroupMilestoneBackendsFigureRegression
VV-5Dissipative terms (M4)M4 (#65)CPU, FNLyesalfven-resistive

Case and scope ​

A transverse field bt=Asin⁡(k⋅x) on a gas at rest decays by Ohmic diffusion at the rate ηk2; with a normal field Bn the same mode is an Alfvén wave damped by viscosity and resistivity together. The oracle (viscous/waves.py) integrates the 2×2 linear system for (vt,bt) exactly; a fourth leg reruns the acoustic wave of VV-2 on the MHD model with B=0.

What the case catches. The Ohmic flux has its own kernels, a curl form whose cross terms an axis-aligned wave never reads, and a sign that the plan in #65 printed wrong (an anti-diffusion; see numerics). Each defect is a number the exact linear mode pins:

  • a sign error grows the field;
  • a missing cross term changes the diagonal rate;
  • a coefficient error changes every rate;
  • a wrong temperature on MHD (a wrong slot, or a wrong T read from the MHD auxiliary state by the viscous and heat fluxes) shows on the acoustic leg on MHD and nowhere else: the constant laws of the Alfvén leg never read T.

Models and numerics ​

ItemChoiceCode
Equationsideal MHD (mhd-ideal), γ=1.4, with resistivity η and, on two legs, viscosity and conductivitymodels
Divergence controlnone (mhd-none) on the Ohmic and acoustic legs; GLM, ch=3, α=0 (mhd-glm) on the Alfvén legGLM; adam_flume_cpu_mhd_glm_kernels.F90
Ohmic fluxcurl form, dissipative_order 4 or 2add_resistive_fluxes_o4, add_resistive_fluxes_o2, adam_flume_cpu_dissipation_kernels.F90; compute_resistive_flux, adam_flume_dissipation_library.F90; numerics
Viscous and heat fluxesas in VV-1, the temperature from the MHD auxiliary stateadd_dissipative_fluxes_o4, adam_flume_cpu_dissipation_kernels.F90
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, N/4 cells per block along the active axes; an axis-aligned magnetic wave keeps the transverse axis active and thin (4 blocks of 6 cells), the acoustic wave on MHD a null transverse axis (1 cell)
Ranks2
Initial conditionsine-wave in its magnetic mode (bt=Asin⁡(k⋅x), A=10−5) or acoustic mode, ρ0=p0=1, u=0; wavelength 1 along an axis, 1/2 along the diagonal
Boundariesperiodic on the x and y faces, extrapolation on the z faces
LegModelDirectiondissipative_orderCoefficientsB backgroundNt
Ohmic xmhd-nonex4 and 2η=0.01032 / 64 / 1280.5
Ohmic diagonalmhd-none45° (the cross terms ∂iBd of the curl form)4η=0.01024 / 48 / 960.1
Alfvén xmhd-glmx4μ=0.01, η=0.005Bn=132 / 64 / 1280.5
acoustic on MHDmhd-nonex4μ=0.01, k=0.02; odd part of the ±A twins032 / 64 / 1280.5

The rates the oracle holds: Ohmic ηk2; Alfvén damping (ν+η)k2/2.

Input files ​

FileRole
src/tests/flume/verification/viscous/waves.pymake --mode magnetic writes each input; oracle integrates the linear (vt,bt) system exactly
src/tests/flume/verification/viscous/check.sh --legs vv5runs the five ladders (--np N; FLUME_EXE selects the backend)
src/tests/flume/regression/alfven-resistive/input.inithe frozen visco-resistive Alfvén wave at 45°, MHD-GLM, Bn=1, μ=0.01, η=0.005, 322, t=0.05
make_doc_figures.py (fig_viscous, fig_viscous_ladders)the figures, from the CPU and FNL work directories of viscous/check.sh
bash
cd src/tests/flume/verification/viscous && ./check.sh --legs vv5             # CPU
FLUME_EXE=$PWD/../../../../../exe/adam_flume_fnl ./check.sh --legs vv5       # FNL

Results ​

VV-1 to VV-5: convergence, and Becker's shock against the exact profile

Middle panel: the five VV-5 ladders, each normalised by its coarsest error, against the order-2 and order-4 slopes.

VV-1, VV-2 and VV-5: absolute errors on CPU and FNL, and the Ohmic decay

Centre: the VV-5 ladders as absolute RMS errors, CPU (filled, solid) and FNL (open, dotted), which coincide. Right: the decay against the exact rate, |Ameasured/Aexact−1|, converging at order 4 (order 2 for the order-2 flux).

Oracle: as VV-1, the observed order of the finest pair ≥3.8 at order 4, ≥1.9 at order 2.

LegNRMS error (CPU)Order (CPU)FNL
Ohmic x, order 432 / 64 / 1283.64⋅10−11 / 2.29⋅10−12 / 1.43⋅10−13+3.99, +4.00the same
Ohmic x, order 232 / 64 / 1283.68⋅10−9 / 9.20⋅10−10 / 2.30⋅10−10+2.00, +2.00the same
Ohmic diagonal, order 424 / 48 / 961.14⋅10−10 / 7.19⋅10−12 / 4.50⋅10−13+3.99, +4.00the same
Alfvén x, order 432 / 64 / 1286.37⋅10−11 / 1.10⋅10−12 / 2.18⋅10−14+5.85, +5.66the same
acoustic on MHD, order 432 / 64 / 1288.20⋅10−11 / 1.69⋅10−12 / 2.19⋅10−14+5.60, +6.272.21⋅10−14 at 128 cells, +6.26

CPU and FNL on 2 ranks, identical to the printed digits except the round-off of the acoustic leg's odd part.

QuantityMeasuredReference
Ohmic decay0.3947841ηk2=0.3947842
Alfvén damping0.29610(ν+η)k2/2=0.29609
acoustic amplitude on MHD, 32 cells (CPU)8.6252132315⋅10−6VV-2 on Euler, CPU: 8.6252132316⋅10−6 (FNL: 8.6252132321⋅10−6)

Related cases: the same oracle on Euler is VV-1 and VV-2; the energy budget and the divergence of the same resistive flux with GLM and EGLM are in VV-6; the diagonal Ohmic wave crosses 2:1 seams in VV-8.

Findings ​

  • The measured Ohmic rate is the derived one: the sign printed in the #65 plan was wrong, the code's is right.
  • Along x the Ohmic decay of by is the same equation as the shear wave's uy in VV-1, and its errors are the VV-1 errors scaled by the amplitude, to three digits: two kernels, one stencil.
  • The Alfvén wave's error is dominated by the inviscid WENO part, as on the acoustic wave, hence the order above four.
  • The acoustic wave on MHD reproduces VV-2 on Euler: the measured amplitude agrees to ten digits at 32 cells; the RMS errors agree to three, the inviscid parts of the two models being different kernels.
  • The diagonal runs without divergence control. With GLM or EGLM the same ladder measured +7.65 then +1.72, and +3.32 from 96 to 192 cells. The cause is the ideal scheme: run with η=0, where the exact field is static, GLM's upwinding (ch=3) damps it at fifth order (8.5⋅10−12 at 48 cells, 2.7⋅10−13 at 96), with the opposite sign to the Ohmic error and as large, so the two cancel near 48 cells and a 24/48/96 ladder is not asymptotic. Without divergence control the η=0 field stays at round-off. A smaller time step (CFL 0.05) changed no printed digit, so neither error is temporal. GLM and EGLM with resistivity are covered by VV-6.
  • The magnetic amplitude is 10−5: the wave's magnetic pressure drives an O(A2) flow that advects it at O(A3), odd in A (no twin cancels it), relative A2=10−10 here.
  • #85 asks for the decay against the exact rate as a figure; the published figure shows the error ladders only.