  Most hydrodynamical simulations of galaxy cluster formation carried out to
date have tried to model the cosmic gas as an ideal, inviscid fluid, where only
a small amount of (unwanted) numerical viscosity is present, arising from
practical limitations of the numerical method employed, and with a strength
that depends on numerical resolution. However, the physical viscosity of the
gas in hot galaxy clusters may in fact not be negligible, suggesting that a
self-consistent treatment that accounts for the internal gas friction would be
more appropriate. To allow such simulations using the smoothed particle
hydrodynamics (SPH) method, we derive a novel SPH formulation of the
Navier-Stokes and general heat transfer equations and implement them in the
GADGET-2 code. We include both shear and bulk viscosity stress tensors, as well
as saturation criteria that limit viscous stress transport where appropriate.
Adopting Braginskii's parameterization for the shear viscosity of hot gaseous
plasmas, we then study the influence of viscosity on the interplay between
AGN-inflated bubbles and the surrounding intracluster medium (ICM). We find
that certain bubble properties like morphology, maximum clustercentric radius
reached, or survival time depend quite sensitively on the assumed level of
viscosity. Interestingly, the sound waves launched into the ICM by the bubble
injection are damped by physical viscosity, establishing a non-local heating
process. Finally, we carry out cosmological simulations of galaxy cluster
formation with a viscous intracluster medium. Viscosity modifies the dynamics
of mergers and the motion of substructures through the cluster atmosphere.
Substructures are generally more efficiently stripped of their gas, leading to
prominent long gaseous tails behind infalling massive halos. (Abridged)
