A nonsteady state method for determining diffusion coefficients in porous media