Diffusion in inhomogeneous media with periodic microstructures