requires at least the partial solution of a sequence of linear systems. ... lattice constant, distance between centers of two adjacent pores. Lthroat ... contact angle.
Transport in Porous Media 37: 277–301, 1999. © 1999 Kluwer Academic Publishers. Printed in the Netherlands.
277
Comparison of Iterative Methods for Computing the Pressure Field in a Dynamic Network Model KRISTIAN MOGENSEN1, ERLING STENBY1, SRILEKHA BANERJEE2,? and VINCENT A. BARKER3,?? 1 Engineering Research Center (IVC-SEP), Department of Chemical Engineering, Technical
University of Denmark, DK-2800 Lyngby, Denmark 2 S.N. Bose National Centre for Basic Sciences, Block JD, Sector III, Salt Lake, Calcutta 700 091,
India 3 Department of Mathematical Modelling, Technical University of Denmark, DK-2800 Lyngby,
Denmark (Received: 27 May 1998) Abstract. In dynamic network models, the pressure map (the pressure in the pores) must be evaluated at each time step. This calculation involves the solution of a large number of nonlinear algebraic systems of equations and accounts for more than 80% of the total CPU-time. Each nonlinear system requires at least the partial solution of a sequence of linear systems. We present a comparative study of iterative methods for solving these systems, where we apply both standard routines from the public domain package ITPACK 2C and our own routines tailored to the network problem. The conjugate gradient method, preconditioned by symmetric successive overrelaxation, was found to be consistently faster and more robust than the other solvers tested. In particular, it was found to be much superior to the successive overrelaxation technique currently used by many researchers. Key words: dynamic network models, iterative methods.
Nomenclature Roman A Cgeom C f G l L Lthroat ncorners nx , ny , nz p pc
cross-sectional area. geometry factor. volume parameter. geometry factor. conductance. length of element in calculation of conductance. lattice constant, distance between centers of two adjacent pores. throat length. number of corners for given geometry. number of pores in the x, y, z-directions. pressure. capillary pressure.
? This work was performed while visiting the Technical University of Denmark. ?? Author for correspondence.
278 q r Rasp R1 , R2 S t V
KRISTIAN MOGENSEN ET AL.
volumetric flow rate. radius. aspect ratio. principal radii of curvature. saturation. time. volume.
Greek Scalars α half-angle. β resistance factor. γ interfacial tension. 1 difference. measure of residual error. µ viscosity. ω successive overrelaxation parameter. θ contact angle. ξ tolerance. Subscripts eff event frontal i j min nw pore tot throat w
effective. event (snap-off or pore-filling). frontal displacement. property related to pore i or to fluid i. property related to pore j . minimum. nonwetting phase. property related to the pore. total. property related to the throat. wetting phase or water.
1. Introduction Network modelling began with the work of Fatt (1956a–c), who computed capillary pressure and relative permeability curves in a network of interconnected pores. Since then, numerous authors have contributed to our present understanding of multiphase flow in porous media. Sahimi (1995), Dullien (1992), and Berkowitz and Balberg (1993) have given thorough literature reviews. In the past decade, network models have become steadily more sophisticated and have been used to provide insight into a variety of phenomena. For a compilation of papers on quasi-static network models, see Blunt (1997). A dynamic network model of two-phase flow was presented by Koplik and Lasseter (1985) and investigated for small 2-D networks. A similar approach was taken by Chen and Koplik (1985) using a modification of Poiseuille’s law for throats of rectangular cross-section. Lenormand et al. (1988) simulated the dynamics of drainage on 100 × 100 2-D networks. They noted that, due to capillary pressure, the system of equations used to solve the pressure at each node was nonlinear.
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
279
Whereas previously reported work (Koplik and Lasseter, 1985; Chen and Koplik, 1985) consisted of replacing the nonlinear problem by a sequence of linear problems, Lenormand et al. (1988) chose to solve the nonlinear problem directly using a relaxation technique. Another dynamic two-phase model of drainage was developed by Blunt and King (1991) for the purpose of studying the effect of viscous and capillary forces on relative permeabilities for 2-D and 3-D networks. Their simulations showed that drainage relative permeability may be a function of both viscosity ratio and capillary number. Payatakes and coworkers looked at dynamic network models in connection with ganglion mobilization. Ganglion motion was first simulated by Dias and Payatakes (1986a, b), who investigated the effect of stranding, break-up, coalescence, and shape of ganglia. The issue of collision and coalescence of nonwetting ganglion clusters was further addressed in a paper by Constantinides and Payatakes (1991). Vizika et al. (1994) investigated the role of the viscosity ratio during forced imbibition and found that it affects residual oil saturation significantly, even for low capillary numbers. Dynamic network modelling was applied to drainage-dominated three-phase flow under strongly wetting conditions by Pereira et al. (1996). They simulated three-phase displacements as a sequence of two-phase displacements. Finally, Mogensen and Stenby (1998) developed a dynamic network model of imbibition that took into account the flow of wetting fluid in crevices and the mobilization of ganglia. In dynamic network models the pressure map must be calculated at each time step. Conservation of volume, together with Poiseuille’s law relating pressure drop to flow rate and the assumption of incompressibility of fluids, results in an algebraic system of equations for the determination of the pressure in each pore body. There are a large number of techniques for solving these systems. In the dynamic network model, used for work presented here, which is that described in Mogensen and Stenby (1998), most of the CPU-time is spent in calculating pressure. Finding a fast solver is therefore a matter of importance. A compilation of papers on network models reveals that the successive overrelaxation (SOR) method is a popular solution technique. Applications of SOR to compute pressure in the nodes are described in Blunt and King (1988, 1990, 1991), Bryant and Blunt (1992), Ewing and Gupta (1993), Kiriakidis et al. (1993), Lenormand et al. (1988), Nilsen et al. (1996), Paterson et al. (1996), and Pereira et al. (1996). The conjugate gradient method is also applicable when the equations for pressure arise from volume conservation. Papers dealing with the conjugate gradient method may be divided into three groups. The first group discuss the application of conjugate gradients without preconditioning: Blunt (1997), Ioannidis and Chatzis (1993), Kantzas and Chatzis (1988), Øren et al. (1996). The second group of papers deal with the preconditioned conjugate gradient method, but the type of preconditioning is not specified: Constantinides and Payatakes
280
KRISTIAN MOGENSEN ET AL.
(1991), Dias and Payatakes (1986a,b), Koplik and Lasseter (1985), Valavanides et al. (1996), Vizika et al. (1994). The third group of papers is concerned with the preconditioned conjugate gradient method and specifies the type of preconditioning used: Constantinides and Payatakes (1996) use an incomplete Cholesky factorization for preconditioning, while Mogensen and Stenby (1998) use symmetric SOR preconditioning. Other preconditioned gradient-type methods are described in Jerauld and Salter (1990) and Goode and Ramakrishnan (1993). The remainder of this paper is organized as follows: Section 2 describes some basic aspects of the network model. Displacement mechanisms and pore-level events are discussed in Section 3. Section 4 is devoted to the simulation procedure. Issues such as calculation of fluid conductance and fluid rates are addressed, and it is shown how the model simulates fluid advance. Section 5 discusses the system of equations that determines the pressures in the pores and reviews some basic iterative methods that can be applied to solve this system. It also describes the public domain ITPACK 2C package of routines that are applicable to this problem. Section 6 reports the performance of some of the ITPACK 2C routines as well as that of our own implementations of a number of iterative methods. Finally, Section 7 contains a discussion of the obtained results and presents our conclusions. It is our hope that the reader will find our material on network modelling and iterative methods for linear systems to be a useful review of these topics.
2. The Network Here we will briefly describe the main features of our network model. Details are given in Mogensen and Stenby (1998). The porous medium is represented as a 3-D network of wide pore spaces which are connected by narrower regions called throats. We denote the number of pores in the three directions by nx , ny and nz . A schematic 2-D version of this network is shown in Figure 1. Often the distribution of throat sizes can be adequately represented by a common statistical distribution such as the normal, the lognormal, or the Weibull distribution. In this paper we have chosen the truncated Weibull distribution k f (r) = b
r −a b
k−1
" # r −a k , exp − b
with k = 2. The parameters a and b are determined by the mean value and the standard deviation. The existence and importance of spatial correlation in consolidated porous media has been established by several authors, including Jerauld and Salter (1990),
281
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
Figure 1. A network of pores and throats (nx = ny = 5). The pores are represented by the black squares.
Bryant et al. (1993), and Blunt (1997). In this work, pore radii are generated from the Weibull distribution and throat radii are then correlated as follows: rpore,i + rpore,j rthroat,i,j = min rpore,i , rpore,j , , 2Rasp where Rasp is the aspect ratio defined as the average pore radius divided by the average throat radius. The aspect ratio Rasp is specified a priori. To assign a volume and cross-sectional area to pores and throats, their geometry must be specified. In our model, throats may have either circular, rectangular or triangular cross-section. The cross-sectional area is 2 Athroat = Cgeom rthroat , √ where Cgeom is π , 4, or 3 3, depending on whether the throats are circular, rectangular, or triangular, respectively. We take the pore and throat volumes to be simple functions of the radius: C
pore,2 Vpore = Cpore,1 rpore ,
C
throat,2 Vthroat = Cthroat,1 rthroat .
A similar approach has been followed by Heiba et al. (1992), McDougall and Sorbie (1995), Blunt (1997), and others. In the work reported here we have put Cpore,1 = Cpore,2 = Cthroat,1 = Cthroat,2 = 1. 3. Fluid Displacement and Pore-Level Events If the displacement is quasi-static, the pressure difference at the interface of the two fluids, called the capillary pressure, is given by the Young–Laplace equation 1 1 pc = pnw − pw = γ , + R1 R2
282
KRISTIAN MOGENSEN ET AL.
where nw and w stand for the nonwetting and wetting phases, respectively, γ is the interfacial tension, and R1 and R2 are the principal radii of curvature of the fluid interface. For a cylindrical throat of radius r, the capillary pressure at the fluid interface is 2γ cos(θ) pc = , (1) r where θ is the contact angle. For square capillaries we use a formula given by Legait (1983), γ θ + cos2 (θ) − π/4 − sin(θ) cos(θ) pc = . √ r cos(θ) − π/4 − θ + sin(θ) cos(θ) The displacement of nonwetting fluid by wetting fluid is called imbibition, and the reverse process is called drainage. Imbibition is a spontaneous process where the capillary forces are responsible for the fluid motion, whereas in drainage capillary forces must be overcome by applying an external pressure drop. We have θ < 90◦ for an imbibition process and 90◦ < θ < 180◦ for a drainage process. Equation (1) shows that the smallest radius controls the rate of drainage because it maximizes the capillary pressure. Two distinct types of displacement mechanisms exist. The first is a piston-like advance, where the displacing fluid advances in a connected front that occupies the center of the pore space. The displacing fluid resides behind the front at all times. For a drainage process, once a throat has been filled the adjacent pore is automatically filled next. In imbibition, pore filling is more complex. Lenormand and Zarcone (1984) found that it depends on the number of neighboring pores that have already been filled. These cooperative pore-filling mechanisms are not included in our network model. In imbibition, a second displacement type, called ‘snap-off’, may occur due to the existence of crevices in the pore structure. The wetting fluid can maintain hydraulic continuity and conductance through these crevices, leading to pore filling ahead of the connected front. An accumulation of wetting phase gradually forms a stable neck and eventually blocks the pore throat, as illustrated in Figure 2. The blocking of throats can lead to considerable entrapment of the non-wetting phase. The criterion for snap-off, assuming creeping flow, is rthroat 1 − tan(θ) tan(α) < , rpore 2f
(2)
where α is the half-angle defined in Figure 3 and f is a geometric factor close to unity.
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
283
Figure 2. Formation of a stable neck in a converging/diverging capillary segment.
Figure 3. Corner geometry in capillary of rectangular cross-section.
4. Simulation of Fluid Displacement Poiseuille’s law applied to a capillary segment, assuming this is a tube of constant cross-sectional area, states that q = G1p, where q is the flow rate, G is a conductance, and 1p is the pressure drop. If only one phase is present then G = Ar 2 /8µl, where µ stands for fluid viscosity and l is the pore or throat length. If several phases are present in the same capillary segment then G must be determined for each phase, and this involves the area occupied by each phase. 4.1.
AREA OCCUPIED BY TWO PHASES IN EQUILIBRIUM
For throats of noncircular cross-section, the wetting fluid resides in the corners (see Figure 4). The radius of curvature between two phases in the corner can be found by using the Young–Laplace equation: γ . rw/nw = pnw − pw Here pw is the pressure in the wetting film and pnw is the bulk (i.e., nonwetting) phase pressure. There is only one radius of curvature. The total cross-sectional area
284
KRISTIAN MOGENSEN ET AL.
Figure 4. Wetting fluid residing in crevices in the pore space.
for the wetting fluid is (Mogensen and Stenby, 1998) 2 Aw = ncornersrw/nw [cot(α) cos2 (α) ˜ − ( 12 π − α) ˜ + cos(α) ˜ sin(α)], ˜
where α˜ = α + θn/nw , and the area occupied by the nonwetting phase is then the total area minus Aw . 4.2.
PHASE CONDUCTANCES
Modifying Poiseuille’s law for the bulk phase, we obtain (Blunt, 1997) G=
4 π reff , 8µl
where the effective bulk phase radius in a throat is expressed as ! r Anw 1 reff = + rthroat . 2 π For a throat (i, j ) connecting pores i and j , the throat length is Lthroat,i,j = L − (rpore,i + rpore,j ), where L is the distance between the centers of two adjacent pores. This implies that the sum of the two pore radii cannot exceed L. The wetting phase conductance is G=
2 Aw rw/nw
βµl
,
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
285
where β is a dimensionless resistance factor that accounts for the lowered conductance of a wetting layer next to a solid. Its value has been estimated by Ransohoff and Radke (1988) and by Zhou et al. (1997). The total bulk fluid conductance between the centers of pores i and j is given by the harmonic mean 1 1 1 1 1 . = + + Gi,j Gthroat,i,j 2 Gi Gj
4.3.
PRESSURE AND FLOW RATES
Calculation of pressure is the key feature that distinguishes a dynamic network model from a regular quasi-static model. The usual approach for the calculation of pressure in the pores is to assume incompressibility of all fluids. If conservation of volume is imposed at pore i then X qi,j = 0, (3) j ∈S(i)
where S(i) is the set of pore numbers j such that pore j is a neighbor of pore i and where qi,j is the volumetric flow rate in the throat connecting pores i and j . In an oil–water flow, the flow rate for a throat depends on whether the pores on each side of the throat contain the same phase (the case of a single-phase throat) or different phases (the case of a two-phase throat). The flow rate for a single-phase throat is qi,j = Gi,j (pi − pj ).
(4)
In the case of a two-phase throat, the flow rate is given by (5a) below if pore i contains water and pore j contains oil, and by (5b) if pore i contains oil and pore j contains water: Gi,j (pi − pj + pc,i,j ), pi − pj + pc,i,j > 0 qi,j = (5a) 0, pi − pj + pc,i,j < 0, qi,j =
Gi,j (pi − pj − pc,i,j ), pi − pj − pc,i,j 6 0 0, pi − pj − pc,i,j > 0.
(5b)
Note that a two-phase throat conductance is essentially a step function of the unknown pressures, having either a prescribed positive value Gi,j or the value zero. One can think of the throat as being ‘open’ in the first case and ‘closed’ in the second. The physical rationale behind this cut-off condition is the following: In a restricted imbibition process, flow rate is controlled by pore size. If the pore is too large, water will not be able to penetrate it. Invasion of oil into the throat, on the other hand, is controlled by the throat size. This event is very unlikely to occur, especially for large aspect ratios, since the capillary threshold for drainage
286
KRISTIAN MOGENSEN ET AL.
is higher than that for imbibition. The oil–water interface will therefore freeze at the pore–throat boundary. An algebraic system for the determination of the pore pressures is obtained in three steps: (1) Impose (3) at every pore where the pressure is unknown (these pores are determined by the boundary conditions of the problem); (2) Substitute for each flow rate the appropriate expression from (4) or (5); (3) Apply the boundary conditions. An example of appropriate boundary conditions is when the pressure is specified at an inlet face and an outlet face (opposite one another) and a ‘no-flow’ boundary condition is imposed at the remaining faces. These are the boundary conditions used in the work reported here. Given these, one arrives at a system of n equations in n pressure unknowns, where n is the number of pores between the inlet and outlet faces. We call this system the flow balance system. Because the two-phase throat conductances depend on pressure, the flow balance system is nonlinear. The task of solving this system is discussed in Sections 5 and 6. 4.4.
FLUID ADVANCE
The dynamic invasion process is simulated in a series of time steps. Knowing the flow rates, the minimum filling time for frontal displacement is found from the relation Snw,i Vi tmin,frontal = min , qi where the minimum is with respect to all pore/throats i containing a moving interface. In throats where the snap-off criterion in (2) is satisfied, the time step is defined as the time taken for the crevice flow to form a stable neck. 5. Calculation of Pressure We consider now the problem of solving numerically the flow balance system derived in Section 4.3. When the equations and unknowns have been assigned an ordering, this system can be expressed in the form A(p) p = b(p),
(6)
where p is an n × 1 vector containing the unknown pore pressures, A(p) is an n × n matrix of conductances, and b(p) is an n × 1 vector dependent on the pore pressures at the inlet and outlet faces, the conductances of the throats connected to these faces, and the conductances and capillary pressures of the twophase throats. The dependency of A(p) and b(p) on p is a consequence of the
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
287
fact that a two-phase throat conductance is a step function of p, having either a prescribed positive value (when the throat is open) or the value zero (when the throat is closed). Let m denote the number of two-phase throats. Since there are only 2m possible combinations of open and closed two-phase throats, there are only 2m possible pairs {A(p), b(p)}. We denote these Al , bl , l = 1, 2, . . . , 2m . Thus, associated with the nonlinear flow balance system (6) is a set of linear systems Al p = b l ,
l = 1, 2, . . . , 2m .
(7)
Any solution of (6) must be the solution of at least one of these linear systems. These systems are symmetric and very sparse, the maximum number of nonzero entries in any row of Al being five for 2-D networks and seven for 3-D networks. Further, if there is no phase entrapment, which we are assuming, then these matrices are also irreducibly diagonally dominant and therefore positive definite. Finally, since the nondiagonal entries are nonpositive, these matrices are M-matrices (see Axelsson, (1994). All of these properties are favorable for solving the systems in (7) by iterative methods. In the absence of phase entrapment, (6) has precisely one solution. This is because, (1) a vector p is a solution of (6) if and only if it yields an extremum of the function f (p) = 12 pT A(p)p − b(p)T p, and (2) the function f (p) has an extremum for precisely one vector p. (f (p) opens upwards and is convex, and the extremum is the global minimum of f (p).) A natural iteration for (6) is A(pk ) pk+1 = b(pk ),
k = 0, 1, . . . .
(8)
Since in every step we are solving one of the linear systems in (7) and since the number of these is 2m , the process defined by (8) either produces the solution of (6) in at most 2m steps or cycles without end. While we have no proof that the former invariably occurs, all of our computational experience to date indicates that this is in fact the case. Further, we have found that when the initial vector p0 is taken to be the pressure solution from the previous time step then the number of steps of (8) is surprisingly small. Each step of (8) presents us with a linear system A p = b,
(9)
where, for some l, A = Al and b = bl . Because of the sparse nature of A and the other properties of A mentioned earlier, iterative methods are effective for solving (9) and almost mandatory for 3-D networks. Two important classes of iterative methods are stationary iterative methods and gradient-type methods.
288
KRISTIAN MOGENSEN ET AL.
Figure 5. A 2-D network.
5.1.
STATIONARY ITERATIVE METHODS
Important references for this discussion are Hageman and Young (1981), Varga (1962), and Young (1971). A stationary iterative method for solving (9) is constructed by choosing a splitting of A of the type A=M−N
(10)
and then iterating according to M pnew = N pold + b (solve for pnew ).
(11)
There are two requirements: The work per iteration should be modest and so should the number of iterations required to approximate the solution of (9) with reasonable accuracy. The first requirement involves the form of M; desirable forms in this respect are diagonal, triangular, band, or some product of these forms. The second requirement leads to the demand that ρ(M−1 N) < 1, where ρ(M−1 N) is the spectral radius of M−1 N; that is, the maximum modulus among the eigenvalues of M−1 N. The smaller the value of ρ(M−1 N), the faster the convergence. We give below some basic stationary iterative methods as applied to a two-phase 2-D network problem consisting of an nx × ny connected array of pores, illustrated in Figure 5 for nx = 4 and ny = 3. The pressure is assumed to be specified at the left and right boundaries, and a noflow condition is imposed at the horizontal boundaries. For convenience we have adopted a double-index notation for the pore pressures and throat conductances. The unknown pore pressures are pi,j , j = 1, 2, . . . , ny , i = 2, 3, . . . , nx − 1, the number of these being n = (nx − 2)ny .
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
289
Figure 6. Pores and throats involved in the typical flow balance equation.
The typical flow balance is based on the five pores shown in Figure 6. For simplicity of presentation we temporarily assume that all capillary pressures are zero. Then (9) may be expressed as H V V Gi,j pi,j − GH i−1,j pi−1,j − Gi,j pi+1,j − Gi,j −1 pi,j −1 − Gi,j pi,j +1 = 0, j = 1, 2, . . . , ny , i = 2, 3, . . . , nx − 1, (12)
where H V V Gi,j = GH i−1,j + Gi,j + Gi,j −1 + Gi,j .
Since (9) is linear, all conductances are constant and therefore independent of pressure. Typically at least some of the two-phase throats are closed, making the associated conductances zero. When i = 2 or nx − 1 then one of the terms in (12) contains a known pressure at the left or right boundary, respectively. When j = 1 or ny then one of the throats in Figure 6 is external to the network and the no-flow condition prescribes that the corresponding conductance is zero. We suppose the ordering of equations and unknowns in (9) to be the result of going through the network rowwise, bottom to top, left to right within a row, making p = [p2,1 , p3,1 , . . . , pnx −1,1 , p2,2 , p3,2 , . . . , pnx −1,ny ]T .
290
KRISTIAN MOGENSEN ET AL.
This ordering dictates the sequence in which pore pressures are updated in the typical step of an iterative method. Three classical stationary iterative methods, as applied to (12), are the following. The Jacobi method: 1 new old H old V old V old pi,j (GH i−1,j pi−1,j + Gi,j pi+1,j + Gi,j −1 pi,j −1 + Gi,j pi,j +1 ). Gi,j The Gauss–Seidel method: 1 new new H old V new V old pi,j = (GH i−1,j pi−1,j + Gi,j pi+1,j + Gi,j −1 pi,j −1 + Gi,j pi,j +1 ). Gi,j The successive overrelaxation (SOR) method: ω new old new pi,j = (1 − ω)pi,j + (GH i−1,j pi−1,j + Gi,j old V new V old +GH i,j pi+1,j + Gi,j −1 pi,j −1 + Gi,j pi,j +1 ).
SOR with ω = 1 yields the Gauss–Seidel method. Note that these expressions reflect the rowwise ordering of pores described above. Since the linear systems are symmetric positive definite systems, SOR converges for 0 < ω < 2, the optimal value of ω depending on the particular system. As the size of the network increases, the tendency is for ω to approach 2. In order of increasing rate of convergence (decreasing ρ(M−1 N)) we have Jacobi, Gauss–Seidel and optimal SOR. Also important is the symmetric SOR (SSOR) method. The typical step of the SSOR method consists of two parts, the first being a step of SOR and the second being a step of ‘reverse SOR’, where the pore pressures are updated in reverse order. While SSOR, considered as a stationary iterative method, is generally less efficient than ordinary SOR, it yields a useful preconditioner for the conjugate gradient method (see below). Each of the four stationary iterative methods above can be characterized by a splitting of type (10). These splittings are described in terms of the basic decomposition of any symmetric matrix A given by A = L + D + LT , where L is the strictly lower triangular part of A and D is the diagonal part. The matrix M in (10) is as follows for the four methods: 1 D + L, ω T 1 ω 1 = D + L D−1 D+L . 2−ω ω ω
MJ = D, MSSOR
MGS = D + L,
MSOR =
(13) (14)
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
5.2.
291
GRADIENT- TYPE METHODS
We now turn to gradient-type methods, important references here being Axelsson (1994), Barrett et al. (1994), Greenbaum (1997) and Saad (1995). By far the most popular gradient-type method for symmetric positive definite systems is the conjugate gradient method. The algorithm for this is given by (16) below with M = I, the identity matrix. The rate of convergence of the conjugate gradient method depends on the parameter κ(A) = λn /λ1 > 1, where λ1 and λn are the smallest and largest eigenvalues of A, respectively. The smaller the value of κ(A), the faster the convergence. The strength of the conjugate gradient method is that it yields a rate of convergence comparable to that of optimal SOR without requiring an optimized parameter. Let M be an arbitrary symmetric positive definite matrix, and suppose each side of (9) is multiplied by M−1 : M−1 A p = M−1 b.
(15)
Consider the quantity κ(M−1 A), the ratio of the extreme eigenvalues of the matrix M−1 A. If M = A then κ(M−1 A) = κ(I) = 1, the optimal value. More generally, if M is a good approximation to A then we expect κ(M−1 A) κ(A). Hence, the idea: Choose a matrix M that approximates A and apply the conjugate gradient method to (15). This procedure cannot be carried out directly as described because in general M−1 A is unsymmetric despite the symmetry of both A and M. However, there is a simple transformation of (15) that produces a symmetric positive definite system, and the conjugate gradient method can be applied to this. Skipping the details, this procedure, known as the preconditioned conjugate gradient method, is implemented by the following algorithm. Choose p, compute g = Ap, solve Mh = g, put D = −h, and iterate until convergence as follows: gTold hold , dTold A dold
(16a)
pnew = pold + τ dold ,
(16b)
gnew = gold + τ A dold,
(16c)
Mhnew = gnew
(16d)
τ =
β=
(solve for hnew ),
gTnew hnew , gTold hold
dnew = −hnew + β dold .
(16e) (16f)
The matrix A appears only in matrix–vector products of the form Ad with d given, and only one such product needs to be computed per iteration. For our
292
KRISTIAN MOGENSEN ET AL.
problem, the computation of Ad is given by H V V (Ad)i,j = Gi,i di,i − GH i−1,j di−1,j − Gi,j di+1,j − Gi,j −1 di,j −1 − Gi,j di,j +1 , j = 1, 2, . . . , ny , i = 2, 3, . . . , nx − 1.
The components of d associated with pores on left or right boundaries of the network are assumed to be zeros. The matrix M is called the preconditioning matrix. Candidates for this matrix are the matrices denoted M in the splittings associated with certain stationary iterative methods; see (13) and (14). To see why a good stationary iterative method might yield a good preconditioning matrix, recall that a good stationary iterative method has the property that (11) is easy to solve and that ρ(M−1 N) is small. Now if (11) is easy to solve then so is (16d). Further, the relation M−1 A = M−1 (M − N) = I − M−1 N implies that κ(M−1 A) 6
1 + ρ(M−1 N) , 1 − ρ(M−1 N)
so reducing ρ(M−1 N) also reduces κ(M−1 A). With regard to (13), the requirement that M be symmetric eliminates MGS and MSOR . With regard to (14), the requirement that M be positive definite restricts ω to the interval 0 < ω < 2. Using MJ and MSSOR as the preconditioning matrix in (16) leads to, respectively, the Jacobi-preconditioned conjugate gradient method and the SSOR-preconditioned conjugate gradient method. Another source of preconditioning matrices is the process of incomplete factorization. Recall that any symmetric positive definite matrix has the Cholesky factorization A = CCT ,
(17)
where C has lower triangular form. Typically C is much less sparse than the lower triangular part of A because of fill-in. If most (or all) of the fill-in is discarded during the factorization then we have a relation of the form A = M − N, where M = CCT .
(18)
Here C denotes the computed incomplete Cholesky factor, which is usually much sparser than the exact C in (17), and N is a measure of the error incurred in the factorization. The matrix M in (18) can be used to precondition the conjugate gradient method.
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
5.3.
THE ITPACK
2C
293
PACKAGE
ITPACK 2C (hereafter denoted simply ‘ITPACK’) is a public domain collection of seven FORTRAN subroutines for solving sparse linear systems which are symmetric positive definite or nearly so. Hence, it is applicable to systems of type (9). It is available at the software repository Netlib at website http://www.netlib.no/netlib/ itpack/index.html. Detailed background for the methods can be found in Hageman and Young (1981); see also Kincaid et al. (1982). ITPACK requires the coefficient matrix A to be stored in a sparse matrix format in which the nonzeros of A are stored by rows in consecutive locations. The methods implemented in ITPACK are listed in Table I. SOR, JCG, and SSORCG have been discussed above. Semi-iteration is a technique for accelerating stationary iterative methods that is based on Chebyshev polynomials. It is most effective when the extreme eigenvalues of the coefficient matrix can be well estimated. The reduced-system methods require that the system of equations be ordered in such a way that A has a partitioning of the form A1,1 A2,1 A , (19) A2,1 A2,2 where A1,1 and A2,2 are diagonal matrices. The rowwise order that we have used for (9) does not produce this property. However, any ‘checkerboard ordering’ of our system does. A checkerboard ordering is obtained by supposing the internal pores to be colored in checkerboard fashion and then ordering the pores of one color before ordering those of the other. For further information about semi-iteration and reduced-system techniques, see Hageman and Young (1981). Most of the above methods involve parameters that one would like to know or optimize. A feature of the ITPACK package is that it can be requested to determine such parameters dynamically during the computation. Table I. List of ITPACK solvers Abbreviation
Method
SOR JCG SSORCG JSI SSORSI RSSI RSCG
Successive overrelaxation Jacobi-preconditioned conjugate gradients SSOR-preconditioned conjugate gradients Jacobi semi-iteration SSOR Semi-iteration Reduced-system semi-iteration Reduced-system conjugate gradients
294
KRISTIAN MOGENSEN ET AL.
Table II. List of our solvers
5.4.
Abbreviation
Method
XGS XSOR XJCG XSSORCG XIFCG
Gauss–Seidel Successive overrelaxation Jacobi-preconditioned conjugate gradients SSOR-preconditioned conjugate gradients Inc.-fact.-preconditioned conjugate gradients
OUR ROUTINES
We have made our own implementations of a number of iterative methods for solving system (9). These are listed in Table II. To avoid confusion with the ITPACK routines we use the prefix ‘X’ in all of our names. 5.5.
ITERATIVE SOLUTION OF THE NONLINEAR PROBLEM
Sections 5.1–5.4 have been concerned with iterative methods for solving linear systems of type (9) because such methods are needed for solving the nonlinear system (6) via algorithm (8). We now consider (8) more closely. If, in the typical step, the vector pk+1 is not the solution of (6), then it is pointless to compute pk+1 to high accuracy since usually A(p) = A(pk+1) and b(p) = b(pk+1 ) for vectors p in some neighborhood of pk+1 . Thus, a sufficiently accurate approximation to pk+1 (which in fact may not have to be very accurate) will lead to precisely the same system in the following step of (8) as would have been obtained from the exact value of pk+1 . This consideration is the basis of the following algorithm for the iterative solution of (6): Algorithm 1 Set p∗ equal to the pressure computed in the previous time step. Compute A = A(p∗ ), b = b(p∗ ) and r = b − Ap∗ . If k r k∞ / k b k∞ 6 then terminate current time step. Iterate on the linear system Ap = b. Denote the new solution vector p∗ . Step 5. Go to Step 2.
Step 1. Step 2. Step 3. Step 4.
Step 1 needs no comment. Regarding Step 2, the computation of A(p∗ ) and b(p∗ ) is essentially only an updating of the two-phase throat conductances. Note that if r = 0 then p∗ is the solution of (6). Hence the stopping test in Step 3 yields a final vector p∗ which approximates the exact solution of (6) with an accuracy dependent on . The vector norm used in Step 3 is defined for any vector x of length n by kxk∞ = max |xi |. 16 i 6 n
Step 4 must include a strategy for terminating the iterations on the linear system. One strategy is to specify the number of iterations a priori. The second is to impose
295
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
Table III. Performance of iterative solvers for a 10×10 network Routine
Max. It.
Tot. It.
CPU (s)
CPU per It.
Max()
Ave()
SOR JCG SSORCG JSI SSORSI XGS XSOR XJCG XSSORCG XIFCG
203 147 36 1838 80 2425 368 155 53 48
12074 13662 3615 122748 6615 100659 13033 13945 4652 4612
14.0 23.7 17.6 84.3 16.1 30.2 9.1 8.9 7.6 8.9
1.2e−3 1.7e−3 4.9e−3 6.9e−4 2.4e−3 3.0e−4 6.4e−4 6.4e−4 1.6e−3 1.9e−3
4.5e−8 2.1e−8 8.9e−7 8.0e−7 8.3e−8 3.0e−9 4.8e−7 5.6e−8 5.6e−8 5.4e−8
2.5e−7 7.0e−9 2.2e−7 2.4e−7 2.1e−8 1.6e−9 1.2e−7 1.7e−8 1.7e−8 1.4e−8
a stopping test based on accuracy (as in Step 3). Any of the iterative methods listed in Tables I and II can be used in Step 4. It may well happen that the linear system being solved in a pass through Step 4 is the same as that in the previous pass. In this case the phrase ‘Iterate on the linear system Ap = b’ should be understood to mean ‘Continue the iteration on the linear system Ap = b’. The point is that the performance of certain methods (the conjugate gradient method, for example) is degraded by restarts. It should be mentioned that while Algorithm 1 is inspired by (8), there is no guarantee that it will behave like (8). More precisely, if the number of iterations performed in Step 4 is not sufficiently large then the sequence of linear systems that arise in Step 4 may be different from the sequence of linear systems that arise in (8). As in the case of (8), we have no proof of convergence to the solution of (6) but our computing experience to date indicates consistently that there is convergence. (That is, in our computations the stopping test in Step 3 has always been satisfied after a sufficient number of iterations.)
6. Results 6.1.
TESTING SOLVERS ON TWO NETWORKS
We have tested the use of iterative routines from Tables I and II in Step 4 of Algorithm 1 in the case of two networks, one of size 10 × 10 and the other of size 15 × 15 × 15. The entire dynamic flow was simulated in all runs. Results for the 10 × 10 network are shown in Table III. The first group of solvers are a subset of the ITPACK package and the second group are our own routines. As mentioned earlier, the stopping test chosen for Step 4 of Algorithm 1 can be based on a specified number of iterations or it can be based
296
KRISTIAN MOGENSEN ET AL.
on accuracy. For all of the computations in this section the stopping test in Step 4 was based on accuracy. In all probability, the linear systems solved in Step 4 are precisely those that arise in (8). ‘Max. It.’ is the maximum number of iterations used for any single time step, and ‘Tot. It.’ is the total number of iterations for all time steps. ‘CPU (s)’ is the total computing time in seconds, and ‘CPU per It.’ is the average time, in seconds, per iteration. Let =
kb(p) − A(p) pk∞ , kb(p)k∞
where p is the computed solution at some time step. ‘Max()’ is the maximum value of for any time step, and ‘Ave()’ is the average value of over all time steps. Three ITPACK routines perform essentially the same computation as our own, namely SOR, JCG and SSORCG which correspond to our XSOR, XJCG and XSSORCG, respectively. Comparing the total CPU times of these ITPACK routines with those of our own, we observe that the former are generally less than the latter. Probably much of the difference is due to the fact that in using the ITPACK package we must convert matrix A from our own storage scheme to that required by ITPACK. It will also be observed that where an ITPACK routine and one of our own implement the same method, they may differ with respect to number of iterations and the accuracy of the computed solution. This difference is due to the different accuracy-based stopping tests employed in the ITPACK routines and our own. We focus now on our routines. The best performance in terms of total number of iterations is achieved by XSSORCG and XIFCG. It is well known that these methods have a relatively high rate of convergence when the coefficient matrix, in addition to being symmetric positive definite, is also diagonally dominant with nonpositive off-diagonal entries. As mentioned earlier, these are all properties of the matrices we are dealing with. Regarding computing time, we see that XIFCG is somewhat more expensive than XSSORCG. At least part of the reason for this is that the IF preconditioning matrix must be computed while the SSOR preconditioning matrix is ‘free’. Now we consider, the second network which had dimensions 15 × 15 × 15. This is about the smallest size that can be used to calculate relative permeability, residual oil saturation, and other physical properties of interest, since smaller grids are not statistically representative of a homogeneous medium. The entire displacement process involved the calculation of about 7500 pressure maps. Simulation results are listed in Table IV for a subset of the methods applied to the previous problem. The fastest method in terms of total computing time is XSSORCG. The fact that XSSORCG uses 50% more iterations than the corresponding ITPACK routine SSORCG must be seen in relation to the greater accuracy obtained by XSSORCG.
297
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
Table IV. Performance of iterative solvers for a 15×15×15 network Routine
Max. It.
Tot. It.
CPU (s)
CPU per It.
Max()
Ave()
JCG SSORCG SSORSI XSOR XJCG XSSORCG
553 108 204 540 351 91
886512 143625 325454 486569 718041 210391
41947 26072 35379 53300 25725 16549
4.7e−2 1.8e−1 1.1e−1 1.1e−1 3.6e−2 7.9e−2
5.5e−4 3.0e−4 4.3e−4 1.3e−4 7.0e−7 3.0e−7
4.7e−6 2.1e−5 4.3e−6 1.7e−6 7.5e−8 9.2e−8
Figure 7. Total number of iterations (TOTITER) as a function of MAXITER.
As mentioned earlier, the stopping test used by the ITPACK routines differs from our own, and this makes it difficult to compute solutions having the same accuracy. 6.2.
A MORE FLEXIBLE APPROACH
Recall that for the computations in the previous section the stopping test used in Step 4 of Algorithm 1 was based on accuracy. In this case the sequence of linear systems solved in Step 4 is probably identical to that in (8). As mentioned earlier, this procedure can be inefficient because work spent on solving the systems in (8)
298
KRISTIAN MOGENSEN ET AL.
Figure 8. Total CPU time in seconds (CPU (s)) as a function of MAXITER.
to high accuracy is partially wasted except for the last system in the sequence. It might therefore seem reasonable to base the stopping test in Step 4 on a given number of iterations, here denoted MAXITER. Intuition suggests that the smaller the value of MAXITER, the fewer will be the total number of iterations. On the other hand, there is the possibility that the frequent passes through Steps 1–3 of the Algorithm 1 caused by a very small values of MAXITER will penalize such values of MAXITER with regard to total computing time. We have investigated this strategy for our routine XSOR in a dynamic simulation based on a 20 × 20 network. Figures 7 and 8 show the total number of iterations and the total computing time, respectively, as a function of MAXITER. It is observed that the first quantity increases monotonically with MAXITER, as expected, while the second attains a minimum somewhere near MAXITER = 25. Unfortunately, it is difficult to determine a priori the optimal value of MAXITER.
7. Conclusions and Discussion In a dynamic network model, the need arises to compute the pressure map in every time step. In the model considered here, the algebraic system for pressure is nonlinear due to a capillary threshold condition. However, experience shows that the nature of the nonlinearity is such that the system can be solved by solving a small
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
299
finite number of associated linear systems. Hence, iterative methods for solving linear systems are applicable. In this work we have applied some standard iterative methods to the problem at hand. Some of these have been taken from the public domain ITPACK 2C package. developed by Hagemann and Young (1981). The others have been programmed by ourselves to exploit fully our data structures. The best of both the ITPACK routines and our own prove to be effective. Of the methods applied, the consistently most successful has been the SSOR-preconditioned conjugate gradient method. Several strategies connected with the nonlinear aspect of the problem have been considered, these concerning the type of stopping test to be used in Step 4 of Algorithm 1. How this stopping test is handled can have a significant effect on the total computing time in a dynamic simulation. Unfortunately, at present an optimal a priori stopping criterion remains to be found.
References Axelsson, O.: 1994, Iterative Solution Methods, Cambridge University Press, Cambridge. Barrett, R. et al.: 1994, Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, SIAM, Philadelphia, PA, U.S.A. Berkowitz, B. and Balberg, I.: 1993, Percolation theory and its application to groundwater hydrology, Water Resour. Res. 29, 775–794. Blunt, M.: 1997, Effects of heterogeneity and wetting on relative permeability using pore level modeling, SPE J. 2, 70–87. Blunt, M. and King, P.: 1988, Scaling structure of viscous fingering, Phys. Rev. A37, 3935–3941. Blunt, M. and King, P.: 1990, Macroscopic parameters from simulations of pore scale flow, Phys. Rev. A42, 4780–4787. Blunt, M. and King, P.: 1991, Relative permeabilities from two- and three-dimensional pore-scale network modelling, Transport in Porous Media 6, 407–433. Bryant, S. and Blunt, M.: 1992, Prediction of relative permeability in simple porous media, Phys. Rev. A46, 2004–2011. Bryant, S., Mellor, D. and Cade, C.: 1993, Physically representative network models of transport in porous media, AIChE J. 39, 387–396. Chen, J.-D. and Koplik, J.: 1985, Immiscible fluid displacement in small networks, J. Coll. Int. Sci. 108, 304–330. Constantinides, G. and Payatakes, A.: 1991, A theoretical model of collision and coalescence of ganglia in porous media, J. Coll. Int. Sci. 141, 486–504. Constantinides, G. and Payatakes, A.: 1996, Network simulation of steady-state two-phase flow in consolidated porous media, AIChE J. 42, 369–382. Dias, M. and Payatakes, A.: 1986a, Network models for two-phase flow in porous media: Part 1. Immiscible microdisplacement of non-wetting fluids, J. Fluid Mech. 164, 305–336. Dias, M. and Payatakes, A.: 1886b, Network models for two-phase flow in porous media: Part 2. Motion of oil ganglia, J. Fluid Mech. 164, 337–358. Dullien, F.: 1992, Porous Media – Fluid Transport and Pore Structure, Academic Press, San Diego, U.S.A. Ewing, R. and Gupta, S.: 1993, Percolation and permeability in partially structured networks, Water Resour. Res. 29, 3179–3188. Fatt, I.: 1956a, The network model of porous media: I. Capillary pressure characteristics, Trans. AIME 207, 144–159.
300
KRISTIAN MOGENSEN ET AL.
Fatt, I.: 1956b, The network model of porous media: II. Dynamic properties of a single size tube network, Trans. AIME 207, 160–163. Fatt, I.: 1956c, The network model of porous media: III. Dynamic properties of networks with tube radius distribution, Trans. AIME 207, 164–181. Goode, P. and Ramakrishnan, T.: 1993, Momentum transfer across fluid-fluid interface in porous media: a network model, AIChE J. 39, 1124–1134. Greenbaum, A.: 1997, Iterative Methods for SolvingLinear Systems, SIAM, Philadelphia, PA, U.S.A. Hageman, L. and Young, D.: 1981, Applied Iterative Methods, Academic Press, New York, NY, U.S.A. Heiba, A., Sahimi, M., Scriven, L. and Davis, H.: 1992, Percolation theory of two-phase relative permeability, SPE RE 7, 123–132. Ioannidis, M. and Chatzis, I.: 1993, Network modelling of pore structure and transport properties of porous media, Chem. Engng Sci. 48, 951–972. Jerauld, G. and Salter, S.: 1990, The effect of pore-structure on hysteresis in relative permeability and capillary pressure: Pore-level modeling, Transport in Porous Media 5, 103–151. Kantzas, A. and Chatzis, I.: 1988, Application of the preconditioned conjugate gradients method in the simulation of relative permeability properties of porous media, Chem. Engng Comm. 69, 169–189. Kincaid, D., Respess, J., Young, D. and Grimes, R.: 1982, Algorithm 586: Itpack 2c: a fortran package for solving large sparse linear systems by adapted accelerated iterative methods, ACM Trans. Math. Softw. 8, 302–322. Kiriakidis, D. Mitsoulis, E. and Neale, G.: 1993, Computer simulations of immiscible displacement in a porous medium containing a region of different wettability, J. Can. Pet. Tech. 32, 21–25. Koplik, J. and Lasseter, T.: 1985, Two-phase flow in random network models of porous media, SPE J. 25, 89–100. Legait, B.: 1983, Laminar flow of two phases through a capillary tube with variable square crosssection, J. Coll. Int. Sci. 96, 28–38. Lenormand, R. and Zarcone, C.: 1984, Role of roughness and edges during imbibition in square capillaries, SPE 13264. Lenormand, R., Zarcone, C. and Touboul, E.: 1988, Numerical models and experiments on immiscible displacements in porous media, J. Fluid Mech. 189, 165–187. McDougall, S. and Sorbie, K.: 1995, The impact of wettability on water-flooding: pore-scale simulation, SPE RE 10, 208–213. Mogensen, K. and Stenby, E.: A dynamic two-phase pore-scale model of imbibition, Transport in Porous Media 32, 299–327. Nilsen, L., Øren, P., Bakkle, S. and Henriquez, A.: 1996, Prediction of relative permeability and capillary pressure from a pore model, SPE 35531. Øren, P.-E., Bakke, S., Nilsen, L. and Henriquez, A.: 1996, Prediction of relative permeability and capillary pressure from pore-scale modelling, 5th Euro. Conf. on Mathematics of Oil Recovery, Leoben, Austria, 3–6 September 1996. Paterson, L., Painter, S., Zhang, X. and Pinczewski, W.: 1996: Simulations of multiphase flow in naturally heterogeneous rocks, 5th Euro. Conf. on Mathematics of Oil Recovery, Leoben, Austria, 3–6 September 1996. Pereira, G., Pinczewski, W., Chan, D., Paterson, L. and ren, P.-E.: 1996, Pore-scale network model for drainage dominated three-phase flow in porous media, Transport in Porous Media (accepted for publication). Ransohoff, T. and Radke, C: 1988, Laminar flow of a wetting liquid along the corners of a predominantly gas-occupied noncircular pore, J. Coll. Int. Sci. 121, 392–401. Saad, Y.: 1995, Iterative Methods for Sparse Linear Systems, PWS Publishing, Florence, KY, U.S.A. Sahimi, M.: 1995, Flow and Transport in Porous Media and Fractured Rock – From Classical Methods to Modern Approaches, VCH, Weinheim, Germany.
COMPARISON OF ITERATIVE METHODS FOR COMPUTING
301
Valavanides, M., Constantinides, G. and Payatakes, A.: 1996, Simulation of oil ganglia in consolidated porous media. Crowding effects, 5th Euro. Conf. on Mathematics of Oil Recovery, Leoben, Austria, 3–6 September 1996. Varga, R.: 1962, Matrix Iterative Analysis, Prentice-Hall, Englewood Cliffs, NJ, U.S.A. Vizika, O., Avraam, D. and Payatakes, A.: 1994, On the role of the viscosity ratio during low-capillary-number forced imbibition in porous media, J. Coll. Int. Sci. 165, 386–401. Young, D.: 1971, Iterative Solution of Large Linear Systems, Academic Press, New York, NY, U.S.A. Zhou, D., Blunt, M. and Orr, F., Jr.: 1997, Hydrocarbon drainage along corners of noncircular capillaries, J. Coll. Int. Sci. 187, 11–21.