Академический Документы
Профессиональный Документы
Культура Документы
Concepts
I i 2.1 Introduction
To adequately grasp the underlying concepts involved in the structure,
development and use of a reservoir simulator, it is necessary that we have
an understanding of some basic mathematical tools. In particular, we employ
I some elementary ideas derived from vector analysis and matrix theory. In
I what follows, we review only those basic concepts that are essential to our
purpose. Furthermore, the material presented here is restricted to the prem-
I
I ise that solutions to reservoir engineering problems are to be achieved by
I numerical means.
v = v1 + v2 + vg. (2.1)
axes, respectively (see Fig. 2.1). Consequently, if lvll = .vl, lvzl = h , Iv31 =
14j then
I
we speak of such a set of points as the "solution vector.
gradients V@, throughout the system. The potential gradient V@ has the
11
following important properties: III
I
then we define
I
1
where the only requirement we impose on a and b is that they both have
the same number of components. In such a case, we say they are conformable
for addition. The following is also true:
a +b =b + a (commutativity) (2- 6)
a b = /a1Ib! cos 0
la1 = (a a)lI2.
a b =b a (commutativity) (2.12)
a (b + c) =a b +a c (distributive) (2.13)
Since the cartesian unit vectors i, j, k are at right angles to each other
(i.e., they are mutually orthogonal) then it follows that i i = j j = k l
k=lmdioj=i*k=j*k=O.
I
In Eq. 2.11 we can consider the quantity (a1 cos 8 as the component
'
I of vector a in the direction of b. This interpretation is useful in deriving
the continuity equation using vector analysis principles as will be seen. It
I
1 is important to notice that forming dot products of vectors results in a
1 scalar quantity. Thus, it is sometimes called the scalar product.
Another kind of product, the cross-product or vector product c& be
defined such that a vector rather than a scalar quantity is obtained. It is
particularly useful in depicting those processes characterized by rotational
flow. Since such regimes are generally negligible in global reservoir prob-
lems, we make no attempt to treat it here. The interested reader is referred
to any elementary text on vector vlalysis for further details.
2.2.3 Divergence
i
Let v ( x , y, z) be a velocity vector at a point Pin 3-space. The divergence
of v is given by
as a
.'.div v = - +-+-- a s
ax ay a~
r"
We observe the following facts about the divergence of a vector:
where
v2=-
a2 + a2 + 7 ,
7
ax2 ay an
a2
the Laplacian operator.
d i v ( p ) dv=( pv n ds.
R S
Elementary Mathematical Concepts
'
t where 4 is the porosity. Therefore it follows that
The choice of sign on the additive term is purely arbitrary. We adopt the
convention that the minus sign represents a source and the plus sign a
sink.
2.3.1 Matrices
A matrix is simply a rectangular array of elements arranged in horizontal
rows and vertical columns. Thus,
The collection of elements aii is called the main diagonal of the matrix. i
If all the elements of A are zero except possibly those on the main diagonal
then A is called a diagonal matrix. This is conveniently depicted by
A [ l . . . . " . n ] .
I
2.3.3 Matrix Operations
t - Below we outline the essential operations involving matrices. These
' ~ k v o l v eequality, addition and subtraction, scalar multiplication and matrix
I bdtiplication.
TWOmatrices A and B are equal if and only if they are of the same
Order and oij = b, for every i, j. If A = [atr]and B = [bu] and A and B
. -9 of the same order, then we can write C = A & B where Gj = a i j 2 bij
every i, j. If a is a scalar and A = [ao] then we can say B = a A where
aau for every i, j. The following properties hold for these operations:
I:
Reservoir Simulation
A+B=B+A
A+(B+C)=(A+B)+C 1
A+O=A I1
a A = Aa :I
a(A+B)=aA+aB I.
(a1 + +
a2)A= a l A a2A
i
(a1 a2)A =
The matrix, 0, is the zero or null matrix having all entries zero:
We would also like to have a definition of matrix multiplication; i-e.,
if A = [aj]and B = [bij]then we consider the product AB. If A is m X n s
and B is n x p then for C = AB we define
Notice both products AB and BA are defined, but AB =t= BA. In general,
matrix multiplication is not commutative. However, matrix multiplication
satisfies the following properties: +
Elementary Mathematical Concepts 21
We know that if x and y are real numbers then xy = 0 implies that either
x = 0 or y = 0 or both. Matrices, however, do not possess this property.
Furthermore, if AB = AC then this does not imply that B = C. Consequently,
cancellation or division is not a valid operation in matrix algebra.
2.3.4 Determinants
A determinant is a single number that we associate with a square matrix
A. It is denoted by
A=[+
5 -3
0
1 - -3
21
.=[3 Lmdb=[Lf].
which are most conveniently solved by matrix analysis. Eq. 2.27 can be
represented in the compressed matrix form Ax = b where
I
II It plays an important role in determining whether or not a stable, convergent
solution is possible for a given matrix problem.
Subtract twice the first row from the second row and add twice the first
row to the third; thus,
. x,+x2+x3=2
- X 2 - x3=-1
+ +
3x2 2x3 = 4 . (2.30) I
Multiply the second row by 3 and add the result to the third row; then
the equations reduce to
I
Therefore,
1 1 1
0 0 1
i.e., the matrix A was converted to an upper triangular matrix. Thus, solution
by Gaussian elimination is a triangularization of A to yield an upper triangu-
lar matrix U followed by a back solution for the vector x. To achieve this,
all elements below the main diagonal of A are eliminated.
Some variations of this procedure can be employed. Gauss-Jordan reduc-
tion avoids the step of back-substitution. We illustrate this by the same
example. The first step is the same as in Gaussian elimination to a m v e at
Eq. 2.30. We then proceed as follows: multiply the second row of Eq. 2.30
by 3 and 1 and add the results to the third and the first row, respectively
I Next, add (-1) times the third row to the second row, hence I
Then
and
l
iii'
b
I
y
I?
Another technique is to factor matrix A into lower and upper triangular
matrices L and U. Thus we have for Ax = b, LUX = b where A = LU.
k t Ux 5 y, then the problem is solved in the following sequence of steps:
I
(2) Solve Ly = b for y.
(3) Solve Ux = y.
26 Reservoir Simulation
In (1)U will be unit upper triangular, i.e., with ones on the main diagonal.
Step (2) is a forward solution for y and (3) is a backward solution for x.
This technique is called LU decomposition and is identical with Choleski's
(or Banachiewicz's) method for symmetric matrices. We illustrate the proce-
dure for the problem treated before.
The LU factors of A are
Thus,
Therefore,
x3 = -1, x2 = 2, and xl = 1.
x=Bx+c. (2.35)
+ + =2
X3 X2 X1
x3 + x, + 2x1 = 3
xz - 2x1 = 0. (2.37)
I
Matrix-wise this amounts to a column interchange of the first and last col-
umns. We could have alternatively interchanged the first and last rows.
The iteration matrix, B, is
.=[-I
0 -1
0 +%
0 -;I
-1
1 1
0
0 0
[;I=[;].
ye take as a first guess, x(O) =
[:I 1 then we get after 10 iterations,
x(lO)=
-0.875
1.75[
0.9375
1.
28 Reservoir Simulation
Obviously, the rate of convergence is quite slow. However, there are meth-
ods for accelerating the convergence rate. This will be discussed later when
we treat solution techniques for reservoir models.
2.5.1 Definitions
Let V, be a vector space consisting of the set of vectors (xi1i = 1, 2,
. . . , n). If there exists a set of scalars (afli= 1, 2, . . . , n) and we fohn
n
the sum u = ai xi where u is also a vector in Vn, then we say that u is
i=l
a linear combination of the xi's.
n '
A set of vectors (XiJin=,is called linearly independent if aixi = 0
f-1
implies ai = 0 for every i. If the set is not linearly independent then it is
linearly dependent, i.e., if there exists some scalars at, not all zero such
that
n
2 atxi = 0, with some ai * 0.
i=1
2.6 Exercises
+
1. If b = 2i 2j - k and a is a scalar number, for what values of a is Jab1= l ?
2. Find a unit vector having the same direction as b where b = cos a i +
I ,. . '!
>: 1);
i,,%..$
0. What must be true about a, b, c, and d if the matrices ,,I :,:
$ 1
; *l..i
*
&:
.
i..;
0
, I , .,
"
x
',' +''
are to commute? ,.
, i /..
,:.:.
w,,! ,'; .,
11. Denote by Ej an n-vector with 1 in the jth row, all other components being .: . 3. $.,.
, ,
11
i
12- Show that every nonsymrnetric matrix can be written as the sum of a symmetric ~!.!
matrix and a skew-symmetric matrix. :I!
'7 /
i: ii
ill:
4;
+ .[l1:
I $7
! ; 1;
II ffl
. j :! !.$
,, .,.
: i :it
.
I;;$-
i il
! $:
I I:
I jl.
! 1;
; ;I.
i!
ij
:I :.;:
!
fhd AB. What is unusual about this result? ,
,
,
, 'I
~
! ~?:!
! ,I$.
!I!,
'2' 1:
.it,:'j;
<>:I!:
II
,.,%
:i
ii
h
30 Reservoir Simulation
A = [0
0.53
0
0.43 -0.01
-0.25
0
0.92
.834
]
(b) Is A singular or nonsingular?
19. Solve the following problems by Gaussian elimination rounding all calculations
to three decimal places. Note the effects of round-off errors by substituting your
answers back into the equations. In which problem are the round-off errors
worse? Why? What can be done to rninirnize them?
20. Solve 19(a)using an iterative scheme with x(o)= [l, 1, 1IT. What is your answer
after five iterations?
21. Determine if the following are linearly independent or linearly dependent.
23.
217
=
I:[1 be written as a linear combination of those in problem
2.7 References
ctor and Tensor Analysis, McGraw-Hill Book Co. Inc., New York