Using internal magnetic fields to obtain pore size distributions of porous media