1 Introduction

Understanding two-phase flow in porous media is of great importance in various scientific and engineering domains. Traditional models based on representative elementary volumes (REVs) offer a macroscopic understanding of fluid behavior, while fall short in capturing the pore-scale flow phenomena. Advancements in three-dimensional imaging techniques enable us to construct models which describe the pore geometry in more detail (Wildenschild et al. 2002; Arns et al. 2007). Various pore-scale models have been developed and found applications in diverse fields such as agriculture (Wu et al. 2023), CO\(_2\) sequestration (Kang et al. 2010), hydro-geology (Valvatne and Blunt 2004), and petroleum engineering (Aziz et al. 2020). By incorporating pore geometry information, these models provide valuable insights into the complex dynamics of two-phase displacement processes.

To simulate two-phase flow at the pore scale, several numerical methods have been developed, e.g., direct numerical simulation (DNS) (Mehmani and Tchelepi 2019), two-phase lattice Boltzmann methods (LBM) (Liu et al. 2014), smoothed particle hydrodynamics (SPH) (Kunz et al. 2016) and pore-network model (PNM) (Blunt 2001). In contrast to DNS, SPH and LBM which resolve the geometry of void spaces in porous medium explicitly, PNM conceptualizes the void spaces into geometrically simplified yet equivalent set of pore bodies and pore throats. As a result, compared with DNS, SPH and LBM which are computational demanding, PNM is highly computationally efficient (Yang et al. 2016).

Pore-network models can be categorized into quasi-static and dynamic models. For a quasi-static PNM, the fluid state of the network is computed under capillary pressure equilibrium, neglecting the effects of viscous forces. In contrast, a dynamic PNM resolves the transient process where both viscous and capillary effects play a role. For a dynamic PNM, there are two kinds of mathematical formulations, namely single-pressure formulation and two-pressure formulation. For single-pressure formulation, one pressure variable is employed at each pore body to represent both phases (Koplik and Lasseter 1985), whereas the two-pressure formulation, first introduced by Thompson (2002) to investigate the imbibition process in fibrous materials for water-air system, assigns a pressure for each phase in a pore body when two fluid phases coexist. In this work, we focus on the two-pressure formulation, which describes the effects of capillary forces within pore bodies and provides flexibility for representing realistic pore geometries in soils and rocks (Joekar-Niasar et al. 2010).

There have been several algorithms developed to solve the two-pressure dynamic PNM, including IMPES (implicit pressure and explicit saturation), IMP-SIMS (implicit pressure semi-implicit saturation) and FI (fully implicit) schemes. The IMPES scheme for PNM first solves the pressure field implicitly, and then updates the saturation explicitly. With IMPES scheme the numerical instability, i.e., “capillary pinning,” can be easily triggered when simulating flow near the quasi-static state for unfavorable displacement (Koplik and Lasseter 1985). The IMP-SIMS scheme for PNM developed by Joekar-Niasar et al. (2010) and Joekar-Niasar and Hassanizadeh (2011), first updates pressure implicitly, and then updates saturation semi-implicitly with an approximation of pressure gradient. However, mass conservation does not hold for IMP-SIMS due to the approximation of pressure gradient. Using implicit algorithms, on the other hand, the mass conservation is guarantied, and time-step size limitations are reduced (Hammond and Unsal 2012; Chen et al. 2020; An et al. 2020; Weishaupt et al. 2022. However, due to the possible abrupt change in fluid phase conductivity resulted by pore-scale phenomena occurring in the pore throat, implicit schemes face numeric challenges when Newton method is employed to solve the nonlinear system of equations. In such cases, stabilization methods are necessary to improve the numerical performance.

In this paper, we discuss the concepts and mathematical formulations of the pore-network model in Sect. 2. In Sect. 3, we analyze the numerical challenges existing in the implicit dynamic PNM schemes; based on this analysis, we then propose an enhanced fully implicit scheme using regularization (EFI-R) for dynamic PNM, which incorporates a strategy to regularize the discontinuity in the throat’s local conductivity of phases. Additionally, we provide a brief review of other implicit schemes used in pore-network modeling for the comparison with EFI-R developed in this study. We validate the proposed EFI-R scheme through numerical examples in Sect. 4, where we demonstrate its reliability and accuracy. Finally, we present our conclusions in Sect. 5.

2 Methods

In PNM, the void space of a porous medium is represented by pore bodies connected by pore throats. Figure 1 schematically shows two pore bodies connected by a pore throat and the related geometrical parameters. Pore networks can be generated using regular lattice-based, stochastic, or image-based methods (Ye et al. 2017). In this work, we focus on the numerical behavior of pore-network models. Thus, we use synthetic network generation algorithms and do not focus on the extraction from real porous medium samples. Detailed information about relevant pore network will be given when the numerical examples are discussed in Sect. 4.

Fig. 1
figure 1

Geometrical characteristics of pore bodies and pore throats. The wetting phase in pore bodies and pore throats is highlighted in blue, while the non-wetting phase in white. a Two pore bodies connected by a pore throat, filled by two fluid phases. The inscribed radius of pore body i is denoted as \(r_i\), the throat length as \(l_{ij}\), and the inscribed throat radius as \(r_{ij}\). b Square and circular throat cross sections with the same inscribed radius \(r_{ij}\). For a square pore throat, wetting layers can occur once the non-wetting phase invades the pore throat. The radius of the arc meniscus in the wetting layer is denoted as \(r_{am}\). The contact angle of wetting phase shown in this figure is assumed to be zero

2.1 Two-Pressure Formulation in PNM

To explicitly describe the pressure of each fluid phase and capillary effects within pore bodies, we focus on the two-pressure formulation. The physical assumptions used for the dynamic pore-network is the same as the one proposed by Joekar-Niasar et al. (2010), where it is assumed that the volume of pore throats is negligible compared with volume of pore bodies, and the hydraulic resistance to flow in the pore bodies is negligible compared to the pore throats. For each pore body in the network, it is filled with the wetting and/or the non-wetting fluid phase

$$\begin{aligned} S_{w,i} + S_{n, i} = 1\, \end{aligned}$$
(1)

where S represents saturation, the subscript w indicates wetting phase, n non-wetting phase and i refers to pore body i. In addition, the mass balance equation for each phase holds for each pore body.

$$\begin{aligned} V_i \displaystyle \frac{\text {d} \left( \rho _{\alpha , i} S_{\alpha ,i}\right) }{\text {dt}} + \sum _j\left( \rho _\alpha Q_\alpha \right) _{ij} =V_i q_{\alpha ,i}\, \end{aligned}$$
(2)

where \(V_i\) represents the volume of pore i, \(\rho _{\alpha , i}\) the density of phase \(\alpha\) in pore i. \(Q_{\alpha , ij}\) represents the volume flux in throat ij, and \(q_{\alpha ,i}\) is the source or sink term related to pore body i. The volume flux \(Q_{\alpha , ij}\) at pore throat ij can be calculated with Poiseuille equation.

$$\begin{aligned} Q_{\alpha , ij} = g_{\alpha , ij} \left( p_{\alpha , i}- p_{\alpha , j} \right) , \end{aligned}$$
(3)

where \(g_{\alpha ,ij}\) is the local conductivity at pore throat ij, \(p_{\alpha , i}\) and \(p_{\alpha ,j}\) are the pressures of fluid phase \(\alpha\) at pore bodies i and j, respectively. Creeping flow is assumed, where the Reynolds number is small, and the inertial term is negligible. Otherwise, the flux \(Q_{\alpha , ij}\) considering the inertial term is formulated by Sorbie et al. (1995).

The two-pressure formulation assumes that each phase is assigned with a pressure, and the pressure difference between non-wetting phase and wetting phase at each pore body is defined as pore-local capillary pressure

$$\begin{aligned} p_{c,i} = p_{n,i} - p_{w,i}, \end{aligned}$$
(4)

which can be described as a function of pore-local saturation

$$\begin{aligned} p_{c,i} = f\left( S_{w, i} \right) . \end{aligned}$$
(5)

In addition, the previously mentioned throat conductivity \(g_{\alpha, ij}\) is determined by the local curvature radius of the throat, which is a function of throat-local capillary pressure \(p_{c,ij}\) defined as a function of capillary pressures at pore bodies i and j:

$$\begin{aligned} g_{\alpha, ij} = f \left( p_{c,ij} \right) = f \left( p_{c,i}, \ p_{c,j} \right) . \end{aligned}$$
(6)

Equations (5) and (6) are constitutive relations which close the system of equations. In addition, these local rules describe pore throat-local phenomena, which will be discussed in detail in Sect. 2.2.

2.2 Local Rules

Local rules are constitutive relations applied locally for each pore body and pore throat, which enables the model to simulate pore-scale phenomena. In addition, they are closure relations which are necessary to obtain a well-posed system of equations.

2.2.1 Pore-Local Capillary Pressure

At each pore body, the local capillary pressure is a function of the pore geometry and the pore-local saturation. It is assumed that the local equilibrium of capillary pressure between a pore body and its neighboring pore throat(s) can be built due to the slow flow velocity. However, the pore-local capillary pressure–saturation relation derived from the above assumption is not monotone. Considering a drainage process in a pore body initially filled with wetting phase, once the non-wetting phase enters the pore body, the radius of curvature of the interface between the two phases is small, giving a high capillary pressure. By decreasing the wetting phase saturation, the curvature decreases, which results in decreasing of the capillary pressure. Such a decreasing trend in the capillary pressure continues until the non-wetting phase touches the wall of the pore body and pushes the wetting phase into the corners. Then, the capillary pressure starts to increase again. Using the simplified approach introduced by Joekar-Niasar et al. (2010), assuming that the non-wetting phase entering the pore body touches the pore body walls in an instant, the pore-local capillary pressure–saturation relation can be formulated as a monotonic relation

$$\begin{aligned} p_{c, i} = \displaystyle \frac{2 \gamma }{r_{i} \left( 1-\exp {\left( -6.83 S_{w,i} \right) } \right) }, \end{aligned}$$
(7)

where \(\gamma\) is the interfacial tension.

During the imbibition process, two important phenomena are of great importance: cooperative pore filling and snap-off. Cooperative pore filling dominates when the ratio of pore body to pore throat radius is small, which results an interface with larger curvature radius bridging over several throats and an efficient displacement of non-wetting fluid (Joekar Niasar et al. 2009). In contrast, when the ratio of pore throat radius to pore body radius is small and the interface remains within a pore body, snap-off event occurs when a sufficient amount of wetting phase accumulates at the throats, following by swelling of the wetting layers, which eventually connect to each other and block the throat within an instant. In this work, we neglect cooperative pore filling effect.

We propose a simplified pore-local capillary pressure–saturation curve for simulating the imbibition process. We assume that the pore-local capillary pressure approximates to zero when the pore is going to be fully imbibed (\(S_{w,i} \rightarrow 1\)). This adjustment is based on the fact that when the non-wetting phase exits the pore, the interface disappears, resulting in a capillary pressure of zero. When the pore is only partially imbibed, we treat the imbibition process as the reverse of the drainage. In practice, we modify the high wetting saturation region of the drainage curve such that the capillary pressure becomes zero at \(S_{w,i} = 1\) and then utilize this modified curve as the imbibition curve. An example of pore-local capillary pressure and saturation relations for drainage and imbibition processes is shown in Fig. 2.

It is important to note that although the imbibition and drainage curves employed in this study provide only an approximation of the real \(p_{c,i}-S_{w,i}\) relationship, they can still be utilized to simulate both drainage and imbibition processes (Joekar-Niasar et al. 2010). During the drainage process, when the upstream non-wetting phase attains a sufficient amount (i.e., when \(S_{w,i}\) is low), a capillary pressure capable of overcoming the resistance within the pore throat would result in an invasion event. In the case of imbibition, when there is a substantial presence of wetting phases in the upstream pore (i.e., when \(S_{w,i}\) is sufficiently high), a low capillary pressure would lead to the occurrence of a snap-off event. These two pore-scale phenomena (i.e., invasion and snap-off), inherent to drainage and imbibition processes, will be considered in our model and thoroughly discussed in the Sect. 2.2.2.

Fig. 2
figure 2

Pore-local capillary pressure curves for drainage and imbibition processes. The pore has a cubic shape, where pore radius \(r_i = 200\) \(\upmu\)m. The interfacial tension \(\gamma =0.0725\) \(\hbox {N}\,\hbox {m}^{-1}\). The region of \(S_w \in [0.9, 1]\) is approximated with a monotone spline connecting \(p_{c,i}(S_{w, i} = 0.9)\) and 0

2.2.2 Invasion and Snap-Off

For the drainage process at pore scale, an important event is the invasion of a pore throat by the non-wetting phase, replacing the wetting phase. To determine if a pore throat is invaded, we choose the maximum capillary pressure of the two neighboring pore bodies and compare it with the pore throat entry capillary pressure. Following Lenormand et al. (1988), when the maximum capillary pressure is higher than the throat entry pressure, the throat is invaded by the non-wetting phase. The entry pressure of a pore throat is a function of its shape and radius, surface tension, as well as the contact angle. The entry capillary pressure can be expressed as

$$\begin{aligned} p_{c,entry} = \displaystyle \frac{\gamma }{r_{ij}} \cos \theta \left( 1 + 2 \sqrt{\pi G}\right) F, \end{aligned}$$
(8)

where \(\theta\) is the static contact angle. G is the shape factor, which represents the simplified throat geometry and is defined as the throat cross-sectional area \(A_\text {tot}\) divided by the square of its perimeter P:

$$\begin{aligned} G = \displaystyle \frac{A_\text {tot}}{P^{2}}. \end{aligned}$$
(9)

A pore throat can be idealized as triangle if \(0< G < \sqrt{3}/36\), as square if \(G = 1/16\), and as circle if \(G = \pi /4\) (Valvatne and Blunt 2004). In Eq. (8), factor F is given by (Mason and Morrow 1991; Ma et al. 1996):

$$\begin{aligned} F = \displaystyle \frac{1+\sqrt{1 + \displaystyle \frac{4GD}{\cos ^2 \theta }}}{1+2\sqrt{\pi G}}, \end{aligned}$$
(10)

where

$$\begin{aligned} D = \pi - 3 \theta + 3 \sin \theta \cos \theta - \displaystyle \frac{\cos ^2 \theta }{4G}\ . \end{aligned}$$
(11)

For a local imbibition process, we compare the minimum capillary pressures of the two neighboring pores with the snap-off capillary pressure to determine if snap-off event occurs. The snap-off capillary pressure can be calculated as (Blunt 2017):

$$\begin{aligned} p_{c,snap-off} = \displaystyle \frac{\gamma \cos \theta _a}{r_{ij}} \left( 1-\tan \theta _a\tan \beta \right) , \end{aligned}$$
(12)

with the advancing contact angle \(\theta _a\) and the corner half-angle \(\beta\).

However, solely measuring the current capillary pressure and comparing with the threshold value to decide whether an invasion or snap-off event would occur at the pore throat is insufficient. Considering a scenario wherein two connected pore bodies, with one exhibiting a local capillary pressure higher than the entry pressure, while the other having a local capillary pressure lower than the snap-off threshold. In such circumstance, deciding whether an invasion or snap-off event is triggered solely based on the current capillary pressure is not possible. It is necessary to also refer to the history of the pore throat phenomena to capture the evolving dynamics. That means we should look if the pore throat has already been invaded or not. If the throat has not been invaded and the current capillary pressure exceeds the entry capillary pressure of the throat, invasion will occur, transitioning the throat from being filled with a single-phase wetting phase to being filled with a two-phase liquid. However, if the throat has already been invaded (two-phase), the current capillary pressure needs to be compared with the snap-off capillary pressure. If the current capillary pressure is lower than the snap-off pressure, snap-off phenomenon will occur, resulting in the swelling and contact of the wetting layers, filling the entire throat. The flow inside the throat changes from two-phase to single wetting phase. By taking the historical state of the throat into account, it becomes clear whether an invasion or imbibition process is occurring. Figure 3 illustrates the decision-making process in our EFI-R scheme. Employing this decision-making approach could lead to alternating snap-off and invasion events, i.e., a pore throat is invaded in a time step and followed by a snap-off event in the next time step. For instance, the following behavior could occur that after a pore throat is invaded, the saturation of the non-wetting phase in the connected pore body increases slightly. In the next time step, if the capillary pressure of this pore body is smaller than the snap-off capillary pressure, snap-off occurs in the pore throat. This cycle continues until either invasion or snap-off prevails and the throat reaches a stable invasion state. This process can be computationally expensive, a pragmatic solution in this case could be setting a threshold, e.g., \(S_{n,\epsilon } = 0.1 \%\) of non-wetting phase saturation in the invaded pore, meaning that snap-off events are only considered when a pore is invaded with certain amount of non-wetting phase fluid.

Fig. 3
figure 3

Decision-making for invasion and snap-off events. The occurrence of invasion and snap-off events is determined by the historical state and the current capillary pressure of the throat. a An invasion event, b a snap-off event

2.2.3 Throat-Local Conductance–Capillary Pressure Relations

We use the single-phase throat conductivity derived by Patzek and Silin (2001) if there is only one phase presenting in the pore throat:

$$\begin{aligned} g_{ij}= \displaystyle \frac{k_G A_\mathrm {tot}^{2}G}{\mu l_{ij}}, \end{aligned}$$
(13)

where \(k_G\) is a throat-shape-dependent proportionality constant which gives the values of 0.5 for circles, 0.5623 for squares, and 0.6 for equilateral triangles, \(\mu\) the dynamic viscosity.

In a case that there are two phases coexisting in a throat, the throat-local conductance of each phase is a function of both throat geometry and throat-local capillary pressure. In this case, the wetting phase sticks to the corners of the throat, while the non-wetting phase occupies bulk void space in the middle. It should be noted that such behavior can only occur in pore throats with angular cross-section shape. The conductivity of the wetting phase, i.e., wetting layer conductivity, can be calculated using the expression proposed by Ransohoff and Radke (1988):

$$\begin{aligned} g_{w,ij} = \displaystyle \frac{r_{am}^2}{\mu _w l_{ij}} \sum _{\Lambda = 1}^{n_{corner}} \displaystyle \frac{A_{w,\Lambda }}{\xi _\Lambda }, \end{aligned}$$
(14)

where \(\mu _w\) is the dynamic viscosity of wetting phase, \(n_{corner}\) the number of corners at the throat where wetting phase is present, \(A_{w,\Lambda }\) the wetting phase area at corner \(\Lambda\), \(\xi _\Lambda\) the dimensionless resistance factor which can be either numerically computed or analytically approximated using the method introduced by Zhou et al. (1997).

For throat conductivity of the non-wetting phase, we use the throat conductivity formula given by Bakke and Øren (1997) and Tørå et al. (2012):

$$\begin{aligned} g_{n, ij} = \displaystyle \frac{r_{eff}^{2}A_{n,ij}}{8 \mu _n l_{ij}}, \end{aligned}$$
(15)

where \(A_{n,ij}\) is the cross-sectional area occupied by non-wetting fluid, \(\mu _n\) the dynamic viscosity of non-wetting fluid and \(r_{eff}\) the effective radius of the non-wetting phase defined as (Blunt 1997):

$$\begin{aligned} r_{eff} = \displaystyle \frac{1}{2} \left( \sqrt{\displaystyle \frac{A_{n,ij}}{\pi }} + r_{ij} \right) \ . \end{aligned}$$
(16)

We distinguish between the local drainage and imbibition process for pore throat conductivity of each fluid phase. For a drainage process, the throat was not invaded and was filled with wetting phase initially, the non-wetting fluid replaces the wetting phase, e.g., the interface moves from pore body i toward pore body j. Before the capillary pressure at the pore body i reaches the entry pressure, the conductivity of the wetting phase is equal to single-phase throat conductivity which should be calculated using Eq. (13), while the non-wetting phase conductivity is zero. After the capillary pressure reaches the entry pressure, two phases flow through the pore throat and wetting and non-wetting throat conductivity should be calculated using Eqs. (14) and (15), respectively. We use superscript dr to denote a drainage process and define \(p_{c,ij}^{dr} = \max \left( p_{c,i}, p_{c,j} \right)\), the throat conductivity is then formulated as:

$$\begin{aligned} g_{w,ij}^{dr}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{dr} < p_{c,entry} \\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{dr} \ge p_{c,entry} \end{array}\right. } \end{aligned}$$
(17)
$$\begin{aligned} g_{n,ij}^{dr}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{dr} < p_{c,entry} \\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{dr} \ge p_{c,entry}. \end{array}\right. } \end{aligned}$$
(18)

An example of the throat conductivity computed by Eqs. (17) and (18) during a drainage process is shown in Fig. 4a.

For an imbibition process, considering a throat that has been invaded by the non-wetting phase and the conductivity of wetting and non-wetting phase is calculated using Eqs. (14) and (15), respectively. When snap-off event happens, the wetting phase layers in the corners of the throat touch each other and fill the throat instantaneously. Thus, single-phase conductivity is used as the wetting phase conductivity, which is calculated by Eq. (13) and the conductivity of non-wetting phase becomes zero. We use superscript im to indicate an imbibition process and define \(p_{c,ij}^{im} = \min \left( p_{c,i}, p_{c,j} \right)\), then the throat conductivity can be formulated as:

$$\begin{aligned} g_{w,ij}^{im}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{im}\le p_{c,snap-off} \\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{im} > p_{c,snap-off} \end{array}\right. } \end{aligned}$$
(19)
$$\begin{aligned} g_{n,ij}^{im}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{im}\le p_{c,snap-off} \\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{im} > p_{c,snap-off}. \end{array}\right. } \end{aligned}$$
(20)

An example of the throat conductivity calculated by Eqs. (19) and (20) during an imbibition process is shown in Fig. 4b. During the imbibition process, the non-wetting phase conductivity is continuous decreasing close to the \(p_{c,snap-off}\) due to the influence of corner flow.

Figure 4 shows the hysteresis effect of the throat-local conductivity depending on the displacement process. It can also be seen that the conductivity experience abrupt changes (discontinuities) when \(p_{c,entry}\) or \(p_{c,snap-off}\) is reached.

Fig. 4
figure 4

Throat conductivity \(\mathbf {g}_{\varvec{\alpha }, \mathbf {ij}}\) at throat \(\mathbf {ij}\) over throat-local capillary pressure \(\mathbf {p_{c,ij}}\) for drainage and imbibition processes. a \(g_{ij}-p_{c,ij}\) curve for the drainage process, b \(g_{ij}-p_{c,ij}\) curve for the imbibition process. With dynamic viscosities of both wetting and non-wetting phase 0.001 \(\hbox {Pa}\,\hbox {s}\), throat radius \(r_{ij} = 100\) \(\upmu\)m and throat length \(l_{ij} = 100\) \(\upmu\)m

3 Numerical Algorithms

3.1 Fully Implicit Scheme

We introduce the enhanced fully implicit scheme using regularization (EFI-R) as a novel approach for dynamic PNM. System (2) is discretized with an implicit Euler scheme but any other implicit time discretization method could also be applied. This does not affect the presented regularization strategy. The adoption of a fully implicit approach enables us to overcome the limitations encountered in IMPES and IMP-SIMS schemes, characterized by mass conservation errors and restrictions on time-step sizes. Moreover, employing a fully implicit framework facilitates the coupling of the pore network with a free flow (Weishaupt et al. 2019). Nevertheless, opting for the fully implicit algorithm with the widely employed Newton method as the nonlinear solver introduces numerical challenges due to the discontinuity of the fluid conductivity discussed in Sect. 2.2.3.

3.2 Numerical Challenges

To approximate the solution at time \(t^{k+1}\), given the solution of the previous time step \(t^{k}\), the commonly used Newton method solves the following system of equations within each nonlinear iteration loop, e.g., m-th iteration:

$$\begin{aligned} J^{m,k+1} \Delta u ^{m,k+1} = R(u^{m,k+1})\, \end{aligned}$$
(21)

where J is the Jacobian matrix defined as the derivative of residual \(R^{m,k+1}\) with solution vector \(u^{m,k+1}\) of iteration m at time step \(\Delta t^{k+1}\), i.e., (\(p_w^{m,k+1}, S_n^{m,k+1}\)):

$$\begin{aligned} J^{m,k+1} = \displaystyle \frac{\partial R(u^{m,k+1})}{\partial u^{m,k+1}} \end{aligned}$$
(22)

Inserting Eq. (3) into Eq. (2), the residual of iteration m can be written as:

$$\begin{aligned} R(u^{m,k+1}) = V_i \displaystyle \frac{ (S_{\alpha , i}^m \rho _{\alpha , i}^m)^ {k+1} - (S_{\alpha , i} \rho _{\alpha , i})^k}{\Delta t^{k+1}} - \displaystyle \sum _j^{n_j} \left( { g_{\alpha , ij}^{m,k+1} \left( p_{\alpha , i}^{m,k+1}- p_{\alpha , j}^{m,k+1} \right) } \right) - q_{\alpha , i}^{m,k+1}. \end{aligned}$$
(23)

With the invasion and snap-off decision-making process introduced in Sect. 2.2.2, if the throat was not invaded during the time step \(\Delta t^k\), the throat-local conductivity \(g_{\alpha , ij}^{m,k+1}\left( p_{c,i}^{m,k+1}, p_{c,j}^{m,k+1} \right)\) at iteration m for time step \(\Delta t^{k+1}\) can be written as

$$\begin{aligned} g_{w,ij}^{dr, m, k+1}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{} \text {if } \ p_{c,ij}^{dr, m,k+1}< p_{c,entry} \\ \text {Evaluated by Eq.}\,(14), &{} \text {if } \ p_{c,ij}^{dr, m,k+1} \ge p_{c,entry} \end{array}\right. } \end{aligned}$$
(24)
$$\begin{aligned} g_{n,ij}^{dr,m, k+1}= & {} {\left\{ \begin{array}{ll} 0, &{} \text {if } \ p_{c,ij}^{dr, m, k+1} < p_{c,entry} \\ \text {Evaluated by Eq.}\,(15), &{} \text {if } \ p_{c,ij} ^ {dr, m, k+1} \ge p_{c,entry} \end{array}\right. } \end{aligned}$$
(25)

, which is the implicit discrete form of Eq. (17) and Eq. (18). If the throat has been invaded at time \(t^k\), then for time step \(\Delta t^{k+1}\), the throat-local conductivity is formulated as

$$\begin{aligned} g_{w,ij}^{im,m,k+1}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{} \text {if } \ p_{c,ij}^{im, m, k+1} \le p_{c,snap-off} \\ \text {Evaluated by Eq.}\,(14), &{} \text {if } \ p_{c,ij}^{im, m, k+1} > p_{c,snap-off} \end{array}\right. } \end{aligned}$$
(26)
$$\begin{aligned} g_{n,ij}^{im, m, k+1}= & {} {\left\{ \begin{array}{ll} 0, &{} \text {if } \ p_{c,ij}^{im, m, k+1} \le p_{c,snap-off} \\ \text {Evaluated by Eq.}\,(15), &{} \text {if } \ p_{c,ij}^{im, m, k+1} > p_{c,snap-off} \end{array}\right. }, \end{aligned}$$
(27)

which is the discrete form of Eqs. (19) and (20).

Since the residual \(R(u^{m,k+1})\) contains the term \(g_{\alpha , ij}^{m,k+1}\left( p_{c,i}^{m,k+1}, p_{c,j}^{m,k+1} \right)\), derivatives of \(g_{\alpha , ij}^{m,k+1}\) with respect to primary variables need to be calculated for determining the Jacobian matrix \(J^{m,k+1}\). When an invasion event is going to happen in the current time step \(\Delta t^{k+1}\), the derivative of \(g_{\alpha , ij}^{m,k+1}\) with respect to the primary variable \(S_n^{m, k+1}\) is undefined at the discontinuity (see Fig. 4). When approximating it numerically (difference approximations), it yields to an ill-conditioned Jacobian matrices and finally leads to convergence issues.

The previously proposed implicit schemes for dynamic PNM handle this numerical challenge by not incorporating the discontinuity in the throat conductivity relation implicitly. In the following, we analyze the fully implicit scheme proposed by Weishaupt et al. (2022) and Chen et al. (2020) as an example. In both schemes, the maximum capillary pressure between pore bodies i and j \(p_{c,ij}^{dr}\) is utilized for comparison with both \(p_{c,entry}\) and \(p_{c,snap-off}\) to determine the occurrence of invasion and snap-off events.

The fully implicit scheme proposed by Weishaupt et al. (2022) updates the invasion state (i.e., whether a pore throat is invaded or not) at the end of each iteration. This means the throat conductivity at the current iteration m for the time step \(\Delta t^{k+1}\) is formulated as:

$$\begin{aligned} g_{w,ij}^{m, k+1}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{dr, m-1,k+1} < p_{c,snap-off} \\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{dr, m-1,k+1} \ge p_{c,snap-off} \end{array}\right. } \end{aligned}$$
(28)
$$\begin{aligned} g_{n,ij}^{m, k+1}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{dr, m-1, k+1} < p_{c,entry} \\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{dr, m-1, k+1} \ge p_{c,entry}. \end{array}\right. } \end{aligned}$$
(29)

Since discontinuity does not exist in Eqs. (13), (14), constant value zero and Eq. (15), employing such a strategy for calculating throat conductivity offers an alternative approach to avoid the approximation of the derivatives at the discontinuity existing in the throat-local conductivity curve. However, this strategy presents three deficiencies. Firstly, utilizing \(p_{c,ij}^{dr} = \max \left( p_{c,i}, p_{c,j} \right)\) to compare with \(p_{c,snap-off}\) would underestimate the occurrence of snap-off, which should instead be determined based on the minimum capillary pressure between two neighboring pores. Secondly, the loss of historical throat state information hindering a correct description of the throat conductivity for each phase used in the current time step. Lastly, when utilizing larger time steps, the invasion state in the current state is not updated in time. If this error persists until convergence is reached, the invasion state of the throat will be incorrectly determined.

Chen et al. (2020) employs an alternate strategy in their fully implicit scheme, the throat conductivity in his scheme is expressed as follows:

$$\begin{aligned} g_{w,ij}^{m, k+1}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{} \text {if } \ p_{c,ij}^{dr, m,k+1}< p_{c,entry}\,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1}> p_{c,snap-off}\\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{dr, m,k+1} \ge p_{c,entry}\,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1}> p_{c,snap-off}\\ \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{dr, m, k+1} \le p_{c,snap-off} \,{ \& \& }\, p_{c,ij}^{m-1, k+1}< p_{c,entry}\\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{dr, m, k+1} > p_{c,snap-off} \,{ \& \& }\, p_{c,ij}^{m-1, k+1} < p_{c,entry} \end{array}\right. } \end{aligned}$$
(30)
$$\begin{aligned} g_{n,ij}^{m, k+1}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{dr, m, k+1}< p_{c,entry} \,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1}> p_{c,snap-off}\\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{dr, m, k+1} \ge p_{c,entry} \,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1}> p_{c,snap-off}\\ 0, &{}\text {if } \ p_{c,ij}^{dr, m, k+1} \le p_{c,snap-off} \,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1}< p_{c,entry}\\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{dr, m, k+1} > p_{c,snap-off}\,{ \& \& }\, p_{c,ij}^{dr, m-1, k+1} < p_{c,entry}. \end{array}\right. } \end{aligned}$$
(31)

Although employing a distinct strategy, this algorithm shares similar shortcomings with the scheme proposed by Weishaupt et al. (2022). Firstly, it also underestimates the occurrence of snap-off events. Secondly, this approach also does not record the historical invasion state of the throat at the time \(t^k\). It appears that the invasion state from the iteration \(m-1\) is erroneously regarded as the historical invasion state. In our opinion, it is physical that the invasion state at time \(t^k\) would determine the conductivity curve in the next time step, but the invasion state at previous iteration should not determine the conductivity curve used in the next iteration. Lastly, in this scheme, decision making done in each iteration loop is based on a decision made in the previous iteration. When no time-step size controlling or appropriate damping strategy is employed, a possible wrong decision, made in an early iteration step and caused by an unconverged solution, could remain incorrect in the following iteration steps. For example, if a throat is decided as invaded at iteration m, and the capillary pressure is between entry pressure and snap-off pressure at iteration \(m+1\), the throat would be decided as invaded at iteration \(m+1\) based on the invasion decision made at iteration m; however, the invasion decision at iteration m might be wrong since the solution is not converged yet.

Based on the aforementioned analysis, it is evident that the discontinuity in the throat-local conductivity curve results in convergence issues when employing a Newton solver to solve the two-pressure formulation. To address this challenge, we propose in this paper an EFI-R (enhanced fully implicit scheme using regularization) for the dynamic PNM. The primary objective of the presented regularization strategy is to smooth the jumps observed in the conductivity curve, thereby enhancing the reliability of our results and improving the efficiency of the algorithm.

3.3 Regularization

We present a regularization strategy addressing the numerical challenges associated with throat conductivity discontinuities. Specifically, the jump in the throat-local conductivity in terms of capillary pressure is smoothed using a monotonic piece-wise cubic polynomial that is twice continuously differentiable.

In the two-phase pore-network model, the conductivity is calculated based on the historical invasion state and current capillary pressure. In the context of throat conductivity hysteresis, we discuss the regularization of conductivity curves in two distinct scenarios: drainage and imbibition.

For a drainage process, we denote the interval of \(p_{c,ij}\) where we utilize regularization as \(\left[ p_{c,reg, left}^{dr}, p_{c,reg,right}^{dr} \right]\). The discontinuity of Eqs. (17) and (18) is smoothed and formulated as:

$$\begin{aligned} g_{w,ij}^{dr}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{dr} \le p_{c,reg, left}^{dr} \\ g_{w, MS}^{dr}, &{}\text {if } \ p_{c,reg, left}^{dr} < p_{c,ij}^{dr} \le p_{c, reg, right}^{dr}\\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{dr} > p_{c, reg, right}^{dr} \end{array}\right. } \end{aligned}$$
(32)
$$\begin{aligned} g_{n,ij}^{dr}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{dr}< p_{c,reg, left}^{dr}. \\ g_{n, MS}^{dr}, &{}\text {if } \ p_{c,reg, left}^{dr} < p_{c,ij}^{dr} \le p_{c, reg, right}^{dr}\\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{dr} > p_{c, reg, right}^{dr} \end{array}\right. } \end{aligned}$$
(33)

where we choose \(p_{c,reg, left}^{dr} = p_{c,entry}\). We use \(g_{w, MS}^{dr}\) and \(g_{n, MS}^{dr}\) to denote the smoothed curve used to regularize the conductivity law, where the subscript “MS” indicates the monotonic spline. In this case, there is no non-wetting flux in the throat before capillary pressure reaches \(p_{c,entry}\). Since \(p_{c,ij}^{dr} = \max \left( p_{c,i}, p_{c,j} \right) = f (S_{w,i}, S_{w,j})\). The regularization interval can also be written in terms of saturation of the pore which triggers the invasion event \(\left[ S_{w,reg,left}^{dr}, S_{w,reg,right}^{dr} \right]\), where \(S_{w,reg,left}^{dr}\) and \(S_{w,reg,right}^{dr}\) are determined by Eq. (7) as an inverse function of capillary pressure. The saturation values range between 0 and 1, thus, formulated in this way, the regularization interval is also normalized, which allows to better quantify the length of the regularization interval. We introduce a new measure \(\epsilon ^{dr} = S_{w, reg, right}^{dr}- S_{w,reg,left}^{dr}\) and denote \(\epsilon ^{dr}\) as regularization interval length for a drainage process. An example is shown in Fig. 5.

Fig. 5
figure 5

Regularized throat conductivity at throat \(\mathbf {ij}\) over throat-local capillary pressure \(\mathbf {p_{c,ij}}\) for a drainage process. Regularization employed on the conductivity law for a drainage case, using the same pore throat geometry as Fig. 4. The dashed lines represent pore throat conductivity without regularization, while the solid lines represent the regularized conductivity where the regularization interval length \(\epsilon ^{dr} = 0.05\)

For imbibition, we regularize the region \(\left[ p_{c,reg,left}^{im}, p_{c,reg, right}^{im}\right]\) and we choose \(p_{c,reg, right}^{im} = p_{c,snap-off}\). The regularized throat conductivity for an imbibition process can be written as:

$$\begin{aligned} g_{w,ij}^{im}= & {} {\left\{ \begin{array}{ll} \text {Evaluated by Eq.}\,(13), &{}\text {if } \ p_{c,ij}^{im} \le p_{c,reg,left}^{im} \\ g_{w, MS}^{im}, &{}\text {if } \ p_{c,reg,left}^{im} < p_{c,ij}^{im} \le p_{c,reg, right}^{im}\\ \text {Evaluated by Eq.}\,(14), &{}\text {if } \ p_{c,ij}^{im} > p_{c,reg, right}^{im} \end{array}\right. } \end{aligned}$$
(34)
$$\begin{aligned} g_{n,ij}^{im}= & {} {\left\{ \begin{array}{ll} 0, &{}\text {if } \ p_{c,ij}^{im} \le p_{c,reg,left}^{im} \\ g_{n, MS}^{im}, &{}\text {if } \ p_{c,reg,left}^{im} < p_{c,ij}^{im} \le p_{c,reg, right}^{im}\\ \text {Evaluated by Eq.}\,(15), &{}\text {if } \ p_{c,ij}^{im} > p_{c,reg, right}^{im}. \end{array}\right. } \end{aligned}$$
(35)

Similar to drainage process, the regularization interval for an imbibition process can also be written in terms of saturation of the pore which triggers snap-off event \(\left[ S_{w,reg,left}^{im}, S_{w,reg,right}^{im} \right]\). We define \(\epsilon ^{im} = S_{w, reg, right}^{im}- S_{w,reg,left}^{im}\) as regularization interval length for an imbibition process. For simplicity, we would choose the same regularization interval length for drainage and imbibition processes in this paper and denote the regularization interval length as \(\epsilon\), where \(\epsilon = \epsilon ^{dr} = \epsilon ^{im}\).

Employing such regularization strategies to the system prevents over- and undershoots of saturation. The physical saturation bounds are guaranteed without chopping strategies.

4 Numerical Results

We validate our proposed enhanced fully implicit scheme using regularization (EFI-R) of PNM through three numerical experiments and compare it with the fully implicit scheme (FI) proposed by Weishaupt et al. (2022). In order to investigate the influence of time-step size, the time-step size controlling strategy, i.e., accuracy check which is an invasion state check criterion, is not employed as default, because one of the reasons of using an implicit pore-network model is to overcome the constraint of small time steps. Both FI and EFI-R schemes and the presented numerical examples are implemented in DuMux, an open-source simulator for flow and transport in porous media (Koch et al. 2021).

The first experiment involves conducting drainage and imbibition experiments on a one-dimensional pore network. We investigate the influence of time-step size, as well as the numerical convergence of the proposed method. The second numerical example is a full drainage scenario on a three-dimensional unstructured pore network. Various global pressure differences are assigned to the inlet and outlet of the pore network as boundary conditions, and we compare the equilibrium states calculated from our EFI-R scheme with the results obtained from the static PNM. The final experiment focuses on a partial drainage scenario. By comparing the results of EFI-R and FI, we investigate the robustness of our scheme in terms of time-step sizes.

4.1 One-Dimensional Verification Case

We consider a one-dimensional hydrophilic pore network, which consists of 10 cubic pore bodies, each with the same pore body size, i.e., the inscribed radius of the square cross-section of 200 \(\upmu\)m. These pores are connected by throats, each having an inscribed radius of 100 \(\upmu\)m.

4.1.1 Drainage Case

We consider an incompressible two-phase system, where both wetting and non-wetting phases have a density of 1000 \(\hbox {kg}\,\hbox {m}^{-3}\). Three different viscosity ratios M = 10, M = 1 and M = 0.1 are investigated, where M is defined as the ratio between invading to receding dynamic fluid viscosity, i.e., \(\mu _n / \mu _w\). The viscosity ratios are varied by changing the non-wetting viscosity, while the wetting phase dynamic viscosity is set to \(\mu _w = 0.001\) \(\hbox {m}^{2}\,\hbox {s}^{-1}\) for all three cases. The network is initially filled with the wetting phase. A non-wetting fluid is injected at the left inlet of the pore network with a fixed mass flux of \(5\times 10^{-8}\) \(\hbox {kg}\,\hbox {s}^{-1}\). At the outlet, the pressure of wetting phase is given as 1 bar, and the non-wetting phase saturation is zero. We run the simulation for 5 s. The interfacial tension between the wetting and non-wetting phase is 0.725 \(\hbox {N}\,\hbox {m}^{-1}\). The throat shape is assigned to be circular, which means that there is no corner flow in the throat. The displacement is piston-like, and the analytical solution can be derived.

Convergence analysis We first investigate how the regularization interval width \(\epsilon\) influences the efficiency and accuracy of a drainage process for different viscosity ratios. Then, we compare our enhanced fully implicit scheme using regularization with the fully implicit scheme proposed by Weishaupt et al. (2022). To quantify the numerical errors, the following relative discrete \(L^2\)-errors for wetting phase saturation \(S_w\) is defined,

$$\begin{aligned} E_{S_w} = \left[ \displaystyle \frac{1}{ V }\sum _{i = 1}^n V_i \left( S_{w, i} - S_{w,i}^{ref} \right) ^2\right] ^{\frac{1}{2}}, \end{aligned}$$
(36)

where V is the total pore volume of the network and \(S_{w,i}^{ref}\) denotes the saturation of pore i obtained from analytical solution.

The entry pressure and the corresponding saturation can be analytically calculated using Eqs. (8) and (5) which gives \(p_{c,entry} = 1450\) Pa and \(S_{w, entry} = 0.10\), considering a static contact angle of \(\theta = 0^{\circ }\). The analytical solution of wetting phase saturation for the 10 pore bodies at the final time \(t=5s\) are \(S_{w}^{ref} = \left[ S_{w, entry}, S_{w, entry}, S_{w, entry}, S_{w, entry}, 0.69, 1, 1, 1, 1, 1 \right]\). We investigate the convergence behavior for \(\epsilon \rightarrow 0\) for each of the three viscosity ratios. The results are shown in Fig. 6.

Fig. 6
figure 6

Convergence behavior for different regularization intervals. Different viscosity ratios are investigated for one-dimensional drainage simulation, where a M = 10, b M =1 and c M = 1. The left axis shows the total number of Newton iterations used for the simulation, whereas the right axis corresponds to the \(L^2\)-error

Based on the results obtained from the three sets of numerical experiments, several key observations can be made regarding our EFI-R scheme. Firstly, it is evident that as the regularization interval length \(\epsilon \rightarrow 0\), the number of Newton iterations increases. This is expected since a smaller \(\epsilon\) corresponds to steeper throat conductivity curves, yielding more ill-conditioned Jacobian matrices. Consequently, the system of equations becomes more challenging to solve. In addition, as \(\epsilon \rightarrow 0\), the global relative \(L^2\)-error of the global wetting phase saturation solution approaches to zero as well, which means that the results converge to the analytical solution. This is reasonable, as \(\epsilon\) becomes smaller, the regularization effect decreases, resulting in the throat conductivity curves aligning more closely with the original curves. In other words, as \(\epsilon \rightarrow 0\), Eqs. (32) and (33) converge to Eqs. (17) and (18), respectively. Additionally, for varying viscosity ratios, it is found that in this case smaller values of the viscosity ratio M correspond to smaller global \(L^2\)-errors of wetting phase saturation. This finding highlights the advantage of our EFI-R scheme in simulating unfavorable displacement scenarios.

Comparison with fully implicit scheme We compare our enhanced fully implicit scheme using regularization EFI-R with the fully implicit scheme FI (Weishaupt 2020) for the above described drainage case with M = 0.1. To investigate the influence of time step size for FI, we have two setups for time loops where we set initial time step both as 0.1 s and the following time-step sizes are adjusted with the convergence performance of the previous time step. For one setup, we set maximum allowed time-step size \(\Delta t_{max} = 2\,s\), and for another, the maximum allowed time-step size \(\Delta t_{max}\) is limited as = 0.1 s. The wetting phase saturation results are shown in Fig. 7.

Fig. 7
figure 7

Comparison of wetting phase saturation for FI (Weishaupt 2020) and EFI-R in a drainage scenario. Pore-by-pore comparison of wetting phase saturation calculated with FI and EFI-R (\(\epsilon =0.1\)) for drainage case with maximum allowed time-step size \(\Delta t_{max} = 2\,s\). The purple line is the wetting phase saturation calculated by FI with time-step size controlling \(\Delta t_{max} = 0.1s\). The solid black line is the analytical solution of wetting phase saturation

It can be seen that employing FI and allowing large time-step sizes can lead to wrong invasion states. Employing FI with \(\Delta t_{max} = 2\,s\) lead to all first seven throats connected to the inlet pore get invaded in this case. Specially, during the computation, it is noticed that the third, fourth, and fifth pore throats are decided to be invaded within the same time step in the successive iterations and the non-wetting phase fluid is transported from third pore to the sixth pore. In addition, the circular throat shape prevents the occurrence of snap-off phenomenon and therefore the throats remain open. The reason that the throat invasion states here are mistakenly decided is due to large time-step size. When using some time-step control strategy to prevent such large time steps, e.g., the maximum time-step size is limited as 0.1 s, such wrong solution behavior is circumvented. However, EFI-R shows a much more accurate result. The reason is that FI makes the decision whether the invasion event occurs or not before final converged result is obtained. Therefore, for FI scheme, it is likely that within one iteration, a throat is predicted to be invaded even though this should not be. This shortcoming of FI scheme motivated Weishaupt et al. (2022) to propose an accuracy check strategy, which checks for each invasion or snap-off event whether the capillary pressure is too far away from the critical capillary pressure, i.e., entry capillary pressure or snap-off capillary pressure. A maximum allowed shift is assigned, for instance, at the iteration where the throat is considered as being invaded, the capillary pressure must be near the entry capillary pressure, e.g., in the range of 1% deviation of \(p_{c,entry}\). However, it is computationally expensive (see Sect. 4.3). Similar strategies to prevent wrong invasion state predictions are also required for other fully implicit schemes that have been presented in literature. For instance, the scheme proposed by Chen et al. (2020) requires a delicate time-step size estimation. For the implicit scheme proposed by An et al. (2020), a global saturation chopping strategy needs to be applied, which restricts the global averaged saturation change within each time step. In contrast, for EFI-R, the invasion state remains unknown in each time step until the converged solution is obtained. Therefore, strategies like capillary pressure accuracy check, time-step size estimation or Newton chopping are not necessary to obtain the correct invasion states of throats when using the proposed EFI-R scheme.

Figure 8 shows a comparison of these schemes, where the averaged time-step size used in FI and EFI-R is varied and the respective global \(L^2\)-error is compared. It is observed that the EFI-R scheme provides more accurate results for large time-step sizes with comparable number of total Newton iterations.

Fig. 8
figure 8

Comparison of accuracy and efficiency between EFI-R and FI (Weishaupt 2020) for dynamic PNM. a Global relative \(L^2\)-errors of wetting phase saturation over average time-step size, b number of total Newton iterations over averaged time-step size

4.1.2 Imbibition Case

Next, we consider the case of imbibition. The Dirichlet boundary conditions are assigned at both inlet and outlet. We assign \(p_{w,inlet} = 1\) bar and \(S_{n,inlet} = 0\) at inlet, \(p_{w,outlet} = 1\) bar and \(S_{n,outlet} = 1\) at outlet. The snap-off event takes place when capillary pressure is smaller than snap-off pressure \(p_{c,snap-off} = 725\) Pa. We run the simulation for 1 s, the distributions of wetting phase saturation for each pore calculated with FI and EFI-R, respectively, are presented in Fig. 9.

Fig. 9
figure 9

Comparison of wetting phase saturation for FI (Weishaupt 2020) and EFI-R in an imbibition scenario. Pore-by-pore comparison of wetting phase saturation calculated with FI and EFI-R (\(\epsilon =0.1\)) for imbibition case after 1 s

As shown in Fig. 9, the imbibition process calculated with EFI-R scheme proceeds much faster than the one calculated with FI scheme. In this case, FI compares \(p_{c,ij}^{dr} = \max \left( p_{c,i}, p_{c,j}\right)\) with the \(p_{c, snap-off}\), which causes no snap-off event occurring during this simulation and thus the wetting phase replaces non-wetting phase relatively slowly. In contrast, EFI-R compares \(p_{c,ij}^{im} = \min \left( p_{c,i}, p_{c,j}\right)\) with the \(p_{c, snap-off}\) to decide if a snap-off event would occur. The snap-off event occurs at the beginning of the simulation because the inlet pore is initially filled with wetting phase, which triggers the snap-off event at the throat connected to the inlet pore. Until the end of simulation, the first 8 throats are snapped off when calculating with EFI-R, which accelerates the imbibition process of wetting phase. In conclusion, the occurrence of snap-off events is often underestimated by FI, as it is less likely for the maximum of \(p_{c,i}\) and \(p_{c,j}\) to be smaller than \(p_{c,snap-off}\). It is noted that for this imbibition case, the significant differences of the results calculated by EFI-R and FI schemes are mainly caused by the different criteria in determining the snap-off event, rather than the regularization strategy used in the EFI-R.

4.2 Three-Dimensional Full Drainage Case

In this section, the dynamic two-phase pore-network model is validated through a numerical drainage experiment conducted on a random generated pore network. The resulting global capillary pressure–saturation curve evaluated by the EFI-R scheme is compared to the solutions obtained from a quasi-static pore-network model.

The pore network is generated with the algorithm outlined by Raoof and Hassanizadeh (2010). Initially, a fully connected cubic lattice of \(10\times 10\times 10\) pores with a side length of \(1\times 10^{-3}\) m is created. Pore throat connections are then randomly removed with a probability of 90% in all spatial directions. The pore body radii follow a log-normal distribution with a mean pore radius of \(4.5\times 10^{-5}\) m and a standard deviation of \(3\times 10^{-6}\) m, while the throat radii are calculated according to (Joekar-Niasar et al. 2008).

Considering the network’s lateral sides are closed. The left side of the network is connected to a non-wetting phase reservoir where \(S_{n, inlet} = 1\) and the saturation of right side is assigned as \(S_{n, outlet} = 0\). Additionally, both inlet and outlet are assigned with specified pressures, \(p_{n,inlet}\) and \(p_{w,outlet}\), respectively. The non-wetting phase is confined within the domain and prevented from escaping through the right side. The invasion process is driven by an incremental increase in the global capillary pressure difference, \(p_{c,global} = p_{n,inlet} - p_{w,outlet}\), once the equilibrium state is reached. At equilibrium points calculated by EFI-R scheme, two fluid phases reach a stationary state. These equilibrium points are also modeled by the quasi-static pore-network model.

Assuming cubic pore bodies, pore-local \(p_c-S_w\) curves are determined using Eq. (5). The pore throats have square cross-sectional shapes. A fixed value of interfacial tension \(\gamma =0.0725\) \(\hbox {N}\,\hbox {m}^{-1}\) is set, and the H2O-Air fluid system implemented in DuMux (Koch et al. 2021) is employed, with water being the wetting phase. The capillary entry pressure \(p_{c,e}\) of the throats is determined using Eq. (8), considering a static contact angle of \(\theta = 0^{\circ }\).

The global pressure difference \(p_{n,inlet} - p_{w,outlet}\) and the capillary pressure \(p_c\), weighted by the interfacial area, obtained from both the dynamic and quasi-static PNM simulations are taken as functions of the average wetting phase saturation \(S_w\) across the domain. These results are presented in Fig. 10.

Fig. 10
figure 10

Validation of EFI-R scheme in terms of global capillary pressure–saturation curve. Comparison of equilibrium solutions simulate by EFI-R scheme with different regularization interval length \(\epsilon\) and simulation results of quasi-static PNM

As shown in Fig. 10, the EFI-R reproduces exactly the results simulated by quasi-static PNM at equilibrium points for all \(\epsilon\) values for the global capillary pressure and averaged saturation. Moreover, while the utilization of different regularization interval lengths \(\epsilon\) does introduce slight varied results in the process reaching the equilibrium point, the effects induced by \(\epsilon\) on an upscaled capillary pressure–saturation curve for the entire pore-network are not significant.

In addition, we present the comparison of number of invaded throats at each global capillary pressure and the results of the pore-by-pore saturation comparison in Fig. 11

Fig. 11
figure 11

Validation of EFI-R scheme in terms of pore-by-pore saturation. On the left side of the picture, the number of invaded throats, as a function of global capillary pressure difference, under equilibrium states simulated by EFI-R is compared with the results simulated by the quasi-static PNM. On the right side of the picture a pore-by-pore comparison of under global capillary pressure of a 4520 Pa, b 4560 Pa and c 4600 Pa is shown. Here, the first column shows the fluid distribution is shown with the local saturation \(S_w\) at each pore. The second column shows the differences of saturation between the results simulated by EFI-R and quasi-static PNM for each pore, where the local pore saturation difference is denoted as \(\Delta S_w\)

As shown in Fig. 11, the equilibrium solutions computed by EFI-R precisely match the results computed by quasi-static PNM at each global capillary pressure. The numbers of invaded throats calculated by EFI-R and quasi-static models are exactly the same under each global capillary pressure and the difference of saturation in each pore body is negligible. A similar comparison study between FI scheme proposed by Weishaupt (2020) and quasi-static simulations is carried out, however, as pointed out by Weishaupt (2020, pp. 83), the results computed by dynamic PNM using FI scheme and quasi-static are biased if the time-step size control strategy is missing. In contrast to FI, EFI-R, however, is able to obtain results that accurately match results of quasi-static without employing any time-step size controlling strategy.

4.3 Three-Dimensional Partial Drainage Case

We consider a three-dimensional partial drainage case. The pore network is generated following the same algorithm described in Sect. 4.2. Initially, a fully connected cubic lattice of \(20\times 20\times 20\) pores with a side length of \(2\times 10^{-3}\) m is created. Pore throat connections are then randomly removed with a probability of 90% in all spatial directions. The pore body radii follow a log-normal distribution with a mean pore radius of \(4.5\times 10^{-5}\) m and a standard deviation of \(3\times 10^{-6}\) m, while the throat radii are calculated according to (Joekar-Niasar et al. 2008). The detailed network geometry information is shown in Fig. 12. The fluid system is H2O-Air implemented in DuMux. The air is injected at the left inlet with a fixed injection rate \(Q=5\times 10^{-10}\) \(\hbox {kg}\,\hbox {s}^{-1}\). We simulate the drainage process for 2 s.

Fig. 12
figure 12

Pore network used in 3D partial drainage case. a 3D pore network, where the inlet pores are colored as orange, outlet pores are colored as red and inner pores are colored with blue. b Pore size distribution, c throat size distribution, d coordination number distribution

We simulate the aforementioned scenario using FI and EFI-R, respectively, and conduct two comparison studies. The first study focuses on the accuracy and efficiency of FI and EFI-R. The second comparison study aims to investigate the consistency of the algorithms in relation to time-step sizes.

The first comparison study is conducted when no maximum time-step size limitation \(\Delta t_{max}\) is assigned. For FI and EFI-R, we compare the average time-step size, total Newton iterations and number of invaded throats, respectively. The results are presented in Table 1.

Table 1 Comparison of numeric behavior between FI and EFI-R

As given in Table 1, EFI-R provides larger averaged time-step sizes compared to FI during the simulation for this test case. The number of invaded throats after the partial drainage process simulated with EFI-R for different \(\epsilon\) stays around 1230 and is therefore relatively stable, whereas the number of invaded throats for FI is 1267. After incorporating an accuracy check strategy proposed by Weishaupt et al. (2022), which ensures that the capillary pressure is within a 1% deviation from the entry pressure whenever an invasion event occurs, the result simulated with FI is 1233, which is close to the results simulated with EFI-R. However, it is worth noting that this accuracy check strategy incurs a significant computational cost. Consequently, the time-step size is reduced by two orders of magnitude, and the total number of iterations increases approximately tenfold compared to FI simulations without the accuracy check, as well as around tenfold compared to the total iteration count obtained with EFI-R.

Next, we investigate the influence of time-step sizes on the simulation results. We apply 5e−3 s, 1e−3 s, 5e−4 s, 1e−4 s as the maximum allowed time-step size \(\Delta t_{max}\) for both FI and EFI-R (\(\epsilon = 0.05\)), respectively. We take the results simulated with \(\Delta t_{max} =\) 1e−4 s as the base case for both FI and EFI-R. The simulated results of base cases for FI and EFI-R, as well as the difference of the results obtained for other values of \(\Delta t_{max}\) are presented in Fig. 13.

As shown in Fig. 13, the simulation results deviate only slightly for the EFI-R (with \(\epsilon = 0.05\)) when varying the maximum allowed time-step size \(\Delta t_{max}\). The number of invaded throats in the pore network still hovers around 1230 (\(\pm 5\)). However, for the FI scheme, the results deviate strongly when changing \(\Delta t_{max}\). The number of invaded throats varies from 1255 to 1300. The results indicate that our EFI-R scheme yields more robust results in terms of time-step size.

Fig. 13
figure 13

Comparison between FI (Weishaupt 2020) and EFI-R for 3D partial drainage scenario with different \({\varvec{\Delta }} \mathbf {t}_{\mathbf {max}}\). a, b are non-wetting phase saturation distributions of base cases with \(\Delta t_{max} =\)1e−4 s calculated by EFI-R and FI scheme, respectively. c and d show the differences between the non-wetting phase saturation employing \(\Delta t_{max} =\)5e−4 s against the results in the base cases, for both EFI-R and FI scheme, respectively. e, f show the differences between results employing \(\Delta t_{max} =\) 5e−3 s against the respective base case, while g and h show the differences against base case for \(\Delta t_{max} =\)1e-3 s. Pores with saturation differences higher than 0.5 are denoted as biased pores, and the number of biased pores is denoted as \(N_\mathrm {biased}\)

5 Conclusion

In this paper, an enhanced fully implicit scheme using regularization based on the two-pressure formulation, EFI-R, for dynamic pore-network models has been introduced. The EFI-R incorporates an approach that predicts the possible invasion and snap-off events based on the historical invasion states of the pore throats in the pore network. This decision-making approach also effectively accounts for the hysteresis effect of local throat conductivity, ensuring the utilization of appropriate throat conductivity curves at each time step. Furthermore, the numerical challenges associated with numerical simulation of two-phase flow in porous media using dynamic implicit pore-network models have been discussed in detail. A regularization strategy has been introduced to handle the abrupt change of pore throat conductivity during pore throat invasion and snap-off. This strategy solves the convergence issues caused by the decision-making approach of invasion and snap-off events. Through a series of numerical experiments, the robustness and efficiency of EFI-R in comparison with the fully implicit scheme has been demonstrated. With these favorable numerical properties, the EFI-R allows to investigate more complex physical processes at the pore scale in heterogeneous porous media. For further work, we will compare our results with DNS simulations to validate the local rules used in dynamic PNM. In addition, our PNM will be extended to incorporate compositional effects to be able to model physical processes such as dissolution, degassing, condensation or evaporation. The microfluidic evaporation experiments will be simulated, and the results will be compared with the experimental results.