  Simple self-consistent models of galaxy groups and clusters are tested
against the results of high-resolution adiabatic gasdynamical simulations. We
investigate two models based on the existence of a 'universal' dark matter
density profile and two versions of the beta-model. The mass distribution of
relaxed clusters can be fitted by phenomenological formulae proposed in the
literature. Haloes that have experienced a recent merging event are
systematically less concentrated and show steeper profiles than relaxed objects
near the centre. The hot X-ray emitting gas is found to be in approximate
hydrostatic equilibrium with the dark matter potential, and it is well
described by a polytropic equation of state. Analytic formulae for the gas
density and temperature can be derived from these premises. Though able to
reproduce the X-ray surface brightness, the beta-model is shown to provide a
poor description of our numerical clusters. We find strong evidence of a
'universal' temperature profile that decreases by a factor of 2-3 from the
centre to the virial radius, whereas baryon fraction and entropy are
monotonically increasing functions. Numerical resolution and entropy
conservation play a key role in the shapes of the profiles at small radii.
