  We present an implementation of smoothed particle hydrodynamics (SPH) with
improved accuracy for simulations of galaxies and the large-scale structure. In
particular, we combine, implement, modify and test a vast majority of SPH
improvement techniques in the latest instalment of the GADGET code. We use the
Wendland kernel functions, a particle wake-up time-step limiting mechanism and
a time-dependent scheme for artificial viscosity, which includes a high-order
gradient computation and shear flow limiter. Additionally, we include a novel
prescription for time-dependent artificial conduction, which corrects for
gravitationally induced pressure gradients and largely improves the SPH
performance in capturing the development of gas-dynamical instabilities. We
extensively test our new implementation in a wide range of hydrodynamical
standard tests including weak and strong shocks as well as shear flows,
turbulent spectra, gas mixing, hydrostatic equilibria and self-gravitating gas
clouds. We jointly employ all modifications; however, when necessary we study
the performance of individual code modules. We approximate hydrodynamical
states more accurately and with significantly less noise than standard SPH.
Furthermore, the new implementation promotes the mixing of entropy between
different fluid phases, also within cosmological simulations. Finally, we study
the performance of the hydrodynamical solver in the context of radiative galaxy
formation and non-radiative galaxy cluster formation. We find galactic disks to
be colder, thinner and more extended and our results on galaxy clusters show
entropy cores instead of steadily declining entropy profiles. In summary, we
demonstrate that our improved SPH implementation overcomes most of the
undesirable limitations of standard SPH, thus becoming the core of an efficient
code for large cosmological simulations.

Cosmology and Nongalactic Astrophysics;Astrophysics of Galaxies