1 Introduction

Fluid flow simulation in subsurface porous media is an essential process in virtually all reservoir engineering applications. Hydrodynamic reservoir models are typically based on a numerical solution of a system of nonlinear partial differential equations (for details see, e.g. Aziz and Settari 1979) that describe the evolution in time of pressure field and fluid flow. These equations are discretized using such numerical methods as finite volumes (Monteagudo and Firoozabadi 2004) or finite elements (Young 1981), and are solved using IMPES (implicit pressure, explicit saturation), sequential, or fully implicit schemes (Coats et al. 1998; Spillette et al. 1973; Jiang and Tchelepi 2019). In order to accurately reflect the structural and physical complexities of a hydrocarbon reservoir, the numerical model typically contains millions of cells. Numerical simulations based on such models are inevitably very challenging computationally. Another factor that increases the computational complexity of reservoir models is the non-linearity of the governing equations. Consequently, industry-grade reservoir simulations are very resource-intensive and usually require high-performance computing hardware. A significant effort by the reservoir simulation community is aimed at improving the computational efficiency of the simulations either through parallelization or by algorithmic means. Despite such improvements, the computational cost and consequently the duration of the simulation are often prohibitive for such classes of problems as reservoir optimization and uncertainty quantification, as they typically require thousands of runs of simulation scenarios.

This paper discusses an application of the Reduced Order Modeling (ROM) approach to reservoir simulation problems where a range of boundary conditions needs to be explored. A new variant of the proper orthogonal decomposition (POD) method is introduced: it leads to a considerable decrease in the number of calculations for each particular set of boundary conditions, and hence to a reduction of the overall computational cost of the problem.

ROM methods and their applications to resource-intensive simulations in various areas of science and engineering have been actively explored in recent years (e.g. Mehta and Linares 2017; Shlizerman et al. 2012; Xiao et al. 2015; Yao et al. 2019). A class of ROM methods frequently applied to large-scale simulation problems is based on POD. In these methods, POD is used to obtain a consistent representation of a model in a functional space whose dimension is lower than that of the original model. To that end, the model’s state variables are projected onto a lower-dimensional POD domain, and Galerkin or least-squares Petrov–Galerkin projection is applied to obtain a reduced system of equations (Carlberg et al. 2017).

One of the main difficulties in the realization of efficient POD-based ROMs lies in handling the non-linearities of the model’s equations. Iterative algorithms frequently used for solving non-linear systems of equations, such as Newton’s method, require calculating the non-linear terms and estimating the Jacobian. To do so, one generally needs to project the approximate solution back to the original domain and calculate the nonlinear functional in the full-scale domain on every iteration of the algorithm. The cost of such full-scale non-linear functional calculation and the back-and-forth projections may considerably offset the gains obtained from the model reduction.

Several approaches were suggested to treat non-linearities efficiently. Chaturantabut and Sorensen (2010) introduced the Discrete Empirical Interpolation Method (DEIM) to treat non-linearities in POD-based ROMs governed by systems of time-dependent partial differential equations (PDE). POD-DEIM has become one of the most widely used ROM methods applied to reservoir simulation problems (e.g. see, Tan et al. 2019; Efendiev et al. 2016). Carlberg et al. (2011) developed the Gauss-Newton with Approximated Tensors (GNAT) method, which also uses POD to reduce the vector of unknowns, but in contrast to DEIM, it operates in a fully discrete domain. Jiang and Durlofsky (2019) successfully applied the GNAT approach to complex reservoir simulations. Rewienski and White (2003) developed a method called trajectory piecewise linearization (TPWL). In this method, a number of the system’s states and Jacobians are first calculated and saved; then new simulations are obtained as a result of linear expansions around previously saved states. This approach can also be applied in a reduced subspace such as the one obtained through POD. A combination of POD and TPWL (POD-TPWL) is now widely used to model subsurface flows (e.g. see, Cardoso and Durlofsky 2010; He et al. 2011). Trehan and Durlofsky (2016) developed an extension of TPWL called trajectory piece-wise quadratic extension procedure (TPWQ) and combined it with POD (POD-TPWQ).

In recent years, ROM methods based on machine learning (ML) have gained popularity. Kani and Elsheikh (2017) developed a deep residual recurrent neural network (DR-RNN) approach and applied it in Kani and Elsheikh (2018) to the modeling of two-phase subsurface flows. They used POD to project the original problem onto a reduced subspace and used a recurrent neural network (RNN) to model the dynamics in the reduced space. Another group of methods uses Variational Autoencoders (VAE) to obtain a reduced representation of the model’s states. Lee and Carlberg (2019) modified the GNAT approach and used VAE instead of POD. Temirchev et al. (2020) used VAE combined with RNN to mimic the dynamics of subsurface flows. In Temirchev et al. (2019), an approach called Neural Differential Equations based ROM (NDE-b-ROM) was suggested: the authors applied the Neural Ordinary Differential Equations method (Chen et al. 2019) to model the dynamics in the reduced latent space while the reduced representation was obtained with the help of VAE. Fraces et al. (2020) used feedforward neural networks to approximate derivatives in the Buckley-Leverett problem. They exploited the transfer learning approach and Generative Adversarial Networks to obtain an approximation of PDE solution continuous both in time and space.

Many important reservoir engineering problems involve iterative simulations whose total computational cost may be particularly high. A typical example of such problems are various optimization tasks, such as finding the optimal well locations, well geometries, well completion schemes, and well control schedules. The numerical solution of such optimization problems requires multiple simulations of essentially the same reservoir unit with varying well parameters and schedules. Reduced reservoir models, including POD-based ROMs, were successfully applied to well control optimization problems (e.g. Jansen and Durlofsky 2017; Cardoso 2010; Trehan and Durlofsky 2016; Insuasty et al. 2015; Cardoso and Durlofsky 2010; He et al. 2011). However, some reservoir optimization problems require simulations with varying well locations and well geometries, in addition to well control sequences. For such problems, standard POD-based ROMs fail to correctly reproduce the flow dynamics even after a slight change in well location or well geometry with respect to the model used to construct the basis. In these cases, classical POD schemes require the construction of a new POD basis after every change in well locations or geometry. That implies re-calculating, from scratch, a new training data set based on high-resolution model simulations with a significant associated computational overhead.

This paper introduces a POD-based adaptive scheme that accounts for changes in well location and well geometry at the expense of a relatively small computational overhead. The proposed scheme requires significantly less training data compared to what is necessary for constructing a new POD basis from scratch.

The paper proceeds as follows. In Sect. 2, the governing equations for a two-phase immiscible displacement problem are presented together with an overview of POD-Galerkin ROM method and its application to this problem. Section 3 describes two different approaches for constructing the POD basis for the problems with varying well locations and geometries. Section 4 introduces a test problem related to the optimization of the geometry of a horizontal production well; the results of simulations using full resolution and adaptive POD models are compared and discussed. In Sect. 5, the advantages and shortcomings of the proposed adaptive POD scheme are discussed, and directions for further work are suggested.

2 POD-Galerkin ROM for Two-Phase Immiscible Flow

2.1 Two-Phase Immiscible Flow

The mathematical model of a two-phase immiscible flow is obtained by combining the system of mass conservation (continuity) equations for fluid phases (oil and water) and Darcy’s law for each phase. The continuity equation takes the form

$$\begin{aligned} \frac{\partial \phi \rho _{o, w} s_{o, w}}{\partial t} - \nabla \cdot (\rho _{o, w}\mathbf {v}_{o, w}) + q_{o,w} = 0 , \end{aligned}$$
(1)

where subscripts ow denote oil and water phases respectively, \(\phi \) is the porosity, \(\rho \) the fluid density, s the fluid saturation, and \(\mathbf {v}\) is the Darcy velocity that can be expressed as follows

$$\begin{aligned} \mathbf {v}_{o, w} = -\lambda _{o, w}\mathbf {K}\nabla (p_{o, w} - \rho _{o, w}g h) . \end{aligned}$$
(2)

Here \(\mathbf {K}\) is the absolute permeability tensor, \(\lambda = \frac{k_r}{\mu }\) the phase mobility, \(k_r\) is the relative permeability of the corresponding phase, and \(\mu \) is the viscosity of this phase, p the fluid pressure, g the gravitational acceleration, h the depth, and q is the source or sink term (Kani and Elsheikh 2018). After neglecting the capillary pressure, compressibility, and gravitational effects, the mass conservation equation and Darcy’s law are combined to obtain a system of equations for pressure

$$\begin{aligned} \nabla \cdot \mathbf {K}\lambda \nabla p = q , \end{aligned}$$
(3)

and for water saturation

$$\begin{aligned} \phi \frac{\partial s_w}{\partial t} + \nabla \cdot \mathbf {v}_w = \frac{q_w}{\rho _w} , \end{aligned}$$
(4)

where \(p = p_o = p_w\) is the global pressure, \(\lambda = \lambda _w + \lambda _o\) the total mobility, \(q = q_w + q_o\) is the source or sink term. The discrete form of the model can be obtained by dividing the domain into blocks and by applying the finite volume method to Eqs. (3) and (4). Discretized pressure equation in matrix form can be written as

$$\begin{aligned} \mathbf {A}\mathbf {s}_p = \mathbf {b}\;, \end{aligned}$$
(5)

where \(\mathbf {A} \in \mathbb {R}^{n\times n}\) is a coefficient matrix, \(\mathbf {s}_p \in \mathbb {R}^n\) is the pressure state vector, and \(b \in \mathbb {R}^n\) is the vector of right-hand sides of corresponding equations. Each element of the unknown vector \({s_p}_i\) represents the mean pressure value in the i-th grid block. The saturation equation takes the form

$$\begin{aligned} \frac{\mathrm {d} \mathbf {s}_s}{\mathrm {d}t} + \mathbf {B}(\mathbf {v})f_w(\mathbf {s}_s) = \mathbf {d}, \end{aligned}$$
(6)

where \( \mathbf {s}_s \in \mathbb {R}^n\) is the saturation state vector, \(\mathbf {v}\) is the velocity field obtained from the pressure field, \(\mathbf {B} \in \mathbb {R}^{n\times n}\) is a coefficient matrix that depends on the velocity, \(f_w(\mathbf {s}_s)\) is the nonlinear term that depends on the saturation field, and \(\mathbf {d} \in \mathbb {R}^n\) is the vector of right-hand sides of the equations. Equations (5) and (6) are coupled through the dependence of matrix \(\mathbf {A}\) on the saturation field and the dependence of the velocity \(\mathbf {v}\) on the pressure field. There are several ways of constructing the numerical solution of such coupled problems. In the present work, the IMPES method (Fanchi 2018) is used: at each time step, the saturation field from the previous time step is used to construct the matrix \(\mathbf {A}\). The pressure equation is solved using an implicit scheme to obtain the pressure field. The obtained pressure field is then used to calculate the velocity field \(\mathbf {v}\) and construct the matrix \(\mathbf {B}\). After that, Eq. (6) is solved explicitly, and the saturation field is obtained.

2.2 POD-Galerkin Model

2.2.1 POD Basis

The main objective of proper orthogonal decomposition is to obtain an optimal low-dimensional functional basis that is capable to adequately represent high-dimensional data. Once constructed, the POD basis can be used to formulate a reduced order model that corresponds to the original high-resolution model. POD decomposes a given fluctuating field into an orthonormal system of spatial modes \(\mathbf {u_i}(x)\) and the corresponding temporal coefficients \(a_i(t)\) (Kunisch and Volkwein 2003)

$$\begin{aligned} \mathbf {u'}(x) = \sum \limits _{i=1}^Na_i \mathbf {u_i}(x) . \end{aligned}$$
(7)

The discrete variant of POD is also known as principal component analysis (PCA), and both methods are closely related to the singular value decomposition method (SVD) (Abdi and Williams 2010). In order to generate a set of POD modes, one needs to construct a matrix \(\mathbf {X}\), in which each column represents the solution at a given instant, such that if the model’s state is represented by n values, and the data set consists of m model states, then \( \mathbf {X} \in \mathbb {C}^{n\times m}\).

The POD basis is optimal in the sense that for any given dimension of the basis r, the truncation error is minimal

$$\begin{aligned} \int \limits _t\int \limits _x\left( u(x, t) - \sum \limits _1^ra_i(t)u_i(x) \right) ^2\mathrm {d}x\mathrm {d}t = \min _{\phi , b}\int \limits _t\int \limits _x\left( u(x, t) - \sum \limits _1^rb_i(t)\phi _i(x) \right) ^2\mathrm {d}x\mathrm {d}t .\nonumber \\ \end{aligned}$$
(8)

In the discrete case, this equation can be written as

$$\begin{aligned} \sum \limits _{i=1}^n\sum \limits _{j=1}^m \left( x_{i, j} - \sum \limits _{k=1}^r(u^k_ia^k_j) \right) ^2 = \min \limits _{\phi , b} \sum \limits _{i=1}^n\sum \limits _{j=1}^m \left( x_{i, j} - \sum \limits _{k=1}^r(\phi ^k_ib^k_j) \right) ^2\;, \end{aligned}$$
(9)

where \(x_{i, j}\) corresponds to the j-th value of the i-th system’s state, \(u_i^k\) is the i-th value of the k-th basis vector \(\mathbf {u}^k\), and \(a^k_j\) is a projection of the j-th state onto the k-th basis vector. This representation can be obtained by factorization of the matrix X using SVD

$$\begin{aligned} \mathbf {X=U\Sigma V^*}\;, \end{aligned}$$
(10)

where \(\mathbf {U} \in \mathbb {C}^{n\times n}\) is the matrix of left singular vectors, \(\mathbf {V} \in \mathbb {C}^{m\times m}\) is the matrix of right singular vectors, \(\mathbf {\Sigma } \in \mathbb {R}^{m\times m}\) is the singular values matrix (a diagonal matrix with non-negative values \(\sigma _i\) on the main diagonal). In block form the factorization Eq. (10) can be written as

$$\begin{aligned} \mathbf {X} = \left[ \begin{array}{ccccc} \mathbf {u}_1&\dots \mathbf {u}_i&\dots \mathbf {u}_m&\end{array} \right] \left[ \begin{array}{ccccc} \sigma _1 &{} &{} &{} &{}\\ &{} \ddots &{} &{} &{}\\ &{} &{} \sigma _i &{} &{}\\ &{} &{} &{} \ddots &{} \\ &{} &{} &{} &{} \sigma _n \\ 0 &{} \dots &{} \dots &{} \dots &{} 0 \end{array} \right] \left[ \begin{array}{c} \mathbf {v}^*_1 \\ \vdots \\ \mathbf {v}^*_i \\ \vdots \\ \mathbf {v}^*_n \end{array} \right] \;, \end{aligned}$$
(11)

where \(\mathbf {u}_i\) is an n-dimensional column vector, and \(\mathbf {v}^*_i\) is a m-dimensional row vector. The singular matrix \(\mathbf {\mathbf \Sigma }\) is constructed such that \(\sigma _1 \ge \sigma _2 \ge \dots 0 \) (Shlizerman et al. 2012). The optimal reduced basis is obtained by taking the first r left singular vectors \(\mathbf {u}_i\).

To obtain a reduced POD basis for a specific problem, one needs to construct a snapshot matrix \(\mathbf {X}\), which is composed of state vectors \(\mathbf {s}\) obtained from the solution of the full system. For two- or three-dimensional problems, the model’s states are first flattened to vectors. These vectors called snapshots are then stacked to compose the snapshot matrix. The reduced POD basis is obtained by applying SVD to the snapshot matrix and keeping the first r columns of the calculated singular matrix.

2.2.2 POD-Galerkin ROM

POD-Galerkin ROM of a two-phase immiscible displacement in IMPES formulation can be stated as follows. During the offline stage (also called the training stage), pressure snapshots are recorded, and a snapshot matrix \(\mathbf {X}_p\) is constructed. Then SVD (Eq. (10)) is applied to the snapshot matrix, and the reduced basis \(\mathbf {U}^r_p = [\mathbf {u}_1 \dots \mathbf {u}_i \dots \mathbf {u}_r]\) is obtained. During the online stage, a reduced representation of the pressure equation Eq. (5) is constructed. It can be written as

$$\begin{aligned} \mathbf {A}^r\mathbf {s}_p^r=\mathbf {b}^r\,, \end{aligned}$$
(12)

where \(\mathbf {A^r} = {\mathbf {U}^r_p}^\top \mathbf {A}\mathbf {U}^r_p\) is the projection of the equation coefficients matrix onto the reduced subspace, \(\mathbf {s}_p^r = {\mathbf {U}^r_p}^\top \mathbf {s}_p\), and \({\mathbf {b}}^r = {\mathbf {U}^r_p}^\top \mathbf {b}\) are the projections of the state vector and of the right-hand side of the equation onto the reduced subspace respectively. This equation is solved in the reduced subspace to obtain a new reduced pressure state \(\mathbf {s}^r_p\). It is used to form a full representation of the pressure state \(\widetilde{\mathbf {s}}_p\), the velocity field \(\widetilde{\mathbf {v}}\), and the coefficient matrix \(\widetilde{\mathbf {B}}(\widetilde{\mathbf {v}})\). The saturation field \(\widetilde{\mathbf {s}}_s\) is then calculated explicitly, and a new coefficient matrix \(\widetilde{\mathbf {A}}\) is formed. This procedure is repeated for subsequent time steps.

3 Adaptive POD-Galerkin Technique for Problems with Variable Well Locations and Geometry

This section discusses applications of POD-Galerkin ROM to problems with varying well locations and geometry. First, it describes a straightforward approach for constructing POD-basis suitable for modeling problems with well locations and geometry varying in a certain range. This will be referred to as the universal basis approach. In the second part of the section, a novel technique for adaptation of the existing POD-basis to new boundary conditions, such as locations or geometry, is introduced and its detailed workflow is described. The proposed approach leads to a significant reduction in the number of snapshots required to build the new basis, thus reducing the computational cost of corresponding full-scale model simulation.

3.1 Universal POD Basis

To address optimal well placement problems, the POD-Galerkin model must be capable of simulating production scenarios with various well locations and geometries. This universal model thus needs to capture the key spatio-temporal features of all these scenarios. This can be achieved by generating a sufficiently long learning data set that contains the maximum amount of information on possible modes of the model. To generate such a data set, one needs to perform simulations with varying well parameters (locations, geometries) and record the corresponding snapshots.

One of the possible ways to achieve this is to perform a sufficiently long simulation with random variations of parameters of interest, and use the set of collected snapshots to build the basis for POD-Galerkin ROM. Constructed in this way basis will be referred to as universal, since it captures a wide variety of system states. The universal basis approach can be formulated as follows:

  1. 1.

    Run a full-dimensional simulation with well control and well parameters (e.g. well geometry) randomly varying during the simulation and collect the resulting snapshots.

  2. 2.

    Compose the snapshot matrix \(\mathbf {S}\).

  3. 3.

    Perform SVD of \(\mathbf {S}\) and take the first r components (\(r \ll n\), where n is the dimension of the original model) in order to construct the reduced basis \(\mathbf {U}^r\!\!.\)

  4. 4.

    Use the basis \(\mathbf {U}^r\) to obtain the reduced POD-Galerkin model.

3.2 Adaptive POD Basis

Let us compare the universal basis approach with using the POD basis constructed for a specific well configuration. The latter is referred to as the local basis approach. In this approach, a series of snapshots are generated with fixed geometry and well locations, and step-wise pressure changes with random amplitudes are applied at every timestep at the injector wells. These snapshots are flattened and stacked into a matrix, after which SVD is applied to that matrix, and the reduced basis is obtained. The local basis is easy to construct since it requires simulations with a single well configuration. However, POD-Galerkin model with such a basis is only adapted to simulations with the particular well locations and geometry that were used to build the local basis. To perform simulations with a different well configuration, it is necessary to build a new basis corresponding to the new well configuration. Although using the local POD basis constructed for a well configuration that does not match the actual simulated well configuration yields quite poor results, this poorly matching basis still contains some useful information about the simulated problem. This section describes a new approach based on the utilization of this information, which allows us to update the POD basis and adapt it to handle simulations with new well configurations.

To adapt the existing POD basis to a new model setting, one needs to update it with additional components while keeping the information about the generic features of the model. Let us consider a POD basis constructed for a particular well configuration and adapt it to simulate production scenarios for a different well configuration. Building a new local POD basis from scratch may require a considerable amount of additional computations, since one needs to generate a new training data set that typically consists of thousands of simulated snapshots of the full-resolution model. Additional computing resources required to generate such training data set may entirely eliminate the gain achieved due to POD model reduction. The new proposed approach is based on updating the existing POD basis with several new components obtained from a limited amount of additional snapshots; this leads to accurate simulations with new well configurations using the updated POD basis.

Let us consider a reduced POD basis \(\mathbf {U}^r_o\) constructed for a given well configuration, and calculate a few additional snapshots corresponding to the new well location \({\mathbf {s}_p}_i\). These snapshots are stacked to form the matrix \(\mathbf {S}_p\). The information lost during the projection of these snapshots onto the reduced subspace defined by the basis \(\mathbf {U}^r_o\) can be expressed in the matrix form

$$\begin{aligned} {\mathbf {S}_p}^{res} = {\mathbf {S}_p} - \mathbf {U}^r_o {\mathbf {U}^r_o}^\top {\mathbf {S}_p} . \end{aligned}$$
(13)

SVD (Eq. (10)) is then applied to this residual snapshot matrix to obtain a residual basis \(\mathbf {U}^r_{res} = [{\mathbf {u}_1 \dots \mathbf {u}_i \dots \mathbf {u}}_{\mathbf {r^{res}}}]\). By construction, this basis is orthogonal to \(\mathbf {U}^r_o\). One can therefore use a combination of components from these bases to build an updated basis \(\widetilde{\mathbf {U}^r}\) which can be used in the POD-Galerkin method. The suggested method complements \(\mathbf {U}^r_o\) by several components from \(\mathbf {U}^r_{res}\) to construct \(\widetilde{\mathbf {U}^r}\) which can be used in a reduced POD-Galerkin model for the new well configuration. The numerical experiments show that the number of additional components \(r^{res}\) does not significantly affect the quality of simulation and usually, just one to three additional components are enough. The analysis of the sensitivity of the simulation error with respect to the number of additional components (\(r^{res}\)) is presented in Sect. 4.3.3. The workflow of the proposed method can be summarized as follows:

  1. 1.

    Calculate n snapshots with the new well configuration.

  2. 2.

    Compose the snapshot matrix \(\mathbf {S}_p\).

  3. 3.

    Calculate the residual snapshot matrix \(\mathbf {S}_p^{res}\) (Eq. 13).

  4. 4.

    Perform SVD and take the first \(r^{res}\) components (\(r^{res}\ll r\); usually 1-3 additional components are enough) to obtain the reduced basis for the residual snapshots \(\mathbf {U}^r_{res}\).

  5. 5.

    Update the existing POD basis \(\mathbf {U}^r_o\) by adding the components of \(\mathbf {U}^r_{res}\) to obtain \(\widetilde{\mathbf {U}^r}\) (\(\widetilde{\mathbf {U}^r} = \begin{bmatrix} \mathbf {U}^r_o&\mathbf {U}^r_{res}\end{bmatrix}\)).

  6. 6.

    Use \(\widetilde{\mathbf {U}^r}\) to formulate the updated reduced POD-Galerkin model.

4 Numerical Validation and Sensitivity Analysis of Adaptive POD-Galerkin Technique

4.1 Test Problem Setup

Let us consider a simplified production optimization problem in which one needs to optimize the orientation (azimuth) of a horizontal producing section of a well. A two-dimensional immiscible displacement problem in a square domain of the size \(1{,}000\times 1{,}000\; \text {m}\) is considered, and the domain is divided into \(40\times 40\) square cells. Heterogeneous porosity and permeability fields are generated numerically to mimic a high permeability fluvial channel crossing a less permeable formation (Fig. 1).

Fig. 1
figure 1

a Porosity field, b permeability field of the model; blue dots in the corners indicate the positions of injector wells, green line shows the location of the producer

In the corners of the square area, four injector wells are placed that inject water with controlled injection pressure. The oil that initially saturates the model is displaced toward the center of the simulation area where fluids are recovered by a 150-m long horizontal producer (Fig. 1).

4.2 Numerical Tests of POD-Galerkin ROM with Universal Basis

To test the ROM with the universal basis, it first needed to be built. This was done by running a simulation in which the orientation (azimuth) of the horizontal producer was randomly changed at regular time intervals. The injection pressure at each injection well was also varied randomly during that part of the simulation. All the pressure fields obtained from this simulation were flattened into vectors and stacked together to form a snapshot matrix where each column represents a specific pressure field state. Singular value decomposition was performed on this matrix (Eq. (10)), and the first r columns of the resulting left singular matrix \(\mathbf {U}\) were taken to obtain the reduced POD basis. In Fig. 2, the first 12 components of the reduced basis are shown. This basis was further used to formulate the reduced problem (Eq. (12)).

Fig. 2
figure 2

The first 12 principal components of the universal POD basis

Figures 3 and 4 show the simulated fluid production rates for two particular producer orientations (63 and 175 degrees clockwise from the horizontal axis).

Fig. 3
figure 3

Simulation of the fluid production of the well oriented 63 degrees clockwise from the horizontal axis. a Production rates, b well placement scheme

Fig. 4
figure 4

Simulation with the producer oriented 175 degrees clockwise from the horizontal axis a production rates, b well placement scheme

One can observe that in both cases the production curves simulated by the reduced model demonstrate a very close match with the solutions obtained by the full model. However, to achieve such accuracy, a relatively large number of components (80-100) must be kept in the reduced basis due to the complex structure of the solutions used in the construction of the POD basis. Figure 5 presents the results of modeling the production rates with a variable number of the reduced basis components.

Fig. 5
figure 5

Production rates simulated using a variable number of components of the reduced basis. a 20 components, b 40 components, c 100 components, d 120 components

Root relative squared errors (RRSE) (Eq. (14)) were calculated for the deviation of the solutions obtained with a variable number of the reduced basis components with respect to the full model solution. RRSE is designed to be relative to an error of a simple predictor (constant mean value) (Witten and Frank 2011).

$$\begin{aligned} E = \sqrt{\frac{\sum \nolimits _{i=1}^n(\hat{q}_i - q_i)^2}{\sum \nolimits _{i=1}^n(q_i - \overline{q}_i)^2}}\;, \end{aligned}$$
(14)

where \(\hat{q}\)—production rate calculated by ROM, q—reference production rate (from full-scale model), \(\overline{q}\)—mean value of reference production rate. Errors were calculated separately for oil and water rates. RRSE for oil and water production rates as a function of the number of the POD basis components are shown in Fig. 6.

Fig. 6
figure 6

Root relative squared error of the simulated fluid production rates as a function of number of the POD basis components

One can observe that a POD basis containing at least 80 components should be used to simulate the production rates with acceptable accuracy.

4.3 Numerical Tests of POD-Galerkin ROM with Adaptive Basis

4.3.1 Adaptive POD-Bases for Models with Variations of Horizontal Well Direction (Azimuth)

To assess the simulation accuracy using the proposed adaptive technique, one needs to first construct a local basis for some specific well configuration. In our case, a simulation with the producing well oriented 63 degrees clockwise from the horizontal axis was performed. The resulting snapshots were stacked in a matrix. This snapshot matrix was decomposed using SVD (Eq. (10)). The first r columns of the left singular matrix \(\mathbf {U}\) were taken to form the reduced basis \(\mathbf {U}^r\). In Fig. 7, the first 12 principal components of this local POD basis are shown.

Fig. 7
figure 7

The first 12 principal components of the local POD basis

Figure 8 shows the simulated production rates for the same well configuration obtained using a variable number of components of the local POD basis.

Fig. 8
figure 8

Production rates simulated using the local POD basis with a variable number of components. a 10 components, b 20 components, c 30 components, d 35 components

One can observe that a similar accuracy of the simulations is achieved with fewer components of the local POD basis compared to the case of the universal POD basis. For example, simulations with 20 components of the local POD basis (Fig. 8b) give practically the same accuracy as those with 100 components of the universal POD basis (Fig. 5c), at a significantly lower computational cost. Another advantage of the local basis is that it is much easier to construct since it requires significantly fewer snapshots than the universal basis. However, POD-Galerkin model with a local basis is only capable of simulating scenarios with one specific well location and geometry, and to simulate a new well configuration, it is necessary to build a new basis corresponding to that configuration. Figure 9 presents simulated production rates for a well oriented 175 degrees obtained with the POD basis constructed for a mismatching well orientation (63 degrees clockwise from the horizontal axis) and with a variable number of the basis components.

Fig. 9
figure 9

Simulated production rates of the well oriented 175 degrees clockwise from the horizontal axis using the local POD basis constructed for a mismatching producer orientation (63 degrees) and a variable number of components of the reduced basis: a 20 components, b 40 components, c 100 components, d 200 components

One can observe that in this case, the simulated production curves do not match the full model solution, and the accuracy of the ROM simulation remains poor even when using up to 200 POD basis components.

To make the local POD basis applicable to the problems with new well configurations, the basis adaptation procedure described in Sect. 3.2 was applied. To obtain the snapshots required for basis adaptation, a simulation was performed with a new well configuration (horizontal producer well is oriented 175 degrees clockwise to horizontal axis) and with randomized well controls, and 10 snapshots were recorded corresponding to the first 10 changes in borehole pressure schedule. The simulation was performed with the same time step as in the original scenario. As a reminder, constructing a new POD basis for that problem from scratch would require generating about a thousand full-model snapshots.

The snapshot matrix \({\mathbf {S}_p}\) is then composed, and the residual snapshot matrix \(\mathbf {{S}_p}^{res}\) is obtained using Eq. (13). As an illustration, Fig. 10 shows one of such snapshots together with the corresponding reduced snapshot (\(\mathbf {U}^r_o {\mathbf {U}^r_o}^\top {\mathbf {s}_p}_i\)) and the residual snapshot (\({\mathbf {s}_p}_i - \mathbf {U}^r_o {\mathbf {U}^r_o}^\top {\mathbf {s}_p}_i\)).

Fig. 10
figure 10

a Original snapshot (\({\mathbf {s}_p}_i\)), b reduced snapshot (\(\mathbf {U}^r_o {\mathbf {U}^r_o}^\top {\mathbf {s}_p}_i \)), c residual snapshot (\(\mathbf {{s}_p}_i^{res}\))

SVD is then performed on the residual snapshot matrix, and the additional components are obtained. The first 12 of the obtained additional components are presented in the Fig. 11.

Fig. 11
figure 11

The first 12 principal components of the residual snapshot matrix decomposition (\(\mathbf {U}^r_{res}\))

Since only 10 additional snapshots were used, most of the higher-order residual components are quite noisy and contain little structural information about the model. Consequently, only the first three residual components are used to build the updated basis \(\widetilde{\mathbf {U}^r}\) by adding them to the original basis \(\mathbf {U}^r_o\)(which consists of 30 components). One can then use the updated basis to formulate the POD-Galerkin problem for the new well configuration. The simulated production rates obtained for the new well configuration with the updated POD basis are shown in Fig. 12.

Fig. 12
figure 12

Simulated fluid production rates: a using the local basis for a mismatching well orientation; b using the POD basis constructed from 10 additional snapshots; c using the adaptive POD basis

One can observe that the proposed method of the local basis adaptation significantly increases the accuracy of the simulations. Figure 12b shows the results of the production rates simulation using the local basis with 33 components (the same number as in the adaptive basis) built using the same 10 additional snapshots. One can conclude from these results that 10 additional snapshots of the model are not sufficient to construct a new basis without using the information contained in the original basis. However, the adaptive POD basis scheme with the same 10 additional snapshots provides quite a satisfactory result.

To estimate the number of snapshots required to build the local basis from scratch, several simulations were performed with POD-Galerkin models using bases constructed from a variable number of snapshots. The corresponding simulated production rates are shown in Fig. 13.

Fig. 13
figure 13

Production rates simulated using POD-Galerkin models with local basis constructed from a variable number of snapshots: a 10 snapshots; b 100 snapshots; c 500 snapshots; d 1000 snapshots

One can observe that to construct a proper local basis, approximately 1000 snapshots are required, in contrast with just about 10 additional snapshots needed for the adaptation of the existing basis.

4.3.2 Adaptive POD-Bases for Models with Variations of Well Location and Well Length

To further test the applicability of the proposed technique to problems with changing well configurations, it was used to build the adaptive bases for models with varying well location and well length. Figure 14 shows the well location for which the original POD basis was constructed, as well as the new location for which the adaptation of the original basis is performed.

Fig. 14
figure 14

Well placement scheme: blue circles represent the injector wells; the green line represents the original position of the producer; the red line represents the new position of the producer

Figure 15 presents a comparison of the simulated fluid production rates for the new producer location for models using the original POD basis and the adaptive POD basis. The basis adaptation was performed the same way as in changing the well orientation. The simulation with the new well location is performed and first snapshots are recorded.

Fig. 15
figure 15

Simulated fluid production rates: a the original POD basis, b the adaptive POD basis constructed using 50 new snapshots and 1 additional component

Figure 16 shows a well placement scheme with a variable length of the producing section.

Fig. 16
figure 16

a Well placement scheme. Blue circles represent the injector wells; the green line shows the original position and length of the producer; the red line indicates the new length of the producer. b zoomed-in part of the model with the producer well

Figure 17 presents a comparison of the simulated fluid production rates for this model obtained with the original POD basis and with the adaptive POD basis.

Fig. 17
figure 17

Simulated fluid production rates: a the original POD basis, b the adaptive POD basis constructed using 50 new snapshots and 1 additional component

One can see that the proposed approach allows adapting the existing ROM to a wide range of new well configurations, including varying well orientations, length, and position, at the expense of a relatively small number of additional snapshots. In contrast, if one tries to build a universal POD-based ROM capable of accurately simulating production rates for models with variable well positions and geometries, a set of snapshots is required that scales exponentially with the number of varying parameters (well orientation, well length, etc.). In statistics and ML applications this problem is known as the curse of dimensionality (Bishop 2006). Another problem is the increasing complexity of the snapshot space that would in turn lead to a significant increase in the number of POD basis components required for adequate simulation accuracy and stability. That makes the universal POD-basis approach impractical for problems with multiple optimization parameters.

4.3.3 Analysis of Sensitivity to the Number of Additional Snapshots and Complementary Basis Components

In order to estimate the impact of the number of additional snapshots used in the adaptive POD basis on the accuracy of the flow rate simulations, several variants of the model with a modified length of the producer (Fig. 16) and a specific number of additional snapshots for each of the variants were simulated. The results of these simulations are presented in Fig. 18.

Fig. 18
figure 18

Simulated fluid production rates for the model with a modified length of the producer, obtained with the adaptive POD basis using a variable number of snapshots: a 10 snapshots, b 30 snapshots, c 50 snapshots, d 100 snapshots

Deviations of the simulated fluid production rates with respect to the full model were calculated for the models with the adaptive POD basis constructed with a variable number of additional snapshots. The corresponding RRSE graphs are presented in Fig. 19.

Fig. 19
figure 19

Root relative squared error of simulated fluid production rates with respect to the full model as a function of the number of additional snapshots used in the construction of the adaptive POD basis

Not surprisingly, increasing the number of additional snapshots initially improves the accuracy of the flow rate simulations. However, using more than 30–50 additional snapshots does not lead to a further improvement of the accuracy.

In Fig. 20, the simulated fluid production rates are shown for models built with the adaptive POD basis with a variable number of additional components. In all the presented cases, the POD basis adaptation was performed using 50 additional snapshots.

Fig. 20
figure 20

Simulated fluid production rates for models with the adaptive POD basis with a variable number of additional components: a 1 component, b 3 components, c 5 components, d 10 components

Deviations of the simulated fluid production rates with respect to the full model were calculated for the cases with the adaptive POD basis constructed with a variable number of additional components. The corresponding RRSE graphs are presented in Fig. 21.

Fig. 21
figure 21

Root relative squared error of simulated fluid production rates with respect to the full model as a function of the number of additional components of the adaptive POD basis

One can observe that the influence of the number of additional components of the adaptive basis on the production rate simulations is relatively small, and typically 1–3 additional components are sufficient for a satisfactory basis adaptation.

5 Conclusions and Future Work

In this work, separate approaches for efficient use of POD-Galerkin ROMs for reservoir simulation were explored for several problems in which variations of the boundary conditions, such as well location and geometry, are essential. In the universal basis approach, a training data set is generated that contains snapshots of the solutions corresponding to all of the considered well geometries. This approach allows using the same POD basis for simulating scenarios with various well geometries. However, that comes at the expense of a relatively large number of the universal POD basis components required to obtain a reasonable accuracy of the simulations. Another drawback of this approach is the necessity to generate a very large training data set to reflect the entire range of possible scenarios. The universal basis approach may be suitable in cases where a relatively small range of possible well geometries needs to be explored.

The new approach introduced in this work is based on the adaptation of the POD basis to variable well configurations. This approach enables using the POD basis constructed for a specific model configuration to simulate a different problem setup. Such an adaptation of the POD basis is achieved at a relatively low computational cost by updating the basis with a few additional components obtained from the snapshots of the new model configuration. It was found that the number of such additional snapshots is substantially smaller than the one required for building a new POD basis from scratch. The new adaptive method was validated on several test cases; a POD-Galerkin ROM was used to simulate immiscible oil displacement by water injection in various settings of a synthetic reservoir model in which a horizontal producer had variable location, length, and orientation.

In the present work, the adaptive POD reduction technique was only applied to the pressure field. An extension of the proposed adaptive approach that includes the reduction of the saturation-related variables is in the scope of our future work. Another envisaged direction of studies is the application of the adaptive POD approach to address reservoir optimization problems, such as finding the optimal well design, well completion, and hydraulic fracturing schemes.