• Tidak ada hasil yang ditemukan

Solution of the on-linear Equations

Parameter Symbol Dimensions SI Units Darcy Units Field Units

Chapter 3: Numerical Scheme

3.6 Solution of the on-linear Equations

Newton's method is derived using the Taylor expansion:

oR(X")

R(X"+1) ;::; R(X")+ (X"+1- X"),

ar

(92)

where X" is the current best estimate for X and X"+1 is the best estimate at the next iteration. We are trying to find X such that R(X)

=

O. Setting the left hand side of Equation 92 to zero and rearranging gives:

o R(X") (X"+1 _ X")= -R(X") .

oX (93)

This gives a system of linear equations to be solved at each Newton iteration. The equations are linear because the differential is treated as a constant within each iteration. The Jacobian oR / oX is a matrix with elements of the form oR /,

ar ..

j

That is, every element of R is differentiated by every element of X. Since each element of X and R is itself a 3-component vector, each element of oR / oX is a matrix of the form:

oROi oROi oRa;

op"J OSW} OSgj oR, oRw1 oRw1 oRw1 oXj o P"j OSWj osgj

oRg, oRg ; oRg ; o P"j OSwJ os!Y

Equation 93 is commonly expressed in the form:

Ax =b

where the residual, b is given by

b=-R=--+F+Q!1M

!1t

(94)

(95)

(96)

and the Jacobian, A, can be expanded as

oR 1 oM of oQ

A - - - -

- OX - I::.t oX OX OX' (97)

Before considering the structure of A, an ordering system that relates the co-ordinate of a cell in the grid to its position in the vector needs to be defined. The simplest system for a 3-dimensional Cartesian or radial grid is to cycle through all the cells in line before moving to the next line. When all the lines in a plane have been completed then the cycling proceeds on the next plane, continuing until all the planes have been completed. Thus, the position of the cell with grid co-ordinates i, j,k is given by i+

(J -

1) x m+(k - 1)x n x m where m is the number of cells in a single line of the grid and n is the number of lines in a plane.

The mass terms, M, for a given block are a function only of the state variable at that block and therefore contribute only to the diagonal of A. Likewise the mass sink terms, Q, are a function only of the state variable at the block itself and the well variable and therefore also contribute only to the diagonal.

The flow terms, F, on the other hand are a function of the state variable at the block itself and the state variables at each of the adjacent blocks as indicated by Equation 67. Therefore of / oX is zero for all non-adjacent blocks. As a result, the flow terms contribute only to the diagonal and to several off centre diagonal bands. The innermost bands correspond to cells that are neighbours within a given line and thus are the bands that are immediately adjacent to the diagonal. The next set of bands correspond to cells that are in adjacent lines with the same position in a line. These bands are offset from the diagonal by the number of cells in a line. The outermost set of bands arises through cells that lie in adjacent planes but have the same position in the plane. These outermost bands are offset from the diagonal by the number of cells in a plane. Note that there may be gaps in the bands that correspond to the edge of the grid. That is, a cell that lies at the edge of the grid does not have neighbouring cells in certain directions and the flow terms, and hence derivatives, corresponding to these directions are therefore zero.

As an example, A for a grid with 4 cells in a line, 2 lines in a plane, and 3 planes has the structure:

(98)

d "\ "2 "3

'\ d "I "2 "3

'I

d "I "2 "3

'I

d "2 "3

'2 d "\ "3

'2

'I

d "\ "3

'2

'I

d "] "3

'2 'I d "3

'3 d "I "2 "3

"

,] d "I "2 "3

J

'3 'I d "1 "2 "3

'3

,]

d "2 "3

= '3 '2 d "I "3

'3 '2

,]

d "1 "3

'3 '2 'I d "I "3

'3 '2

,]

d "3

'3 d "\ "2

'3

'I

d "1 "2

'3 'I d

"I "2

'3 'I d "2

'3 '2 d "\

'3 '2

'I

d "1

" '2 'I

d "I

J

'3 '2 'I d

Note that the positions of the non-zero values are symmetrical but that the values themselves are not because, in general, 0 Fij / OXj

"*

0 Fj ; /oX;.

After the linear equations have been solved the state vector is updated and a new residual R(X"+1) is calculated. Two separate measures are used to determine whether a sufficient degree of accuracy has been reached. The first is the overall material balance error, which assesses whether the change in mass of fluids in the reservoir is sufficiently close to the mass of fluid that has been extracted from, or injected into, the wells. Material balance for each component is assessed by summing the residuals for that component over all the blocks in the reservoir. The second constraint is whether the residuals for the individual cells are sufficiently small for all components.

The maximum residual found in all the cells of the reservoir is compared to a user defined maximum error to determine whether to continue with the iterations.

It is useful to adjust the residual so that it reflects errors in saturation rather than the error in terms of volume at standard conditions. This is achieved by dividing the residual for each block by the pore volume for each block. The reason this is necessary is that the volume of the blocks can vary greatly, particularly for radial grids. If the block volume is large then it may have a large residual in terms of standard volumes of the components without having any discernible effect on the outcome of the simulation. On the other hand, blocks with very small volumes will always have small residuals in terms of standard volumes even when the proportion of the components in the block is totally wrong. The material balance error used by

Eclipse is also specified in terms of a saturation, in this case as a fraction of the field pore volume.

A high level algorithm for the Newton iterations is as follows:

1. Compute initial residual, R(Xo)

=

-b, using state vector from previous time step as an initial guess for the solution.

2. While the material balance error and maximum saturation weighted residual are too large:

2.1.

2.2.

2.3.

2.4.

Calculate the Jacobian, A

=

_OR_(_X_n_)

OX

Solve the linear equations, Ax =b, for x Update the state vector, Xn+1= Xn - X

Calculate the new residual, R (Xn+I)= -b