We analyse the performance of 12 different implementations of Smoothed Part
icle Hydrodynamics (SPH) using seven tests designed to isolate key hydrodyn
amic elements of cosmological simulations which are known to cause the SPH
algorithm problems. In order, we consider a shock tube, spherical adiabatic
collapse, cooling flow model, drag, a cosmological simulation, rotating cl
oud-collapse and angular momentum transport. In the implementations special
attention is given to the way in which force symmetry is enforced in the e
quations of motion. We study in detail how the hydrodynamics are affected b
y different implementations of the artificial viscosity including those wit
h a shear-correction modification. We present an improved first-order smoot
hing-length update algorithm that is designed to remove instabilities that
are present in simple forward prediction algorithms. Gravity is calculated
using the adaptive particle-particle, particle-mesh algorithm.
For all tests we find that the artificial viscosity is the single most impo
rtant factor distinguishing the results from the various implementations. T
he shock tube and adiabatic collapse problems show that the artificial visc
osity used in the HYDRA code prior to version 4.0 performs relatively poorl
y for simulations involving strong shocks when compared to a more standard
artificial viscosity. The shear-correction term is shown to reduce the shoc
k capturing ability of the algorithm and to lead to a spurious increase in
angular momentum in the rotating cloud-collapse problem. For the disc stabi
lity test, the shear-corrected and previous HYDRA artificial viscosities ar
e shown to reduce outward angular momentum transport. The cosmological simu
lations produce comparatively similar results, with the fraction of gas in
the hot and cold phases varying by less than 10 per cent amongst the versio
ns. Similarly, the drag test shows little systematic variation amongst vers
ions, The cooling flow tests show that implementations using the force symm
etrization of Thomas & Couchman are more prone to accelerate the overcoolin
g instability of SPH, although the problem is generic to SPH. The second mo
st important factor in code performance is the way force symmetry is achiev
ed in the equation of motion. Most results favour a kernel symmetrization a
pproach. The exact method by which SPH pressure forces are included in the
equation of motion appears to have comparatively little effect on the resul
ts. Combining the equation of motion presented by Thomas & Couchman with a
modification of the Monaghan & Gingold artificial viscosity leads to an SPH
scheme that is both fast and reliable.