29.1 Introduction

Proper reservoir management often is challenging to perform due to the intrinsic uncertainties and complexities associated with the reservoir properties (see [31]). To this end, accurate results for reservoirs are obtained if a fully-resolved, fine grid discretization is used in the model. At every time step, this requires the solution of large systems of nonlinear equations. The importance of obtaining a simpler model that can represent the physics of the full system is paramount to speed up the workflows that require many (from dozens to thousands) calls of the forward model. This is usually the case in history matching (see [1, 27]), production optimization problems (see [10]) and uncertainty quantifications (see [23]). Also, the computational time of such large-scale models become the bottleneck of fast turnarounds in the decision-making process and assimilation of real-time data into reservoir models (see [16, 21]). Over the past decade, numerous techniques have been applied in porous media flow simulation to reduce the computational effort associated with the solution of the underlying coupled nonlinear partial differential equations. These techniques range from heuristic approaches (see [25, 29]), to more elegant mathematical techniques (see [3, 22]), explore the idea of reducing the complexity of a model that can approximate the full nonlinear system of equations with controlled accuracy. In many cases, reduced-order modeling techniques are a viable way of mitigating computational cost when simulating a large scale model, while they maintain high accuracy when compared with high fidelity models. Reduced order modeling by projection has been used in systems/controls, framework, such as the balanced truncation (see [22]), proper orthogonal decomposition (POD) (see [11]), the trajectory piecewise linear (TPWL) techniques of Cardoso and Durlofsky [6], empirical interpolation methods (see [12, 19]), bilinear Krylov subspace methods (see [17]) and quadratic bilinear model order reduction (see [20]). Many of these simulation models treat the reservoir as a whole model, while near-well regions in reservoir simulations usually require Local Grid Refinement (LGR) and Local Time Stepping (LTS) due to several physical processes that occur in these regions such as higher Darcy velocities, the coupling of the stationary well model with the transient reservoir model, high non-linearities due to phase segregation (typically gas separates) and complex physics such as formation damage models. In addition the near-well geological model is usually finer in the near-well region due to the higher availability of reliable data. Different approaches combining LTS and LGR have been studied for reservoir simulation applications. The first class of algorithms belongs to Domain Decomposition Methods (DDM). Matching conditions are defined at the near-well reservoir interface with possible overlap, and a Schwarz algorithm is used to compute the solution (see [13, 26]). A second class of methods uses both a coarse grid on the full domain and a LGR in the near-well grid (usually called windowing). These grids communicate both at the near-well reservoir interface and also between the perforated fine and coarse cells. In [24], Walid et al. combined these two latter approaches. An efficient iterative algorithm is obtained using at the near-well reservoir interface, optimized Robin conditions for the pressure. DDM and MOR has been combined and applied in different multi-physics problems (see [2, 4, 5, 8, 9], and [30]).

In this chapter, we combine the DDM algorithm developed in [24] with the MOR technique developed in [18]. We describe model reduction techniques that consider near-well and reservoir regions separately and use different spatial and temporal resolutions to achieve efficient and accurate reduced order models. We use full resolution to solve the near-well discretization and apply MOR (POD-DEIM) in the rest of the domain. We use POD to construct a low-order model using snapshots formed from a forward simulation with the original high-order model. In the presence of a general nonlinearity, the computational complexity of the reduced model still depends to the original fully-resolved discretization. By employing the Discrete Empirical Interpolation Method (DEIM), we reduce the computational complexity of the nonlinear term of the reduced model to a cost proportional to the number of reduced variables obtained by POD.

This chapter is organized as follows. We first present in Sect. 29.2 a compressible flow model in porous media. Then, in Sect. 29.3 we describe the local space and time refinement discretization coupled with model order reduction using POD and DEIM. Finally in Sect. 29.4 we illustrate the efficiency of our MOR-DDM algorithm on 2D test cases both in terms of accuracy and CPU time compared with the reference solution obtained using the LGR grid with global fine time stepping and full resolution.

29.2 Compressible Flow Model in Porous Media

In this section we consider compressible phase flow in a porous media. The model describes the injection of gas through a injector well in a 2D reservoir initially saturated with gas. The velocity is given by the Darcy laws

$$\displaystyle{ \mathbf{V} = -\frac{1} {\mu } \;\mathbf{K}\;\mathbf{\nabla }p, }$$
(29.1)

where p is the pressure and μ is the gas viscosity assumed to be constant. The rock permeability is denoted by K and the rock porosity by ϕ. Then, the pressure p is solution of the following mass conservation equation.

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{r@{\,\,}l@{\,\,}ll} \phi \ \partial _{t}\rho (\,p) +\; \mathbf{\nabla }\cdot \left (\rho (\,p)\ \mathbf{V}\right )\,\,& = 0, \,\,&\mbox{ in }\varOmega _{r} \times (0,T), \\ -\mathbf{K}\nabla p \cdot \mathbf{n}\,\,& = 0, \,\,&\mbox{ on }\varGamma _{r} \times (0,T), \\ p\,\,& = p_{\mathrm{bhp}},\,\,&\mbox{ on }\varGamma _{w} \times (0,T), \\ p\,\,& = p_{\mathrm{init}},\,\,&\mbox{ in }\varOmega _{r} \times \{ 0\},\end{array} \right.& &{}\end{array}$$
(29.2)

where ρ( p) is the mass density (assumed linear) and p bhp(t) is the imposed bottom hole pressure at the well boundary. To simplify notation, we assume that the injection pressure p bhp(t) is chosen such that − Kp ⋅ n w < 0 at the well boundaries Γ w , where n w is the unit normal vector at the well boundaries outward to Ω r . The case of producer wells could also be dealt without additional difficulties. The near-well accuracy controls the injection (production) rate which motivates the use of a near-well refinement of the spatial and temporal resolution for the simulation of this model.

Let us denote by Ω w Ω r the near-well region. In the following, the outer boundary of the near-well region Ω w is denoted by Γ rw (see Fig. 29.1). We use a model order reduction-domain decomposition method (MOR-DDM) to solve Eqs. (29.1)– (29.2) with a coarse discretization in space and time in the reservoir domain Ω r and a locally refined space and time discretization in the near-well region Ω w . These discretizations are coupled by solving iteratively both subproblems on a given time interval (t n−1, t n) using appropriate interface conditions at Γ w and Γ rw . A Robin condition for the pressure is used at the boundary Γ rw of the subdomain Ω w . At the well boundary Γ w of the domain Ω r , a total flux Neumann condition is imposed.

Fig. 29.1
figure 1

Example of reservoir domain Ω r and near-well subdomain Ω w with the near-well reservoir interface Γ rw , and the well boundaries Γ w

29.3 Model Order Reduction Using Local Space and Time Refinement

Instead of using a local grid refinement and a global fine time step size with full resolution to solve Eqs. (29.1)– (29.2), we use a domain decomposition method coupling the coarse discretization in space and time in the reservoir domain using POD-DEIM with a fine discretization in space and time in the near-well domain using full resolution. In the following, first the coarse and fine finite volume discretizations of Ω r and Ω w are introduced, then we describe the MOR-DDM algorithm with a single time step, and finally the extension taking into account local time stepping schemes in the near-well domain is explained.

29.3.1 Two Level Finite Volume Discretization

The discretization (see Fig. 29.2) starts from a coarse finite volume mesh of the full reservoir domain Ω r defined by

$$\displaystyle{ {\Bigl (\mathcal{M}_{r},\mathcal{F}_{r}^{\mathrm{int}},\mathcal{P}_{ w}\Bigr )}, }$$

where \(\mathcal{M}_{r}\) is the set of coarse cells K, \(\mathcal{F}_{r}^{\mathrm{int}}\) the set of coarse inner faces σ, and \(\mathcal{P}_{w}\) the set of well perforations. The mesh is assumed to be conforming in the sense that the set of neighbouring cells \(\mathcal{M}_{\sigma } \subset \mathcal{M}_{r}\) of an inner face \(\sigma \in \mathcal{F}_{r}^{\mathrm{int}}\) contains exactly two cells K and L. The inner face σ is denoted by σ = K | L. Considering that the size of the cells is very large compared with the well radius, the wells are discretized using Peaceman’s indices in each perforated cell [28]. For the sake of simplicity, the well is assumed to be vertical with consequently, in our horizontal 2D case, a single perforation. Let us denote by \(\mathcal{P}_{w}\) the set of perforations σ and by \(K_{\sigma }^{r} \in \mathcal{M}_{r}\) the corresponding perforated coarse cells.

Fig. 29.2
figure 2

Left: LGR mesh \(\mathcal{M}^{\mathrm{lgr}}\). Top right: reservoir coarse mesh \(\mathcal{M}_{r}\). Bottom right: near-well fine mesh \(\mathcal{M}_{w}\) and near-well reservoir interfaces \(\mathcal{F}_{rw}\)

A set of near-well coarse cells is assumed to be refined (coarse cells inside the red boundary in Fig. 29.2) and the near-well mesh is obtained by adding a layer of coarse cells at the boundary of the union of the refined cells. The resulting near-well mesh is defined by

$$\displaystyle{ {\Bigl (\mathcal{M}_{w},\mathcal{F}_{w}^{\mathrm{int}},\mathcal{F}_{ rw},\mathcal{P}_{w}\Bigr )}, }$$

where \(\mathcal{M}_{w}\) is the set of cells K, \(\mathcal{F}_{w}^{\mathrm{int}}\) is the set of inner faces σ, \(\mathcal{P}_{w}\) is the set of well perforations, and \(\mathcal{F}_{rw} \subset \mathcal{F}_{r}^{int}\) is the set of boundary faces corresponding by construction to coarse faces. The fine perforated cells are denoted by K σ w for all perforations \(\sigma \in \mathcal{P}_{w}\) as Fig. 29.2 displays. We assume that the near-well mesh is conforming in the sense that the set of neighboring cells \(\mathcal{M}_{\sigma } \subset \mathcal{M}_{w}\) of an inner face \(\sigma \in \mathcal{F}_{w}^{\mathrm{int}}\) contains exactly two cells K and L, and the inner face σ is denoted by σ = K | L. At the near-well reservoir interface, for each face \(\sigma \in \mathcal{F}_{rw}\), we assume that the set of the two neighboring cells \(\mathcal{M}_{\sigma } =\{ K,L\}\) is ordered such that \(K \in \mathcal{M}_{w} \cap \mathcal{M}_{r}\) and \(L \in \mathcal{M}_{r}\setminus \mathcal{M}_{w}\).

A cell centre finite volume discretization is used for the discretization of the compressible flow model. We will denote by P r (resp. P w ) the vector of cell pressures P r, K , \(K \in \mathcal{M}_{r}\) (resp. P w, K , \(K \in \mathcal{M}_{w}\)). Let σ = K | L be an inner coarse or fine face, and n K, σ the unit normal vector at the face σ outward to the cell K. Let P be the reservoir or near-well discrete pressure P r or P w . Assuming the orthogonality of the mesh w.r.t. the permeability field K, the Darcy flux \(\int _{\sigma } -\mathbf{K}\nabla p \cdot \mathbf{n}_{K,\sigma }d\sigma\) is approximated by the following conservative Two Point Flux Approximation (TPFA) [14]

$$\displaystyle{ F_{K,\sigma }(\,P) = T_{\sigma }(\mathbf{P}_{K} -\mathbf{P}_{L}), }$$

where T σ is the transmissivity of the face \(\sigma \in \mathcal{F}_{r}^{int}\) or \(\sigma \in \mathcal{F}_{w}^{int}\). A Two Point flux approximation of the Darcy flux is also assumed at the near-well reservoir interface \(\sigma = K\vert L \in \mathcal{F}_{rw}\). It is denoted by

$$\displaystyle{ F_{K,\sigma }(\mathbf{P}_{w,K},\mathbf{P}_{r,L}) = T_{\sigma }(\mathbf{P}_{w,K} -\mathbf{P}_{r,L}), }$$

where T σ is the transmissivity of the face σ. In the following DDM algorithm, P r, L represents the pressure interface value viewed by the near-well subdomain in order to obtain the same finite volume discretization than the one obtained on the single LGR mesh \(\mathcal{M}^{\mathrm{lgr}}\) shown in Fig. 29.2. For each \(\sigma \in \mathcal{P}_{w}\), the Darcy flux \(\int _{\sigma } -\mathbf{K}\nabla p \cdot \mathbf{n}_{K,\sigma }d\sigma\) at the well perforation boundary is defined by the two point flux approximation

$$\displaystyle{ F_{K,\sigma }^{s}(\mathbf{P}_{ s,K},\mathbf{P}_{\sigma }) = PI_{\sigma }^{s}(\mathbf{P}_{ s,K} -\mathbf{P}_{\sigma }), }$$

where P σ denotes the pressure inside the perforation, K = K σ s is the coarse (s = r) or fine (s = w) perforated cell, and PI σ s for s = r or s = w is the modified transmissivity of the perforation σ in the cell K obtained using the Peaceman formula which takes into account the singularity of the pressure solution at the well (see [28]).

29.3.2 Model Order Reduction: Domain Decomposition Method

At the near-well reservoir interface \(\mathcal{F}_{rw}\), a Robin optimized interface condition is used.

$$\displaystyle\begin{array}{rcl} \begin{array}{r@{\,\,}c@{\,\,}ll} \,\,&\,\,&\lambda \ p_{w} +\alpha \ \mathbf{K}\;\nabla p_{w} \cdot \mathbf{n}_{w} =\lambda \ p_{r} +\alpha \ \mathbf{K}\;\nabla p_{r} \cdot \mathbf{n}_{w},\end{array} & &{}\end{array}$$
(29.3)

where n w is the normal at Γ rw outward Ω w , and λ and α are two positive optimized parameters (see [24]). The parameter α is set to 1 and the parameter λ is chosen to optimize the convergence rate leading to an optimized DD algorithm. The optimization of the coefficient λ is done using existing theory for optimized Schwarz methods (see [15]), the optimal parameter can be computed analytically in such a way that the DDM algorithm converges in two iterations after time integration on one coarse time step, without taking into account the local time stepping. On the well boundary Γ w , a Neumann total flux condition is used. In our injection well example, we obtain the following condition

$$\displaystyle\begin{array}{rcl} \begin{array}{r@{\,\,}c@{\,\,}ll} \,\,&\,\,& -\rho (\,p_{r})\frac{1} {\mu } \mathbf{K}\nabla p_{r} = -\rho (\,p_{\mathrm{bhp}})\frac{1} {\mu } \mathbf{K}\nabla p_{w},\end{array} & &{}\end{array}$$
(29.4)

Let us consider, on the reservoir and near-well meshes, the same time discretization t 0, t 1, ⋯ , t N of the interval (0, T) with t 0 = 0, t N = T, and Δt n = t nt n−1 > 0, n = 1, ⋯ , N. The gas flow model in porous media is integrated by an implicit Euler scheme. The discretization in space uses the TPFA discretization of the Darcy flow together with an upwinding of the mass density with respect to the sign of the Darcy flow. Let the reservoir and near-well solutions at time t n−1 be given. Let us denote by x + = max(x, 0) and x = min(x, 0). Then, knowing the near-well solution P w at time t n, the reservoir subproblem computes the solution P r at time t n of the conservation equations is given by:

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \,\,&\,\,&\text{For each cell }K \in \mathcal{M}_{r},\\ \,\,&\,\,& \\ \,\,&\,\,&\phi _{K}\,\frac{\vert K\vert } {\varDelta t^{n}} {\Bigl (\rho (\mathbf{P}_{r,K}) -\rho (\mathbf{P}_{r,K}^{n-1})\Bigr )} \\ \,\,\\ \,\,\\ \,\, \\ \,\,&\,\,& +\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{r,K})} {\mu } F_{K,\sigma }(\mathbf{P}_{r})^{+} +\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{r,L})} {\mu } F_{K,\sigma }(\mathbf{P}_{r})^{-} \\ \,\,&\,\,& +\sum _{\sigma \in \mathcal{P}_{w}\,\vert \,K_{\sigma }^{r}=K}\frac{\rho (\,p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{r}(\mathbf{P}_{ r,K},p_{\mathrm{bhp}}) = 0,\end{array} \right.& &{}\end{array}$$
(29.5)

coupled with the well perforations interface conditions for all \(\sigma \in \mathcal{P}_{w}\)

$$\displaystyle{ \frac{\rho (p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{r}(\mathbf{P}_{ r,K},p_{\mathrm{bhp}}) = \frac{\rho (p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{w}(\mathbf{P}_{ w,K_{\sigma }^{w}},p_{\mathrm{bhp}}). }$$
(29.6)

Knowing the solution P r , the near-well subproblem computes the solution P w , of the conservation equations is given by:

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \,\,&\,\,&\mbox{ For each cell }K \in \mathcal{M}_{w},\\ \,\,&\,\,& \\ \,\,&\,\,&\phi _{K}{\Bigl (\rho (\mathbf{P}_{w,K}) -\rho (\mathbf{P}_{w,K}^{n-1})\Bigr )}\frac{\vert K\vert } {\varDelta t^{n}}\\ \,\, \\ \,\,&\,\,& +\sum _{\sigma =K\vert L\in \mathcal{F}_{w}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{w,K})} {\mu } F_{K,\sigma }(\mathbf{P}_{w})^{+} +\sum _{\sigma =K\vert L\in \mathcal{F}_{w}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{w,L})} {\mu } F_{K,\sigma }(\mathbf{P}_{w})^{-} \\ \,\,&\,\,& +\sum _{\sigma =K\vert L\in \mathcal{F}_{rw}}\frac{\rho (\mathbf{P}_{w,K})} {\mu } F_{K,\sigma }(\mathbf{P}_{w,K},\mathbf{P}_{w,\sigma })^{+} +\sum _{\sigma =K\vert L\in \mathcal{F}_{rw}}\frac{\rho (\mathbf{P}_{w,\sigma })} {\mu } F_{K,\sigma }(\mathbf{P}_{w,K},\mathbf{P}_{w,\sigma })^{-} \\ \,\, \\ \,\,&\,\,& +\sum _{\sigma \in \mathcal{P}_{w}\,\vert \,K_{\sigma }^{w}=K}\frac{\rho (\,p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{w}(\mathbf{P}_{ w,K},p_{\mathrm{bhp}}) = 0,\end{array} \right.& &{}\end{array}$$
(29.7)

coupled with the following near-well reservoir interface conditions for all σ = K | L

$$\displaystyle{ \vert \sigma \vert \lambda _{\sigma }\mathbf{P}_{w,\sigma } -\alpha _{\sigma }F_{K,\sigma }(\mathbf{P}_{w,K},\mathbf{P}_{w,\sigma }) = \vert \sigma \vert \lambda _{\sigma }\mathbf{P}_{r,\sigma } -\alpha _{\sigma }F_{K,\sigma }(\mathbf{P}_{r,K},\mathbf{P}_{r,\sigma }), }$$
(29.8)

where | σ | the lengh of the face σ.

Model reduction is performed using POD and DEIM, to solve the reservoir subproblem (29.5)– (29.6) coupled with a fully-resolved of the near-well subproblem (29.7)– (29.8). POD constructs a low-order model using snapshots from a forward simulation with the original high-order model using fine time step and LGR mesh \(\mathcal{M}^{lgr}\).

Let us denote by n r the number of cells in the mesh \(\mathcal{M}_{r}\) located into the subdomain Ω r ∖Ω w , by n w the number of cells in the mesh \(\mathcal{M}_{r}\) located in the near-well domain Ω w , and by n p n r the reduced pressure dimensional space. Given a set of snapshots \(\mathbb{S}_{\mathbf{P}} ={\Bigl [ \mathbf{P}_{r}(t^{1}),\mathbf{P}_{r}(t^{2}),\ldots.,\mathbf{P}_{r}(t^{N})\Bigr ]} \in \mathbb{R}^{n_{r}\times N}\), we apply a singular value decomposition (SVD) on the matrix \(\mathbb{S}_{\mathbf{P}}\). The POD basis matrix \(\varphi \in \mathbb{R}^{n_{r}\times n_{p}},\) corresponds to the first n p left singular vectors. To extend the POD basis matrix to the full reservoir domain and to keep the full well-resolution in the near-well region, we define the following prolongation of the POD basis matrix

$$\displaystyle{ \tilde{\varphi }= \left (\begin{array}{*{10}c} \varphi & 0\\ 0 &I_{n_{ w}}\\ \end{array} \right ) \in \mathbb{R}^{n_{rw}\times n_{pw} }, }$$

where n rw = n r + n w and n pw = n p + n w , then the pressure is projected into the reduced subspace as, \(\mathbf{P}_{r}(t) =\tilde{\varphi } \mathbf{p}_{r}(t)\), where \(\mathbf{p}_{r}(t) \in \mathbb{R}^{n_{pw}}\) is the reduced solution. POD is usually limited to problems with linear or bilinear terms. In the presence of a general nonlinearity, the computational complexity of the reduced model still depends to the finely resolved discretization. DEIM effectively overcomes this shortcoming of the method. DEIM constructs a subspace to approximate the nonlinear terms and selects points that specify an interpolation based projection of dimension m p n r to give a nearly optimal subspace approximation to the nonlinear term (see [7, 18]).

Let us denote by N r  (P r (t)) the nonlinear term in the reservoir subproblem (29.5)– (29.6), then for each cell \(K \in \mathcal{M}_{r}\), (N r  (P r )) K is given by:

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \,\,&(\mathbf{N}_{r}\ (\mathbf{P}_{r}))_{K} =\,\,&\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{r,K})} {\mu } F_{K,\sigma }(\mathbf{P}_{r})^{+} +\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\mathbf{P}_{r,L})} {\mu } F_{K,\sigma }(\mathbf{P}_{r})^{-} \\ \,\,& \,\,& +\sum _{\sigma \in \mathcal{P}_{w}\,\vert \,K_{\sigma }^{r}=K}\frac{\rho (\,p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{r}(\mathbf{P}_{ r,K},p_{\mathrm{bhp}})\end{array} \right.& &{}\end{array}$$
(29.9)

Let us define the diagonal matrix \(L = (\vert K\vert \phi _{K})_{K\in \mathcal{M}_{r}} \in \mathbb{R}^{n_{rw}\times n_{rw}}\) where ϕ K and | K | denote, respectively, the porosity and the surface of the cell K. Then the system (29.5) can be rewritten in the following algebraic form:

$$\displaystyle\begin{array}{rcl} \frac{1} {\varDelta t^{n}}\mathbf{L}\ {\Bigl (\rho (\mathbf{P}_{r}) -\rho (\mathbf{P}_{r}^{n-1})\Bigr )} + \mathbf{N}_{ r}\ (\mathbf{P}_{r}) = 0.& &{}\end{array}$$
(29.10)

We replace P r and P r n−1 respectively by \(\tilde{\varphi }\mathbf{p}_{r}\) and \(\tilde{\varphi }\mathbf{p}_{r}^{n-1}\) and we project the system (29.10) onto \(\tilde{\varphi }\), then the reduced system of (29.10) is of the form:

$$\displaystyle\begin{array}{rcl} \frac{1} {\varDelta t^{n}}\tilde{\varphi }^{T}\ \mathbf{L}\ \tilde{\varphi }{\Bigl (\rho (\mathbf{p}_{ r}) -\rho (\mathbf{p}_{r}^{n-1})\Bigr )} +\tilde{\varphi } ^{T}\ \mathbf{N}_{ r}\ (\tilde{\varphi }\mathbf{p}_{r}) = 0,& &{}\end{array}$$
(29.11)

We approximate the nonlinear function N r on a linear subspace spanned by basis vectors \(\varPsi ={\Bigl (\psi _{1},\cdots \,,\psi _{m_{p}}\Bigr )} \in \mathbb{R}^{n_{r}\times m_{p}}\), obtained by applying POD to the snapshots of the nonlinear function \(\mathbf{N}_{r}: \mathbb{S}_{\mathbf{N}_{r}} ={\Bigl [ \mathbf{N}_{r}(\mathbf{P}_{r}(t^{1})),\mathbf{N}_{r}(\mathbf{P}_{r}(t^{2})),\cdots \,,\mathbf{N}_{r}(\mathbf{P}_{r}(t^{N}))\Bigr ]} \in \mathbb{R}^{n_{r}\times N}\). Similarly to POD, to extend the DEIM to the full reservoir domain and to keep the full well-resolution in the near-well region, we define the following prolongation of the DEIM basis matrix

$$\displaystyle{ \tilde{\varPsi }= \left (\begin{array}{*{10}c} \varPsi & 0\\ 0 &I_{n_{ w}}\\ \end{array} \right ) \in \mathbb{R}^{n_{\mathrm{lgr}}\times m_{pw} }, }$$

where m pw = m p + n w , then \(\mathbf{N}_{r} \approx \sum _{i=1}^{m_{pw}}c_{i}\,\tilde{\psi }_{i} =\tilde{\varPsi } \mathbf{c}\). Thus, DEIM selects only m pw rows of \(\tilde{\varPsi }\) to compute the coefficients c. This can be formalized using the selection matrix

$$\displaystyle{ \mathcal{P} ={\Bigl [ e_{\wp _{1}},\ldots,e_{\wp _{m_{pw}}}\Bigr ]} \in \mathbb{R}^{n_{\mathrm{lgr}}\times m_{pw} } }$$

where e i is the ith column of the identity matrix. Assume \(\mathcal{P}^{T}\,\tilde{\varPsi }\) is nonsingular, the reduced system (29.11) becomes

$$\displaystyle\begin{array}{rcl} \frac{1} {\varDelta t^{n}}\mathop{\underbrace{ \tilde{\varphi }^{T}\ \mathbf{L}\ \tilde{\varphi }}}\limits _{n_{pw}\times n_{pw}}{\Bigl (\rho (\mathbf{p}_{r}) -\rho (\mathbf{p}_{r}^{n-1})\Bigr )} +\mathop{\underbrace{ \tilde{\varphi }^{T}\,\tilde{\varPsi }(\mathcal{P}^{T}\,\tilde{\varPsi })^{-1}}}\limits _{ n_{pw}\times m_{pw}}\ \mathop{\underbrace{ \mathcal{P}^{T}\ \mathbf{N}_{ r}\ (\tilde{\varphi }\mathbf{p}_{r})}}\limits _{m_{pw}\times 1} = 0,\qquad & &{}\end{array}$$
(29.12)

When the nonlinearity is component-wise, the selection matrix \(\mathcal{P}^{T}\) can be brought inside the nonlinearity N r and hence the computational complexity of \(\mathcal{P}^{T}\ \mathbf{N}_{r}\ (\tilde{\varphi }\mathbf{p}_{r})\) is independent of the fine grid dimension n lgr (size of high fidelity model). This is obviously not applicable in our case. However, thanks to the TPFA discretization, the evolution of each nonlinear element depends only to the neighboring elements, and therefore it is possible to compute the nonlinear term \(\mathcal{P}^{T}\ \mathbf{N}_{r}\ (\tilde{\varphi }\mathbf{p}_{r})\) independently of the fine grid dimension n lgr using a certain sparse matrix data structure. Let \(\tilde{\varphi }_{K}\) the row of the basis matrix \(\tilde{\varphi }\) corresponding to the cell \(K \in \mathcal{M}_{r}\), then \(\mathbf{P}_{r,K} =\tilde{\varphi } _{K}\mathbf{p}_{r}\), and hence the Two Point flux approximation of the Darcy flux can be rewritten in the following reduced order form

$$\displaystyle{ F_{K,\sigma }(\mathbf{P_{r}}) = T_{\sigma }(\mathbf{P}_{r,K} -\mathbf{P}_{r,L}) = T_{\sigma }(\tilde{\varphi }_{K} -\tilde{\varphi }_{L})\mathbf{p}_{r} =\tilde{ F}_{K,\sigma }(\,\mathbf{p_{r}}) }$$

Using the notations above, Eq. (29.9) can be rewritten in the following reduced order form

$$\displaystyle\begin{array}{rcl} \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \,\,&(\tilde{\mathbf{N}}_{r}\ (\,\mathbf{p}_{r}))_{K} =\,\,&\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\tilde{\varphi }_{K}\mathbf{p}_{r})} {\mu } \tilde{F}_{K,\sigma }(\,\mathbf{p}_{r})^{+} +\sum _{\sigma =K\vert L\in \mathcal{F}_{r}^{\mathrm{int}}} \frac{\rho (\tilde{\varphi }_{L}\mathbf{p}_{r})} {\mu } \tilde{F}_{K,\sigma }(\,\mathbf{p}_{r})^{-} \\ \,\,& \,\,& +\sum _{\sigma \in \mathcal{P}_{w}\,\vert \,K_{\sigma }^{r}=K}\frac{\rho (\,p_{r,\sigma })} {\mu } F_{K,\sigma }^{r}(\tilde{\varphi }_{ K}\mathbf{p}_{r},p_{r,\sigma }),\end{array} \right.& &{}\end{array}$$
(29.13)

with p r, σ denotes the pressure inside the perforation. Let us denote by K i the ith cell in the reservoir mesh \(\mathcal{M}_{r}\). Then, a new formulation of \(\mathbf{N}_{r}(\tilde{\varphi }\mathbf{p}_{r})\) is provided by

$$\displaystyle{ \mathbf{N}_{r}\ (\tilde{\varphi }\mathbf{p}_{r}) ={\Bigl [ (\tilde{\mathbf{N}}_{r}\ (\,\mathbf{p}_{r}))_{K^{1}},\ldots,(\tilde{\mathbf{N}}_{r}\ (\,\mathbf{p}_{r}))_{K^{n_{rw}}}\Bigr ]}^{T} \in \mathbb{R}^{n_{rw} }, }$$

and thus

$$\displaystyle{ \mathcal{P}^{T}\ \mathbf{N}_{ r}\ (\tilde{\varphi }\mathbf{p}_{r}) ={\Bigl [ (\tilde{\mathbf{N}}_{r}\ (\,\mathbf{p}_{r}))_{K^{\wp _{1}}},\ldots,(\tilde{\mathbf{N}}_{r}\ (\,\mathbf{p}_{r}))_{K^{\wp _{m_{pw}} }}\Bigr ]}^{T} \in \mathbb{R}^{m_{pw} }. }$$

Equation (29.12) coupled with the well perforations interface conditions for all \(\sigma \in \mathcal{P}_{w}\)

$$\displaystyle{ \frac{\rho (\,p_{r,\sigma })} {\mu } PI_{\sigma }^{s}(\tilde{\varphi }_{ K_{\sigma }^{r}}\mathbf{p}_{r} - p_{r,\sigma }) = \frac{\rho (\,p_{\mathrm{bhp}})} {\mu } F_{K,\sigma }^{w}(\mathbf{P}_{ w,K_{\sigma }^{w}},p_{\mathrm{bhp}}). }$$
(29.14)

Let us set

$$\displaystyle{ \mathbf{p}_{r,\mathcal{P}_{w}} ={\Bigl ( p_{r,\sigma },\sigma \in \mathcal{P}_{w}\Bigr )}, }$$

using these notations, we can rewrite the reservoir subproblem (29.12)– (29.14) as follows

$$\displaystyle{ \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \mathcal{R}_{r}{\Bigl (\mathbf{p}_{r},\mathbf{p}_{r,\mathcal{P}_{w}}\Bigr )}\,\,& =\,\,&0, \\ \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{p}_{r},\mathbf{p}_{r,\mathcal{P}_{w}}\Bigr )}\,\,& =\,\,&\mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w},p_{\mathrm{bhp}}\Bigr )}, \end{array} \right. }$$

where \(\mathcal{R}_{r}\) denotes the system of reservoir conservation equation, and \(\mathcal{B}_{Q_{T}}\) denotes the total flux boundary conditions at the well perforations \(\mathcal{P}_{w}\). Similarly, let us set

$$\displaystyle{ \mathbf{P}_{w,\mathcal{F}_{rw}} ={\Bigl ( \mathbf{P}_{w,\sigma },\sigma \in \mathcal{F}_{rw}\Bigr )}\,\,\mbox{ and }\,\,\mathbf{P}_{r,\mathcal{F}_{rw}} ={\Bigl (\tilde{\varphi } _{L}\mathbf{p}_{r},\sigma = K\vert L,\sigma \in \mathcal{F}_{rw}\Bigr )}, }$$

Similarly, we can rewrite the near-well subproblem (29.7)– (29.8) as follows

$$\displaystyle{ \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \mathcal{R}_{w}{\Bigl (\mathbf{P}_{w},\mathbf{P}_{w,\mathcal{F}_{rw}}\Bigr )}\,\,& =\,\,&0, \\ \mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{P}_{w},\mathbf{P}_{w,\mathcal{F}_{rw}}\Bigr )}\,\,& =\,\,&\mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{P}_{r},\mathbf{P}_{r,\mathcal{F}_{rw}}\Bigr )},\end{array} \right. }$$

where \(\mathcal{R}_{w}\) denotes the system of reservoir conservation equation, and \(\mathcal{B}_{\mathrm{robin}}\) denotes the Robin boundary condition for the pressure at the interface Γ rw . Then, the MOR-DDM algorithm, at a given time step t n, is the following multiplicative Schwarz algorithm which computes the reservoir and near-well solutions p r , and P w of the coupled systems (29.12)– (29.14)– (29.7)– (29.8) solving successively the following subproblems

$$\displaystyle{ \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \mathcal{R}_{r}{\Bigl (\mathbf{p}_{r}^{k},\mathbf{p}_{r,\mathcal{P}_{w}}^{k}\Bigr )}\,\,& =\,\,&0, \\ \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{p}_{r}^{k},\mathbf{p}_{r,\mathcal{P}_{w}}^{k}\Bigr )}\,\,& =\,\,&\mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w}^{k-1},p_{\mathrm{bhp}}\Bigr )} \end{array} \right. }$$
$$\displaystyle{ \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \mathcal{R}_{w}{\Bigl (\mathbf{P}_{w}^{k},\mathbf{P}_{w,\mathcal{F}_{rw}}^{k}\Bigr )}\,\,& =\,\,&0, \\ \mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{P}_{w}^{k},\mathbf{P}_{w,\mathcal{F}_{rw}}^{k}\Bigr )}\,\,& =\,\,&\mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{p}_{r}^{k},\mathbf{P}_{r,\mathcal{F}_{rw}}^{k}\Bigr )}\end{array} \right. }$$

for k ≥ 1 until the following stopping criteria is fulfilled:

$$\displaystyle{ dQ = \frac{\vert \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w}^{k},p_{\mathrm{bhp}}\Bigr )} -\mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w}^{k-1},p_{\mathrm{bhp}}\Bigr )}\vert } {\vert \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w}^{k},p_{\mathrm{bhp}}\Bigr )}\vert } \leq \varepsilon, }$$
(29.15)

for a given ɛ.

29.3.3 Local Time Stepping

Let t 0, ⋯ , t N denote the coarse time discretization on the reservoir domain with the coarse time stepping Δt n = t nt n−1 > 0, n = 1, ⋯ , N. Each time interval (t n−1, t n) is discretized using a local time stepping scheme in the near-well subdomain denoted by t n, m, m = 0, ⋯ , N n with Δt n, m = t n, mt n, m−1 > 0 for all m = 1, ⋯ , N n , and t n, 0 = t n−1, \(t^{n,N_{n}} = t^{n}\). Firstly, the boundary conditions at the near-well reservoir interface are interpolated in time between the two successive coarse times t n−1 and t n:

$$\displaystyle{ \left \{\begin{array}{r@{\,\,}c@{\,\,}l} \mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{P}_{w}^{n,m,k},\mathbf{P}_{w,\mathcal{F}_{rw}}^{n,m,k}\Bigr )}\,\,& =\,\,&\frac{t^{n,m}-t^{n-1}} {\varDelta t^{n}} \ \mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{p}_{r}^{k,n},\mathbf{P}_{r,\mathcal{F}_{rw}}^{k,n}\Bigr )} \\ \,\,& \,\,& + \frac{t^{n}-t^{n,m}} {\varDelta t^{n}} \ \mathcal{B}_{\mathrm{robin}}{\Bigl (\mathbf{p}_{r}^{k,n-1},\mathbf{P}_{r,\mathcal{F}_{rw}}^{k,n-1}\Bigr )}.\end{array} \right. }$$

Secondly, at each well perforation of the reservoir coarse mesh, the time average of the total flux between t n−1 and t n is imposed:

$$\displaystyle{ \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{p}_{r}^{n,k},\mathbf{p}_{ r,\mathcal{P}_{w}}^{n,k}\Bigr )} =\sum _{ m=1}^{N_{n} }\frac{\varDelta t^{n,m}} {\varDelta t^{n}} \mathcal{B}_{Q_{T}}{\Bigl (\mathbf{P}_{w}^{n,m,k-1},p_{\mathrm{ bhp}}^{n,m}\Bigr )}. }$$

To construct the reduced basis for the pressure and the nonlinear term at the offline stage, we collect the snapshots at each coarse time step of the full global fine time step resolution in the LGR mesh \(\mathcal{M}^{\mathrm{lgr}}\).

29.4 Numerical Tests

The reservoir, defined by the two-dimensional domain Ω r = (−L, L) × (−L, L) with L = 2. 5 km, is assumed to be heterogeneous with porosity ϕ and permeability K shown in Figs. 29.3 and 29.4 (SPE10, top layer). The reservoir is initially saturated with liquid (gas) at initial pressure p init = 40 ⋅ 105 Pa. The bottom hole pressure p bhp (t) at offline stage and online stage are depicted in Fig. 29.5. The vertical well injector of radius r w = 0. 12 m is located at the center of the reservoir. The gas mass density defined by

$$\displaystyle{ \rho (\,p) = \frac{M} {RT}p, }$$

where R = 8. 314 J K−1 mol−1, the molar mass M = 0. 016 Kg, the fixed temperature T = 323 K. The gas viscosity is fixed to μ = 13 ⋅ 10−6. The reservoir coarse mesh \(\mathcal{M}_{r}\) is the uniform Cartesian mesh M r × M r with M r = 19 of step \(\varDelta x = \frac{2L} {M_{r}} = 263.15\) m. The near-well subdomain is defined by Ω w = (−L w , L w ) × (−L w , L w ) with L w = 657 m, and its mesh \(\mathcal{M}_{w}\) is obtained, starting from the restriction of the coarse mesh \(\mathcal{M}_{r}\) to Ω w , by subdivision of all coarse cells in the subdomain (−L w + Δx, L w Δx) × (−L w + Δx, L w Δx) by a factor 3 in each direction leading to nine square fine cells per coarse cell.

Fig. 29.3
figure 3

Porosity (SPE10)

Fig. 29.4
figure 4

Permeability (SPE10)

Fig. 29.5
figure 5

Given bottom hole pressure (p bhp )

In order to construct our algorithm MOR-DDM, we solve the model (29.1)– (29.2) on LGR mesh \(\mathcal{M}^{\mathrm{lgr}}\) as shown in Fig. 29.2 for 30 days using the coarse time step Δt = 1 day, and a fine time stepping obtained by subdivision of each coarse time step into five sub time steps and saved the snapshots of pressure and the nonlinear term at each coarse time step. Thus, we have 30 snapshots for the both pressure and the nonlinear term. Let us denote by MOR\(^{n_{p},m_{p}}\)-DDM, the reduced order model-domain decomposition algorithm obtained with n p and m p modes successively for the pressure and the nonlinear term. The solutions obtained by the MOR\(^{n_{p},m_{p}}\)-DDM algorithm are compared in term of accuracy and CPU time to both the solution obtained with DDM algorithm and to the reference solution obtained on the LGR mesh \(\mathcal{M}^{\mathrm{lgr}}\) computed with the fine time stepping.

The well cumulative gas flow rate as a function of time obtained with different algorithms ((n p , m p ) ∈ {1, 3, 5}2) is exhibited in Fig. 29.6. We show in Figs. 29.7 and 29.8 the pressure solution obtained at final time, successively for the reference solution and for the MOR5,5-DDM algorithm. The figure shows that the solutions converge to the reference solution on the LGR mesh with fine time stepping as the number of modes increase

Fig. 29.6
figure 6

Cumulative gas rate obtained at 30 days with different algorithms

Fig. 29.7
figure 7

Pressure obtained at 30 days with fine discretization using full order

Fig. 29.8
figure 8

Pressure obtained at 30 days with MOR5,5-DDM

The convergence of the DDM iterations exhibited in Figs. 29.9 and 29.10 successively for DDM algorithm and for MOR\(^{n_{p},m_{p}}\)-DDM algorithm ((n p , m p ) ∈ {1, 3, 5}2) is obtained in 2 iterations in both cases for the stopping criteria ɛ = 10−2 on the relative well total flux maximum variation (29.15).

Fig. 29.9
figure 9

Convergence of dQ obtained by DDM algorithm using full order

Fig. 29.10
figure 10

Convergence of dQ obtained by MOR3,3-DDM algorithm

We finally give in Table 29.1, the CPU times and the relative pressure error obtained with the reference LGR algorithm using the global fine time step, the DDM algorithm and the MOR\(^{n_{p},m_{p}}\)-DDM algorithms ((n p , m p ) ∈ {1, 3, 5}2).

Table 29.1 Relative pressure error and CPU time obtained with different algorithms

These results show a factor of roughly 2 of gain in CPU time obtained with DDM algorithm with an error equal to 0. 16%. A factor of almost 4 of gain in CPU time is obtained with our new algorithms MOR-DDM. This gains do not include the snapshot generating offline cost and it seems to be not significant compared to what usually obtained via MOR. However this disadvantage disappear when we apply our DD-ROM algorithm in real case of reservoir simulation application. First, the basis function generated at the offline stage will be re-used for many different input and output data, therefore the cost of our algorithm will be reduced too much compared to the re-used of the high fidelity model. Second, due to the use of a full order on the near-well region, the CPU gains will increase whenever the size of the near-well region decreasing compared to the rest of the reservoir. In our example the near well region is almost one fifth of the reservoir domain whereas in real case the near well region is limited to few meters and the reservoir stretches mostly over several tens of kilometers.

The error obtained with the different modes number is close to the error obtained with DDM algorithm using full order.

29.5 Conclusion

A model order reduction algorithm for a compressible flow model in porous media coupling near-well regions locally refined in space and time with a coarser reservoir discretization has been presented. The algorithm is based on domain decomposition method and using POD locally for the pressure and DEIM locally for the nonlinear term. The algorithm has been implemented in 2D for a gas flow through porous media in a heterogeneous reservoir with an injection well. The numerical results show good behavior of our algorithm that provides good accuracy compared to the reference solution obtained with full order on LGR using a global fine time step. Furthermore we observe important gains in CPU time for a cost approximately 4 times less. Compared with the solution obtained with full order using local time step (DDM algorithm) we get a CPU time savings for a cost approximately 2 times less.