A variational formulation has been developed to solve a parabolic partial differential equation describing free-surface flows in a porous medium. The variational finite element method
is used to obtain a discrete form of equations for a two-dimensional domain. The matrix characteristics and the stability criteria have been investigated to develop a stable numerical algorithm for solving the governing equation. A computer programme has been written to solve a symmetric positive definite system obtained from the variational finite element analysis. The system of equations is solved using the conjugate gradient method. The solution generates time-varying hydraulic heads in the subsurface. The interfacing free surface between the unsaturated and saturated zones in the variably saturated domain is located, based on the computed hydraulic heads. Example problems are investigated. The finite element solutions are compared with the exact solutions for the example problems. The numerical characteristics of the finite element solution method are also investigated using the example problems.