An Eulerian scheme is used to reformulate the equations of groundwater with pressure dependent density flowing through saturated zones, and moisture transport in unsaturated zones. The governing equation is decomposed into advection along characteristic path lines and propagation of the residue at a fixed frame of reference. This formal decomposition enables the handling of physical phenomena that incorporate discontinuities and/or steep gradient without the need for means of artificial smoothing.