  The strong deviation in the properties of X-ray clusters from simple scaling
laws highlights the importance of non-gravitational heating and cooling
processes in the evolution of proto-cluster gas. We investigate this from two
directions: by finding the amount of `excess energy' required in intra-cluster
gas in order to reproduce the observed X-ray cluster properties, and by
studying the excess energies obtained from supernovae in a semi-analytic model
of galaxy formation. Using the insights obtained from the model, we then
critically discuss possible ways of achieving the high excess specific energies
required in clusters. These include heating by supernovae and active galactic
nuclei, the role of entropy, and the effect of removing gas through radiative
cooling.
  Our model self-consistently follows the production of excess energy as well
as its effect on star formation in galaxies. Excess energy is retained in gas
as gravitational, kinetic and/or thermal energy. The gas distribution of
virialized halos are modelled with a 2-parameter family of gas density
profiles; gas profiles are then chosen according to the total energy of the
gas. We investigate four contrasting ways of modifying gas density profiles in
the presence of excess energy, in order to study the sensitivity of results to
the model. In addition, we estimate the minimum excess specific energy required
when all available gas profiles are considered, using a fiducial cluster with a
temperature of around 2 keV. We find that the excess specific energies required
in clusters lie roughly in the range 1--3 keV/particle. (abridged)
