A block preconditioner for non-isothermal flow in porous media

A block preconditioner for non-isothermal flow in porous media

Thomas Roy thomas.roy@maths.ox.ac.uk Tom B. Jönsthövel tjonsthovel@slb.com Christopher Lemon clemon@slb.com Andrew J. Wathen andy.wathen@maths.ox.ac.uk Mathematical Institute, University of Oxford, Oxford, United Kingdom Schlumberger Houston Production Technology Center, Houston, TX, United States of America Schlumberger Abingdon Technology Center, Abingdon, United Kingdom

In petroleum reservoir simulation, the industry standard preconditioner, the constrained pressure residual method (CPR), is a two-stage process which involves solving a restricted pressure system with Algebraic Multigrid (AMG). Initially designed for isothermal models, this approach is often used in the thermal case. However, it does not have a specific treatment of the additional energy conservation equation and temperature variable. We seek to develop preconditioners which better capture thermal effects such as heat diffusion. In order to study the effects of both pressure and temperature on fluid and heat flow, we consider a model of non-isothermal single phase flow through porous media. For this model, we develop a block preconditioner with an efficient Schur complement approximation. Both the pressure block and the approximate Schur complement are approximately inverted using an AMG V-cycle. The resulting solver is scalable with respect to problem size and parallelization.

preconditioning, iterative solvers, porous media, thermal reservoir simulation
journal: Computational Physics

1 Introduction

Models of fluid flow in porous media are used in the simulation of applications such as petroleum reservoirs, carbon storage, hydrogeology, and geothermal energy. In some cases, fluid flow must be coupled with heat flow in order to capture thermal effects. Petroleum reservoir simulation is used in optimizing oil recovery processes, which often involve heating and steam injection inside the reservoir in order to reduce the viscosity of the oil. This is especially important in the case of heavier hydrocarbons.

In the case of isothermal multiphase flow, a global pressure couples local concentration/saturation variables. The equations in the system are elliptic with respect to the pressure and hyperbolic with respect to the non-pressure variables. The industry standard constrained pressure residual (CPR) preconditioner introduced by Wallis  wallis1983incomplete (); wallis1985constrained () in the early 80s defines a discrete decoupling operator essentially splitting pressure and non-pressure variables, in order that each can be preconditioned separately. Indeed, the global nature of the pressure variable requires a more precise “global” preconditioning than the other variables for which “local” preconditioning is sufficient. In brief, the CPR preconditioner is a two-stage process in which pressure is solved first approximately, followed by solving approximately the full system.

A major improvement to CPR was introduced in lacroix2003iterative () with the use of Algebraic Multigrid (AMG) ruge1987algebraic () as a preconditioner for the pressure equation in the first stage. AMG is used as a solver for elliptic problems, usually as a preconditioner for a Krylov subspace method. Therefore, the elliptic-like nature of the pressure equation makes it an ideal candidate for the use of AMG. This improved preconditioner, often denoted CPR-AMG, is widely used in modern reservoir simulators.

The non-isothermal case adds a conservation of energy equation and a temperature (or enthalpy) variable to the system of PDEs. In the standard preconditioning approach, the energy conservation equation and the temperature unknowns are treated similarly to the secondary equations and unknowns. This means that the thermal effects are only treated in the second stage of CPR, usually an Incomplete LU factorization (ILU) method. More dense incomplete factors are often needed in the thermal case. While this results in a lower iteration count, it is not ideal in terms of computational time, memory requirements, and parallelization.

Alternatives to the usual approach were recently proposed. The Fraunhofer Institute for Algorithms and Scientific Computing (SCAI) focuses on AMG for systems of PDEs based on clees2005amg (), often called System AMG (SAMG). While it seeks to replace CPR-AMG, the SAMG approach proposed in clees2010efficient (); gries2014preconditioning () is quite similar in the isothermal case. Indeed, AMG is applied to the whole system, but all non-pressure variables remain on the fine level. In the thermal case, however, SAMG allows the consideration of both pressure and temperature for the hierarchy. A proper comparison with CPR-AMG for thermal simulation cases has yet to be done.

The inclusion of temperature in the AMG hierarchy is still not well understood. The temperature is not always descriptive of the flow everywhere in the reservoir (for example in regions of faster flows). This justifies an adaptive method where only variables which are descriptive be included in the first stage of CPR. Retaining the CPR structure, Enhanced CPR (ECPR) constructs a “strong” subsystem for the first stage of CPR by looking at the coupling in the system matrix li2017enhanced (). The resulting subsystem has no real physical interpretation and it is unclear if it is possible to solve it via AMG.

In the context of this paper, we consider single phase non-isothermal flow. This single phase case is relevant for geothermal models and simple reservoir simulation examples, but can also be applied to miscible displacement problems (where a concentration plays a similar role to temperature) booth2008miscible (). We present a block preconditioner for the solution of the resulting coupled pressure-temperature system. Additionally, this solver can be extended to the multiphase case as the first stage of a CPR-like two-stage preconditioner roy2019constrained ().

In Section 2, we present the mathematical model for non-isothermal flow in porous media and the discretization. In Section 3, we describe the preconditioning approaches for the linearized system. Numerical results for the preconditioners are presented in Section 4. We conclude in Section 5 with a discussion on the future direction of this research.

2 Problem statement

In this section, we describe a coupled PDE system and its discretization.

2.1 Single phase thermal flow in porous media

We describe the equations for single phase flow in porous media coupled with thermal effects.

2.1.1 Conservation of mass

We start with the continuity equation which states that the rate at which mass enters the system is equal to the rate of mass which leaves the system plus the accumulation of mass within the system. Additionally, we include a source/sink term which accounts for mass which is added or removed from the system. We have


where is the porosity field of the rock, is the density of the fluid, is the fluid velocity, is a source/sink term, and is the spatial domain in , . The source/sink term represents injection/production wells and is given in Section 2.1.5. We further assume that the velocity follows Darcy’s law darcy1856fontaines (), i.e.


where is the pressure, is the permeability tensor field, is the viscosity, and is gravitational acceleration. The density and viscosity are functions of pressure and temperature given in Section 2.1.4. Then, (1) becomes


We also assume Neumann and Dirichlet boundary conditions


where is Neumann boundary data, is Dirichlet boundary data, is the unit outward normal vector on , and .

2.1.2 Conservation of energy

Similarly, we have a conservation of energy equation for the heat energy. Note that formulations where enthalpy is an independent variable are common, but here we consider temperature as an independent variable as in a reference commercial reservoir simulator debaun2005extensible (). Here, and are the specific heat of the fluid and rock, respectively, is the density of the rock, and is temperature. Here, represents the enthalpy of the fluid, and , its energy density. Heat energy is not only transported by a heat flux, but also by the fluid flux. We get the following advection-diffusion equation:


where is the heat flux, and is a source/sink term representing wells or heaters and given in Section 2.1.5. Furthermore, we assume that the heat flux follows Fourier’s law, i.e.


where is the thermal conductivity field. It is given by


where and are the conductivities of the rock and the fluid, respectively. Then, (5) becomes


Then, assuming Darcy flow, we get


We also assume Neumann and Dirichlet boundary conditions


where is Neumann boundary data, is Dirichlet boundary data, , and .

2.1.3 Coupled problem

We assume that and are empirically determined functions of pressure and temperature. Our choices are given in Section 2.1.4.

We are interested in solving the following boundary value problem:
find , such that


where , , and initial conditions for and are prescribed.

2.1.4 Nonlinear quantities

The density and viscosity are empirically determined functions of temperature and pressure. For the examples in this paper, we will consider the flow of heavy oil in porous media and thus use the following empirical laws.

-0.8021 23.8765 0.31458 -9.21592
Table 1: Parameters for the Bennison viscosity correlation
Figure 1: The Bennison viscosity correlation for heavy oil.

For viscosity, we choose the following correlation bennison1998prediction ():


which takes temperature in F and returns viscosity in cp (0.001 kg m s). The viscosity as a function of temperature (in Kelvin) is illustrated in Figure 1. The dimensionless parameters can be found in Table 1. The American Petroleum Institute (API) gravity is a measure of how heavy or light a petroleum liquid is compared to water: if its API is greater than 10, than it is lighter and floats on water; if less than 10, it is heavier and sinks. We can calculate API gravity from specific gravity (SG) (ratio of the density of the petroleum liquid to the density of water, at 60 F) using the following formula:


For density, we use the following correlation:


where , are reference pressure and temperature and is the density at those values, is a compressibility coefficient and is a thermal expansion coefficient. Values representative to those used in reservoir simulation are bar, = 288.7056 K (F), , and . Given a specific gravity, we have , where kg m is the density of water at the reference temperature.

2.1.5 Source/sink terms

We first consider source/sink terms representing injection and production wells. A simple way to model these is by using point sources/sinks


where and represent the location of injection and production wells, respectively, is the Dirac delta function, and are the wells’ injection and production rates, respectively.

The production rate is usually given by a constant target production rate. Similarly, the injection rate is given by a target injection rate. These rates can only be maintained if the pressure at the production well does not drop below a minimum pressure, and the pressure at the injection well does not go above a maximum pressure. In those cases, a well model is required. We consider the commonly used Peaceman well model peaceman1978interpretation (); chen2009well () for anisotropic media with as the permeability tensor field. In this case the rates are given by


where is the height of well opening, is the equivalent permeability, is the bottom-hole pressure, is the well radius, and is the equivalent radius which can be calculated using


where and are the horizontal lengths of the grid cell. Since we want to allow mesh refinements, we do not want the model to change as we vary the grid size. Therefore, we arbitrarily fix meters, and also choose meters and meters.

Oil recovery techniques for heavy oils can include electromagnetic heating sahni2000electromagnetic (). These can be expressed as source terms for the energy equation. For simplicity, we do not use an electromagnetic model and choose the simple function


where represent the location of heaters, is the heat transfer coefficient, and is the target heating temperature. For our simulations, we have a heating coefficient of JsK. For simplicity, we also choose to be the same as .

2.2 DG0 discretization

In reservoir simulation, Finite Volume methods are most commonly used leveque2002finite (). Since the flux entering a given volume is identical to that leaving an adjacent one, these methods are conservative. Additionally, upwind schemes introduce substantial numerical diffusion, which helps with stability. In this section, we present a discontinuous Galerkin (DG) method riviere2008discontinuous () that is equivalent to a Finite Volume method used in reservoir simulation and is based on the description in riseth2015nonlinear (). The resulting weak formulation allows us to implement our problem in the open source Finite Element software Firedrake rathgeber2016firedrake ().

Let be a partition of into open element domains such that union of their closure is , where is a set of indices. Let the interior facet and let denote the union of all interior facets. Let connection set denote the set of indices such that . We begin by presenting a DG0 (piecewise constant) method for the heat equation


The variational problem for (23)-(24) on a single cell is: find such that


where is the outward normal to . Let us first consider such that . Let denote the center point of cell . For the flux on the interior facets, we choose the following flux approximation


Here, denotes the limit of in cell as it goes to the edge .

We consider a piecewise constant approximation of our solution, i.e. in the approximation space with basis . The DG0 approximation is . For this approximation, on , is constant and . Therefore, (25) becomes


Note that this is equivalent to


which is a Finite Volume approximation of the heat equation. In reservoir simulation, this way of approximating the interior facet integrals is known as a “two-point flux” (TPFA) approximation. In order for such a Finite Volume method to converge, the grid must satisfy a certain orthogonality property eymard2000finite (). In brief, in each cell, there exists a point called the center of the cell such that for any adjacent cell, the straight line between the two centers is orthogonal to the boundary between the cells. For the examples in this paper, we choose quadrilateral meshes, which easily satisfy this condition.

If instead is a boundary element, then the boundary integral becomes


where is the unit outward pointing normal of a cell. We use the following flux approximation


where is the shortest distance form to the boundary . For each , we have


For a given ordering of the indices in , we denote by and the limit value of for two cells sharing an edge. Now, summing over all , and noting that each interior facet is visited twice, we obtain


We define the jump of as . We then get the following problem: find such that


for all .

2.2.1 Upwinding

We now consider an upwind Godunov method godunov1959difference () for the advection equation


where is a given vector field. For an interior , the upwind scheme is given by


where is the upwind value of , which, for a facet shared by and and pointing from to , is given by


For the full discretized problem we have: find such that


for all .

2.2.2 Semidiscrete problem

We now discretize (11)-(14) in space using the semidiscrete DG0 formulation described above. Assuming homogeneous Neumann boundary conditions, the variational problem is: find the approximation such that


for all . The brackets denote the average across the facets, and the double brackets denote the harmonic average across the facets. The use of the harmonic average is standard for two-point flux approximation, and is obtained by considering piecewise constant permeabilities eymard2000finite (). The upwind quantities are given by


For the delta functions in the source/sink terms, we choose the simple approximation:


2.2.3 Fully discretized problem

For time discretization, we use the backward Euler method. We define the two following forms, which are linear with respect with their last argument:


Let , which is linear in both and , but nonlinear in and . At each time-step, given the previous solution , we search for such that


3 Solution algorithms

The system of nonlinear equations (45) can be written as a system of nonlinear equations for the real coefficients and of the DG0 functions and , respectively. Let be the vector of these coefficients and the function such that is equivalent to (45). By linearizing this equation with Newton’s method, we must solve at each iteration


The resulting linearized systems can be written as a block system of the form


where is the Newton increment. The different blocks are the discrete versions of Jacobian terms as follows






All coefficients in (48)-(53) are evaluated at the previous Newton iterate , and and denote the partial derivatives with respect to and , respectively.

The linearized systems are often very difficult to solve using iterative methods. Indeed, efficient preconditioning is required in order to achieve rapid convergence with linear solvers saad2003iterative (). In this section, we will detail different preconditioning techniques used to solve (47). We first mention some methods which are important ingredients of the preconditioning techniques.

Krylov subspace methods are used to approximate the solution of by constructing a sequence of Krylov subspaces, . The generalized minimal residual method (GMRES) saad1986gmres () is a Krylov subspace method suitable for general linear systems. The approximate solution is formed by minimizing the Euclidean norm of the residual over the subspace .

Incomplete LU factorization (ILU) saad2003iterative (); meijerink1977iterative () is a general preconditioning technique in which sparse triangular factors are used to approximate the system matrix . This preconditioner requires assembling the factors and then solving two triangular systems. A popular way to determine the sparsity pattern of the factors is to simply choose the relevant triangular parts of the sparsity pattern of . This is known as ILU(0). More generally, choosing the sparsity pattern of is called ILU().

Multigrid methods brandt1977multi (); briggs2000multigrid (); trottenberg2000multigrid () use hierarchies of coarse grid approximations in order to solve differential equations. Smoothing operations (such as a Jacobi or Gauss-Seidel iteration) are combined with coarse grid corrections on increasingly coarser grids. For positive definite elliptic PDEs, it is known that multigrid methods can provide optimal solvers (in the sense of linear scalability with the dimension of the discretized problem).

Algebraic Multigrid (AMG) ruge1987algebraic (); stuben2001introduction () uses information from the entries of the system matrix rather than that of the geometric grid. This makes AMG an ideal black-box solver for elliptic problems. Although it can be used to solve simpler problems, AMG is often used as a preconditioner for Krylov subspace methods in problems which are essentially elliptic. Relative to preconditioners such as ILU, parallel variants of multigrid methods retain more effectiveness.

3.1 Two-stage preconditioning: CPR

Let and be two preconditioners for the linear system for which we have the action of their (generally approximate) inverse , and . Applying a multiplicative two-stage preconditioner can be done as follows:

  1. Precondition using : ;

  2. Compute the new residual: ;

  3. Precondition using and correct: .

The action of the two-stage preconditioner can be written as


In the case of multiphase flow in porous media, the standard preconditioner is the Constrained Pressure Residual method (CPR) wallis1983incomplete (). In the multiphase case, the linear systems are like in (47) except that the temperature blocks are replaced (or combined in the thermal case) with saturation blocks.

In the case of CPR, the first stage preconditioner is given by


where is approximated using an AMG V-cycle. The second preconditioner is chosen such that , usually with an incomplete LU factorization method (ILU).

In addition to the two-stage preconditioner, decoupling operators are often used to reduce the coupling between the pressure equation and the saturation variables. Indeed, an approximation of the pressure equation is performed in the first stage of CPR where the saturation coupling is ignored. A decoupling operator is a left preconditioner applied a priori to (47) of the form


The most often-used approximations for multiphase flow are Quasi-IMPES (QI) and True-IMPES (TI)  lacroix2003iterative (); lacroix2000iterative (); scheichl2003decoupling (). The approximations are , . Here, is a diagonal matrix with entries the sums of the entries in the columns of , which is equivalent to the mass accumulation terms when discretized with the two-point flux approximation as outlined in this paper (as the fluxes sum up to zero in a given column).

By performing this decoupling operation on the system (47) before CPR, the first stage now consists in solving a subsystem for the approximate Schur complement instead of the original pressure block. However, the properties of the resulting need to be amenable to the application of AMG (for example M-matrix properties). While this is nearly guaranteed in the black-oil case gries2015system (), it does not necessarily follow for compositional flow or thermal flow. For the single phase test cases detailed in Section 4, we observe that CPR performs best without decoupling operators (results not shown here).

3.2 Block factorization preconditioner

Consider the following decomposition of the Jacobian


where is the Schur complement. The inverse of the Jacobian is given by


Even if is sparse, the Schur complement is generally dense. A common preconditioning technique is to use the blocks of the factorization (57) combined with a sparse approximation of the Schur complement elman2014finite ().

3.3 Schur complement approximation

Common sparse approximations for the Schur complement are and . Here we present a Schur complement approximation which performs significantly better than such simple approximations.

For the derivation of our Schur complement approximation, we consider the linearized problem before discretization. This approach results in an approximation which holds as we refine the mesh. See mardal2011preconditioning () for a theoretical framework in using the infinite-dimensional setting to find mesh-independent preconditioners for self-adjoint problems.

3.3.1 Steady-state case

We first consider a steady-state single phase thermal problem: find , such that


where is given by (2), and we have no-flux boundary conditions for the fluid and heat. Here we will consider the linearized system in a continuous setting. Applying a Newton method to (59)-(60), we obtain a block systems of the form (47) where the blocks are:


where we have used the product rule for the divergence operator in (62) and (63). Then the second term of the Schur complement (which corresponds in the continuous setting to the Poincaré-Steklov operator) becomes


We notice that in , the terms cancel. We are left with


One of the nonlinear terms has canceled, and so we consider if it is possible that the last two terms also cancel. Consider the operator , which is close to the operator . This holds if is close to , i.e. if is close to being constant with respect to .

Assuming that the operator is applied to a sufficiently smooth vector field , we can use Helmholtz decomposition to decompose this field into the sum of its curl-free and divergence-free part , where is a scalar potential and a vector potential. Since removes the divergence-free part of a field, applying to , we obtain


assuming that satisfies the same boundary conditions as the operator . Hence is a projection to the curl-free subspace, and it acts like the identity operator when applied to curl-free vector fields.

We assume that this also holds for . In (65), we see that this operator is applied to which is of the form , where is a scalar field. In order for to be a curl-free vector field, we need , i.e. we need and to be parallel vectors. In the discretized case, our grid satisfies an orthogonality property as mentioned in Section 2.2, and the gradients of and are approximated using a two-point flux approximation. In this case, the gradients are always orthogonal to the facets, and thus parallel. Accordingly, we replace the operator by the identity and obtain the following Schur complement approximation


Similar heuristic arguments for replacing by the identity operator in the case of the Stokes problem can be found, for example, in maday1993analysis (), and for the Navier-Stokes equations, in kay2002preconditioner ().

3.3.2 Source terms

Similarly, we consider the steady-state case with the addition of source/sink terms. In this case, production wells satisfy , while injection wells satisfy . Thus,