Artificial resistivity is included in Smoothed Particle Magnetohydrodynamics simulations to capture shocks and discontinuities in the magnetic field. Here we present a new method for adapting the strength of the applied resistivity so that shocks are captured but the dissipation of the magnetic field away from shocks is minimised. Our scheme utilises the gradient of the magnetic field as a shock indicator, setting α_B = h|gradB|/|B|, such that resistivity is switched on only where strong discontinuities are present. The advantage to this approach is that the resistivity parameter does not depend on the absolute field strength. The new switch is benchmarked on a series of shock tube tests demonstrating its ability to capture shocks correctly. It is compared against a previous switch proposed by Price & Monaghan (2005), showing that it leads to lower dissipation of the field, and in particular, that it succeeds at capturing shocks in the regime where the Alfvén speed is much less than the sound speed (i.e., when the magnetic field is very weak). It is also simpler. We also demonstrate that our recent constrained divergence cleaning algorithm has no difficulty with shock tube tests, in contrast to other implementations.
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…
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 this paper, we develop a new method for magnetohydrodynamics (MHD) using smoothed particle hydrodynamics (SPH). To describe MHD shocks accurately, the Godunov method is applied to SPH instead of artificial dissipation terms. In the interaction between particles, we solve a nonlinear Riemann problem with magnetic pressure for compressive waves and apply the method of characteristics for Alfv{é}n waves. An extensive series of MHD test calculations is performed. In all test calculations, we compare the results of our SPH code with those of a finite-volume method with an approximate Riemann sol…
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…
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…
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 …
In this study, we investigate the dispersive properties of smoothed particle magnetohydrodynamics (SPM) in a strongly magnetized medium by using linear analysis. In modern SPM, a correction term proportional to the divergence of the magnetic fields is subtracted from the equation of motion to avoid a numerical instability arising in a strongly magnetized medium. From the linear analysis, it is found that SPM with the correction term suffer from significant dispersive errors, especially for slow waves propagating along magnetic fields. The phase velocity for all wave numbers is significantly la…
The development of smooth particle magnetohydrodynamic (SPMHD) has significantly improved the simulation of complex astrophysical processes. However, the preservation the solenoidality of the magnetic field is still a severe problem for the MHD. A formulation of the induction equation with a vector potential would solve the problem. Unfortunately all previous attempts suffered from instabilities. In the present work, we evolve the vector potential in the Coulomb gauge and smooth the derived magnetic field for usage in the momentum equation. With this implementation we could reproduce classical…
We present a constrained formulation of Dedner et al's hyperbolic/parabolic divergence cleaning scheme for enforcing the \nabla\dot B = 0 constraint in Smoothed Particle Magnetohydrodynamics (SPMHD) simulations. The constraint we impose is that energy removed must either be conserved or dissipated, such that the scheme is guaranteed to decrease the overall magnetic energy. This is shown to require use of conjugate numerical operators for evaluating \nabla\dot B and \nablaψ in the SPMHD cleaning equations. The resulting scheme is shown to be stable at density jumps and free boundaries, in contr…
Numerical methods to improve the treatment of magnetic fields in smoothed field magnetohydrodynamics (SPMHD) are developed and tested. Chapter 2 is a review of SPMHD. In Chapter 3, a mixed hyperbolic/parabolic scheme is developed which cleans divergence error from the magnetic field. Average divergence error is 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 clean…
This paper presents an overview and introduction to Smoothed Particle Hydrodynamics and Magnetohydrodynamics in theory and in practice. Firstly, we give a basic grounding in the fundamentals of SPH, showing how the equations of motion and energy can be self-consistently derived from the density estimate. We then show how to interpret these equations using the basic SPH interpolation formulae and highlight the subtle difference in approach between SPH and other particle methods. In doing so, we also critique several `urban myths' regarding SPH, in particular the idea that one can simply increas…
The equations of smoothed particle magnetohydrodynamics (SPMHD), even with the various corrections to instabilities so far proposed, have been observed to be unstable when a very steep density gradient is necessarily combined with a variable smoothing length formalism. Here we consider in more detail the modifications made to the SPMHD equations in LBP2015 that resolve this instability by replacing the smoothing length in the induction and anisotropic force equations with an average smoothing length term. We then explore the choice of average used and compare the effects on a test `cylinder-in…
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(科尔多瓦天文台,科尔多瓦国立大学)
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 …
We present a novel implementation of Smoothed Particle Hydrodynamics (SPHS) that uses the spatial derivative of the velocity divergence as a higher order dissipation switch. Our switch -- which is second order accurate -- detects flow convergence before it occurs. If particle trajectories are going to cross, we switch on the usual SPH artificial viscosity, as well as conservative dissipation in all advected fluid quantities (for example, the entropy). The viscosity and dissipation terms (that are numerical errors) are designed to ensure that all fluid quantities remain single-valued as particl…
In this paper we discuss recent applications of the Smoothed Particle Hydrodynamics (SPH) method to the simulation of supersonic turbulence in the interstellar medium, as well as giving an update on recent algorithmic developments in solving the equations of magnetohydrodynamics (MHD) in SPH. Using high resolution calculations (up to 134 million particles), we find excellent agreement with grid-based results on a range of measures including the power spectrum slope in both the velocity field and the density-weighted velocity rho^(1/3) v, the latter showing a Kolmogorov-like k^-5/3 scaling as p…
Firstly, we give a historical overview of attempts to incorporate magnetic fields into the Smoothed Particle Hydrodynamics method by solving the equations of Magnetohydrodynamics (MHD), leading an honest assessment of the current state-of-the-art in terms of the limitations to performing realistic calculations of the star formation process. Secondly, we discuss the results of a recent comparison we have performed on simulations of driven, supersonic turbulence with SPH and Eulerian techniques. Finally we present some new results on the relationship between the density variance and the Mach num…
Smoothed Particle Hydrodynamics (SPH) is a ubiquitous numerical method for solving the fluid equations, and is prized for its conservation properties, natural adaptivity, and simplicity. We introduce the Sphenix SPH scheme, which was designed with three key goals in mind: to work well with sub-grid physics modules that inject energy, be highly computationally efficient (both in terms of compute and memory), and to be Lagrangian. Sphenix uses a Density-Energy equation of motion, along with variable artificial viscosity and conduction, including limiters designed to work with common sub-grid mod…
We describe a new switch to reduce dissipation from artificial resistivity in Smoothed Particle Magnetohydrodynamics simulations. The switch utilises the gradient of the magnetic field to detect shocks, setting alpha_B = h |gradB| / |B|. This measures the relative degree of discontinuity, and the switch is not dependent on the absolute field strength. We present results comparing the new resistivity switch to the switch of Price & Monaghan (2005), showing that it is more robust in capturing shocks (especially in weak fields), while leading to less overall dissipation. The design of this switch…
We describe a simple method for estimating the vertical column density in Smoothed Particle Hydrodynamics (SPH) simulations of discs. As in the method of Stamatellos et al. (2007), the column density is estimated using pre-computed local quantities and is then used to estimate the radiative cooling rate. The cooling rate is a quantity of considerable importance, for example, in assessing the probability of disc fragmentation. Our method has three steps: (i) the column density from the particle to the mid plane is estimated using the vertical component of the gravitational acceleration, (ii) th…
We present a constrained transport (CT) algorithm for solving the 3D ideal magnetohydrodynamic (MHD) equations on a moving mesh, which maintains the divergence-free condition on the magnetic field to machine-precision. Our CT scheme uses an unstructured representation of the magnetic vector potential, making the numerical method simple and computationally efficient. The scheme is implemented in the moving mesh code Arepo. We demonstrate the performance of the approach with simulations of driven MHD turbulence, a magnetized disc galaxy, and a cosmological volume with primordial magnetic field. …
The numerical convergence of smoothed particle hydrodynamics (SPH) can be severely restricted by random force errors induced by particle disorder, especially in shear flows, which are ubiquitous in astrophysics. The increase in the number NH of neighbours when switching to more extended smoothing kernels at fixed resolution (using an appropriate definition for the SPH resolution scale) is insufficient to combat these errors. Consequently, trading resolution for better convergence is necessary, but for traditional smoothing kernels this option is limited by the pairing (or clumping) instability…
We perform a comparison between the smoothed particle magnetohydrodynamics (SPMHD) code, Phantom, and the Eulerian grid-based code, Flash, on the small-scale turbulent dynamo in driven, Mach 10 turbulence. We show, for the first time, that the exponential growth and saturation of an initially weak magnetic field via the small-scale dynamo can be successfully reproduced with SPMHD. The two codes agree on the behaviour of the magnetic energy spectra, the saturation level of magnetic energy, and the distribution of magnetic field strengths during the growth and saturation phases. The main differe…
In magnetohydrodynamics (MHD), the magnetic field is evolved by the induction equation and coupled to the gas dynamics by the Lorentz force. We perform numerical smoothed particle magnetohydrodynamics (Spmhd) simulations and study the influence of a numerical magnetic divergence. For instabilities arising from divergence B related errors, we find the hyperbolic/parabolic cleaning scheme suggested by Dedner et al. 2002 to give good results and prevent numerical artifacts from growing. Additionally, we demonstrate that certain current Spmhd implementations of magnetic field regularizations give …
We present a 'two-fluid' implementation of dust in smoothed particle hydrodynamics (SPH) in the test particle limit. The scheme is able to handle both short and long stopping times and reproduces the short friction time limit, which is not properly handled in other implementations. We apply novel tests to verify its accuracy and limitations, including multi-dimensional tests that have not been previously applied to the drag-coupled dust problem and which are particularly relevant to self-gravitating protoplanetary discs. Our tests demonstrate several key requirements for accurate simulations o…