You are on page 1of 5

A nonlinear test case for the finite element method in two-phase flow

P. C. Robinson, J. Rae and C. P. Jackson


OX1 I ORA, Theoretical Physics Division, Building 424.4, AERE Harwell, Oxfordshire UK (Received February 1979, revised October 1979)

The ability of the finite element method to compute the motion of sharp interfaces in two-phase flow is examined by applying it to a test problem for which an analytical solution can be found. The problem is one of imbibition, the nonlinear diffusion of a fixed amount of water into an oil filled porous medium and can be solved exactly by similarity and the separation of variables method used by Boyer. The finite element program used was of the Galerkin type and employed a self-adaptive time stepping algorithm with both linear and quadratic isoparametric triangular elements. Results are presented for both elements and show that there is little difficulty in this type of diffusion problem in following the oil-water interface to accuracies of 2 or 3 percent.

Introduction
progress in computational fluid mechanics has in the past often stemmed from attempts to model better the behaviour of oil and gas in reservoirs. The recent growth in applications of the finite element method to fluids-3 is no exception although the number of articles devoted to single phase flows by far outstrips that of publications on simultaneous flow of more than one fluid. Although numerical simulation of reservoirs is still dominated by finite difference methods4 finite element methods are increasingly being investigated. -12 The proponents of the latter claim several advantages for the method. It is able to model, in a natural way, the complex geometrical shapes of reservoirs, patterns of rock faults and local modifications of the mesh near wells or at other regions of special importance. In addition it is often claimed that its intrinsic high-order accuracy allows good representation of the motion of waterflood fronts without the usual problems arising from false diffusion. There are, however, differences of opinion on this89g212 and further testing is needed. As the equations describing the oil-water system are nonlinear there are very few analytic solutions known beyond the classic Buckley-Ieverett case.13 There have been, however, a number of studies of a related equation, the nonlinear diffusion equation, and in particular Boyer14 has found exact solutions of physical interest. These are described below and put into the context of oil-water flow where they provide a useful test of numerical methods.

The equations of motion for oil and water in the appropriate circumstances have also been solved by a computer program RESOLVE which is based on the finite element method. The results are presented below and discussed in the light of the analytic solutions.

Flow equations

and an analytic

solution
of

It is often assumed that oil and water in reservoirs are incompressible liquids which follow the Darcy equations motion. The governing equations of the flow may be written: 4 @

; = V.TO

VP,

@ z=

V.Tw VPw

where ,V is the gradient operator, r$is the reservoir porosity and Se, SW, P,, PW are the oil and water saturations and pressures. The transmissibilities To, Tw depend on the absolute rock permeability k, the relative permeabilities k,,, k,, and the viscosities po, pwin the form: To= ckk,o __
PO

Tw=

ckk,w ___
PW

(3)

where c is a constant

which depends on the system of units


0307-904X/80/030212-05/$02.00 0 IPC Business Press and UKAEA 19 80

212

Appl. Math. Modelling,

1980,

Vol 4, June

Finite element method in two-phase flow: P. C. Robinson et al.

used. We take the viscosities to be constant and kYo, krw to be known functions of So, Sw respectively so the two equations (1) and (2) link four unknown variables Se, SW, PO, P . The equations are supplemented in the usual way 41ys by the further two equations: SeSr$!=l PO ~ pw = P&S,) (4) (5)

where : R(7) =

(627)6

(12)

where P,, the capillary pressure, is again a known function OfSw. The equations are now manipulated into a form showing the connection with nonlinear diffusion in a cylindrically symmetric reservoir. By adding (1) and (2) and using (4) we have in cyclindrical coordinates.
T s+TrW-_=&aPW & A r

and c is a constant which fixes the initial condition. The solution corresponds to a delta function spike at the origin at the time zero, which subsequently spreads throughout the reservoir by diffusion, but with a sharply defined front at r = R(T). The amount of water in the reservoir stays constant. For comparison with the computed solution we follow the motion from time r = 1.85 when the peak water saturation has been chosen to be 0.3 (corresponding to c = 0.3). The saturation of course always stays below the peak starting value so that the relative permeabilities of (1) make sense.

(6)

Finite

element

equations

and solution

method

If there are no sources present so the total amounts of fluids do not change we need to choose the integration constant A as zero. Equations (5) and (6) then give: apw
Tr0

%-

= -

__

dP,

asw __
&

T,,

+ Tyw

dS,

(7)

which when substituted equation for S w :

back into (2) leads to a closed

rT,o T,w
T,., + Trw

dp,
dSw

asw

7 (8)

This has the form of the nonlinear

diffusion equation: (9)

as _=_ aT

i
r s

WS)

The capillary pressure and relative permeabilities are empirically determined functions of saturation which may take a number of forms. Often the capillary pressure curve is a straight line over much of the saturation range and relative permeabilities are frequently taken to have a quadratic behaviour kr, = S: , k, w = s$,. With these forms the effective diffusion coefficient in (8) behaves like S$ for low water saturation and falls into the class of powerlaw diffusion equations for which some solutions can be found. We can arrange exact quadratic behaviour by setting: k,, =S;
krW =

s*s*
l-2Sw
w

(10)

Although the expression for krW here is quite artificial and in fact makes no physical sense for SW > 0.5, provided we look at problems where the water saturation never exceeds about 0.4 the relative permeabilities behave in a plausible manner. With suitably scaled units of time equation (8) now reduces to equation (9) with D(S) = S*. A number of special solutions are known for the nonlinear diffusion equation16i7 but here we use only the results of Bayer l4 who employed the technique of separation of variables to find similarity solutions for power law diffusion. For D(S) = S* it is easy to check that a solution of this type is:
S(r, 7) = R*(7) A(1 - $-) * r<R(T) (11) 0 r > R(T)

The oil and water flow problem with its analytic solution discussed above, was used as a test case for the finite element reservoir simulation program RESOLVE developed at Harwell. The details of the comparison are given in the following section. In this section we present an outline derivation of the finite-element equations. Although the program is capable of handling more general compressible flows, for simplicity the argument is presented only in terms of the case discussed above. The details of the finite element method can be found in many sources, of which a few are listed1,*18 among the references. In essence the method spatially discretizes the problem by dividing the domain !Z of interest into a number of elements of simple geometric shapes (or simple mappings of such shapes) on each of which the fields are approximated by low-order polynomials determined by the values at a small number of nodes. This can be regarded equivalently as expanding the fields in terms of piecewise polynomial basis functions $~i each associated with a node, which are only non-zero on elements containing the associated node. The elements available in RESOLVE include the isoparametric 3 node linear triangle and the isoparametric 6 node quadratic traiangle, as well as several quadrilateral elements. Note that the popular Hermite cubic quadrilateral would not be expected to perform well in the present case since it has a continuous derivative across element boundaries whereas the waterflood front is discontinuous. Equations for the nodal values of the fields are obtained from the weak form of the governing partial differential equations, derived by multiplying the equations with a suitably smooth test function W and integrating over a. The second derivative terms in (1) and (2) are integrated by parts to reduce smoothness requirements. Thus the weak form of the water equation (2) with boundary conditions of a specified flux fout of part Ci of the boundary C of a, and a specified value on the remainder C,, is:

I
%l

( VW . (Tw VP,)
(13)

In the Gale&in formation of the finite element method the test functions for each equation are taken to be the basis functions 3/i for all the nodes i except those on C2. (It is easy to see that this leads to the same number of equations

Appt.

Math.

Modelling,

1980,

Vol 4, June

213

Finite

element

method

in two-phase

flow:

P. C. Robinson

et al.

as unknowns).

The water equations,

for example are:

( v Gil

VW v Pw) -

lLif

OCl41

element,cl

The integrations over elements are evaluated numerically in the program by a Gaussian quadrature scheme. The equations are coupled nonlinear ordinary differential equations in time for the nodal values. They are sparse, because tii is only non-zero on elements containing node i so that only a small number of nodal saturation and pressure values appear in each equation. They are also stiff, that is characterized by a wide range of time scales, arising, for example, as the waterflood spreads. RESOLVE uses a stiffly stable first-order method, based on the backward differentiation formula. The method advances in time automatically adjusting the size of the time step to be as large as possible subject to a constraint upon the acceptable error in each step. g,20 At each stage a set of nonlinear algebraic equations has to be solved, which is done by an iterative NewtonRaphson linearization about the latest approximation to the solution. The sparseness of the equations allows an efficient direct solution technique (the frontal method) to be used for the linear equations arising at each iteration.

Figure

7 Finite

element

grid for quadratic

run.

Midside

nodes

are

not shown

Results
For the finite element analysis triangular elements were used on a sector, taking advantage of the radial symmetry of the problem. The problem was solved using quadratic shape functions and again using linear shape functions. For the quadratic case a 10 sector was used with a grid of 39 elements giving 120 nodes. In the linear case a 5 sector was used with a grid of 79 elements giving 81 nodes. In both cases there were 41 nodes along each side of the sector, including the origin, at equal intervals of one-sixth units and in the quadratic case there were also 39 nodes inside the sector. The grid for the quadratic case is shown in Figure 1. Since the program RESOLVE automatically adjusts the time step size the times at which the solution was calculated in the two runs do not correspond. In both cases the time step increased like time to the power 0.85. Table 1 gives the saturations at r = 0 as calculated by the finite element program and as given by equation (I 1) at
Table 1 Finite element and exact solutions at r = 0 Quadratic Number of time steps 0 5 IO 15 20 25 30 35 40 45 50 55 60 run

intervals throughout the runs. The error in these values is around 3% for the quadratic run and 4.5% for the linear run. An error of this order would be expected because of the approximate nature of the initial conditions. The fact that the error does not increase with time supports this explanation. Figures 2 and 3 show the solution for the quadratic run and Figures 4 and 5 for the linear run. In Figures 2 and 4 the initial conditions and the solution after 10 and 20 time steps are plotted. In Figures 3 and 5 the solutions after 30,40 and 60 time steps are plotted. In each case saturation is plotted against radius and the exact solution is given for comparison. It can be seen that the largest discrepancy between Ihe finite element and exact solutions occurs in the region of the flood front. This is a consequence of the discontinuity in the derivative of the exact solution. The numerical solution generally overshoots into negative saturations in a region of size about one element ahead of the front. No water is being added to the system so mass should be conserved. This is the case for both runs. The mass present is not quite that of the exact solution since the initial conditions are not exact. In the quadratic case 100% of the exact solution mass is present and in the linear case 94.9%.

Linear

run

Time 0.0 0.0593 0.1885 0.4791 0.9558 1.651 2.857 4.623 7.382 11.54 17.30 26.06 37.72

Finite element solution 0.300 0.267 0.227 0.185 0.153 0.130 0.109 0.0936 0.0803 0.0693 0.0606 0.0529 0.0468

Exact

solution

Time 0.0 0.0717 0.2326 0.5321 1.036 1.805 3.096 4.997 7.879 12.06 17.97 26.35 38.21

Finite element solution 0.300 0.264 0.218 0.179 0.148 0.125 0.105 0.0899 0.0774 0.0672 0.0589 0.0518 0.0458

Exact

solution

0.300 0.270 0.231 0.188 0.156 0.133 0.112 0.0963 0.0827 0.0714 0.0625 0.0546 0.0483

0.300 0.265 0.222 0.184 0.153 0.130 0.109 0.0939 0.0810 0.0704 0.0617 0.0544 0.0481

214

Appl.

Math.

Modelling,

1980,

Vol 4, June

Finite

element

method

in two-phase

flow:

P. C. Robinson

et al.

program results for the pressure are in good agreement with this.

Conclusions
In this paper we investigated the use of the finite element method in calculating the diffusive motion of immiscible fluids in a porous medium. The conclusions drawn from this test case are: (l), low-order elements in a conventional Galerkin formulation are able to model the flow to good o30d

04

0.8 1.2 Radius, (scaled units)

16

?.I

Figure 2 Finite element and exact initial conditions


tions after 10 (0) and 20 (0) time steps for quadratic

(a and SOILIrun

-0osL
00

04

12 08 Radius, (scaled unltsl

I.6

Figure 4 Finite element and exact initial conditions (4) and solutions after 10 (0) and 20 (0) time steps for linear run.

-0-02

0.0

05

1-O I.5 2.0 Radius, (scaled units)

25

3.0

Figure 3 Finite element and exact solutions after 30 (~I.40 and 60 (0) time steps for quadratic run.

(0)

The program calculates the oil pressure as well as the water saturations. From equations (6) and (7) an explicit expression for PO in terms of SW can be found: P,=1-S~----1
1 -SW

- 2 log(1 -SW)

tP,

-0021 00

o-5

10

15 Radius,

20 (scaled umts)

25

30

P, is the oil pressure at infinity where the water saturation is zero and is taken to be zero by the program. The

Figure 5 Finite element and exact solutions after 30 (A). 40 (0) and 60 (01 time steps for linear run.

Appl.

Math.

Modelling,

1980,

Vol

4, June

215

Finite

element

method in two-phase flow: P. C. Robinson et al.


2 3 Connor, J. J. and Brebbia, C. A., Finite element techniques for fluid, Newnes-Butterworth, London, 1976 Proceedings of the 4th Symposium on Numerical Simulation of Reservoir Performance, Sot. Pet. Eng. of AIME, Los Angeles 1976 Crichlow, H. B., Modern reservoir engineering, a simulation approach, Prentice-Hall, Englewood Cliffs 1977 Shun, Y. M. Sot. Pet. Eng. J. 1971, 11, 139 Lewis, R. W. et al., Int. J. Num. Meth. Eng. 1975, 9,433 Lewis, R. W., et al. ch 9, vol I of reference 1 Langsrud, O., Paper SPE 5725 of reference 3 Spivak, A. et al., SOC. Pet. Eng. J. 1977, 17,27 Settari, A. et al., Sot. Pet. Eng. J. 1977,17,2?8 tioldwater, M. H. et al. Paper EUR87 European Offshore Petrol. ConJ, London, 1978 Wilson, D. C. and Casinder, P. C. Paper EUR86, European Offshore Petrol. Conf., London, 1978 Buckley, S. E. and Leverett, M. C. Tram AIME 1942, 146, 96 Boyer, R. H.,J. Math. Phys. 1961,40,41 Collins, R. E. Flow of fluids through porous materials, Reinhold, New York 1961 Ames. W. F.. Nonlinear Dartial differential eauations in engineering: Academic Piess, New York, 196i Crank, J. The mathematics of diffusion, Clarendon Press, Oxford 1975 Zienkiewicz, 0. C., The finite element method, McGraw-Hill, London 1977 Gear, G. W., in Formulations and computational algorithms in finite element analysis, (ed. Bathe, K. J. et al.) U.S. Germany Symposium, M.I.T. Press, 1976 Byrne, G. D. and Hindmarsh, A.C. A.C.M. Trans. Math. Software 1 1975 (71)

accuracy with no special adaptations: (2), linear elements perform quite well in fitting the waterflood front and are worth considering for this type of problem: (3), at a flood front the saturations sometimes overshoot into nonphysical negative saturation values, as indeed one would expect from the shape functions. It is unreasonable, for example, to expect the quadratic fit to overshoot less than about l/8 of the value at the node behind the front. This behaviour, however. causes little problem in finding the front position to good accuracy: (4), in stiff problems such as this there are great savings in computer time to be had from a selfadaptive time stepping scheme: (S), this is one of very few nonlinear problems which can be solved exactly in a tractable form and yet relates to a physical problem. It should prove useful as a test for other programs handling twophase flow in reservoirs.

4 5 6 I 8 9 10 11 12 13 14 15 16

Acknowledgements The authors wish to thank the United Kingdom Department


of Energy, the British Gas Corporation and the British National Oil Corporation for permission to publish the results of this work. References 1 Gallagher, R. H. et al., Finite elements
Wiley, London, 1975 in fluids, V. 1 and II 20 17 18 19

216

Appl.

Math.

Modelling,

1980,

Vol 4, June

You might also like