Institute of Astronomy, Madingley Rd, Cambridge, CB3 0HA, UK
School of Mathematical Sciences, Monash University, Clayton 3800, Australia
In this paper we show how the Smoothed Particle Hydrodynamics (SPH) equations for ideal magnetohydrodynamics (MHD) can be written in conservation form with the positivity of the dissipation guaranteed. We call the resulting algorithm Smoothed Particle Magnetohydrodynamics (SPMHD). The equations appear to be accurate, robust and easy to apply and do not suffer from the instabilities known to exist previously in formulations of the SPMHD equations. In addition we formulate our MHD equations such that errors associated with non-zero divergence of the magnetic field are naturally propagated by the flow and should therefore remain small. In this and a companion paper \citep{pm03b} we present a wide range of numerical tests in one dimension to show that the algorithm gives very good results for one dimensional flows in both adiabatic and isothermal MHD. For the one dimensional tests the field structure is either two or three dimensional. The algorithm has many astrophysical applications and is particularly suited to star formation problems.
*The pdf version is an electronic version of an article published in Monthly Notices of the Royal Astronomical Society: complete citation information for the final version of the paper, as published in the print edition of Monthly Notices of the Royal Astronomical Society, is available on the Blackwell Science Synergy online delivery service, accessible via the journal's Website at:http://www.blacksci.co.uk/MNR