The div B=0 Constraint in Shock-Capturing Magnetohydrodynamics Codes

G. Tóth

Department of Atomic Physics, Eötvös Univ., Hungary

accepted by the Journal of Computational Physics

Seven schemes to maintain the div B=0 constraint numerically are compared. All these algorithms can be combined with shock-capturing Godunov type base schemes. They fall into three categories: the eight-wave formulation maintains the constraint to truncation error, the projection scheme enforces the constraint in some discretization by projecting the magnetic field, while the five different versions of the constrained transport/central difference type schemes conserve div B to machine accuracy in some discretization for every grid cell. It is shown that the three constrained transport algorithms, which have been introduced recently, can be recast into pure finite volume schemes, and the staggered representation of the magnetic field is unnecessary. Another two new and simple central difference based algorithms are introduced. The properties of the projection scheme are discussed in some detail, and I prove that it has the same order of accuracy as the base scheme even for discontinuous solutions. I describe a flexible and efficient implementation of the projection scheme using conjugate gradient type iterative methods. Generalizations to resistive MHD, to axial symmetry, and to non-Cartesian grids are given for all schemes.

The theoretical discussion is followed by numerical tests, where the robustness, accuracy, and efficiency of the seven schemes and the base scheme can be directly compared. All simulations are done with the Versatile Advection Code, in which several shock-capturing base schemes are implemented. Although the eight-wave formulation usually works correctly, one of the numerical tests demonstrates that its non-conservative nature can occasionally produce incorrect jumps across strong discontinuities. Based on a large number of tests, the projection scheme, one of the new central difference based schemes, and one of the constrained transport schemes are found to be the most accurate and reliable among the examined methods.