  The angular-diameter distance D_A of a galaxy cluster can be measuread by
combining its X-ray emission with the cosmic microwave background fluctution
due to the Sunyaev-Zeldovich effect. The application of this distance indicator
usually assumes that the cluster is spherically symmetric, the gas is
distributed according to the isothermal beta-model, and the X-ray temperature
is an unbiased measure of the electron temperature. We test these assumptions
with galaxy clusters extracted from an extended set of cosmological
N-body/hydrodynamical simulations of a LCDM concordance cosmology, which
include the effect of radiative cooling, star formation and energy feedback
from supernovae. We find that, due to the steep temperature gradients which are
present in the central regions of simulated clusters, the assumption of
isothermal gas leads to a significant underestimate of D_A. This bias is
efficiently corrected by using the polytropic version of the beta-model to
account for the presence of temperature gradients. In this case, once irregular
clusters are removed, the correct value of D_A is recovered with a ~ 5 per cent
accuracy on average, with a ~ 20 per cent intrinsic scatter due to cluster
asphericity. This result is valid when using either the electron temperature or
a spectroscopic-like temperature. When using instead the emission-weighted
definition for the temperature of the simulated clusters, D_A is biased low by
\~ 20 per cent. We discuss the implications of our results for an accurate
determination of the Hubble constant H_0 and of the density parameter Omega_m.
We find that H_0 can be potentially recovered with exquisite precision, while
the resulting estimate of Omega_m, which is unbiased, has typical errors
Delta(Omega_m) ~ 0.05.
