## Simulating astrophysical magnetic fields with smoothed particle magnetohydrodynamics

thesis

posted on 02.03.2017, 00:38 by Tricco, Terrence StanislausNumerical methods to improve the treatment of magnetic fields in smoothed field magnetohydrodynamics (SPMHD) are developed and tested. A mixed hyperbolic/parabolic scheme is developed which "cleans" divergence error from the magnetic field. The method introduces a scalar field which is coupled to the magnetic field. A conservative form for the hyperbolic equations is obtained by first defining the energy content of the new field, then using it in the discretised Lagrangian to obtain equations which manifestly conserve energy. This is shown to require conjugate first derivative operators in the SPMHD cleaning equations. Average divergence error is shown to be an order of magnitude lower for all test cases considered, and allows for the stable simulation of the gravitational collapse of magnetised molecular cloud cores. The effectiveness of the cleaning may be improved by explicitly increasing the hyperbolic wave speed or by cycling the cleaning equations between timesteps. In the latter, it is possible to achieve DivB=0 in SPMHD. The method is adapted to work with a velocity field, demonstrating that it can reduce density variations in weakly compressible SPH simulations by a factor of 2.
A switch to reduce dissipation of the magnetic field from artificial resistivity is developed. Discontinuities in the magnetic field are located by monitoring jumps in the gradient of the magnetic field at the resolution scale relative to the magnitude of the magnetic field. This yields a simple yet robust method to reduce dissipation away from shocked regions. Compared to the existing switch in the literature, this leads to sharper shock profiles in shocktube tests, lower overall dissipation of magnetic energy, and importantly, is able to capture magnetic shocks in the highly super-Alfvenic regime.
These numerical methods are compared against grid-based MHD methods by comparison of the small-scale dynamo amplification of a magnetic field in driven, isothermal, supersonic turbulence. We use the SPMHD code, Phantom, and the grid-based code, Flash. We find that the growth rate of Flash is largely insensitive to the numerical resolution, whereas Phantom shows a resolution dependence that arises from the scaling of the numerical dissipation terms. The saturation level of the magnetic energy in both codes is about 2-4% of the mean kinetic energy, increasing with higher magnetic Reynolds numbers. Phantom requires lower resolution to saturate at the same energy level as Flash. The time-averaged saturated magnetic spectra have a similar shape between the two methods, though Phantom contains twice as much energy on large scales. Both codes have PDFs of magnetic field strength that are log-normal, which become lopsided as the magnetic field saturates. We find encouraging agreement between grid- and particle methods for ideal MHD, concluding that SPMHD is able to reliably simulate the small-scale dynamo amplification of magnetic fields. We note that quantitative agreement on growth rates can only be achieved by including explicit, physical terms for viscosity and resistivity, because those are the terms that primarily control the growth rate and saturation level of the turbulent dynamo.