Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 Introduction

CO2 sequestration in porous media, such as saline aquifers and oil and gas reservoirs, is an important venue to reduce the excessive amount of carbon dioxide in the atmosphere. Numerical simulations for CO2 sequestration process have been studied using many simulators. The reader is referred to the work of Class et al. [4] for a benchmark study of these simulations. The focus of this paper is to develop a discontinuous Galerkin (DG) method to simulate CO2 storage, which is a two-component two-phase type of flow. DG methods for two-phase flow without inter-mass transfer have been heavily studied in the literature (see, e.g., [1, 2, 5, 9, 12]). Similarly, two-component single-phase flow (also referred to as miscible displacement) has been numerically and successfully modeled by DG methods [6, 10, 11, 13,14,15,16,17]. The most commonly used model for two-phase flow is the elliptic pressure-hyperbolic saturation formulation, in that the pressure and saturation are weakly coupled together, and the problem can be solved sequentially. Bastian and Riviere [2] used nonsymmetric interior penalty DG formula for the pressure equation and for the diffusion term in the saturation equation, and used the upwind scheme for the advection term. The nonlinear coefficients were linearized by time-lagging. A variant of DG method using similar techniques along with adaptivity in time and space was numerically investigated by Klieber and Riviere [12]. Eslinger [9] numerically studied the compressible air–water two-phase problem using the local DG method for saturation equation. The numerical DG solutions of two-phase flow problem usually have spurious overshoot and undershoot phenomena resulting from large advection, which can be controlled by slope limiting. However, the slope limiters are difficult to construct for higher-dimensional problems, and theoretical analysis is limited to one-dimensional problems. Fully implicit fully coupled DG method proposed by Epshteyn and Riviere [5] can be used to stabilize the oscillations without using slope limiters, but computational cost is increased. In [1], Bastian showed the robustness and scalability of a DG method for a wetting-phase pressure and capillary pressure formulation of the incompressible two-phase flow.

Our paper solves a two-component two-phase problem, with the additional difficulty that one component moves from one phase to the other. The novelty of this work is the approach for handling transfer from one phase to the other. Discontinuous finite element methods were first applied to the two-phase two-component model with interphase mass transfer by Ern and Mozolevski [7]. Their work took into account phase disappearance and showed the potential to handle heterogeneous porous medium. In [7], Henry’s law is used to express the linear correlation of density and pressure, which allows for the easy choice of liquid pressure and dissolved gas density as the primal variables. The density changes in CO2 sequestration problem vary greatly, and hence in our study, Henry’s law is not used. Rather, we use a cubic spline interpolant for the relationship between mass fraction and pressure. Other properties like CO2 viscosity and the mass fraction of CO2 in water also depend on the gas pressure. Therefore, we need the gas pressure to be one of the primal variables to reduce the complexity of simulation. The difficulty to correctly simulate the accumulation of the non-wetting phase due to the discontinuous capillary pressures in heterogeneous porous media was studied by Ern et al. [8]. They enforced the nonlinear interface conditions weakly and used the weighted average numerical flux and total velocity reconstruction for the DG scheme.

An outline of the paper is the following: the mathematical models are given in the next section. The numerical scheme is described in Sect. 3 and numerical results are shown in Sect. 4. Some conclusions follow.

2 Mathematical Model

In this section, we first show the mathematical model and explain the terms used in the model. Then, we transform the model to the equations that we use for discretization.

2.1 Mass Conservation Laws

We consider the isothermal two-phase two-component model for CO2 sequestration problems. The two phases are CO2-rich phase and water-rich phase. The CO2-rich phase is the non-wetting phase and is denoted by n. The water-rich phase is the wetting phase and is denoted by w. The two components considered are carbon dioxide (denoted by CO2) and water (denoted by H2O). We use the Reynold’s transport theorem for the mass conservation of CO2 and H2O to obtain the following equations:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \phi \frac{\partial}{\partial t}\left(\displaystyle\sum_{\alpha\in \{w,n\}} \rho_{\alpha} X_{\alpha}^{CO_2}S_{\alpha}\right) -\nabla \cdot \left( \displaystyle\sum_{\alpha \in \{w,n\}}\rho_\alpha X_{\alpha}^{CO_2} {\mathbf{v}}_{\alpha}\right) =q^{CO_2},{} \end{array} \end{aligned} $$
(1)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \phi \frac{\partial}{\partial t}\left(\displaystyle\sum_{\alpha \in \{w,n\}} \rho_{\alpha} X_{\alpha}^{H_2O}S_{\alpha}\right) -\nabla \cdot \left( \displaystyle\sum_{\alpha \in \{w,n\}}\rho_\alpha X_{\alpha}^{H_2O} {\mathbf{v}}_{\alpha}\right) =q^{H_2O},{} \end{array} \end{aligned} $$
(2)

where ϕ denotes the porosity, ρα the density of phase α, \(X_{\alpha }^{\beta }\) the mass fraction of component β in phase α, Sα the saturation of phase α, vα the averaged velocity on the macroscopic scale for phase α, and qβ the source term of component β.

The density of the CO2-rich phase ρn depends on the pressure. Figure 1 shows the cubic spline interpolation for the function of ρn(pn), where pn denotes the pressure of the non-wetting phase. The density of brine, which depends on the density of water, salinity, and the solubility of carbon dioxide, is simply assumed to be constant. The mass fractions satisfy the following equation:

$$\displaystyle \begin{aligned} X_{\alpha}^{CO_2} + X_{\alpha}^{H_2O} = 1, \quad \alpha \in \{w, n\}. {} \end{aligned} $$
(3)

The solubility of CO2 in brine depends on the pressure, and the corresponding function \(X_{w}^{CO_2}(p_n)\) is approximated using the cubic spline interpolation as shown in Fig. 2. The solubility of H2O in the CO2-rich phase is approximately 100 times smaller than the solubility of CO2 in brine, and thus we assume

$$\displaystyle \begin{aligned} X_{n}^{H_2O}=0, \quad X_{n}^{CO_2}=1. \end{aligned}$$

The averaged velocity vα is given by the generalized Darcy’s law for multiphase flow. If we neglect the gravity term, we have

$$\displaystyle \begin{aligned} {\mathbf{v}}_{\alpha} = -\frac{k_{r\alpha}}{\mu_{\alpha}}K\nabla p_{ \alpha}, \end{aligned} $$
(4)

where k denotes the relative permeability for phase α, μα the dynamic viscosity of phase α, K the absolute permeability, and pα the pressure of phase α.

Fig. 1
figure 1

Cubic spline interpolation for the correlation of the density of CO2 and the pressure at T = 50C

Fig. 2
figure 2

Solubility of CO2 in water using cubic spline interpolation

We use the Brooks and Corey [3] formula for the relative permeability:

$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle k_{rw} = S_{e}^{\frac{2+3\lambda}{\lambda}},{} \end{array} \end{aligned} $$
(5)
$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle k_{rn} = \left(1-S_{e}\right)^2\left(1-S_{e}^{\frac{2+\lambda}{\lambda}}\right), {} \end{array} \end{aligned} $$
(6)

where λ is a scalar which takes small value (e.g., λ = 0.2) for the heterogeneous material and larger value (e.g., λ = 2.0) for the homogeneous material. The notation Se denotes the effective saturation for the wetting phase, and is defined to be

$$\displaystyle \begin{aligned} S_{e} = \frac{S_{w}-S_{w r}}{1- S_{w r}}, \end{aligned} $$
(7)

where Swr denotes the residual saturation for the wetting phase.

The dynamic viscosity of the CO2-rich phase μn is also a function of pressure. Figure 3 shows the cubic spline interpolation of the function of μn(pn). The dynamic viscosity of brine μw is mainly dependent on the salinity while the pressure has little influence. Therefore, we assume that μw is constant. We now have two equations, which are Eqs. (1) and (2), and four unknowns, which are Sw, Sn, pw, and pn. By definition, the phase saturations sum up to one:

$$\displaystyle \begin{aligned} S_w+S_n =1. {} \end{aligned} $$
(8)

The difference between the phase pressures is the capillary pressure, pc,

$$\displaystyle \begin{aligned} p_n-p_w =p_c, {} \end{aligned} $$
(9)

and it is a function of the effective wetting phase saturation, using the Brooks and Corey formula:

$$\displaystyle \begin{aligned} p_{c}(S_e) = p_{d} S_{e}^{-\frac{1}{\lambda}}, \end{aligned} $$
(10)

where pd is the entry pressure, and λ is the same parameter in Eqs. (5) and (6).

Fig. 3
figure 3

Cubic spline interpolation for the correlation of CO2 viscosity and the pressure at 50C

2.2 The Isothermal Two-Phase Two-Component Model

Before numerical discretization, we manipulate the system (1)–(2) of conservation laws. We first add the two equations and obtain an equation without mass fraction terms. We choose for primary variables the wetting phase saturation, Sw, and the non-wetting phase pressure, pn. The remaining variables, Sn and pw, are replaced by Eqs. (8) and (9). In addition, we set

$$\displaystyle \begin{aligned} X_n^{H_2O}=0, \quad X_n^{CO_2}=1, \quad X_{w}^{H_2O} = 1-X_{w}^{CO_2}. \end{aligned}$$

Finally, we expand the time derivative, and obtain, after manipulation, the following equations:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \phi \left(\rho_{w}-\rho_n\right)\displaystyle\frac{\partial S_{w}}{\partial t} + \phi (1- S_{w}) \frac{d\rho_n}{d p_n} \frac{\partial p_n}{\partial t}\\ &\displaystyle \quad -\nabla \cdot \left( \displaystyle\frac{k_{rw}}{\mu_{w}}\rho_{w} K (-\frac{d p_c}{d S_w})\nabla S_{w} \right) -\nabla \cdot \left( \frac{k_{rw}}{\mu_{w}}\rho_{w} K\nabla p_n\right) \\ &\displaystyle \quad -\nabla \cdot \left( \displaystyle\frac{k_{rn}}{\mu_n}\rho_n K\nabla p_n\right) =q^{CO_2} +q^{H_2O},{} \end{array} \end{aligned} $$
(11)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \phi \rho_{w}\left( 1-X_{w}^{CO_2}\right)\displaystyle\frac{\partial S_{w}}{\partial t} -\phi \rho_{w} S_{w} \frac{d X_w^{CO_2}}{d p_n} \frac{\partial p_n}{\partial t}\\ &\displaystyle \quad -\nabla \cdot \left( \displaystyle\frac{k_{rw}}{\mu_{w}}\rho_{w} \left(1-X_{w}^{CO_2}\right)K \left(-\frac{d p_c}{d S_w}\right)\nabla S_{w}\right)\\ &\displaystyle \quad -\nabla \cdot \left( \frac{k_{rw}}{\mu_{w}}\rho_{w} \left(1-X_{w}^{CO_2}\right)K\nabla p_n\right) =q^{H_2O}. {} \end{array} \end{aligned} $$
(12)

We note that in the equations above, the functions ρn, \(X_w^{CO_2}\), and μn depend on the pressure pn and the functions krw and krn depend on the saturation Sw. Now, let us state the initial and boundary conditions. The time interval is denoted by (0, T). The domain is denoted by Ω and its boundary by ∂Ω. We separate ∂Ω into two parts: the outflow boundary Γ+ and the inflow boundary Γ, satisfying

$$\displaystyle \begin{aligned} \overline{\varGamma^{\partial +} \cup \varGamma^{\partial -}} = \partial \varOmega, \quad \varGamma^{\partial +} \cap \varGamma^{\partial -} = \emptyset. \end{aligned}$$

The initial conditions are described below:

$$\displaystyle \begin{aligned} S_w (x, 0)= S_0 (x), \quad p_n (x, 0)= p_0(x), \quad \forall x \in \varOmega. \end{aligned} $$
(13)

We impose Dirichlet and Neumann-type boundary conditions on different parts of the boundary:

$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle S_w (x, t)= f_s(x,t), \quad \forall x \in \varGamma^{\partial -},\, t\in (0,T), \end{array} \end{aligned} $$
(14)
$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle \nabla S_w (x, t)\cdot \mathbf{n} = 0, \quad \forall x \in \varGamma^{\partial +},\, t\in (0,T), \end{array} \end{aligned} $$
(15)
$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle p_n (x, t)= f_p(x,t), \quad \forall x \in \varGamma^{\partial +},\, t\in (0,T), \end{array} \end{aligned} $$
(16)
$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle \nabla p_n (x, t) \cdot \mathbf{n}= g_p(x,t), \quad \forall x \in \varGamma^{\partial -},\, t\in (0,T). \end{array} \end{aligned} $$
(17)

3 Numerical Method

Equations (11) and (12) are strongly coupled, and thus we use the fully coupled method to solve the problem. We also use the backward Euler method for the time discretization to avoid CFL constraints. For the space discretization, we discuss the existing discontinuous Galerkin methods and propose a new “partial upwind” method in this section.

3.1 Standard DG Discretization

The interior penalty DG methods usually use the average numerical flux with stabilization terms for the diffusion terms (elliptic operators) and use the upwind numerical flux for the advection terms (hyperbolic operators).

Both the third terms in Eqs. (11) and (12) are independent or slightly dependent on pn, and they can be treated as the nonlinear elliptic terms in Sw and are discretized accordingly. The rest of the terms in Eqs. (11) and (12) come from the Darcy’s law for phase velocities, and are elliptic terms in pn and hyperbolic terms in Sw. They are the advection terms and are supposed to be discretized using the upwind method. However, the resulting scheme is unstable, because the fact that they are also the elliptic operator on pn cannot be ignored. Therefore, large penalty terms for pn are needed for stabilization, which gives inaccurate solutions. In fact, inaccuracies in ∇pn yield large oscillations in Sw. Therefore, previous DG work for two-phase problems, such as the papers by Epshteyn and Riviere [5] and by Ern and Mozolevski [7], treat similar terms as the elliptic operator and use the usual DG discretization. This means that numerical diffusive fluxes are averaged and stabilization terms are added. In this work, we show that for the CO2 storage problem, the average fluxes yield oscillations when advection dominates the problem.

3.2 The Partial Upwind Method

The idea behind the partial upwind method is that before applying the upwind method to the advection term, we substract an elliptic part depending on pn from the advection term and discretize it using the usual average numerical flux with stabilization. Hence, the equation for pn is much better stabilized. We expect the proposed method to perform well because upwinding stabilizes the numerical oscillations. A theoretical justification of the convergence of the method is challenging because the nonlinear coefficients degenerate in parts of the domain. We show in the numerical examples that the solution is unstable if we do not use partial upwinding.

We use the Brooks–Corey formula, and the fourth term in Eq. (11) becomes

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle &\displaystyle -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} S_{e}^{3+\frac{2}{\lambda}} K\nabla p_n\right) = -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} \left(\frac{S_{w}-S_{wr}}{1-S_{wr}}\right)^{3+\frac{2}{\lambda}} K\nabla p_n\right) \\ &\displaystyle =&\displaystyle -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} C(p_n,x) K\nabla p_n\right)\\ &\displaystyle &\displaystyle -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} \left(\left(\frac{S_{w}-S_{wr}}{1-S_{wr}}\right)^{3+\frac{2}{\lambda}}-C(p_n,x)\right) K\nabla p_n\right), {}\vspace{-3pt} \end{array} \end{aligned} $$
(18)

where C(pn, x) is a positive function that does not depend on Sw. Then, the first part

$$\displaystyle \begin{aligned} -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} C(p_n,x) K\nabla p_n\right),\end{aligned} $$

is discretized as the elliptic term for pn and the second part

$$\displaystyle \begin{aligned} -\nabla \cdot \left( \frac{\rho_{w}}{\mu_{w}} \left(\left(\frac{S_{w}-S_{wr}}{1-S_{wr}}\right)^{3+\frac{2}{\lambda}}-C(p_n,x)\right) K\nabla p_n\right),\end{aligned} $$

is discretized using the upwind scheme. The selection of C(pn, x) depends on the value of λ. For example, when λ = 2, the best choice is

$$\displaystyle \begin{aligned} C(p_n,x)=\left(\frac{S_{wr}}{1-S_{wr}}\right)^4, \end{aligned}$$

since then \(\left (\frac {S_{w}-S_{wr}}{1-S_{wr}}\right )^{3+\frac {2}{\lambda }}-C(p_n,x) \) can be written as the product of Sw and a scalar α(Sw), that is:

$$\displaystyle \begin{aligned} \left(\frac{S_{w}-S_{wr}}{1-S_{wr}}\right)^{4}-\left(\frac{S_{wr}}{1-S_{wr}}\right)^4=S_w \, \alpha(S_w). \end{aligned}$$

3.3 General PDE Model

The partial upwind method not only works for CO2 sequestration problem, but also works for other two-phase flow problems. Now, let us consider a more general PDE system with the CO2 sequestration problem being a particular case. The general system of PDEs is presented in a way that the ambiguous terms are already reasonably separated according to the partial upwind method.

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \tau_1(\mathbf{x},p) \displaystyle\frac{\partial S}{\partial t} +\theta_1(\mathbf{x},S,p) \frac{\partial p}{\partial t} -\nabla \cdot \left(a_1(\mathbf{x},S) \nabla S\right)\\ {} &\displaystyle -\nabla\cdot \left(b_1(\mathbf{x},p)\nabla p\right) + \nabla \cdot \boldsymbol{\beta}_1(\mathbf{x},S,p,\nabla p) = q_1(t,\mathbf{x}),{} \end{array} \end{aligned} $$
(19)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \tau_2(\mathbf{x},p) \displaystyle\frac{\partial S}{\partial t} +\theta_2(\mathbf{x},S,p) \frac{\partial p}{\partial t} -\nabla \cdot \left(a_2(\mathbf{x},S,p) \nabla S\right)\\ {} &\displaystyle -\nabla\cdot \left(b_2(\mathbf{x},p)\nabla p\right) + \nabla \cdot \boldsymbol{\beta}_2(\mathbf{x},S,p,\nabla p) = q_2(t,\mathbf{x}).{} \end{array} \end{aligned} $$
(20)

Even though in these equations, the term βi(x, S, p, ∇p) (i = 1, 2) has the form of βi(x, S, p)∇p, where βi is a scalar function, we use for convenience the more general notation βi(x, S, p, ∇p). In this system, terms with ai and bi coefficients are treated as elliptic terms and the ones with βi are treated as hyperbolic terms. −∇⋅ (bip) and ∇⋅βi are the separated terms using the partial upwind method.

For our CO2 sequestration model, the coefficients are

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \tau_1(\mathbf{x},p)=\phi \left(\rho_{w}-\rho_n\right), \end{array} \end{aligned} $$
(21)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \theta_1(\mathbf{x},S,p) = \phi (1- S)\rho_n^{\prime}(p), \end{array} \end{aligned} $$
(22)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle a_1(\mathbf{x},S) = \frac{\rho_{w}}{\mu_{w}} \frac{p_{d}}{\lambda}\frac{1}{1-S_{wr}}S_{e}^{2+\frac{1}{\lambda}} K , \end{array} \end{aligned} $$
(23)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle b_1 (\mathbf{x},p)= \frac{\rho_{w}}{\mu_{w}} C_{1,1}K + \frac{\rho_{co_2}}{\mu_n} C_{1,2}K, \end{array} \end{aligned} $$
(24)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \boldsymbol{\beta}_1(\mathbf{x},S,p,\nabla p) = -\frac{\rho_{w}}{\mu_{w}} \left( S_{e}^{3+\frac{2}{\lambda}} - C_{1,1} \right) K\nabla p \\ {} &\displaystyle \quad \quad - \frac{\rho_n}{\mu_n}\left( (1-S_{e})^2(1-S_{e}^{1+\frac{2}{\lambda}}) -C_{1,2} \right) K\nabla p,{} \end{array} \end{aligned} $$
(25)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle q_1(t,\mathbf{x})=q^{CO_2}(t,\mathbf{x})+q^{H_2O}(t,\mathbf{x}), {} \end{array} \end{aligned} $$
(26)
$$\displaystyle \begin{aligned}\begin{array}{rcl} &\displaystyle \tau_2(\mathbf{x},p)=\phi \rho_{w}\left( 1-X_{w}^{CO_2}\right), \end{array} \end{aligned} $$
(27)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \theta_2 (\mathbf{x},S,p)= -\phi \rho_{w} S {X_{w}^{CO_2}}'(p), \end{array} \end{aligned} $$
(28)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle a_2(\mathbf{x},S,p) = \left(1-X_{w}^{CO_2}\right)\frac{\rho_{w}}{\mu_{w}} \frac{p_{d}}{\lambda}\frac{1}{1-S_{wr}}S_{e}^{2+\frac{1}{\lambda}} K, \end{array} \end{aligned} $$
(29)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle b_2 (\mathbf{x},p) = \left(1-X_{w}^{CO_2}\right) \frac{\rho_{w}}{\mu_{w}} C_2K, \end{array} \end{aligned} $$
(30)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \boldsymbol{\beta}_2 (\mathbf{x},S,p,\nabla p)= -\left(1-X_{w}^{CO_2}\right) \frac{\rho_{w}}{\mu_{w}} \left( S_{e}^{3+\frac{2}{\lambda}} -C_2 \right) K \nabla p, {} \end{array} \end{aligned} $$
(31)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle q_2(t,\mathbf{x})=q^{H_2O}(t,\mathbf{x}), {} \end{array} \end{aligned} $$
(32)

where C1,1, C1,2, and C2 play the same role as the C in Eq. (18). The choice of C1,1, C1,2, and C2 that we use are listed here:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle C_{1,1}=\left(\frac{S_{wr}}{1-S_{wr}}\right)^4,\\ {} &\displaystyle C_{1,2}=\frac{\left(1-2S_{wr}\right)}{\left(1-S_{wr}\right)^4},\\ {} &\displaystyle C_2=\left(\frac{S_{wr}}{1-S_{wr}}\right)^4. \end{array} \end{aligned} $$

3.4 Numerical Discretization

Suppose Ω is a polygonal domain. Let \(\mathcal {E}^h\) be the mesh on Ω, comprised of elements denoted by E (intervals in 1D, triangles in 2D, and tetrahedra in 3D). Let γ denote the edge of the element and nγ be a fixed normal direction for every γ. If γ is on the boundary, then nγ is chosen to be the outward direction. Let Γh denote the collection of all the interior edges and Γh, the boundary edges. Let Γh, + denote the set of the outflow boundary and Γh, the inflow boundary.

Define the finite element space as:

$$\displaystyle \begin{aligned} \mathbb{X}^h = \{ v\in L^2(\varOmega):v\in \mathbb{P}^{r}(E), \forall E\in\mathcal{E}^h \}, \end{aligned} $$
(33)

where r denotes the order of the polynomials and r is an integer bigger than or equal to 1. All functions in \(\mathbb {X}^h\) have two different values on edge γ. Let us define the jump of a function on γ. Suppose γ is shared by two neighboring elements E1 and E2, and nγ points from E1 to E2. For any function \(v\in \mathbb {X}^h\), the jump on γ is defined to be

$$\displaystyle \begin{aligned}{}[v]|{}_\gamma = v|{}_{E_1}-v|{}_{E_2}. \end{aligned} $$
(34)

If γ is on the boundary, then

$$\displaystyle \begin{aligned}{}[v]|{}_\gamma = v|{}_E. \end{aligned} $$
(35)

The average is defined as:

$$\displaystyle \begin{aligned} \{v\}|{}_\gamma = \frac{1}{2}(v|{}_{E_1}+v|{}_{E_2}), {} \end{aligned} $$
(36)

and if γ is on the boundary

$$\displaystyle \begin{aligned} \{v\}|{}_\gamma = v|{}_{E}. \end{aligned} $$
(37)

We define the upwind as:

$$\displaystyle \begin{aligned} \begin{array}{rcl} v^{\uparrow}|{}_\gamma = \begin{cases} &\displaystyle v|{}_{E_1}, \quad \mbox{ if } \{\nabla p_n\cdot {\mathbf{n}}_\gamma\} >0,\\ &\displaystyle v|{}_{E_2}, \quad \mbox{ otherwise}.\\ \end{cases} {} \end{array} \end{aligned} $$
(38)

If γ ∈ Γh, +, and γ ∈ E, then

$$\displaystyle \begin{aligned} v^{\uparrow}|{}_\gamma = v|{}_{E}. \end{aligned} $$
(39)

Let Δt denote the time step and N denote the number of time steps such that T = NΔt. Let tn = nΔt be successive discrete times. Define the variational forms \(A_i(p_h^n, S_h^n,v)\) for i = 1, 2 and all \(v\in \mathbb {X}^h\):

$$\displaystyle \begin{aligned} \begin{array}{rcl} {} &\displaystyle A_i(p_h^{n+1}, S_h^{n+1},v)=\\ &\displaystyle \displaystyle\sum_{E\in \mathcal{E}^h}\int_{E} a_i(\mathbf{x},S_{h}^{n+1},p_{h}^{n+1}) \nabla S_{h}^{n+1} \cdot \nabla v {-}\sum_{\gamma \in \varGamma^{h}\cup \varGamma_1^{h,\partial}}\int_{\gamma} \{ a_i(\mathbf{x},S_{h}^{n+1}) \nabla S_{h}^{n+1} \cdot {\mathbf{n}}_{\gamma}\} [v] \\ &\displaystyle + \epsilon \displaystyle\sum_{\gamma \in \varGamma^{h}\cup\varGamma_1^{h,\partial}}\int_{\gamma} \{ a_i(\mathbf{x},S_{h}^{n+1}) \nabla v \cdot {\mathbf{n}}_{\gamma}\} [S_{h}^{n+1}] +\sum_{E\in \mathcal{E}^h}\int_{E} b_i(\mathbf{x},p_{h}^{n+1})\nabla p_{h}^{n+1} \cdot \nabla v \\ &\displaystyle -\displaystyle\sum_{\gamma\in \varGamma^{h}\cup \varGamma_2^{h,\partial}}\int_{\gamma} \{ b_i(\mathbf{x},p_{h}^{n+1})\nabla p_{h}^{n+1}\cdot {\mathbf{n}}_{\gamma}\} [v]+\epsilon \\ &\displaystyle \quad \quad \displaystyle \sum_{\gamma\in \varGamma^{h}\cup \varGamma_2^{h,\partial}}\int_{\gamma} \{ b_i(\mathbf{x},p_{h}^{n+1})\nabla v\cdot {\mathbf{n}}_{\gamma}\} [p_{h}^{n+1}] \\ &\displaystyle -\displaystyle\sum_{E\in \mathcal{E}^h}\int_{E} \boldsymbol{\beta}_i(\mathbf{x},S_{h}^{n+1},p_{h}^{n+1},\nabla p_{h}^{n+1})\cdot \nabla v \\ &\displaystyle \qquad \qquad \displaystyle + \sum_{\gamma \in \varGamma^{h}}\int_{\gamma} \boldsymbol{\beta}_i^{\uparrow}(\mathbf{x},S_{h}^{n+1},p_{h}^{n+1},\nabla p_{h}^{n+1}) \cdot {\mathbf{n}}_{\gamma}. \end{array} \end{aligned} $$
(40)

Define the linear forms \(Q_i^n(v)\) for i = 1, 2:

$$\displaystyle \begin{aligned} \begin{array}{rcl} Q_i^{n+1}(v) =\displaystyle\sum_{E\in \mathcal{E}^h}\int_{E} q_i(t^{n+1},\mathbf{x})v, {} \end{array} \end{aligned} $$
(41)

and the penalty forms for i = 1, 2:

$$\displaystyle \begin{aligned} \begin{array}{rcl} J_i(p_h^{n+1},S_h^{n+1},v)&\displaystyle =&\displaystyle \sum_{\gamma \in \varGamma^{h}\cup \varGamma_2^{h,\partial}}\frac{\sigma_{\gamma}^p}{h_{\gamma}}(\int_{\gamma}\{a_i(\mathbf{x},S_h^n)\})\int_{\gamma}[p_{h}^{n+1}][v] \\ &\displaystyle &\displaystyle +\sum_{\gamma \in \varGamma^{h}\cup \varGamma_1^{h,\partial}}\frac{\sigma_{\gamma}^S}{h_{\gamma}}(\int_{\gamma}\{a_i(\mathbf{x},S_h^n)\})\int_{\gamma}[S_{h}^{n+1}][v]. {} \end{array} \end{aligned} $$
(42)

Notice that the penalty term depends on the value of the elliptic coefficients. The boundary conditions are handled by the following forms, for i = 1, 2:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle B_i^{n+1}(S_h^{n+1},p_h^{n+1},\nabla p_h^{n+1},v) = \\ &\displaystyle \epsilon \displaystyle\sum_{\gamma\in \varGamma_1^{h,\partial}}\int_{\gamma}a_i(\mathbf{x},f_S(\mathbf{x},t^{n+1}))\nabla v\cdot {\mathbf{n}}_\gamma f_S(\mathbf{x},t^{n+1})\\ &\displaystyle +\displaystyle\sum_{\gamma\in \varGamma_1^{h,\partial}}\frac{\sigma_S}{h_\gamma}\left(\int_{\gamma}a_i(\mathbf{x},f_S(\mathbf{x},t^{n}))\right)\int_{\gamma}f_S(\mathbf{x},t^{n+1})v\\ &\displaystyle +\epsilon \displaystyle\sum_{\gamma\in \varGamma_2^{h,\partial}}\int_{\gamma}b_i(\mathbf{x},f_p(\mathbf{x},t^{n+1}))\nabla v\cdot {\mathbf{n}}_\gamma f_p(\mathbf{x},t^{n+1})\\ &\displaystyle +\displaystyle\sum_{\gamma\in \varGamma_2^{h,\partial}}\frac{\sigma_p}{h_\gamma}\left(\int_{\gamma}b_i(\mathbf{x},f_p(\mathbf{x},t^{n}))\right)\int_{\gamma}f_p(\mathbf{x},t^{n+1})v\\ &\displaystyle +\displaystyle\sum_{\gamma\in \varGamma_1^{h,\partial}}\int_{\gamma}b_i(\mathbf{x},p_h^{n+1})g_p(\mathbf{x},t^{n+1}) v\\ &\displaystyle -\displaystyle\sum_{\gamma\in \varGamma_2^{h,\partial}}\int_{\gamma}\boldsymbol{\beta}_i(\mathbf{x},S_h^{n+1},f_p(\mathbf{x},t^{n+1}),\nabla p_h^{n+1}) \cdot {\mathbf{n}}_\gamma v\\ &\displaystyle -\displaystyle\sum_{\gamma\in \varGamma_1^{h,\partial}}\int_{\gamma}\beta_i(\mathbf{x},f_S(\mathbf{x},t^{n+1}),p_h^{n+1})g_p(\mathbf{x},t^{n+1}) v. \end{array} \end{aligned} $$

We now defined the numerical scheme: find \((S_h^n)_{0\leq n\leq N-1} \subset \mathbb {X}^h\) and \((p_h^n)_{0\leq n\leq N-1} \subset \mathbb {X}^h\), satisfying for all \(v\in \mathbb {X}_h\)

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \displaystyle\sum_{E\in \mathcal{E}^h}\int_{E}\tau_1(\mathbf{x},p_{h}^{n+1}) \frac{S_{h}^{n+1} -S_{h}^n}{\varDelta t}v +\sum_{E\in \mathcal{E}^h}\int_{E}\theta_1(\mathbf{x},S_{h}^{n+1},p_{h}^{n+1}) \frac{ p_{h}^{n+1}-p_{h}^{n}}{\varDelta t}v\\ &\displaystyle +A_1(p_h^{n+1}, S_h^{n+1},v) + J_1(p_h^{n+1},S_h^{n+1},v)\\ &\displaystyle =Q_1(v)+B_1^{n+1}(S_h^{n+1},p_h^{n+1},\nabla p_h^{n+1},v),{} \end{array} \end{aligned} $$
(43)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \displaystyle\sum_{E\in \mathcal{E}^h}\int_{E}\tau_2(\mathbf{x},p_{h}^{n+1}) \frac{S_{h}^{n+1}-S_{h}^n}{\varDelta t}v +\sum_{E\in \mathcal{E}^h}\int_{E}\theta_2(\mathbf{x},S_{h}^{n+1},p_{h}^{n+1}) \frac{p_{h}^{n+1}-p_{h}^n}{\varDelta t}v\\ &\displaystyle A_2(p_h^{n+1}, S_h^{n+1},v) + J_2(p_h^{n+1},S_h^{n+1},v)\\ &\displaystyle \quad =Q_2(v)+B_2^{n+1}(S_h^{n+1},p_h^{n+1},\nabla p_h^{n+1},v), {} \end{array} \end{aligned} $$
(44)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \displaystyle\sum_{E\in \mathcal{E}^h}\int_{E} S_h^0 v= \sum_{E\in \mathcal{E}^h}\int_{E} S_0 v, \end{array} \end{aligned} $$
(45)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \displaystyle\sum_{E\in \mathcal{E}^h}\int_{E} p_h^0 v= \sum_{E\in \mathcal{E}^h}\int_{E} p_0 v. \end{array} \end{aligned} $$
(46)

3.5 The Newton–Raphson Method for Linearization

We denote the basis of \(\mathbb {X}^h\) by \((\phi _j)_{j=1}^J\) and expand the numerical approximations of saturation and pressure for n = 0, ⋯ , N

$$\displaystyle \begin{aligned} S_h^{n} = \sum_{j=1}^J s_j^{n} \phi_j,\quad p_h^{n} = \sum_{j=1}^J p_j^{n} \phi_j.\end{aligned} $$

We denote the vectors of degrees of freedom by \({\mathbf {s}}^n=(s_1^{n},\cdots , s_J^{n})\) and \({\mathbf {p}}^n=(p_1^{n},\cdots , p_J^{n})\). We can rewrite the discrete equations as a general nonlinear system of the form:

$$\displaystyle \begin{aligned} \begin{array}{rcl} F_1({\mathbf{s}}^{n+1},{\mathbf{p}}^{n+1}) =0,\\ F_2({\mathbf{s}}^{n+1},{\mathbf{p}}^{n+1}) =0.\vspace{-3pt} \end{array} \end{aligned} $$

We use the Newton–Raphson method to solve for sn+1 and pn+1:

(47)

where the subscript k denotes the kth iteration. The stopping criterion is

$$\displaystyle \begin{aligned} \|({\mathbf{s}}_{k},{\mathbf{p}}_{k})-({\mathbf{s}}_{k-1},{\mathbf{p}}_{k-1})\|{}_2\leq tolerance \|({\mathbf{s}}_{k},{\mathbf{p}}_{k})\|{}_2. \end{aligned}$$

This algorithm involves calculating the Jacobian \(\frac {\partial (F_1,F_2)}{\partial ({\mathbf {s}}_{k-1},{\mathbf {p}}_{k-1})}\), which is done analytically.

4 Numerical Results

In all simulations, the temperature is fixed at 50 C.

4.1 CO2 Injection Test on Smooth Solutions

We verify the scheme using the method of manufactured solutions. We obtain numerical convergence rates of the partial upwind DG method for the CO2 sequestration model (Eqs. (11) and (12)) on smooth solutions. We describe below the functions of all the parameters and the exact solutions. The density, viscosity, and mass fraction are defined by:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \rho_{n} = 200 + 2\cdot 10^{-6}p,\\ &\displaystyle \mu_{n} = 1.6\cdot 10^{-5} + 5\cdot 10^{-13}p,\\ &\displaystyle X_{w}^{CO_2} = 10^{-15}p^2.\vspace{-3pt} \end{array} \end{aligned} $$

The domain Ω is the unit interval and the final time is T = 0.5. The values of all other parameters are listed in Table 1. The exact smooth solutions are

$$\displaystyle \begin{aligned} p_n(x,t) = 10^5(x-1)^2t+8\cdot 10^6, \quad S_w(x,t) = 0.75\sin{}(0.5\pi x)(1-t) + 0.25.\end{aligned} $$

The source terms are calculated accordingly. Notice that the solutions are linearly dependent on time. Therefore, the backward Euler scheme for time discretization gives no consistency error. Hence, we root out the possibility that a very small time step is needed for the purpose of obtaining the expected convergence rate on space.

Table 1 Table for the parameters for verification example

We use 𝜖 = 1 and set the penalties to be σp = 10, σS = 10. For the Newton’s iteration, the tolerance is 10−10. The starting point of the Newton iteration for each time step is the numerical solution from the previous time step. Tables 2 and 3 show the numerical errors and convergence rates of pn and Sw for r = 1, 2, respectively. “P L2-err” denotes the L2 error for pressure and is defined to be

$$\displaystyle \begin{aligned} \left( \sum_{E\in \mathcal{E}^h}\|p_n(\cdot,0.5)-p_h^N(\cdot)\|{}_{L^2(E)}^2\right)^{\frac{1}{2}}. \end{aligned}$$

“P E-err” denotes the energy error for pressure and is defined to be

$$\displaystyle \begin{aligned} \left( \sum_{E\in \mathcal{E}^h}\| p_n(\cdot,0.5)- p_h^N(0.5)\|{}_{H^1(E)}^2 + \sum_{\gamma\in \varGamma^h}\frac{\sigma_p}{h_\gamma}\| [p_n(\cdot,0.5)-p_h^N(0.5)]\|{}_{L^2(\gamma)}^2\right)^{\frac{1}{2}}. \end{aligned}$$

The errors “ S L2-err” and “S E-err” are defined similarly for the saturation Sw. “CR” denotes the convergence rate. For all these numerical simulations, it takes 3 or 4 Newton iterations to reach the stopping criterion.

Table 2 Errors and convergence rates for smooth solutions for piecewise linears
Table 3 Errors and convergence rates for smooth solutions for piecewise quadratics

Table 2 shows that we obtain first-order convergence rate for pn in the energy norm, but not for Sw, because the energy error for the pressure dominates the total energy error. Since we solve pressure and saturation simultaneously, we are supposed to obtain first-order convergence rate for the total energy error, even though partial result (the saturation in this case) does not converge at the same rate. Table 3 shows that when r = 2, both p and S have the second-order convergence rates or more for the energy norm and third-order convergence rate for the L2 norm. If we compare the results given by r = 2 with r = 1, we see that r = 2 gives much smaller errors, and thus gives us more accurate solutions. Therefore, we prefer r = 2 when we do numerical simulations for multiphase fluid flow problems.

In summary, we have obtained the expected convergence rates for smooth functions using the partial upwind method.

4.2 Two-Phase Incompressible Fluid Flow Problem

In this numerical example, we assume that there is no mass transfer between the two phases and the densities of the two phases are constant. Therefore, we obtain an incompressible two-phase fluid flow problem, which is a simpler problem than the CO2 storage problem. Since there are many studies for this problem, we can compare the results obtained with the partial upwind method with other methods. In this work, we consider the injection of the non-wetting phase into the porous media filled with the wetting phase, because the purpose of this two-phase flow test is to pave the way for CO2 sequestration simulation. We will also compare the partial upwind method with the usual DG method that uses the average numerical flux and show that the partial upwind method is superior for some cases. The two-phase incompressible fluid flow model can be written as:

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle -\phi \rho_n\frac{\partial}{\partial t}S_w -\nabla \cdot \left( \frac{k_{rn}}{\mu_n}\rho_n K\nabla p_n\right) =q^{n},{} \end{array} \end{aligned} $$
(48)
$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle \phi \rho_{w}\frac{\partial}{\partial t}S_{w} -\nabla \cdot \left( \frac{k_{rw}}{\mu_{w}}\rho_{w} K\nabla (p_{n}-p_c)\right)=q^{w}.{} \end{array} \end{aligned} $$
(49)

4.2.1 Example of Homogeneous Medium

The domain Ω is the unit interval. The initial pressure and saturation are

$$\displaystyle \begin{aligned} \begin{array}{rcl} &\displaystyle p_n(x,0) = 2\cdot 10^6, \quad x\in (0,1),\\ &\displaystyle S_w(x,0) = \begin{cases} &\displaystyle 0.3 + 2^5\cdot x, \quad x\in (0,2^{-6}),\\ &\displaystyle 0.8,\quad x\in (2^{-6}, 1).\\ \end{cases} \end{array} \end{aligned} $$

The values of the parameters are listed in Table 4. Figure 4 shows that the non-wetting phase front reaches almost 0.2 m at 30 s and almost 0.4 m at 60 s. Figure 5 shows the same numerical test using the average numerical flux. Comparing the two figures, we can see that both methods can solve this problem well and their results are almost identical. The Newton–Raphson method takes about 4 or 5 iterations to converge for both methods. We also point out that the saturation front for this problem is not very sharp. In the next example, we will change the parameters to obtain a sharper front and we will compare both the partial upwind and averaged flux methods.

Fig. 4
figure 4

Numerical results for Sn using partial upwind DG method. Left and right figures show the solutions at time t = 30 s and t = 60 s, respectively

Fig. 5
figure 5

Numerical results for Sn using the average numerical flux. Left and right figures show the solutions at time t = 30 s and t = 60 s, respectively

Table 4 Parameter values for incompressible two-phase flow in homogeneous medium

We rerun the same example as before, except that the non-wetting phase viscosity μn is chosen to be 10−2 Pa⋅s, which is ten times larger than in the previous example. The resulting saturation front is sharper, thus more challenging to approximate numerically. First, we use the partial upwind method to solve the problem. The penalty values are chosen to be σp = 1000 and σS = 0. The numerical solutions are shown in Fig. 6. The pressure is shown in the left figure and we notice that the pressure gradient has an obvious change near 0.2 m, where also the saturation front is. The saturation front in the right figure is very sharp and it exhibits some local overshoot and undershoot. When we switch to the averaged numerical flux method using the same penalty values, the numerical solution blows up in the first time step. Table 5 summarizes the numerical parameters used for both methods.

Fig. 6
figure 6

Numerical results given by the partial upwind method for p (left) and Sw (right) at t = 60 s. σp = 1000 and σS = 0

Table 5 List of the parameters for the two-phase flow in homogeneous medium

In order to have a case where both methods are stable, we add more diffusion to the saturation by choosing a large value for σS. Figure 7 shows the saturation solutions after 60 s from both methods, when σS = 1000. The left figure uses the partial upwind flux, and the right one uses the average flux. Both methods capture the sharp front, but the right figure shows some wiggles on the interval (0, 0.2). If we choose σS = 100, which means we add less diffusion, the average flux method blows up during the first time iteration, while we know from Fig. 6 that the partial upwind method works well even for σS = 0. From Table 5, we also see that both numerical methods use the same number of iterations to converge, if they do not blow up. Therefore, the partial upwind method is more robust than to the average flux method for this case.

Fig. 7
figure 7

Numerical results for Sw at t = 60 s given by the partial upwind flux (left) and the average flux (right). σp = 1000 and σS = 1000

4.2.2 Example of Heterogenous Medium

The domain is a heterogeneous porous medium in the sense that properties are different in the subdomain (0.1562, 0.3125) than in the rest of the domain. The values of all the parameters are listed in Table 6. The pressure ranges from 8 ⋅ 106 to 8.05 ⋅ 106 Pa. The initial wetting phase saturation is 0.9. We run the test with N = 256 intervals and with Δt = 1 s. Figures 8 and 9 show the numerical results for σS = 10 and σS = 0, respectively. We show the curves of pn and Sw at t = 15 and t = 45 s. At t = 15 s (figures in top row), the saturation front gradually passes the discontinuous point of the porous medium. More wetting phase is left in the high permeability region, resulting a saturation jump. At t = 45 s, we see that there is another saturation jump, where the porous medium property changes. We see from both figures that the one with σS = 0 seems to capture the saturation discontinuity slightly better than σS = 10, because there are less oscillations close to the discontinuities.

Fig. 8
figure 8

Partial upwind numerical results for two-phase flow in heterogenous media. Figures show the numerical solutions pn (left) and Sw (right) at time t = 15 s (top) and t = 45 s (bottom). Penalty values are σp = 1000 and σS = 10

Fig. 9
figure 9

Partial upwind numerical results for two-phase flow in heterogenous media. Figures show the numerical solutions pn (left) and Sw (right) at time t = 15 s (top) and t = 45 s (bottom). Penalty values are σp = 1000 and σS = 0

Table 6 Parameter values for incompressible two-phase flow in heterogenous porous medium

This numerical test shows the promising potential of the partial upwind DG method to solve multiphase multicomponent flows in heterogeneous media.

4.3 Injection of CO2 into Homogeneous Porous Medium

We now simulate the CO2 sequestration problem on the domain Ω = (0, 1000). The initial non-wetting phase pressure is 250 bar and the initial wetting phase saturation is 0.95. Assume that CO2 is injected at the rate of \(\frac {\partial p}{\partial x}=-50\) for 3 years, at the endpoint x = 0. The parameters used in the simulations in this section are listed in Table 7. We first study the effect of varying the polynomial degrees and second the effect of varying the time steps.

Table 7 Parameter values for the simulation of CO2 sequestration problem in homogeneous media

4.3.1 CO2 Injection Simulation for Different Orders of Approximation

We use N = 256 intervals for the mesh and Δt = 5 days for the time step. The numerical solutions are shown in Figs. 10 and 11 for r = 1 and r = 2, separately. We see that the CO2-rich phase reaches approximately 270, 540, and 810 m after 1, 2, and 3 years, respectively. We also observe that the saturation of CO2 gradually grows with time for a given point in space. Taking the point of 200 m, for example, CO2 saturation is about 0.27 after the first year, 0.33 after the second year, and 0.36 after the third year. In addition, comparing Fig. 10 with Fig. 11, we observe that the solution obtained with r = 2 has less overshoot and has a sharper front than the solution obtained with r = 1. The effects of different values of σS are also studied. The case σS = 10 is shown in Fig. 11 and the case σS = 0 is shown in Fig. 12. We observe more oscillations near the saturation front in Fig. 12. It seems that the local oscillations are better controlled with larger penalty values for the term penalizing the saturation.

Fig. 10
figure 10

CO2 injection simulation in 1, 2, and 3 years. CO2 pressure (top), brine saturation (middle), and CO2 saturation (bottom). Parameters are: r = 1, h = 1000∕256 m, Δt = 5 days, σp = 1000, σS = 10

Fig. 11
figure 11

CO2 injection simulation in 1, 2, and 3 years. CO2 pressure (top), brine saturation (middle), and CO2 saturation (bottom). Parameters are: r = 2, h = 1000∕256 m, Δt = 5 days, σp = 1000, σS = 10

Fig. 12
figure 12

CO2 sequestration simulation in 1, 2, and 3 years. CO2 pressure (top), brine saturation (middle), and CO2 saturation (bottom). Parameters are: r = 2, h = 1000∕256 m, Δt = 5 days, σp = 1000, σS = 0

4.3.2 CO2 Injection Simulation for Different Time Steps

In this section, we investigate how large of a time step we can choose when we use the backward Euler for the time discretization. We simulate the injection of CO2 with Δt = 5, 10, 30 days, respectively, on 128 elements for a final time T = 300 days. Figure 13 shows the numerical solutions of the CO2 saturation. We see that the solution with Δt = 10 days is only slightly diffusive than with Δt = 5 days. Therefore, Δt = 10 days gives an accurate enough solution. The solution with Δt = 30 days is more diffuse and fails to capture the sharp front. It is however more efficient and may be used when high accuracy is not the first priority. We also observe that the blue and the green curves have some small oscillations near the front. We note that since the problem is nonlinear, the time step does depend on the mesh size, but it is not clear how they are quantitatively related. We find that for a fixed mesh size, there is a limit to the maximum of the time step for the scheme to be stable. For instance, for this simulation, if we use 256 elements, the scheme blows up immediately with Δt = 30 days.

Fig. 13
figure 13

Comparison of the numerical solutions for CO2 saturation with different time steps. Parameters are: r = 2, h = 1000∕128 m, σp = 1000, σS = 0

4.4 Injection of CO2 into Heterogeneous Porous Medium

We consider a heterogeneous porous medium where the properties are different in the interval (0, 156.25) and the interval (156, 25, 1000). Table 8 lists the values for the parameters of the problem. The initial saturation for the wetting phase is 0.95. The partial upwind method is used on a mesh with 512 elements and the time step is equal to 10 days. The penalties are chosen to be σp = 1000 and σS = 10. Figures 14 and 15 show the simulation for 10 years and 15 years, correspondingly. We can see that there is a jump for the saturation when the non-wetting phase goes from a high permeability medium to a low permeability medium. The Newton–Raphson method takes three steps to converge with a relative tolerance of 10−8.

Fig. 14
figure 14

CO2 pressure and saturation after 10 years of injection into heterogenous porous media

Fig. 15
figure 15

CO2 pressure and saturation after 15 years of injection into heterogenous porous media

Table 8 Parameter values for the CO2 injection into the heterogenous porous medium

This test shows that the partial upwind method is a good candidate for simulating discontinuous solutions.

5 Conclusion

In this work, we propose the partial upwind method, which is a new version of the discontinuous Galerkin method that employs a carefully chosen decomposition of the elliptic and hyperbolic parts of the two-phase two-component model problem. The method is shown to be convergent, stable, and robust for several simulation test cases, including the case of incompressible two-phase flow and the case of injection of CO2 in homogeneous and heterogeneous media in one dimension. Future work will study injection in higher-dimensional domains.