Skip to content
bcaddy edited this page Apr 22, 2024 · 14 revisions

Magnetohydrodynamics (MHD) in Cholla

The MHD implementation utilizes the VL+CT integrator described in Stone & Gardiner 2009 with the HLLD Riemann solver from Miyoshi & Kusano 2005; details of the Cholla implementation and performance can be found in Caddy & Schneider 2024. Interface reconstruction is supported in first, second, and third order with the following methods: Piecewise Constant Method (PCM), Piecewise Linear Method with limiting in the Characteristic Variables (PLMC)(Stone et al. 2005), and Piecewise Parabolic Method in the Characteristic Variables (PPMC)(Felker & Stone 2018).

The VL+CT integrator utilizes a staggered grid with the magnetic fields centered at cell faces rather than cell centers. All magnetic fields are stored at the i+1/2 interface.

Turning on MHD & Supported Options

To turn on MHD, build with the MHD flag. In addition, MHD only supports the Van Leer (VL) integrator and the HLLD Riemann solver. MHD supports all reconstruction methods (PCM, PLMP, PLMC, and PPMC) except PPMP (PPM with limiting in the primitive variables). If Cholla MHD is built with an unsupported configuration, then it should raise a compile time error; if it does not, please open an issue about it.

Output

MHD only supports output with HDF5 files, so if output is enabled, the HDF5 flag must also be passed. Full grid and slice outputs are fully supported. In the case of slices, the magnetic fields are converted to cell-centered values. Projections and rotated projections also supported for outputting density, temperature, and in the case of rotated projections, velocity as well.

Initializing

The initial magnetic fields can be set in the same manner as the hydro fields, see the Grid3D::Orszag_Tang_Vortex function in initial_conditions.cpp for an example. Note that the initial conditions must be divergence-free for the VL+CT integrator to work. The easiest way to ensure this condition for non-trivial fields is to initialize from the vector potential rather than the magnetic field directly; the mhd::utils::Init_Magnetic_Field_With_Vector_Potential function in mhd_utilities.cu has been provided to convert a vector potential into the magnetic field.

Reconstruction Choice

Piecewise Linear Method (PLM) is the default. We have found that PPMC, while giving more accurate results in problems with smooth flows, is often very oscillatory near shocks. PLMC and PLMP give similar results, PLMP is slightly more oscillatory near shocks, though this is not present in all problems and is slightly faster than PLMC (~4-5%). Either PLM method works well, though one may work better than the other for specific problems.

Caveats and Known Issues

MHD support has not yet been extended to all other physics modules. Support in other modules is a work in progress but as yet is not complete.

Clone this wiki locally