A numerical solution of a free-boundary problem on the unsaturated flow of liquids in porous media