A block preconditioner for nonisothermal flow in porous media
Abstract
In petroleum reservoir simulation, the industry standard preconditioner, the constrained pressure residual method (CPR), is a twostage 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 nonisothermal 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 Vcycle. The resulting solver is scalable with respect to problem size and parallelization.
keywords:
preconditioning, iterative solvers, porous media, thermal reservoir simulation1 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 nonpressure 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 nonpressure 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 twostage 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 ellipticlike nature of the pressure equation makes it an ideal candidate for the use of AMG. This improved preconditioner, often denoted CPRAMG, is widely used in modern reservoir simulators.
The nonisothermal 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 CPRAMG, the SAMG approach proposed in clees2010efficient (); gries2014preconditioning () is quite similar in the isothermal case. Indeed, AMG is applied to the whole system, but all nonpressure 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 CPRAMG 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 nonisothermal 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 pressuretemperature system. Additionally, this solver can be extended to the multiphase case as the first stage of a CPRlike twostage preconditioner roy2019constrained ().
In Section 2, we present the mathematical model for nonisothermal 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
(1) 
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.
(2) 
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
(3) 
We also assume Neumann and Dirichlet boundary conditions
(4) 
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 advectiondiffusion equation:
(5) 
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.
(6) 
where is the thermal conductivity field. It is given by
(7) 
where and are the conductivities of the rock and the fluid, respectively. Then, (5) becomes
(8) 
Then, assuming Darcy flow, we get
(9) 
We also assume Neumann and Dirichlet boundary conditions
(10) 
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
(11) 
(12) 
(13) 
(14) 
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 
For viscosity, we choose the following correlation bennison1998prediction ():
(15) 
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:
(16) 
For density, we use the following correlation:
(17) 
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
(18) 
(19) 
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
(20) 
where is the height of well opening, is the equivalent permeability, is the bottomhole pressure, is the well radius, and is the equivalent radius which can be calculated using
(21) 
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
(22) 
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
(23) 
(24) 
The variational problem for (23)(24) on a single cell is: find such that
(25) 
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
(26) 
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
(27) 
Note that this is equivalent to
(28) 
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 “twopoint 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
(29) 
where is the unit outward pointing normal of a cell. We use the following flux approximation
(30) 
where is the shortest distance form to the boundary . For each , we have
(31) 
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
(32) 
We define the jump of as . We then get the following problem: find such that
(33) 
for all .
2.2.1 Upwinding
We now consider an upwind Godunov method godunov1959difference () for the advection equation
(34) 
(35) 
where is a given vector field. For an interior , the upwind scheme is given by
(36) 
where is the upwind value of , which, for a facet shared by and and pointing from to , is given by
(37) 
For the full discretized problem we have: find such that
(38) 
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
(39) 
(40) 
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 twopoint flux approximation, and is obtained by considering piecewise constant permeabilities eymard2000finite (). The upwind quantities are given by
(41) 
For the delta functions in the source/sink terms, we choose the simple approximation:
(42) 
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:
(43) 
(44) 
Let , which is linear in both and , but nonlinear in and . At each timestep, given the previous solution , we search for such that
(45) 
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
(46) 
The resulting linearized systems can be written as a block system of the form
(47) 
where is the Newton increment. The different blocks are the discrete versions of Jacobian terms as follows
(48) 
(49) 
(50) 
(51) 
where
(52) 
and
(53) 
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 GaussSeidel 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 blackbox 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 Twostage 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 twostage preconditioner can be done as follows:

Precondition using : ;

Compute the new residual: ;

Precondition using and correct: .
The action of the twostage preconditioner can be written as
(54) 
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
(55) 
where is approximated using an AMG Vcycle. The second preconditioner is chosen such that , usually with an incomplete LU factorization method (ILU).
In addition to the twostage 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
(56) 
The most oftenused approximations for multiphase flow are QuasiIMPES (QI) and TrueIMPES (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 twopoint 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 Mmatrix properties). While this is nearly guaranteed in the blackoil 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
(57) 
where is the Schur complement. The inverse of the Jacobian is given by
(58) 
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 infinitedimensional setting to find meshindependent preconditioners for selfadjoint problems.
3.3.1 Steadystate case
We first consider a steadystate single phase thermal problem: find , such that
(59) 
(60) 
where is given by (2), and we have noflux 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:
(61) 
(62) 
(63) 
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
(64) 
We notice that in , the terms cancel. We are left with
(65) 
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 curlfree and divergencefree part , where is a scalar potential and a vector potential. Since removes the divergencefree part of a field, applying to , we obtain
(66) 
assuming that satisfies the same boundary conditions as the operator . Hence is a projection to the curlfree subspace, and it acts like the identity operator when applied to curlfree 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 curlfree 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 twopoint 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
(67) 
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 NavierStokes equations, in kay2002preconditioner ().
3.3.2 Source terms
Similarly, we consider the steadystate case with the addition of source/sink terms. In this case, production wells satisfy , while injection wells satisfy . Thus,