Introduction

Each phenomenon in the real world can be mathematically drawn through governing equations (well-known as partial differential equations—PDEs). Concerning physical laws and by imposing boundary and initial conditions, the PDEs are constructed. For example, the groundwater’s governing equation can be obtained employing mas balance and continuity laws. However, there is serious trouble for deriving the reliable response of these equations in real problems. Indeed, the real world is so complicated and this prevents obtaining the exact solutions. That is why researchers employ numerical techniques to approximate PDEs.

The application of numerical methods in groundwater modeling has an extensive background. Also, a broad range of various numerical methods is available in this field including finite difference (FD), finite element (FE), finite volume (FV), and meshfree (Mfree). A review of this background reveals that the FD application in groundwater modeling began in the early 1960s in studies by Witherspoon et al. (1962), Knox et al. (1965), Freeze and Witherspoon (1966), Bredehoeft and Pinder (1970) and Pinder and Cooper (1970). The FD applications quickly expanded to more branches of groundwater studies, and this applicability discovered its deficiencies and motivated researchers to test other numerical techniques. For the first time, Zienkiewichz et al. (1966) tested the efficacy of FE in an anisotropic seepage case. Later, Javandel and Witherspoon (1968) examined FE skill in transient flow in permeability problems. A few years later and due to some deficiencies of FE and FD in irregular-shaped boundaries, the FV was introduced and evolved quickly in all disciplines of computational fluid dynamic (CFD), particularly in the groundwater field. For example, studies by Balaguer et al. (1970), Glover (1974), and especially Patankar’s study (1980) can be accounted for the first affairs in the FV’s background (Bon et al. 2021).

As it can be concluded from the above discussion, although numerical modeling has many advantages, researchers must extend their understanding of the system to obtain reliable results. If this preliminary is not satisfied, the numerical model likely does not work effectively and erratic behavior may be incorporated in simulation. In this situation, a positive or negative error is associated with outputs increasingly, and we are faced with unstable results (Fahlman 1991; Kaliakin 2018; Qin 2021; Sadr et al. 2022).

In numerical methods, the stability and variability of interest variables (e.g., groundwater level) depend on multi influencing factors. To continue, some of the influencing factors are introduced and it is explained how these factors affect the stability and convergence of numerical results. After discretization of governing equations through numerical techniques, a set of linear equations is produced, and to solve them some techniques such as iterative methods are employed (Wang and Anderson 1995). In the iterative techniques (e.g., Jacobi or Gauss–Seidel), an initial guess was assumed, and it is then improved successively. The maximum committed error for each iteration is calculated, and while it exceeds a specified threshold, the iterative procedure will be continued. Therefore, the error threshold is one of the most main factors influencing the accuracy, convergence, and stability of numerical results.

The stability of the decision variable in time variable problems depends on the time derivative. This term that usually is approximated as the forward difference in time creates a time step displayed as \(\Delta t\) or \({\text{d}}t\) in discretized form of PDE. In this kind of problem, the state of the decision variable is unsteady and it changes step by step in time. The variable in the first step is simulated in steady state and its value in the second step is then considered as the previous state to obtain the current value. This process will continue in the recursive form. In this case, two specific components control the stability of numerical results: scheme type and time-step size (Moridis et al. 2020). Scheme type refers to the time dependency of the decision variable. Indeed, variable of interest in each time step can change between its current and next own situation. For example, the variable in the implicit scheme reflects the next value perfectly, while the explicit scheme considers the variable in the current state of time. Discretization of PDEs in time-dependence problems depends on the time-step size influencing the convergence and stability of numerical results extremely. For some schemes, it must be adequately slight to avoid error growth.

These factors (time-step size, error threshold, and scheme type) are major influencing components in numerical results’ stability, so a good understanding of them provides a plan to properly tune them and avoid sudden noise. Selecting and discovering of optimum value of influencing components in numerical studies is a challenge for a modeler, particularly in groundwater simulation with high complexity. Therefore, wide studies have been conducted in groundwater numerical modeling to identify stable procedures or introduce some stability criteria for different situations. For example, Larkin (1964) presented a direction explicit method to solve diffusion equations in a simple synthetic study. Results showed that the introduced scheme for generating numerical approximations is stable for time increments. Quon et al. (1965) presented an alternating direction explicit procedure (ADEP) based on Larkin’s suggestion and compared its efficiency with an implicit procedure on hypothetic example in a volumetric for saturated oil reservoir. The results indicated that the proposed scheme needs less time than the implicit scheme. Hoopes and Harleman (1967) used restricted grid spacing and time in the explicit scheme to obtain a stable numerical solution to simulate the radial flow created around an extraction well. Their findings exhibited some drawbacks including large computing time. As a valuable study case, Remson et al. (1971) for the first time discussed on consistency and stability of numerical results in different schemes for groundwater flow modeling. They introduced the ratio \({{T \cdot \Delta t} \mathord{\left/ {\vphantom {{T \cdot \Delta t} {S \cdot a^{2} }}} \right. \kern-\nulldelimiterspace} {S \cdot a^{2} }}\) (T: transmissivity, \(\Delta t\): time step, S: storage coefficient, and a: \(\Delta x\)) as a stability criterion for a homogeneous confined aquifer. Their results showed that this ratio should be less than or equal to 0.5 for stable results. Rushton and Redshaw (1979) extended previous works and presented stability criterion for two-dimensional groundwater flow in a homogeneous confined aquifer. They found that the presented ratio by Remson et al. (1971) must be less than or equal to 0.25 to obtain stable results. Chu and Willis (1987) employed an explicit scheme to provide a direct solution to the Boussinesq equation in simulating groundwater flow in a shallow unconfined aquifer. Results indicated that numerical results were stable when the time step is less than 0.5 days. Van Dam and Feddes (2000) examined the spatial stability of implicit scheme to simulate infiltration, evaporation, and shallow groundwater levels through Richards’s equation (movement of water in unsaturated soils) in three hypothetic case studies. They resulted that greater nodal distances than 5 cm, more oscillation the model seriously will encounter for the infiltration and evaporation fluxes at the soil surface. Regazzoni and Quarteroni (2021) introduced a numerically stabilization index in medicine science, capable of removing the nonphysical oscillations. Their results indicated that the introduced stability index successfully deletes the nonphysical oscillations characterizing the non-stabilized isolated, in the different numerical tests. Also, Guillot (2021) showed a more efficient plan for numerical modeling of self-excited oscillators with power triodes in the power converters studies.

Despite valuable studies presented in the above literature, few related works have focused on determining the optimum value of influencing factors in the stability of groundwater numerical simulation in the field application of finite element. Although some studies such as Remson et al. (1971) and Rushton and Redshaw (1979) presented some stability criteria for groundwater flow, these criteria have some drawbacks and there are many ambiguities for their application in the real-world cases comprising anisotropy, non-homogenous, and intricate boundary conditions. In real practices, the transmissivity and storage coefficients show spatial variability, whereas the ratio introduced by Remson et al. (1971) and Rushton and Redshaw (1979) does not consider this variability. Also, these stability criteria were given only for the explicit scheme, while a criterion covering all possible schemes is required. Furthermore, the proposed ratio was tested in a confined aquifer, and researchers disregarded the stability of numerical simulation in the unconfined aquifer. Finally, the effect of some influencing factors used to solve linear equations set (e.g., error threshold factor) has failed to notice. Indeed, no guidance guides the researcher in choosing the correct values of time interval and error threshold for each scheme type. Hence, more consideration with more flexibility is required to consider all aspects of problems with more complexity.

Based on the above explanation, this study aims to develop the previous works and overcome existing deficiencies by providing a more efficient procedure. Therefore, this paper does not discuss a new stability criterion, but a comprehension framework is recommended to parameterize the influencing components of stability and present their reasonable tolerances. Moreover, this study presents an open-source framework to simulate groundwater through FE in theoretical and real-world case studies. Hence, the finding of this study can facilitate complicated analysis of stability criteria for influencing factors, and consequently, it may be considered a valuable guideline for future studies in groundwater flow modeling.

The following sections are categorized below: "Data and methods" section focuses on groundwater modeling, FE procedure, and discretization, introducing synthetic and field case studies, and examining influencing components and approaches. "Results" section gives the results and explains the numerical model application and the influencing components effect. Finally, "Conclusions" section summarizes the results and discusses further advancements in the modeling system.

Data and methods

Groundwater flow-governing equations

The governing two-dimensional equation in unconfined aquifer can be expressed as follows (Arnold et al. 1993):

$$K\frac{{\partial^{2} h^{2} }}{{\partial x^{2} }} + K\frac{{\partial^{2} h^{2} }}{{\partial y^{2} }} + 2 \cdot Q(i,j) = 2 \cdot S_{{\text{y}}} \frac{\partial h}{{\partial t}},\,\,\,\,\,\,\left( {Q(i,j) = q + \sum\limits_{i = 1}^{n} {Q_{i} \delta (x_{o} - x_{i} ,y_{o} - y_{i} )} } \right),$$
(1)

where Sy, h, t, Q, and K represent the specific yield, potential groundwater head (m), time (day), source or sink (m3/day), and hydraulic conductivity (m/day), respectively, while n, and \(\delta (x_{o} - x_{i} ,y_{o} - y_{i} )\) denote the transmissivity (m2/day), number of pumping wells, and Dirac delta function in which xo and yo are origin coordinate, respectively. Furthermore, initial and boundary conditions are given as follows:

$$\begin{aligned} \frac{\partial h}{{\partial x}}n_{x} + \frac{\partial h}{{\partial y}}n_{y} = & \;\frac{{q_{t} }}{K}\delta \Rightarrow \quad {\text{on}}\,\,\,\,\Gamma = \Gamma t \\ h(x,y,t) = & \;\overline{h}\,\,\,\,\,\,\, \Rightarrow \quad {\text{on}}\,\,\,\,\Gamma = \Gamma u \\ h(x,y,o) = & \;h_{0} \,\,\,\, \Rightarrow \quad \;{\text{on}}\,\,\,\,\,\Omega, \\ \end{aligned},$$
(2)

where \(\Gamma\), \(\Gamma t\), \(\Gamma u\), and \(\Omega \,\) represent total boundary of aquifer, natural boundary, essential boundary, and aquifer domain. However, \(q_{t}\) indicates the inflow/outflow rate to/frsom aquifer over \(\Gamma t\) (m/day). Also, \(n = \left\{ {n_{x} ,n_{y} } \right\}\), \(\delta\), \(\overline{h}\), and \(h_{0}\) are unit vector in x and y directions, nodal spacing of boundary nodes, constant head over \(\Gamma u\), and initial conditions.

Finite element formulation

FE divides the aquifer domain into finite local domains (element) and it then employs an interpolation function (shape function) to evaluate the elements’ potential head through nodes’ values (as interpolator). Each element consists of several nodes that their counts change according to the element type. FE approximates the governing equation into each element and it solves this equation by decreasing derivatives order; hence, it is accounted from weak form ones (Liu and Gu 2005). The weighted residual technique is one of the most applied methods in which the weighted residual of the governing equation is integrated and the weak formulation is achieved. The logic behind this is that the nodes’ residuals are expected to be controlled as much as possible. To accomplish this condition, a weighted average of residuals should be zero. Weighted residual has different kinds including Galerkin, Petrov–Galerkin, least square, collection points. FE is usually associated with the Galerkin approach in which weight function is similar to the shape function:

$$\begin{aligned} \hat{h}(x,y,t) & = \sum\limits_{L} {N_{L} (x,y)h_{L} (t)} = N_{1} (x,y)h_{1} (t) + N_{2} (x,y)h_{2} (t) \\ & \quad + ... + N_{L} (x,y)h_{L} (t), \\ \end{aligned}$$
(3)

where L and \(h_{L} (t)\) represent total number of nodes and potential head for ith node at t time, respectively, while \(N_{L} (x,y)\), \(\hat{h}(x,y,t)\) indicate value of shape function on ith node and potential head of triangular finite element, respectively. By substituting Eq. (3) into Eq. (1) and by imposing assumption of weighted residual, the following equation can be expressed:

$$\int\limits_{\Omega } {\left( {K\left( {\frac{{\partial^{2} \hat{h}^{2} }}{{\partial x^{2} }} + \frac{{\partial^{2} \hat{h}^{2} }}{{\partial y^{2} }}} \right) + 2 \cdot Q(i,j) - 2 \cdot S_{y} \frac{{\partial \hat{h}}}{\partial t}} \right)\;} W_{L} \cdot {\text{d}}\Omega = 0\,\,\,(W_{L} \approx N_{L} ),$$
(4)

where \(W_{L}\) is the weight function that is same to shape function (\(N_{L}\)) in Galerkin (So and hereafter \(W_{L}\) is replaced with \(N_{L}\) in discretization process). Second order of space derivative of potential head can be reduced by multiplying \(N_{L}\) in integral’s components and using integration by part, as follows:

$$\begin{aligned} & - \int\limits_{\Omega } {\left( {K\left( {\frac{{\partial \hat{h}^{2} }}{\partial x} \cdot \frac{{\partial N_{L} }}{\partial x} + \frac{{\partial \hat{h}^{2} }}{\partial y} \cdot \frac{{\partial N_{L} }}{\partial y}} \right)} \right)} {\text{d}}\Omega \\ & \quad + 2\int\limits_{\Omega } {(Q(i,j)} .N_{L} ){\text{d}}\Omega - 2\int\limits_{\Omega } {\left( {S_{y} \frac{{\partial \hat{h}}}{\partial t}} \right)} N_{L} {\text{d}}\Omega \, + ... \\ & \quad + \int\limits_{\Gamma } {K\left( {\frac{{\partial \hat{h}}}{\partial x}n_{x} . + \frac{{\partial \hat{h}}}{\partial y}n_{y} } \right)N_{L} } {\text{d}}\Gamma = 0.\,\,\, \\ \end{aligned}$$
(5)

In the above equation, the fourth integral represents normal flux over the natural boundary and the first three integrals are evaluated using sequential element‐by‐element computations. Indeed, the general domain (\(\Omega \,\)) of the first three integrals is converted to local domains (e), and then, their computations are performed for all elements one by one (see Fig. 1). Hence, the formulation of Eq. (5) can be reworded as the following equation:

$$\begin{aligned} & - \sum\limits_{e} {\int\limits_{e} {\left( {K\left( {\frac{{\partial \hat{h}^{2} }}{\partial x}.\frac{{\partial N_{L}^{e} }}{\partial x} + \frac{{\partial \hat{h}^{2} }}{\partial y}.\frac{{\partial N_{L}^{e} }}{\partial y}} \right)} \right)} {\text{d}}\Omega } \\ & \quad + \sum\limits_{e} {2\int\limits_{e} {(Q(i,j)} .N_{L}^{e} ){\text{d}}\Omega } - \sum\limits_{e} {2\int\limits_{e} {\left( {S_{y} \frac{{\partial \hat{h}}}{\partial t}} \right)} N_{L}^{e} {\text{d}}\Omega } + \,... \\ & \quad + \int\limits_{\Gamma } {K\left( {\frac{{\partial \hat{h}}}{\partial x}n_{x} . + \frac{{\partial \hat{h}}}{\partial y}n_{y} } \right)N_{L} } {\text{d}}\Gamma = 0.\,\,\,\, \\ \end{aligned}$$
(6)
Fig. 1
figure 1

Adopted from Wand and Anderson 1995

Schematic diagram showing global matrix and element‐by‐element computations.

This study used triangular elements for its wide application and well proficiency. The trial solution of the potential head for triangular elements can be expressed as the following equation:

$$\begin{aligned} \hat{h}(x,y,t) = & \;\sum\limits_{m = i,j,k} {N_{m} (x,y)h_{m} (t)} \\ = & \;N_{i} (x,y)h_{i} (t) + N_{j} (x,y)h_{j} (t) + \,N_{k} (x,y)h_{k} (t), \\ \end{aligned}$$
(7)

where the formulation of shape function is as follows:

$$\begin{aligned} N_{i} = & \;\frac{1}{2A}\left[ {(x_{k} y_{j} - x_{j} y_{k} ) + (y_{k} - y_{j} )x + (x_{j} - x_{k} )y} \right] \\ N_{j} = & \;\frac{1}{2A}\left[ {(x_{k} y_{j} - x_{j} y_{k} ) + (y_{k} - y_{j} )x + (x_{j} - x_{k} )y} \right] \\ N_{k} = & \;\frac{1}{2A}\left[ {(x_{k} y_{j} - x_{j} y_{k} ) + (y_{k} - y_{j} )x + (x_{j} - x_{k} )y} \right]. \\ \end{aligned}$$
(8)

Concerning Eq. (7), the spatial and temporal derivatives of potential head in triangular finite element can be expressed as follows:

$$\begin{aligned} \frac{{\partial \hat{h}^{2} }}{\partial x} = & \;2h^{t} \frac{{\partial \hat{h}}}{\partial x} = 2h^{t} \left( {\sum\limits_{m = i,j,k} {\frac{{\partial N_{m} }}{\partial x}h_{m}^{t} } } \right) \\ = & \;2h^{t} \left( {\frac{{\partial N_{i} }}{\partial x}h_{i}^{t} + \frac{{\partial N_{j} }}{\partial x}h_{j}^{t} + \frac{{\partial N_{k} }}{\partial x}h_{k}^{t} } \right) \\ \end{aligned}$$
(9a)
$$\begin{aligned} \frac{{\partial \hat{h}^{2} }}{\partial y} = & \;2h^{t} \frac{{\partial \hat{h}}}{\partial y} = 2h^{t} \left( {\sum\limits_{m = i,j,k} {\frac{{\partial N_{m} }}{\partial y}h_{m}^{t} } } \right) \\ = & \;2h^{t} \left( {\frac{{\partial N_{i} }}{\partial y}h_{i}^{t} + \frac{{\partial N_{j} }}{\partial y}h_{j}^{t} + \frac{{\partial N_{k} }}{\partial y}h_{k}^{t} } \right) \\ \end{aligned}$$
(9b)
$$\frac{{\partial \hat{h}}}{\partial t} = \sum\limits_{m = i,j,k} {N_{m} .\frac{{\partial h_{m} }}{\partial t}},$$
(9c)

where m indicates nodes of element (i, j, k). By substituting Eq. (9a, 9b) into Eq. (6), first integral is edited as follows:

$$\int\limits_{e} {\left( \begin{gathered} K\left( {2h^{t} \left( {\frac{{\partial N_{i} }}{\partial x}h_{i}^{t} + \frac{{\partial N_{j} }}{\partial x}h_{j}^{t} + \frac{{\partial N_{k} }}{\partial x}h_{k}^{t} } \right).\frac{{\partial N_{L}^{e} }}{\partial x}} \right) + ... \hfill \\ + \left( {2h^{t} \left( {\frac{{\partial N_{i} }}{\partial y}h_{i}^{t} + \frac{{\partial N_{j} }}{\partial y}h_{j}^{t} + \frac{{\partial N_{k} }}{\partial y}h_{k}^{t} } \right).\frac{{\partial N_{L}^{e} }}{\partial y}} \right) \hfill \\ \end{gathered} \right)} {\text{d}}\Omega,$$
(10)

where \(L \in m\). Concerning Eq. (8), the spatial derivatives of N are independent in x, y directions and just \(d\Omega\) remains as integrand, so the result of the integral will be equal to the area of the element (\(A^{{\text{e}}}\)). The same strategy can be considered to discrete second and third integrals of Eq. (6). The final form of discretized equations in matrix form by considering the contribution of all elements exciting in the aquifer domain can be expressed in the following equation:

$$\begin{aligned} G_{L,m} = & \;\sum\limits_{e} {K\int\limits_{e} {\sum\limits_{m} {\left( {\frac{{\partial N_{m} }}{\partial x}.\frac{{\partial N_{L} }}{\partial x} + \frac{{\partial N_{m} }}{\partial y}.\frac{{\partial N_{L} }}{\partial y}} \right){\text{d}}\Omega } } } \\ = & \;\left\{ \begin{gathered} 0\;{\text{ if}}\; \, L \notin m \hfill \\ {\text{if}}\; \, L \, \in \, m \, : \hfill \\ \sum\limits_{e} {K.h^{t} \sum\limits_{m} {A^{e} \left( {\frac{{\partial N_{m} }}{\partial x}.\frac{{\partial N_{L} }}{\partial x} + \frac{{\partial N_{m} }}{\partial y}.\frac{{\partial N_{L} }}{\partial y}} \right)} } \hfill \\ \end{gathered} \right. \\ \end{aligned}$$
(11)
$$P_{{L,m}} = {\text{ }}\sum\limits_{e} {S_{y} } \int\limits_{e} {\sum\limits_{{m = 1}}^{3} {(N_{L} N_{m} )} \cdot {\text{d}}\Omega } = \left\{ {\begin{array}{*{20}l} 0 \hfill & {{\text{if}}\;{\mkern 1mu} L \notin m} \hfill \\ {\sum\limits_{e} {S_{y} .\frac{{A^{e} }}{{12}}} } \hfill & {{\text{if }}\;L{\mkern 1mu} \in m{\text{ and }}L \ne m} \hfill \\ {\sum\limits_{e} {S_{y} .\frac{{A^{e} }}{6}} } \hfill & {{\text{if}}\;{\mkern 1mu} L{\mkern 1mu} \in m{\text{ and }}L = m} \hfill \\ \end{array} } \right.$$
(12)
$$\begin{aligned} B_{L} = & \;\sum\limits_{e} {\int\limits_{{}} {Q(i,j)N_{L} .{\text{d}}} } \Omega \\ = & \,\left( {\frac{q}{\Delta x.\Delta y.T}.\frac{{A^{{\text{e}}} }}{3}} \right) + \sum\limits_{i = 1}^{n} {\frac{{Q_{i} \delta (x_{o} - x_{i} ,y_{o} - y_{i} )}}{T}} \\ \end{aligned}$$
(13)
$$\begin{aligned} F_{L} = & \;\frac{1}{2}\int\limits_{\Gamma } {\left( {nx\frac{{\partial h_{e} }}{\partial x} + ny\frac{{\partial h_{e} }}{\partial y}} \right).N_{L} {\text{d}}\delta } \\ = & \;\left\{ {\begin{array}{*{20}l} 0 \hfill & {\text{for all interior nodes}} \hfill \\ 0 \hfill & {\text{for constant head boundary nodes}} \hfill \\ 0 \hfill & {\text{for no - flow boundary nodes}} \hfill \\ {\frac{{q_{t} }}{K}.\frac{{\overline{iL} }}{2} + \frac{{q_{t} }}{K}.\frac{{\overline{Lk} }}{2}} \hfill & {\text{for specific flow}}, \hfill \\ \end{array} } \right. \\ \end{aligned}$$
(14)

where [G] and [P] are global conductance matrix representing hydraulic conductivity, and global mass matrix reflecting specific yield. Also, {B} and {F} are load vector and boundary flux vector. The \(\overline{iL}\) represents spatial interval between i and L (m), and \(\overline{{{\text{Lk}}}}\) is distance between L and k (m). Each internal array of [G] and [P] matrixes is evaluated by considering the contribution of each element. In proceed and to estimate time derivatives of potential head, the forward difference approximation was used as the following equation:

$$\left[ {G_{L,m} } \right] \cdot \left\{ {h_{L} } \right\} + \left[ {P_{L,m} } \right] \cdot \left\{ {\frac{{h^{t + 1} - h^{t} }}{\Delta t}} \right\} = \{ B_{L} \} + \left\{ {F_{L} } \right\}. \,$$
(15)

Cases studies

This study examined the effect of influencing components in two different cases to cover various complexity and uncertainty. In synthetic case, the most focus of the simulation process is on model uncertainty, while field study (Birjand aquifer) not only comprises more real conditions such as anisotropy and heterogeneity but also it involves more uncertainty sources in the simulation process. Moreover, a comparison of influencing factors effects in two aquifers has itself a high degree of importance.

Synthetic test case

Two-dimensional groundwater drawdown in a homogenous, and isotropic synthetic unconfined aquifer, was simulated through the FE model, and the effect of influencing components was examined on numerical results. This aquifer, illustrated in Fig. 2, has two pumping wells with a discharge rate of 1142.85 m3/day and 1428.57 m3/day located, respectively, in 113rd and 143rd nodes. Also, one piezometer was considered in the 85th node to measure the water table drawdown due to pumping. Transmissivity and specific yield were assumed constant in the duration of simulation and their values were 885.71 m2/day and 0.15, respectively. The initial head was considered 100 m throughout the aquifer domain and two different types of boundary conditions were imposed on four sides of the aquifer (see Fig. 2). At last, the simulated drawdown was compared with analytical values to assess model accuracy and performance.

Fig. 2
figure 2

(adopted from Illangasekare and Döll 1989)

Schematic view of synthetic test case

Field study

Birjand plain is located in the east of Iran, where annual rainfall is very low (< 100 mm) and it is classified as an arid region (see Fig. 3). To simulate the groundwater table in the Birjand aquifer, a grid model comprising of 1175 nodes with a vertical and horizontal cell size of 500 m, and 34 rows, and 96 columns, as well as 2195 triangle elements, was embedded into a numerical model. Birjand aquifer consists of nine input sections in the south, northeast, and northwest of the aquifer and one output section in the southwest (see Fig. 4). Also, this aquifer has 11 piezometers head (observation wells) to record actual potential head (coded based on grid number, e.g., piezometer located in the 98th node, coded Piez 98). More information about conceptual model characteristics (boundary conditions, extraction wells, boreholes, and hydrodynamic components) is available in studies by Hamraz et al. (2015), Sadeghi-Tabas et al. (2017), Jafarzadeh et al. (2021a, b).

Fig. 3
figure 3

(adopted from Jafarzadeh et al. 2019)

A schematic map showing the location of Birjand plain and aquifer

Fig. 4
figure 4

(adopted from Hamraz et al. 2015)

Definition of grid model in Birjand aquifer

Influencing components in numerical results stability

Description of the influencing components and their parameterization is presented here to show how consider their effect on the stability of numerical methods output.

Scheme type

Method of solution shows how a variable change between current and next time step. Indeed, it remarks to the temporal variability of the potential head in the simulation process (Owais et al. 2008) based on the following equation:

$$h = \alpha h^{t + 1} + \left( {1 - \alpha } \right)h^{t}.$$
(16)

In the above equation, \(\alpha\) varies linearly between zero (explicit scheme) and one (implicit scheme), while, in the Crank–Nicolson mode, it is equal to 0.5. This study intended to assess the effect of different schemes on the stability of groundwater numerical simulation. By substituting Eq. (16) back into Eq. (15) we obtained:

$$\begin{aligned} \left\{ {\alpha \cdot [G_{L,m} ] + \frac{{[P_{L,m} ]}}{\Delta t}} \right\} &\cdot h_{L}^{t + 1} = \left\{ {\frac{{[P_{L,m} ]}}{\Delta t} - (1 - \alpha ) \cdot [G_{L,m} ]} \right\} \\ &\cdot h_{{_{L} }}^{t} + \{ B_{L} \} + \left\{ {F_{L} } \right\}. \end{aligned}$$
(17)

The stability of numerical results can be examined by considering different values for \(\alpha\). It is known that numerical results in the implicit scheme are always stable, regardless of time-steps size. Therefore, it was considered as a stable simulation to compare other schemes.

Time step

In time-dependent problems, the stability of the decision variable depends on both space and time simultaneously. Based on Eq. (7), \(N_{i} (x,y)\) indicates spatial dependence, while \(h(t)\) reflects temporal ones. In an unsteady problem, the total time of simulation is divided into much little time steps (hereafter \({\text{d}}t\)) and simulation is carried out into each time step to relax the time dependency. Indeed, the unsteady problem is converted to many steady phases in which achieved answer from the previous step is used to simulate the new values. Time-steps size can significantly prevent the oscillations of numerical results in particular when limits to zero. Although some conducted studies in other fields have introduced criteria for time-step magnitude, it is better to perform an optimization process using trial and error to obtain the best time step in each numerical scheme. Hence, this study examined different values of time step to reflect its effect on the stability of numerical results in groundwater modeling.

Error threshold

Iterative methods consider a threshold for earned error (hereafter \(E_{C}\)) in each iteration to present the solution of linear equations produced by numerical methods. It is obvious that higher values of \(E_{C}\) involve more strictness in simulation and presents numerical results with more accuracy and stability, but how much strictness is necessary to obtain reliable results. Surely, more \(E_{C}\) needs more time and facilities as well as it raises computation costs increasingly. Hence, this study involved different error threshold in solving linear equations set to examine their effect on the consistency of numerical results.

Model setup

The employed plan of this study is described here to give a better understanding to reader. At first, the conceptual models of synthetic and real aquifers were constructed, and all information was converted to gridded data. We in this study follow the findings of Sadeghi-Tabas et al. (2017), Jafarzadeh et al. (2021a, b), to construct geological structure and to create the various parts of conceptual model including boundary conditions, surface recharge, extraction wells, and initial values. Then, the formulation of the FE numerical model was implemented as MATLAB code to simulate groundwater level. The effect of influencing factors was then examined by trial and error to find their best value. The quantification of oscillation was calculated through oscillation ratio (ratio of peak-to-trough incidence), used by (Pathak 1982; Dushoff et al. 2004), as follows:

$$O_{R} = \sum\limits_{i = 1}^{n} {\left( {\frac{{Y_{{{\text{peak}}}} }}{{Y_{{{\text{trough}}}} }}} \right)_{n} },$$
(18)

where n is number of peak-to-trough incidence, \(Y_{{{\text{peak}}}}\) is the peak that is more than before and after itself, and \(Y_{{{\text{trough}}}}\) is the lower than value occurred after \(Y_{{{\text{peak}}}}\).

Finally, using the optimum values of influencing factors the fluctuation of unsteady groundwater levels was numerically simulated through FE and compared with observational values to assess the accuracy of the proposed framework. The groundwater modeling in the unsteady state was accomplished during a hydrologic water year (from 23 October 2011 to 21 October 2012). Note that the groundwater numerical modeling of this study has been carried out as MATLAB open-source code and its validity has been previously addressed and confirmed in the studies by Jafarzadeh et al. (2021a, b). Figure 5 exhibits the used methodology in this study. The performance of numerical estimation was examined through RMSE (root-mean-square error). Equation (19) represents the definition of this criterion:

$${\text{RMSE}} = \sqrt {\frac{{\sum\nolimits_{i}^{n} {\left( {S_{p}^{i} - S_{a}^{i} } \right)}^{2} }}{n}},$$
(19)

where Sa and Sp represent analytical and simulated drawdown (m), respectively, and n indicates the number of data.

Fig. 5
figure 5

Representation of employed flow work of this study

Results

Here, we discuss the accuracy, convergence, and stability of numerical results influenced by components such as time-step size, scheme type, and error threshold and present the analysis results in separated factors and case studies.

Examination of scheme types effect

Stability results of FE simulations influenced by scheme types for piezometer location in both case studies are displayed in Fig. 6. In this experiment, simulation length was considered 30 days, and time-step size (\({\text{d}}t\)) as well as error threshold (\(E_{C}\)) was assumed constant (respectively, 1 day and 1e−4 m) to control their effect. As it is shown in Fig. 6a, numerical simulation at synthetic aquifer in the explicit scheme has been rapidly encountered a divergence, and as the simulation process continues the erratic behavior grows increasingly (1st panel). Illustration of the simulated potential head in the 2nd panel denotes that as the \(\alpha\) increases, the irregular temporal variations of numerical outputs become lower. Finally, the last panel shows that numerical simulation with \(\alpha = 0.3\) is associated with a light oscillation in initial time steps (as it is seen in subplot inserted in 3rd panel), while a relative stability may be obtained when \(\alpha\) is equal with or higher than 0.5. Therefore, simulation process at synthetic aquifer with prespecified time step and error threshold presented a convergence and consistency response, with \(\alpha \ge 0.5\).

Fig. 6
figure 6

Illustration of scheme type effect on the stability of numerical simulation at synthetic case (a) and field study (b)

The numerical simulation based on different values of \(\alpha\) is presented in Fig. 6b for four piezometers in the Birjand aquifer (reminder piezometers are not shown for brevity). The simulation duration, time step, and threshold error were similar to the synthetic case. The comparison results of numerical simulations based on the same scheme in two case studies indicate that obtaining stable results in a field study requires more challenge. It was resulted previously, in the synthetic test case numerical simulation based on \(\alpha = 0.3\) have relative stability, while results of FE model in the filed study have not sufficient consistency even in Crank–Nicolson (\(\alpha = 0.5\)). This point is related to the complex process of groundwater flow modeling in a real problem, where more complexities such as anisotropy and heterogeneity, more uncertainty sources, and our imperfect knowledge complicate simulation.

Another point that must be stated here is that the stability response of FE outputs is different between various piezometers even under the same scheme. For example, it is visible that numerical simulation has more oscillation in the Piez 98 while stability is obtained quicker and it may be achieved more conveniently in other piezometers. Therefore, it can be understood that the convergence and stability of numerical simulation have a spatial variability. This matter is not understood through stability criteria introduced by Remson et al. (1971) and Rushton and Redshaw (1979), because they did not consider spatial variability of hydrodynamic components.

Note results in this section revealed that for stable results, more attention must be paid to real case study (Birjand aquifer) than synthetic case; hence in other sections, only Birjand aquifer will be discussed.

Examination of time-step effect

The related results to effect of time-step size (\({\text{d}}t\)) on accuracy and stability of numerical simulation have been given in the proceeding. It should be noted that, to better display, the simulation process for only two piezometers of field study (Piez 60 and Piez 98) was displayed. Also, the values of \(E_{C}\) and simulation length were considered constant to fix their impacts (1e−4 m and 30 days, respectively). The stability of FE outputs under explicit mode is displayed in two first rows of Fig. 7, and other two rows show numerical results based on the Crank–Nicolson scheme. Further, the implicit-based simulation was displayed in the last column for better comparison. Based on obtained results, it can be deduced that explicit-based FE simulations need to slight time step to reach a stable state. Examination of stability in this scheme shows that although system response with \({\text{d}}t = 0.001\) day is stable, compared to implicit scheme it did not present an accurate solution. Indeed, explicit scheme requires that \({\text{d}}t \le 0.001\) days, and it increases time computations. However, results in Crank–Nicolson would converge and lead to a fine stable and accurate solution even with higher time steps (0.1 days).

Fig. 7
figure 7

Illustration of time-step effect on the numerical simulation in field study

Based on stability criteria presented by Rushton and Redshaw (1979), \({\text{d}}t\) for explicit scheme should be lower than or equal to 0.016 days at Piez 98 of real aquifer. However, the finding of this study confirmed that the \({\text{d}}t\) in this location must be lower than 0.001 days. Moreover, a comparison of results in different piezometers revealed that the magnitude of the \({\text{d}}t\) depends on spatial variability.

Examination of error threshold effect

To explain the contribution of error threshold (\(E_{C}\)), another experiment was designed in which \({\text{d}}t\) for each scheme was considered based on obtained results in the previous sections. Figure 8 exhibits results of numerical simulations stability influenced by \(E_{C}\) for explicit (first row), Crank–Nicolson (second row), and implicit (third row) schemes in piezometer Piez 60 where there was a noticeable oscillation. This figure shows that how the \(E_{C}\) improves the accuracy of numerical simulations. As it is seen, the increasing \(E_{C}\) from 1e−3 to 1e−4 m could enhance the FE outputs under the Crank–Nicolson scheme (first and second plots in the second row). A reasonable behavior of numerical simulation under the explicit scheme was achieved by reducing 10 and 100 times of \(E_{C}\) (three panels in the first row). Also, the last row of Fig. 8 confirms that the maximum \(E_{C}\) that can be considered in the implicit scheme is 0.001 m to have a stable simulation. For example, the stability of numerical outputs with \(E_{C}\) of 1e−5 has been obtained under Crank–Nicolson, while numerical simulation under explicit scheme with this \(E_{C}\) is not stable. Findings in this section reveal the severe importance contribution of this factor on the accuracy of numerical results. Therefore, this factor generally was overlooked almost in most studies, and other components such as \({\text{d}}t\) and scheme have obtained more attention.

Fig. 8
figure 8

Illustration of error threshold effect on numerical results in in Piez 60 piezometer of field study

Quantify the oscillation values

Here, the values of oscillation generated in groundwater fluctuations based on the different combinations of \({\text{d}}t\) and \(E_{C}\) are presented to show their effect on convergence. Table 1 represents the oscillation ratio (\(O_{R}\)) for Piez 98 piezometer in different scheme. Note, the phrase NaN indicates that \(O_{R}\) is extremely high resulting a divergence simulation (no answer is available), while the zero values denote stable situation. Also, the cells highlighted by light gray indicate the \(E_{C}\) of 1e−3 m, while the cells colored by normal and dark gray represent the \(E_{C}\) of 1e−5 and 1e−7 m. Indeed, the following table may be accounted for as a applicable guideline to select the right values of the influencing components to get a stable, convergence, and consistency simulation in the numerical application. Further, since the numerical simulation solution under the implicit scheme is always stable, it was ignored in this part.

Table 1 The results of oscillation ratio in different schemes, time interval, and error threshold in the Piez 98 piezometer of field study

The received results confirmed that \({\text{d}}t\) in numerical simulation under explicit scheme must be lower than 0.001 day to make a response with no oscillation. Also, groundwater simulations have no specific oscillation when \({\text{d}}t\) is lower than 0.1 day. Further, the result of this section properly indicates the \(E_{C}\) contribution in removing of oscillation (Fig. 9).

Fig. 9
figure 9

Illustration of oscillation incidence in numerical simulation under Crank–Nicolson scheme in the Piez 98 piezometer of field study

Also, a schematic illustration of simulated groundwater level fluctuations accompanied with \(O_{R}\) value is displayed in the figure.

Groundwater modeling

This section presents the performance results of FE applicability to simulate unsteady groundwater fluctuation for synthetic and real field study using obtained optimum values of influencing factor discussed above. Because numerical simulation in the explicit state requires more attention, the performance of finite elements in both aquifers is assessed here only based on the explicit scheme. The error threshold and time-step size in the Birjand aquifer were set to 1e−7 m and 0.001 day, respectively. Also, this setting for synthetic was 1e−4 m and 0.08 day, respectively, for error threshold and time-step size.

Figure 10 shows the simulated groundwater drawdown compared to analytical solution in the synthetic case study. In terms of RMSE criterion, it can be found that FE outputs are in very close agreement with analytical solutions especially in initial time steps of simulation (first 60 days).

Fig. 10
figure 10

Comparison of analytical solution versus simulated potential head at synthetic aquifer

Simulation of groundwater fluctuation in the real case study was accomplished initially in the steady state and its obtained answer was then used as initial values of unsteady state. Comparison of the measured and simulated potential head in the exciting piezometers of the Birjand aquifer in the steady state is shown in Table 2. Also, the values of performance criteria have been inserted in tow last rows. As shown, FE skill in simulating groundwater level in the steady state is very successful in terms of RMSE.

Table 2 Comparison results between simulated and observed potential head of piezometers at steady state

Here, the unsteady groundwater fluctuation simulated by FE was shown for some piezometers (other piezometers not shown for brevity). Figure 11 shows that FE numerically simulates a powerful prediction of groundwater level and it mimics the temporal fluctuations. Also, Table 3 represents the RMSE criterion for all piezometer of Birjand aquifer. It may be claimed that the numerical methods can produce temporal variations of surface recharge where rainfall has a direct effect on groundwater level (i.e., Piez 53, Piez 560, and Piez 760 piezometers). The vertical distance of groundwater level from ground surface in these observational wells is lower than Piez 631 piezometer (where groundwater level is so low) and it leads to different temporal pattern of fluctuations.

Fig. 11
figure 11

Observed versus simulated groundwater potential head at the Birjand aquifer

Table 3 RMSE criterion for all piezometers of Birjand aquifer

And finally, the distribution of spatial variability of the simulated potential head is displayed in Fig. 12 based on obtained stable results. The dominant groundwater flow direction in the Birjand aquifer is from east to west and southwest generally. Based on obtained results from the FE model, the maximum groundwater table was generated in the east area (1393 m) and it reduces gradually while moving to the west, so the minimum values were simulated in the southwest (1261 m). In this respect, the results of the current study have good agreement with those inferred by other studies including: Hamraz et al. (2015), Sadeghi-Tabas et al. (2017), Mohtashami et al. (2017), as well as Aghlmand and Abbasi (2019).

Fig. 12
figure 12

Illustration of spatial variability of potential head in Birjand aquifer

Conclusions

Realistic results of numerical simulation in groundwater modeling need to obtain stable, accurate, and convergence results. This paper is directed to assess the effect of influencing components involved with the stability of numerical results. The FE model was first implemented to simulate groundwater flow numerically. A numerical framework was then outlined to specify the role of influencing factors such as scheme type, time-step size, and error threshold on the stability of results. The stability of numerical simulation was tested in both synthetic and field case studies and the results are compared with analytical and observational values. The findings of the current study can be listed below: First, examination of FE outputs in two case studies and comparison of its results with analytical solution and observed head revealed that the developed model has the acceptable proficiency to provide groundwater fluctuations with various complex conditions. But, FE has some drawbacks oriented to the formulation process or geometry of the case study. FE needs to create a prespecified elements matrix across of aquifer domain. Further, the elements matrix changes for each case study, while a comprehensive framework has not been presented so far to give automatically the elements matrix for each case study. Hence, this study recommends to test an alternative such as meshless methods that has dealt with mentioned issues.

Second, examination of stability for obtained numerical results in two aquifers indicated that as the complexity of aquifer increases, obtaining stable results has more trouble ahead. By considering the same time-step size (1 day) in two aquifers, the system response with \(\alpha = 0.3\) was stable in the synthetic aquifer, while in the field study, FE simulation was not stable even in Crank–Nicolson (\(\alpha = 0.5\)) scheme.

Third, the examination of scheme type effect revealed that the FE simulations based on the closer schemes to explicit (\(\alpha = 0\)) are more sensitive to time step and error threshold. The size of time steps in the explicit scheme should be lower than or equal to 0.001 days to generate stable results in the real case study. However, in the Crank–Nicolson the values equal to or less than 0.1 days are required.

Fourth, the error threshold can significantly improve the accuracy of stable results. The findings of this study reveal that if error threshold reduces ten times reduction, numerical simulation can give a more realistic behavior under all schemes. Such that, the process of FE outputs under explicit scheme changed more reliable when the error threshold was reduced from 1e−5 to 1e−7 m.

Fifth, obtained results showed a spatial dependence of stability under all schemes and in both case studies. By considering the same values for influencing components, the stability behavior of numerical simulation is not the same as each piezometer.

Moreover, it was discussed in the current study that stability criteria introduced so far do not properly determine the upper or lower limits of influencing components for aquifers with complex conditions. Indeed, they have two major drawbacks:

First, they have not been specified for an unconfined aquifer.

Second, they were very simply formulated to consider the anisotropy and heterogeneity of influencing components.