










































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











































Inner Product of Vectors. Let
u = u 1 i + u 2 j +u 3 k and v = v 1 i + v 2 i+ v 3 k (1)
be vectors in three dimensional vector space, where i, j and k represent the coordinate vectors. The vectors u and v can be written as column vectors,
u
u u u
1 2 3
, v (2)
v v v
1 2 3
The standard inner product (sometimes called the dot product) of the above vectors in three dimensional space is determined as
(u, v) = uT^ v = u vT^ (3)
and is also given by
(u,v) = (^) u v i=
n
where n is the dimension of the vector space (equal to 3 in the above case). uT^ is the transpose of the "matrix" u, obtained by interchanging the rows and columns of u. Standard inner product is also denoted as u. v.
Example
Let u and v be column vectors in two dimensional vector space such that,
u = −
, v =
Substituting for the vectors,
a (^) 1 a (^) 2 a (^) 3 a 4
We now have four simultaneous equations of the form:
(1)a 1 + (1)a 2 + (0)a 3 + (0)a 4 = 0 (1)a 1 + (0)a 2 + (0)a 3 + (1)a 4 = 0 (0)a 1 + (1)a 2 + (1)a 3 + (0)a 4 = 0 (0)a 1 + (0)a 2 + (1)a 3 + (1)a 4 = 0
Solving as we usually do, we get
a 1 = 1, a 2 = -1, a 3 = 1 and a 4 = -1.
and the expression is
v 1 - v 2 + v 3 - v 4 = 0.
Thus we have found values for the constants, not all equal to zero, to satisfy the condition for linear independence of vectors. We conclude that the given vectors are linearly dependent , even though each pair is linearly independent.
Example
Check for linear independence of the following set of vectors
u =
, v =
The vectors are dependent since v can be expressed in terms of u as:
v = 2u
Orthgonality of Vectors. By definition, two vectors are orthogonal to each other if their standard inner product, or dot product, is equal to zero, i.e.
(u, v) = u • v = 0 (8)
Example
Check for orthogonality between vectors u and v in a two dimensional vector space, where
u = −
, v =
The inner product is equal to
(u,v) = (^) u v i=
n
Thus the vectors u and v are orthogonal to each other.
Definition : p is A conjugate if (p, Ap) = 0, i.e., p is orthogonal to Ap where A is a matrix.
Construct a vector, p 2 , orthogonal to p 1 , given v. using the Gram-Schmidt method. Given two linearly independent vectors p 1 and v , construct a vector p 2 orthogonal to p 1. Thus the inner product of p 1 and p 2 is (p 2 , p 1 ) = 0. Let p 2 be a linear combination of v and p 1.
p 2 = v + βp 1 (9)
Substituting for p 2 in the condition for orthogonality,
(v + βp 1 , p 1 ) = 0
(v, p 1 ) + β(p 1 , p 1 ) = 0
Solving for β,
(v, p ) ( p , p )
1 (^1 1) (10)
where β is the scaling factor multiplying the vector p 1 in order to find a vector p 2 orthogonal to it.
Example 4
Solving the above expression for β,
(Av, Ap ) ( Ap , Ap )
1 (^1 1) (15)
p 2 = v + βp 1 (16)
Example
Using the vectors given in the above example and the coefficient matrix
find a vector p 2 such that Ap 2 is orthogonal to Ap 1.
Av = =
Ap 1 = =
The scaling factor
(Av, Ap ) ( Ap , Ap )
1 1 1
The vector p 2 is
p 2 = v + βp 1
Construct a vector, p 3 , orthogonal to vectors p 1 and p 2. Given another vector v such that p 3 is a linear combination of v, p 1 and p.
p 3 = v + β 1 p 1 + β 2 p 2. (17)
We know that the three vectors p 1 , p 2 and p 3 are mutually orthogonal to each other, thus
(p 3 , p 1 ) = 0
(p 3 , p 2 ) = 0
(p 2 , p 1 ) = 0
Substituting for p 3 in the first condition,
((v+ β 1 p 1 + β 2 p 2 ), p 1 ) = 0 (18)
or
(v,p 1 ) + β 1 (p 1 , p 1 ) + β 2 (p 2 , p 1 ) = 0 (19)
In the above expression, the term containing β 2 is equal to zero as (p 2 , p 1 ) = 0. We now have the scaling factor β 1 in terms of the vectors as:
(p,p )
(v,p) =- 1 1
1
Similarly, substituting for p 3 in the second condition, we obtain an expression for β 2
(p ,p )
(v,p) =- 2 2
2
Example
[Taken from notes by R. Chick Wattenbarger (1985)]
This section discusses the conjugate gradient (CG) and conjugate residual (CR) methods used in reservoir simulation. The conjugate gradient method was introduced in 1952 by Hestenes and Stiefel, as an iterative technique for solving systems of linear equations. CG methods initially received a great deal of attention, but interest lessened in favor of successive overelaxation (SOR). During the 1970's, the CG and CR methods gained popularity in reservoir simulation as the petroleum industry attempted to simulate increasing difficult problems.^2
Reservoir simulators model the behavior of petroleum reservoirs by solving partial differential equations that mathematically describe the relevant physical processes occurring in the reservoir. These partial differential equations are usually solved using finite differences. The finite difference solution creates a system of equations that may be expressed in the matrix form:
Ax = b ,
where A is an NxN real matrix, x is the unknown solution vector, b is a real vector and N is the number of equations be solved. In reservoir simulation these matrices are sparse (containing mostly zero elements), banded and conventionally diagonally dominant and nearly symmetric. The methods used to solve these problems are generally classified as either direct or iterative.
Direct methods usually employ some form of guassian elimination. The work and storage requirements of direct methods are proportional to the matrix bandwidth. The matrix bandwidth is determined by a some product of the problem's two smallest dimensions, and is large enough in many problems to make direct methods impractical. The advantage of direct methods is that they always solve the matrix problem. The D4 ordering technique is a popular direct method in reservoir simulation.
Iterative methods are well suited to solving many reservoir simulation problems because they take advantage of the sparseness of the matrix being solved. The work requirement is proportional to the number of iterations required times the number of equations being solved. Iterative methods usually require less storage and less work than direct methods, but may fail to converge. Because iterative techniques can be solved to any tolerance of accuracy and direct methods are subject to roundoff error, the relative accuracy these techniques is not a central issue.
Initially the standard iterative methods used in reservoir simulation were the Strongly Implicit Procedure (SIP) and the Successive Over Relaxation (SOR) method. For best results these methods require the trial and error choice of iteration parameters. These techniques work well for the type of problems encountered in early simulation of nearly homogeneous reservoirs using the IMPES (implicit pressure, explicit saturation) formulation. These problems produced positive definite, nearly symmetric matrices. However, for non-homogeneous problems with high transmissibility ratios, SIP and SOR may fail to converge or converge very slowly.
Conjugate gradient methods have become popular in reservoir simulation because, though essentially iterative, they are guaranteed to converge after N iterations. For this reason CG methods are called semi-iterative. The CG method proposed by Watts (1981), is a means of handling the non-homogeneous, but nearly symmetric problems resulting from the IMPES formulation.^5
With the increased interest in EOR recovery, more difficult problems had to be solved. Thermal problems in particular, are solved with formulations that yield ill-conditioned, highly non- symmetric matrices. Because the early CG methods required a symmetric A matrix, a number of variations have been developed. The most prominent of these are the conjugate residual (CR) methods. The basis of the CG and CR method is described on the following pages.
Classification of Iterative Matrix Solution Techniques. Given
Ax = b
we seek x k+1^ = gk(A,b,xk,xk-1,.........xk-(m +1)
such that lim xk+1^ = x k → ∞
Iterative techniques may be classified as follows:
Degree = m Stationary if Gk^ = G for all k Linear if Gk^ = linear function of xi, i = 1,k
First degree (m=1) iterative techniques may be expressed as:
xk+1^ = xk^ + ckpk or xk+1^ = Tkxk^ + qk
The Successive Over Relaxation (SOR) and Strongly Implicit Procedure (SIP) techniques are the most commonly used methods based on this concept.
The following discussion will use the first form with ck^ as a scalar αk. Thus
The significance of this equation may be interpreted as follows. Over the iteration from k to k+1, xk
Algorithm. At the beginning of the timestep, i.e at the start of iterations , let
x^0 = arbitrary; and ro^ = b - Axo.
For iterations k+1 = 1, 2,..................., the calculations are carried out as follows
pk^ = rk
( ) ( k k )
k k
p Ap
r p ,
The unknown vector and the residual vector are updated as follows:
The above steps are repeated until convergence.
Thus, the direction vector pk^ is chosen in the direction of steepest descent, that is pk^ = rk. αk^ is chosen to minimize (e,r) in the pk^ direction where e is the error vector. Although (e,r) and F(x) are minimized locally in the most rapid manner, this method can be very slow, particularly for ill- conditioned matrices. This method tends to overshoot.^2
Conjugate Direction Techniques. The direction vectors p^0 , p^1 , ...pk-1^ are selected to be non-zero and mutually A-conjugate. That is (Api, pj) = 0 for i different of j. The Gram-Schmidt orthogonalization procedure can be used to generate A-conjugate vectors pk^ from any set of linearly independent vectors (vi) i=0, k-1. Hestenes and Stiefel (1952) show that the CG method is equivalent to Gaussian elimination when (v) is chosen as the set of unit base vectors, i.e. (0,0,0,1), (0,0,1,0), .... The conjugate gradient method is a conjugate direction technique with (v) chosen to be equal to the residual vectors.^2
Algorithm. At the beginning of the timestep, i.e at the start of iterations , let
x^0 = arbitrary; and p^0 = r^0 = b - Ax0.
For iterations k+1 = 1, 2,..................., the calculations are carried out as follows
αk^ = (pk,rk) = (rk,rk)
(pk,Apk) (pk,Apk)
The unknown vector and the residual vector are updated as follows:
xk+1^ = xk^ + αk^ pk
rk+1^ = b - A xk+1^ = rk^ - αk^ A pk The magnitude of the scaling factor is determined as
(rk,Apk) = (rk+1,rk+1) βk^ = − (pk,Apk) (rk,rk) The new value of the search direction vector is determined from the previous known value as follows: pk+1^ = rk+1^ +βkpk
A must be symmetric positive definite (SPD). αk^ is chosen to minimize (e,r) or F(x). Thus (e,r) decreases every iteration, but r may not. βk^ is chosen such that (pi, Apj) = 0 for i > j, i.e the direction vector pk^ is A-conjugate to Ap k-1.
The residual vectors r^0 , r^1 ,... are mutually orthogonal. Thus, rk^ = 0 for some k ≤ N. That is, the classical CG method converges in at most N iterations, neglecting roundoff errors. The larger ( αk/ αk-1), the more roundoff errors effect the orthogonality relations. However the CG method is stable with respect to roundoff errors.
The CG method varies from the method of steepest descent in its choice of direction vectors, making the CG method more suited to solve ill-conditioned matrices.^2
Algorithm. At the beginning of the timestep, i.e at the start of iterations , let
x^0 = arbitrary; r^0 = b^0 - Ax^0 and p^0 = v^0 = H-1^ r^0
For iterations k+1 =1, 2,..................., the calculations are carried out as follows. First a shift vector is calculated
vk^ = H-1^ rk
where H is an approximation of A, such that H-1^ is approximately equal to A-1. This step is called preconditioning.
αk^ = (rk,Apk) (Apk,Apk)
The unknown vector and the residual vector are updated as follows:
xk+1^ = xk^ + αk^ pk+
rk+1^ = b - A xk+1^ = rk^ - αk^ A pk
The magnitude of the scaling factors are determined as
β j k (^) = − (Av,Apj) (Ap ,Ap )j^ j j = 0, 1, 2,........., k.
The new value of the search direction vector is determined from the previous known values as follows pk+1^ = vk^ + ∑ k^ βkjpj j = max(0,k_m+1)
CR requires large amounts of work and storage. This lead Vinsome to propose a truncated version of CR called ORTHOMIN. Instead of making Apk+1^ orthogonal to all the preceding direction vectors Apj, ORTHOMIN makes Apk+1^ orthogonal only to the last m vectors. This requires less storage and work than the classical CR. However, the convergence is no longer guaranteed in N iterations.^1 ORTHOMIN requires that a shift vector be computed each iteration by preconditioning (approximating x* = A-1r with v = H-1r). The vector v is the shift vector. Any preconditioner can be used which suits the problem being solved. ORTHOMIN is the most commonly method in the industry for large problems.
The convergence of the CG and CR methods depend on the eigenspectrum of the matrix A. The convergence may be accelerated by solving the equivalent system.
(H-1A)x = H-1b
where H is sparse, easy to factor, and a good approximation of A. The closer H is to A, the faster the convergence. This is called preconditioning, and should reduce the work requirements.^4
For the case where A is symmetric, A may be decomposed as LDLT, where L is a lower triangular matrix, D is a diagonal matrix. For non-symmetric case, A may be factored as LU, where U is an upper diagonal matrix. Generally, these decompositions are not as sparse as A, but since H only needs to be an approximation of A, the factorization only needs to be approximate. Several papers describe decomposition method which retain the sparseness of A to some degree. Most of these methods take advantage of the fact that the magnitude of the element in the decomposition matrices decrease in the direction of the arrows below.
This allows a factorization of the A matrix which has a limited number of bands, the more insignificant bands being set to zero by compensating the remaining bands.^5
Conclusion. The CG methods have gained wide acceptance in the petroleum industry because of their robustness in solving difficult problems. The non-truncated versions of the CG and CR methods are guaranteed to converge within N iterations, but do so slowly. However, of the preconditioning methods, only the ORTHOMIN procedure theoretically guarantees convergence in N iterations. ORTHOMIN and its variations seem to be the most widely used, even though the CG methods have now been adapted to handle non-symmetric matrices. A majority of current research is devoted to developing preconditioning methods for faster, more efficient convergence.
Summary. A pre-conditioning C.G. method for near symmetrical IMPES matrices. Pre- conditioning method efficiently handles coefficient anisotropy.
solving the problem Ax = b
overview
Step 1. construct a symmetric matrix As ≅ A Step 2. rn^ = b - Axn
Step 3. if || rn^ || < tolerance, stop
Step 4. solveAs x* = rnw/ PCG method
Step 5. xn+1^ = xn^ + x*
Step 6. Go To step 2
Step 1. for IMPES A is almost symmetric
i.e. a (^) E (^) i j ≠ awi + 1 j (but almost = )
for our symmetric matrix, AS
a a E (^) s w (^) s
E w i j i j
i j s i j = =
1
1 2 Step 4.
Solution of AS x* = rn^ w/ PCG Method
Step 4a. (Preconditioning step)
Approximate H ≈ As
Solve H v = r
v = H-1^ r v is the "shift vector" 19