A Monte Carlo simulation of the diffusion of gases in porous solids