  The Sunyaev-Zeldovich (SZ) effect gives a measure of the thermal energy and
electron pressure in groups and clusters of galaxies. In the near future SZ
surveys will map hundreds of systems, shedding light on the pressure
distribution in the systems. The thermal energy is related to the total mass of
a system of galaxies, but it is only a projection that is observed through the
SZ effect. A model for the 3D distribution of pressure is needed to link the SZ
signal to the total mass of the system. In this work we construct an empirical
model for the 2D and 3D SZ profile, and compare it to a set of realistic high
resolution SPH simulations of galaxy clusters and groups, and to a stacked SZ
profile for massive clusters derived from WMAP data. Furthermore, we combine
observed temperature profiles with dark matter potentials to yield an
additional constraint, under the assumption of hydrostatic equilibrium. We find
a very tight correlation between the characteristic scale in the model, the
integrated SZ signal, and the total mass in the systems with a scatter of only
4%. The model only contains two free parameters, making it readily applicable
even to low resolution SZ observations of galaxy clusters. A fitting routine
for the model that can be applied to observed or simulated data can be found at
http://www.phys.au.dk/~haugboel/software.shtml
