  In the context of the concordance cosmology, structure formation in the
Universe is the result of the amplification, by gravitational effects, of small
perturbations in the primeval density field. This results in the formation of
structures known as dark matter haloes, where gas collapses and forms stars,
giving birth to galaxies. Numerical simulations are an important tool in the
theoretical study of galaxy formation and evolution. In the present work, we
describe the implementation of a chemical enrichment model in a
state-of-the-art cosmological simulation of the Local Group. The simulation
includes sub-grid models for the most relevant physical processes. We analyze
the chemical and morphological evolution of two galaxies with virial masses
similar to that of our Milky Way. For each of the stellar components (disc,
bulge and halo), we establish links between their formation history and their
chemical evolution. We find that $\alpha$-element (O, Mg, Si) enrichment
happens at early stages of evolution, as their main producers are short-lived
stars which end their lives as type II supernova explosions. There is also a
gradual contamination with the rest of the elements as type Ia supernovae and
winds of stars in the asymptotic giant branch occur.
