  Methanol and its precursor formaldehyde are among the most studied organic
molecules in the interstellar medium and are abundant in the gaseous and solid
phases. We recently developed a model to simulate CO hydrogenation via H atoms
on interstellar ice surfaces, the most important interstellar route to H2CO and
CH3OH, under laboratory conditions. We extend this model to simulate the
formation of both organic species under interstellar conditions, including
freeze-out from the gas and hydrogenation on surfaces. Our aim is to compare
calculated abundance ratios with observed values and with the results of prior
models. Simulations under different conditions, including density and
temperature, have been performed. We find that H2CO and CH3OH form efficiently
in cold dense cores or the cold outer envelopes of young stellar objects. The
grain mantle is found to have a layered structure with CH3OH on top. The
species CO and H2CO are found to exist predominantly in the lower layers of ice
mantles where they are not available for hydrogenation at late times.
