1. Introduction
The Galerkin finite element method (FEM) has long been used to solve groundwater flow and advection–dispersion–reaction equations to predict groundwater flow and the transport of pollutants in porous media. Popular commercial simulation programs, such as FEMWATER [
1], FEFLOW [
2], and HYDRUS3D [
3], were developed based on the Galerkin FEM, and programs such as these have been widely used for some time. In these commercial software packages, Galerkin FEM is used to solve the governing equation of groundwater flow subject to appropriate boundary and initial conditions. The governing equation is simply a statement of a water mass conservation equation coupled with constitutive relations, such as Darcy’s law. In this conventional FEM formulation, the pressure or hydraulic head distribution is obtained and a velocity field is subsequently calculated using Darcy’s law by taking the derivatives of the calculated pressure head distribution, which is used as either the advection velocity for calculating the contaminant transport or the flow through a boundary for calculating the water mass balance. This approach toward obtaining the velocity field is denoted here as the conventional differential approach (CDA). However, the calculated velocity field using the CDA often contains velocity discontinuities at nodal points and element boundaries. Such discontinuities unfortunately lead to large errors when solving the contaminant transport equation. In addition, discontinuities can also lead to failure to conserve the water mass in mass balance computations. The CDA was included in the HYDRUS software.
Yeh [
4] demonstrated water balance errors in the range of 24–30% for a complex problem due to discontinuities in the computed Darcy flux in the interior of the domain. An alternative postprocessing approach was proposed, which provides a continuous Darcy flux by applying the finite element approach used to simulate the groundwater head field to the Darcy equation, with the fluxes as the state variables. Yeh reported that the global mass balance errors could be reduced from 23.8% to 2.2% when this postprocessing approach was used rather than the CDA. Yeh’s postprocessing approach is already included in the FEMWATER software and several other studies have applied it to a range of groundwater flow and transport simulation problems [
5,
6,
7,
8,
9,
10].
Lynch [
11] showed that a precise global mass balance can be achieved via the Galerkin FEM by focusing only on calculating the boundary flux at a Dirichlet boundary rather than calculating a continuous Darcy flux over a whole domain. It was shown through mathematical analysis that the common practice of discarding the Galerkin equations violates the mass balance by requiring that these fluxes be approximated. In contrast, by retaining the Galerkin equations at Dirichlet boundaries as the equations for the boundary flux, a precise global mass balance was demonstrated through conceptual mathematical and hypothetical abstract examples. By retaining the Galerkin equations at Dirichlet boundaries as the equations for the boundary flux, Carey [
12] showed that boundary fluxes can be calculated with exceptional accuracy. He demonstrated from numerical studies that the boundary flux errors will be
, where
is the degree of the element polynomial basis if the exact solution is sufficiently smooth. Accordingly, he concluded that the calculated boundary fluxes not only have exceptional accuracy but also higher rates of convergence compared to the calculated fluxes using the CDA. It has also been observed by other researchers that the postprocessing technique suggested by Lynch [
11] provides very accurate mass balances [
12,
13,
14,
15,
16]. However, in all of these studies, the advantages of the postprocessing technique were demonstrated only through a conceptual mathematical framework, which was too simple or used hypothetical abstract examples that were far from typical groundwater scenarios or practical application problems. Most examples were limited to a one-dimensional steady state with a homogeneous material and simple boundary conditions or a simple geometry. However, typical groundwater problems are characterized by multi-dimensional, heterogeneous, and transient features, as well as various source/sinks and a complex geometry. Furthermore, in all previous approaches using either Yeh’s postprocessing technique or the CDA, two steps are usually needed to calculate the boundary flux at a Dirichlet boundary. In the first step, Galerkin finite element solutions are obtained by solving an algebraic matrix equation, and then, in the next step, the boundary flux is calculated. Even Lynch’s approach calculates integral boundary fluxes by substituting the obtained finite element solutions into the retained Galerkin equations at Dirichlet boundaries after solving for the finite element pressure or hydraulic head distributions, and hence, also requires two steps.
Furthermore, the same idea of Lynch [
11] and Carey [
12] can be extended to compute not only boundary fluxes but also the internal fluxes [
14,
16]. For the computation of the internal fluxes, the Galerkin equations at the interior nodes will be retained, and then, by treating that node as a Dirichlet boundary, the internal flux can be solved with the Galerkin equation at the node using the groundwater head at an internal node computed with the Galerkin FEM. The need to calculate the internal flux often arises when detailed inflow/outflow components are to be examined at the subdomain level during the calibration and verification phase of modeling studies. On the other hand, an alternative postprocessing method that calculates the internal flux was developed by assuming that the flow field is irrotational [
17,
18,
19,
20]. The alternative postprocessing method subdivides elements into patches and individual fluxes for each patch are computed to calculate flow rates through each of the element faces such that flow through the boundary of any subdomain can be calculated by summing the flow rates at those faces that define the boundary. In this study, we focussed on the calculation of only the boundary fluxes to calculate the global mass balance, rather than the internal fluxes.
In this study, a new and simple computational procedure incorporating the postprocessing approach described by Lynch [
11] was proposed to simultaneously obtain boundary fluxes at the Dirichlet boundary nodes and finite element hydraulic heads at all nodes in only one step. The proposed procedure was applied to typical groundwater scenario examples to illustrate its applicability to realistic groundwater problems. Furthermore, a comparison between the postprocessing approach described by Yeh [
4], the conventional differential approach (CDA), and the new approach proposed in this study was performed using two practical groundwater problems to illustrate the accuracy and efficiency of the new approach for computing the global mass balance or boundary fluxes.
2. Methodology
In this study, a new computational procedure was introduced based on the postprocessing approach described by Lynch [
11]. In the new approach, the global matrix and load vectors are assembled in the Galerkin FEM and the integral boundary fluxes at Dirichlet boundary nodes are assigned as primary variables to be solved, as well as the hydraulic heads at all nodes, except the Dirichlet nodes. Accordingly, the integral boundary fluxes at the Dirichlet nodes and the finite element hydraulic heads at all nodes, except the Dirichlet nodes, can be solved using only one step. The governing equation of water flow in a saturated–unsaturated porous medium can be written as follows [
1,
21,
22,
23]:
where
;
is the pressure head;
is the total head;
is the moisture content;
is the effective porosity;
and
are the modified coefficients of the compressibility of the medium frame and the water, respectively;
is the saturated hydraulic conductivity;
is the relative permeability;
is the source or sink;
is the vertical coordinate (positive upward); and
is time. To solve the nonlinear flow equation (Equation (1)), constitutive relations must be established that relate the primary unknown
to the secondary variables
and
. In this study, without the loss of generality, Gardner constitutive relations were used to solve the transient flow in variably saturated porous media. In Gardner constitutive relations, the water content and relative permeability are given as simple exponential functions of the pressure head, as follows:
where
,
, and
represent the saturated water content, the residual water content, and a soil index parameter related to the pore-size distribution, respectively. The Darcy velocity can be calculated using:
where
is the hydraulic conductivity. The initial condition can be written as:
where
is a prescribed function of the spatial coordinate
x, and
is the region of interest. In the Galerkin FEM, the weighted residual integral equation can be written using weighting functions
, as follows:
where
is the weighting function at node
,
is a trial function of
, and
is the total number of nodes in the finite element network. The trial function
can be calculated using:
where
is the hydraulic head at node
. Using Green’s theorem to remove the second derivative and substituting Equation (7) into Equation (6), one obtains the following:
where
is the boundary of the solution region and
is the outward unit vector normal to
. The resulting system of nonlinear ordinary differential equations (Equation (8)) can be solved in time using the backward (implicit) Euler finite difference scheme. Accordingly, the final nonlinear system can be written by substituting Equation (4) into Equation (8), as follows:
where the superscripts
and
are the new and old time levels, respectively, and
is the time step. These equations can be conveniently written in matrix form as follows:
where
It should be noted that
is denoted by Lynch [
11] as the Galerkin flux or integral boundary flux at boundary node
and new time level
. Lynch demonstrated that if boundary node
is a Dirichlet boundary node, the conventional practice of eliminating the Galerkin equations in Equation (10) at Dirichlet boundaries destroys the mass balance because the flux at the boundary should instead be calculated as the gradient of the obtained pressure or hydraulic head using Darcy’s law. Accordingly, he suggested that the Galerkin equations at Dirichlet boundaries should be retained as the algebraic equations for the boundary flux to ensure a good mass balance. Therefore, Equation (10) can be rewritten as:
where:
Expressing Equation (15) as a matrix and a load vector gives the following:
If three arbitrary nodes with node numbers
,
, and
correspond to a Dirichlet boundary, and the Dirichlet boundary values at the
,
, and
nodes are set to
,
, and
, respectively, Equation (18) can be conventionally changed by setting the rows corresponding to node numbers
,
, and
to zero, the diagonal terms to 1, and the corresponding rows of the load vector to the Dirichlet boundary values
,
, and
, as follows:
Another conventional approach to accommodate the Dirichlet boundary condition is to simply discard rows and columns corresponding to Dirichlet boundaries such that the dimensions of the matrix and the load vector are reduced, and to modify the load terms at nodes connected to Dirichlet boundaries by moving the known Dirichlet boundary values to the right-hand side as follows:
The approach described in Equation (19) maintains the matrix size, whereas the approach described in Equation (20) reduces the matrix size by the number of Dirichlet boundary nodes, and hence the latter approach may be more computationally efficient, particularly for a large number of Dirichlet nodes. Approaches deriving Equations (19) or (20) after some manipulation are hereafter denoted as the typical conventional approach (TCA) for accommodating the Dirichlet boundary condition.
In contrast to the TCA above, the new approach maintains the Galerkin equations at the Dirichlet boundaries by setting the values of
, i.e., the Galerkin fluxes or integral boundary fluxes at the Dirichlet nodes, as unknown variables, and at the same time, moving the values of
, i.e., the a priori known hydraulic heads at the Dirichlet nodes, to the right-hand side. As an easier explanation, if the rows corresponding to node numbers
,
, and
in Equation (18) are expressed in algebraic equations, the following equations can be obtained:
Similarly, rows not corresponding to arbitrary node number
that is not a Dirichlet node can be expressed as Equation (24):
If the known values of
,
, and
(i.e.,
,
,
, respectively) are moved to the right-hand side, and the unknown values of
,
, and
are moved to the left-hand side, Equations (21)–(24) can be changed to Equations (25)–(28), respectively, as follows:
Finally, if the set of Equations (25)–(28) are expressed in a matrix form in the new approach, a new expression for the simultaneous algebraic equation system can be written as follows:
As shown in Equation (29), the unknown variables to be solved are the hydraulic heads at all nodes, except the Dirichlet nodes, along with the Galerkin fluxes at the Dirichlet nodes. Therefore, in the new approach, by solving the simultaneous algebraic systems in Equation (29), the boundary fluxes at the Dirichlet nodes and the finite element hydraulic head solutions at all nodes, except the Dirichlet nodes, can be obtained simultaneously in one step. Compared to the new approach, Yeh’s approach and the CDA consist of two steps, wherein the first step is to obtain the Galerkin finite element hydraulic heads at all nodes by solving Equations (19) or (20), and then, calculate the boundary fluxes using the obtained Galerkin finite element hydraulic heads. Hence, the new approach presents a more straightforward and efficient computational procedure.
The global mass balance can be obtained by integrating Equation (1) over the whole space domain
, applying the divergence theorem, and substituting Equation (4), as follows:
The first and second terms on the left-hand side of Equation (30) represent, respectively, the volumetric rate of increase in moisture content and the mass change rate due to sinks/sources, with the latter being positive for withdrawal over the whole region
. The last term indicates the outwardly normal flux through the global boundary
. If we assume, for the sake of simplicity, that a global boundary consists of a Dirichlet boundary
, a Neumann boundary
, and an impermeable boundary
, the flux through the whole boundary can be divided into three components, as shown below:
where
,
, and
represent the fluxes through a Dirichlet boundary
, Neumann boundary
, and impermeable boundary
, respectively. To evaluate the mass balance computational performance of the different approaches, the global mass balance error over a whole region can be defined as:
If the total mass accumulated within a certain period
in a region can be obtained as the sum of the total net mass through all boundaries during
and the mass added (or removed) to the initial mass in the region during
due to sources (or sinks), Equation (32) can be rewritten as:
where
is the moisture content distribution at the initial time
. Here, at the Neumann and impermeable boundaries, respectively,
and
are known a priori, i.e., prescribed with known values. Accordingly, if the flux through a Dirichlet boundary can be calculated exactly and the finite element hydraulic solutions obtained from Equations (19), (20), or (29) are free of error, the mass balance equation (Equation (30)) will be perfectly satisfied, assuming that the numerical quadrature is exact and there is no temporal discretization error. The flux through the Dirichlet boundary can be conventionally calculated by either differentiating the hydraulic heads computed from Equation (19) or (20) using the CDA, or by applying the finite element approach to the Darcy equation with the hydraulic heads computed from Equation (19) or (20) using Yeh’s approach. However, the approach proposed in this study directly calculates the flux through Dirichlet boundaries by solving Equation (29) for Galerkin fluxes or integral boundary fluxes at the Dirichlet nodes. To illustrate the superiority of the mass balance computation performed using the proposed approach, here, the approach was compared to the CDA and Yeh’s approach using two practical groundwater scenarios.
4. Conclusions
In this study, a simple new computational procedure based on the approach described by Lynch [
11] was proposed to simultaneously obtain boundary fluxes at Dirichlet boundary nodes and finite element hydraulic heads at all nodes, except Dirichlet boundary nodes, within a single step to provide accurate mass balance computations. Compared to previous mass balance computational procedures, such as Yeh’s approach and the CDA, which usually require two steps, the new approach was computationally more efficient and convenient. Most previous mass balance studies based on Lynch’s approach [
11] are limited in application to only simple mathematical concepts or hypothetical abstract examples that have a one-dimensional steady state with homogeneous material and simple boundary conditions or simple geometry. These examples are far from typical groundwater scenarios or realistic application scenarios. Accordingly, the proposed procedure was applied here to two typical groundwater scenarios. The first considered a case of infiltration through the bottom of a long ditch of a certain width, as adapted from Strack [
24], and the second was a problem involving a hypothetical small watershed with a sloping area, as described in Yeh [
4], with different boundary conditions and aquifer properties. In the first example, for two different spatial discretization levels, solutions derived using the proposed approach and two previous approaches (Yeh’s approach and the CDA) were compared in terms of the accuracy of the calculated fluxes at the Dirichlet boundaries using analytical solutions. As the spatial discretization became coarser, the calculated maximum difference between the exact analytical solution and the numerical solutions computed through Yeh’s approach and the CDA were much larger than the difference observed with the new approach. The calculated mass balance errors from the previous approaches increased significantly as the mesh became coarser; however, using the new approach, the errors increased only slightly to within approximately 2% at all mesh discretization levels.
Similarly, in the second example, the mass balance error of the new approach was much less (552-fold and 950-fold, respectively) than those of the previous approaches because Yeh’s approach and the CDA yielded significant errors when calculating the velocities at the impermeable boundaries. Although it has been reported that Yeh’s approach produces much better results than the CDA by obtaining continuous velocity fields, even Yeh’s approach in this example produced significant errors when calculating the velocities, especially when an impermeable boundary was located in a highly complicated flow regime, leading to significant global mass balance errors. Furthermore, the CPU time of the new approach was approximately 32.4% and 31.8% faster than those of Yeh’s approach and the CDA, respectively, because the new approach used only one step to obtain boundary fluxes at the Dirichlet nodes, whereas both Yeh’s approach and the CDA needed a second step to compute the velocity fields. From the results of these numerical experiments, it can be concluded that the new approach provided more accurate and efficient mass balance computations compared to the previous approaches that are widely used in commercial and public groundwater software.