Computer simulation of diffusion in multiphase systems