Skip to content

Divergence cleaning

Vedant edited this page Nov 22, 2021 · 1 revision

Faraday's law is given by,

equation

where the last equality is true in ideal MHD. Taking divergence of the equation above we obtain,

equation

where the second equality is true because the divergence of the curl of a quantity is zero. This tells us that if we start of with a divergence-free magnetic field, it must continue to remain zero. In practice however, the HLL solver is diffusive and produces a non-zero divB. iharm employs the flux-interpolated constrained transport (CT) of Toth 2000 to ensure divB reset to zero up to machine precision. Let's continue with this non-relativistic notation to understand the scheme. From the second equation above we see that maintaining divB to 0 is equivalent to replacing the magnetic fluxes as computed by the Riemann solver with equation which ensures zero divergence. iharm does this in two steps,

  1. Compute the emf,

equation

where FXii,j(Bj) denotes the HLL flux of Bj along Xi at zone (i,j).

  1. Reset the magnetic fluxes based on the corner-centered emf,

equation

equation

equation

equation