Skip to content

Divergence Control in Relativistic MHD

Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

Scrollable table. Use Left and Right arrow keys to reveal additional columns.

Scrollable figure. Use Left and Right arrow keys to inspect hidden content.

Ideal magnetohydrodynamics requires the magnetic field to satisfy a no-monopole constraint. Discretization, mesh refinement, and interpolation can create divergence errors that drive unphysical forces and contaminate conserved quantities. Constrained transport, vector-potential evolution, and hyperbolic cleaning control the error by different mechanisms and have different mesh and gauge failure modes. A fair comparison uses identical physical fluxes and tests both the divergence measure and the underlying MHD solution.

Helpful background. Formulations of General Relativity supplies the spacetime split, Ordinary Differential Equations supplies evolution stability, Relativistic Matter and Compact Objects supplies magnetized matter regimes, Computational Relativity supplies evidence standards, and Fluid and Kinetic Theory supplies induction and MHD waves.

Let nμn^\mu be the future-directed unit normal to a spatial slice and define the Eulerian magnetic four-vector by Bμ=nν∗FνμB^\mu=n_\nu{}^*F^{\nu\mu}, so Bμnμ=0B^\mu n_\mu=0 and its evolved spatial components are BiB^i. This page absorbs 4π\sqrt{4\pi} into BiB^i and uses γ=det⁡γij\gamma=\det\gamma_{ij}. The constraint is

∂i(γBi)=0.\partial_i(\sqrt\gamma B^i)=0.

Its numerical norm must match the storage geometry. A cell-centered finite-difference divergence applied to a face-centered constrained-transport field is a useful independent diagnostic, but it need not vanish to roundoff even when the scheme’s staggered divergence does. Report both and normalize by a magnetic-gradient scale without hiding absolute values.

Magnetic divergence is not physical density. Cleaning it too aggressively can launch waves or dissipate magnetic energy; leaving it localized can produce forces parallel to the error. Monitor fluid and magnetic observables together.

Constrained transport places magnetic fluxes on faces and electric fields on edges so the discrete divergence is preserved by telescoping curls. It can maintain its native constraint to roundoff on a fixed grid. AMR requires divergence-preserving prolongation, restriction, and refluxing; generic component interpolation destroys the property.

Evolving a vector potential AiA_i and constructing BiB^i from a discrete curl also makes divergence of curl vanish in a compatible operator. Gauge modes of AiA_i are not physical but affect interpolation. Etienne et al. 2010, §§II–IV and Figures 1–14 develops vector-potential GRMHD on AMR grids and compares tests.

Hyperbolic or parabolic cleaning introduces a scalar field that propagates and damps divergence. Its wave speed and damping scale must be resolved and boundary conditions must let the cleaning pulse leave. Cleaning reduces rather than algebraically eliminates the error, but it is flexible on unstructured or cell-centered meshes.

The cancellation behind constrained transport is elementary on a Cartesian two-dimensional mesh. Store BxB^x on vertical faces, ByB^y on horizontal faces, and EzE_z at their shared corners. With the same oriented difference operators used everywhere, Faraday’s law updates

Bx,n+1=Bx,n−Δt DyEz,By,n+1=By,n+Δt DxEz.B^{x,n+1}=B^{x,n}-\Delta t\,D_yE_z, \qquad B^{y,n+1}=B^{y,n}+\Delta t\,D_xE_z.

Consequently,

DxBx,n+1+DyBy,n+1=DxBx,n+DyBy,n,D_xB^{x,n+1}+D_yB^{y,n+1} =D_xB^{x,n}+D_yB^{y,n},

because DxDyEz=DyDxEzD_xD_yE_z=D_yD_xE_z: every edge contribution cancels twice with opposite signs. Shared edge values, compatible boundary operators, and time-integrator stage values are essential. In curved coordinates the conserved face variable is the magnetic flux associated with γBi\sqrt\gamma B^i; the integral cancellation survives, while naive differences of undensitized components need not. Constrained transport preserves the initial native divergence, including any initial error; it does not magically remove an inconsistent initialization.

For vector-potential evolution, an algebraic gauge can contain zero-speed gauge modes. Regridding interpolates those modes and can convert them into magnetic structures at refinement boundaries. A generalized Lorenz gauge propagates gauge content away and often behaves more robustly. Etienne et al. 2012, §III and §V, Figures 1–2 identifies this AMR gauge pathology and its mitigation.

The comparison axes are native and independent divergence norms, magnetic energy, conservation, interface artifacts, cost, and physical-wave accuracy. Constrained transport is strongest on compatible staggered meshes; cleaning is easier to compose with varied meshes; vector potentials handle AMR well only with appropriate gauge and transfer operators. None is universally best.

Use a passive-induction translation as the common smooth record. In Minkowski spacetime on (x,y)∈[0,1]2(x,y)\in[0,1]^2 with periodic boundaries, prescribe vi=(0.2,0.1,0)v^i=(0.2,0.1,0) and

Az(t,x,y)=12πsin⁡ ⁣[2π(x−0.2t)]sin⁡ ⁣[2π(y−0.1t)],A_z(t,x,y)=\frac{1}{2\pi} \sin\!\bigl[2\pi(x-0.2t)\bigr] \sin\!\bigl[2\pi(y-0.1t)\bigr],

with Bx=∂yAzB^x=\partial_yA_z, By=−∂xAzB^y=-\partial_xA_z, and Bz=0B^z=0. These expressions give the exact reference and satisfy the continuum constraint identically. Use fourth-order spatial operators and RK4; for cleaning use propagation speed one and damping parameters κ=0.5,1,2\kappa=0.5,1,2. Run N2N^2 grids with N=32,64,128,256N=32,64,128,256 to t=5t=5, repeating CFL factors 0.4,0.2,0.10.4,0.2,0.1. Apply the same velocity, reconstruction order, and boundary data to constrained transport, vector-potential curl, and cleaning variants.

Compare fields with

EB=[∑cVc ∣Bc−Bex,c∣2∑cVc ∣Bex,c∣2]1/2,E_B=\left[ \frac{\sum_cV_c\,|B_c-B_{{\rm ex},c}|^2} {\sum_cV_c\,|B_{{\rm ex},c}|^2} \right]^{1/2},

where ∣X∣2=δijXiXj|X|^2=\delta_{ij}X^iX^j, and normalize both native and independently centered divergence norms as D2=∥∂iBi∥2/(2π∥B∥2)D_2=\|\partial_iB^i\|_2/(2\pi\|B\|_2). Accept the N=256N=256, CFL-0.10.1 result only if EB≤10−5E_B\leq10^{-5}, magnetic-energy drift is at most 10−610^{-6}, and the last two refinements approach fourth order within 20%20\%. Require native D2≤10−12D_2\leq10^{-12} for CT or compatible curl and independently evaluated D2≤10−6D_2\leq10^{-6} for every variant. Reducing CFL from 0.20.2 to 0.10.1 may change EBE_B by no more than 5%5\%; varying κ\kappa must reveal, rather than hide, any cleaning-wave reflection.

Observed discrepancy: not available—specification only.

Then run a circularly polarized Alfvén wave, a magnetized shock tube, and a localized injected divergence pulse. Measure phase, shock locations, divergence, magnetic energy, and conserved budgets. For CT, verify native divergence to roundoff. For cleaning, measure propagation and decay rates. For vector potential, repeat with algebraic and Lorenz gauges across refinement boundaries.

Add a magnetized TOV star or torus, moving refinement boxes through the magnetic field. Track central density, baryon mass, magnetic energy, constraints, and any spurious field at interfaces. The validity regime is ideal GRMHD on the declared mesh and boundary conditions; low divergence does not validate resistive or kinetic physics.

Pin magnetic variable placement, discrete curl and divergence, numerical flux, reconstruction, CT electric-field assembly or cleaning parameters or vector gauge, AMR transfer and reflux operators, boundaries, grid hierarchy, integrator, CFL factor, precision, and code revision. A clean interface could be divb-compare --config alfven-amr.toml --output run/, emitting native and independent norms, field data, budgets, interface profiles, refinement sweeps, and environment metadata. It specifies a rerun record without claiming supplied software.

Reject a method when divergence grows with resolution, a magnetic-energy budget has unexplained changes, cleaning waves reflect, or regridding creates persistent structures. Magnetic energy alone is not generally conserved: it exchanges energy with the fluid through electromagnetic work even in a closed domain. The passive uniform-translation benchmark has constant integrated magnetic energy, but a dynamical MHD test must include that exchange. Failure modes include incompatible CT prolongation, an algebraic zero-speed gauge on AMR, over-damped cleaning, inconsistent boundary fields, and comparing only the native divergence operator that the update preserves by construction.

A vector-potential AMR run has roundoff native divergence, yet stationary magnetic loops appear at every refinement boundary and grow after regridding. Switching from algebraic to Lorenz gauge removes them. Was the original magnetic field physically accurate?

Solution

No. The curl construction preserved its discrete divergence while an interpolated zero-speed gauge mode generated spurious magnetic structure. The independent field and energy diagnostics reveal the failure. Use a propagating gauge and compatible transfers, then demonstrate convergence of the physical field and conserved budgets as well as the native constraint.

  • Etienne, Z. B., Liu, Y. T., and Shapiro, S. L. (2010). “Relativistic magnetohydrodynamics in dynamical spacetimes: A new AMR implementation.” Physical Review D 82, 084031. arXiv.
  • Etienne, Z. B., Paschalidis, V., Liu, Y. T., and Shapiro, S. L. (2012). “Relativistic MHD in dynamical spacetimes: Improved EM gauge condition for AMR grids.” Physical Review D 85, 024013. arXiv.