Skip to content
Helena Richie edited this page Jan 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 (PLM), 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, the HLLD Riemann solver, and the PCM, PLMC, and PPMC reconstruction methods. We plan to support primitive variable reconstruction in the near future. 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 supported. In the case of slices, the magnetic fields are converted to cell-centered values. Projections and rotated projections are not yet supported--if this is a feature you need, please open an issue and we can work with you to add it.

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 method 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.

Clone this wiki locally