The diffusion and photoprocessing of molecules within interstellar ices has been verified experimentally but often not fully included in astrochemical models. With models that consider photodissociation, binary reactions, and diffusion for molecules on the surface and in bulk ice, we explored the chemistry of interstellar and circumstellar ices in gravitationally contracting low-mass starless and prestellar cores, and a protostellar envelope.
Results. Photoprocessing gradually converts mixed H2O and CO ices into CO2 and allows for a late synthesis of icy organic species. Different layers within a single icy mantle favor the synthesis different species. Deuterium-rich molecules are concentrated on the outer surface of ice. Formation of organic molecules in bulk ice lowers their average deuterium content. The abundances of major icy species can be changed by about 25-50 % because of ice photoprocessing. Inter-layer diffusion of icy species allows sequential evaporation in protostellar envelopes, which occurs over a prolonged period.