In this paper we investigate the use of the vector potential as a means of maintaining the divergence constraint in the numerical solution of the equations of Magnetohydrodynamics (MHD) using the Smoothed Particle Hydrodynamics (SPH) method. We derive a self-consistent formulation of the equations of motion using a variational principle that is constrained by the numerical formulation of both the induction equation and the curl operator used to obtain the magnetic field, which guarantees exact and simultaneous conservation of momentum, energy and entropy in the numerical scheme. This leads to a novel formulation of the MHD force term, unique to the vector potential, which differs from previous formulations. We also demonstrate how dissipative terms can be correctly formulated for the vector potential such that the contribution to the entropy is positive definite and the total energy is conserved.
On a standard suite of numerical tests in one, two and three dimensions we find firstly that the consistent formulation of the vector potential equations is unstable to the well-known SPH tensile instability, even more so than in the standard Smoothed Particle Magnetohydrodynamics (SPMHD) formulation where the magnetic field is evolved directly. Furthermore we find that, whilst a hybrid approach based on the vector potential evolution equation coupled with a standard force term gives good results for one and two dimensional problems (where dAz/dt = 0), such an approach suffers from numerical instability in three dimensions related to the unconstrained evolution of vector potential components. We conclude that use of the vector potential is not a viable approach for Smoothed Particle Magnetohydrodynamics.
Supersonic turbulence is believed to be at the heart of star formation. We have performed smoothed particle magnetohydrodynamics (SPMHD) simulations of the small-scale dynamo amplification of magnetic fields in supersonic turbulence. The calculations use isothermal gas driven at rms velocity of Mach 10 so that conditions are representative of star-forming molecular clouds in the Milky Way. The growth of magnetic energy is followed for 10 orders in magnitude until it reaches saturation, a few percent of the kinetic energy. The results of our dynamo calculations are compared with results from gr…
We present an updated constrained hyperbolic/parabolic divergence cleaning algorithm for smoothed particle magnetohydrodynamics (SPMHD) that remains conservative with wave cleaning speeds which vary in space and time. This is accomplished by evolving the quantity $ψ/ c_h$ instead of $ψ$. Doing so allows each particle to carry an individual wave cleaning speed, $c_h$, that can evolve in time without needing an explicit prescription for how it should evolve, preventing circumstances which we demonstrate could lead to runaway energy growth related to variable wave cleaning speeds. This modificati…
Obtaining a stable magnetohydrodynamical (MHD) formalism in SPH - i.e. smoothed particle magnetohydrodynamics (SPMHD) - has proven remarkably difficult. To implement MHD requires two steps: a modification to the momentum equation and an induction equation, and both present challenges. We first provide an overview of how SPMHD is implemented, and then discuss how this implementation fails and the limitation of various corrective methods - with particular reference to the effects of particle disorder. Although there are many problems for which, with careful choice of corrective measures, good re…
Smoothed particle magnetohydrodynamics has reached a level of maturity that enables the study of a wide range of astrophysical problems. In this review, the numerical details of the modern SPMHD method are described. The three fundamental components of SPMHD are methods to evolve the magnetic field in time, calculate accelerations from the magnetic field, and maintain the divergence-free constraint on the magnetic field (no monopoles). The connection between these three requirements in SPMHD will be highlighted throughout. The focus of this review is on the methods that work well in practice, …
We present Phantom, a fast, parallel, modular and low-memory smoothed particle hydrodynamics and magnetohydrodynamics code developed over the last decade for astrophysical applications in three dimensions. The code has been developed with a focus on stellar, galactic, planetary and high energy astrophysics and has already been used widely for studies of accretion discs and turbulence, from the birth of planets to how black holes accrete. Here we describe and test the core algorithms as well as modules for magnetohydrodynamics, self-gravity, sink particles, H_2 chemistry, dust-gas mixtures, phy…
In numerical simulations, artificial terms are applied to the evolution equations for stability. To prove their validity, these terms are thoroughly tested in test problems where the results are well known. However, they are seldom tested in production-quality simulations at high resolution where they interact with a plethora of physical and numerical algorithms. We test three artificial resistivities in both the Orszag-Tang vortex and in a star formation simulation. From the Orszag-Tang vortex, the Price et. al. (2017) artificial resistivity is the least dissipative thus captures the density …
We present a novel method of magnetohydrodynamics (MHD) within the smoothed particle hydrodynamics scheme using the Geometric Density average force expression (GDSPH). GDSPH has recently been shown to reduce the leading order errors and greatly improve the accuracy near density discontinuities, eliminating surface tension effects. Here, we extend the study to investigate how SPMHD benefits from this method. We implement ideal MHD in the Gasoline2 and Changa codes with both GDSPH and traditional SPH (TSPH) schemes. An constrained hyperbolic divergence cleaning scheme is employed to control the …
Smoothed particle magnetohydrodynamics for simulations of galaxy and cosmic structure formation
Lorentz Institute for Theoretical Physics, Leiden University(莱顿大学洛伦兹理论物理研究所);Leiden Observatory, Leiden University(莱顿大学莱顿天文台);Instituto de Astronomía teórica y experimental-Conicet(理论与实验天体物理学研究所-阿根廷国家科学研究委员会);Observatorio Astronómico de Córdoba, Universidad Nacional de Córdoba(科尔多瓦天文台,科尔多瓦国立大学)
We present a meshless method for magnetohydrodynamics by evolving the vector potential of magnetic fields. A novel scheme and numerical techniques are developed to restrict the divergence of magnetic field, based on the Meshless Finite Mass/Volume with HLLD Riemann solver for conservative flux calculation. We found the magnetic field could be stabilized by a proper smoothing process and so the long-term evolution becomes available. To verify the new scheme, we perform the Brio-Wu shock tube, 2D and 3D Orszag-Tang vortex and Magnetorotational Instability test problems. Our results suggest that …
Orbital advection is a significant bottleneck in disk simulations, and a particularly tricky one when used in connection with magnetohydrodynamics. We have developed an orbital advection algorithm suitable for the induction equation with magnetic potential. The electromotive force is split into advection and shear term, and we find that we do not need an advective gauge as solving the orbital advection implicitly precludes the shear term from canceling the advection term. We prove and demonstrate the third order in time accuracy of the scheme. The algorithm is also suited for non-magnetic prob…
We describe a strategy for code modernisation of Gadget, a widely used community code for computational astrophysics. The focus of this work is on node-level performance optimisation, targeting current multi/many-core IntelR architectures. We identify and isolate a sample code kernel, which is representative of a typical Smoothed Particle Hydrodynamics (SPH) algorithm. The code modifications include threading parallelism optimisation, change of the data layout into Structure of Arrays (SoA), auto-vectorisation and algorithmic improvements in the particle sorting. We obtain shorter execution ti…