  We describe an SPH model for chemical enrichment and radiative cooling in
cosmological simulations of structure formation. This model includes: i) the
delayed gas restitution from stars by means of a probabilistic approach
designed to reduce the statistical noise and, hence, to allow for the study of
the inner chemical structure of objects with moderately high numbers of
particles; ii) the full dependence of metal production on the detailed chemical
composition of stellar particles by using, for the first time in SPH codes, the
Qij matrix formalism that relates each nucleosynthetic product to its sources;
and iii) the full dependence of radiative cooling on the detailed chemical
composition of gas particles, achieved through a fast algorithm using a new
metallicity parameter zeta(T) that gives the weight of each element on the
total cooling function. The resolution effects and the results obtained from
this SPH chemical model have been tested by comparing its predictions in
different problems with known theoretical solutions. We also present some
preliminary results on the chemical properties of elliptical galaxies found in
self-consistent cosmological simulations. Such simulations show that the above
zeta-cooling method is important to prevent an overestimation of the
metallicity-dependent cooling rate, whereas the Qij formalism is important to
prevent a significant underestimation of the [alpha/Fe] ratio in simulated
galaxy-like objects.
