  Using high-resolution hydrodynamical simulations of galaxy clusters, we study
the interaction between the brightest cluster galaxy, its supermassive black
hole (BH) and the intracluster medium (ICM). We create initial conditions for
which the ICM is in hydrostatic equilibrium within the gravitational potential
from the galaxy and an NFW dark matter halo. Two free parameters associated
with the thermodynamic profiles determine the cluster gas fraction and the
central temperature, where the latter can be used to create cool-core or
non-cool-core systems. Our simulations include radiative cooling, star
formation, BH accretion, and stellar and active galactic nucleus (AGN)
feedback. Even though the energy of AGN feedback is injected thermally and
isotropically, it leads to anisotropic outflows and buoyantly rising bubbles.
We find that the BH accretion rate (BHAR) is highly variable and only
correlates strongly with the star formation rate (SFR) and the ICM when it is
averaged over more than $1~\rm Myr$. We generally find good agreement with the
theoretical precipitation framework. In $10^{13}~\rm M_\odot$ haloes, AGN
feedback quenches the central galaxy and converts cool-core systems into
non-cool-core systems. In contrast, higher-mass, cool-core clusters evolve
cyclically. Episodes of high BHAR raise the entropy of the ICM out to the
radius where the ratio of the cooling time and the local dynamical time $t_{\rm
cool}/t_{\rm dyn} > 10$, thus suppressing condensation and, after a delay, the
BHAR. The corresponding reduction in AGN feedback allows the ICM to cool and
become unstable to precipitation, thus initiating a new episode of high SFR and
BHAR.
