You are on page 1of 34

Dr.

Helmy Sayyouh 01/17/23 1


 The most widely used numerical technique in reservoir
simulation is the finite-difference approach.

 The governing equations, as well as the boundary conditions


used for describing flow in porous media, have only first-order
and second-order derivatives, and so we will limit our
discussion to these.

2
 P 1 P

x 2  t

Dr. Helmy Sayyouh 01/17/23 2


 First-order derivatives appear in the governing
equations on the right-hand side in the form of
the time derivative (the accumulation term).

 In addition, first-order derivatives appear when


the gradient is specified across a given
boundary.

 To approximate the first-order derivatives, we


use truncated Taylor series expansion.

Dr. Helmy Sayyouh 01/17/23 3


 The derivative is
approximated at the point x
(also designated as i) at which
the value of pressure is Pi.

 The two neighboring points to


the central point are x - Dx
(also designated as i -1) and x
+ Dx (also designated as i -
1).

 Accordingly, at these two


neighboring points, the
pressure values are Pi - 1 and
P i + 1, respectively.

01/17/23 Dr. Helmy Sayyouh 4


 In general, a Taylor series expansion for evaluating a
function f (x) at x + Dx can be written

f x  2 f2
x  3 f 3

f x x  f x x   ...


x x 2 ! x 2 x
3! x x3

Using the notation of the previous Figure we can write the equation

Pi 1  Pi x
P

 x  P
2


 x  3 P
2
...
3

2 3
x i 2! x i 3! x i

Dr. Helmy Sayyouh 01/17/23 5


 The forward-difference approximation to the first-order
derivative at point uses the values of the function at points i
and i +1.

P Pi 1  P
  O( x)
x i x

The second term on the right-hand side of the Equation denotes the error in
the approximation and is read as “order of .” The magnitude of the error is
the same as the magnitude of . In practice, the error term is dropped in
writing the finite-difference analogues. Thus, we write:

P P  P
 i 1
x i x

Dr. Helmy Sayyouh 01/17/23 6


The exact derivative of P at point is the slope of the tangent AB to the curve at
point O. Equation uses the slope of the secant OC to approximate this derivative.
As we can conclude from the figure, the accuracy of this approximation depends on
the shape of the curve, as well as the length of the interval between and in the limit
as point is moved progressively closer to the secant OC tends to obtain the same
shape as the tangent AB.

01/17/23 Dr. Helmy Sayyouh 7


 In reservoir simulation, we use the forward
difference approximation.
 The two neighboring points in this case represent
the old time level and the new time level .
 When this derivative is written at a point i in the
spatial domain it represents the rate of change of
pressure with time at point i. In other words,

 P  P n 1  P n
   i i
 t i t

Dr. Helmy Sayyouh 01/17/23 8


 With the same strategy,
but now using the
neighboring point , we
can obtain the
backward-difference
approximation to the
first-order derivative
from Equation using the
(-) sign.

01/17/23 Dr. Helmy Sayyouh 9


The central-difference
approximation to the
first-order derivative
at point i uses the
two adjacent
neighboring points.
Note that the secant CE is almost parallel to the
desired tangent AB.

P P  P
i 1 i 1

x i 2 
x

01/17/23 Dr. Helmy Sayyouh 10


 It is apparent from previous Figure that central-
difference provides a more accurate approximation
to the first-order derivative than either the forward-
or backward-difference approximation does.

Dr. Helmy Sayyouh 01/17/23 11


 The left-hand-side of the flow equation is composed of
second-order derivatives representing the flux terms. To
approximate these second-order derivatives, we use central-
difference approximation.

2 P  P 2 P P


 2  
 
x i
i 1
( 
x
i
)
2 
i 1 O x 2

OR
2 P  P 2 P P
i 1 i i1
 2   2
 
x i ( 
x )

Dr. Helmy Sayyouh 01/17/23 12


 There are two principal groups of finite-
difference schemes: explicit and implicit.

 We can illustrate the governing concepts for


these schemes using the classical diffusivity
equation as it is written in one dimension:
2
 P 1 P

x 2  t

Dr. Helmy Sayyouh 01/17/23 13


P n 2 P n P n 1
P n 1  P n 
i 1 i i1  i i 

( x ) 2   t 



Since pressures at the old time level are known at all locations, the only
unknown in Equation is the pressure at the new time level

t   ( x ) 2  n 
n 1 P n n 
P  
2  P P
i ( x ) 2 

i 1
  
t  i i 1 


Dr. Helmy Sayyouh 01/17/23 14


P n 1 2 P n 1 P n 1 P n 1 P n 
i 1 i i 1  1  i i 
2   t 
( x )  

collecting all the unknown terms on one side, we obtain


the characteristic form of the implicit finite-difference
scheme

t n 1
 2  t  n 1 t n 1 n
2 P  1  2 P i  2 P  P
( x ) i 1

 ( x )  ( x ) i 1
 i

Dr. Helmy Sayyouh 01/17/23 15


A k A k n
x x  n 1 n 1   n 1 n 1 
P P  x x P P
 B x  i1, j, k i, j, k  B x  i, j, k i 1, j, k 
x i 1 2 , j, k i 1 , j, k
2

n
A k A k
y y  n 1 n1 y y  n 1 n 1 
 P P  P  P
 B y  i, j1, k i, j, k  B y  i, j, k i, j1, k 
y i, j1 2, k
i, j1 2 , k
n
A k  n 1 n 1  A k  n 1 n 1 
 z z P  P  z z P P q
 B z  i, j, k 1
 i , j, k  B z  i , j, k i , j, k 1
  i, j, k
z i, j, k 1 2 i, j, k  2
1

 V bc   n 1 n 
   P  P
 5 . 615 
t i, j, k  i, j, k i, j, k 

Dr. Helmy Sayyouh 01/17/23 16


The term Ax kx/Δx is the constant part of the transmissibility group,
while the term μB could depend on the pressure. To calculate these
two terms at the interface, we must use averaging procedures.

For the constant part of the transmissibility (Ax kx/Δx), if we consider


the two blocks as being connected in series, it becomes necessary to
use harmonic averaging, such as

2A A k k
A k x i, j,k x i x i, j, k x i
x x 1 , j , k 1 , j , k

x 1
i , j, k
A k
xi , j , k x i , j , k
x i1, j, k A x k
xi
x i, j, k
2 i 1 , j , k 1 , j , k

Dr. Helmy Sayyouh 01/17/23 17


 The second term (μB) is
considered a weak function of
pressure; that is, it exhibits
weak non-linearity. We
calculate this term at the
arithmetic average of
pressures at the two
neighboring blocks:

01/17/23 Dr. Helmy Sayyouh 18


 Note that under multiphase flow conditions, a
typical transmissibility term will include relative
permeability to the fluid for which the flow
equation is being written. In that case, the
transmissibility group between the blocks i, j, k and
i+1, j, k is

A k k
x x rf
 B x
f f i 1 / 2, j , k

Dr. Helmy Sayyouh 01/17/23 19


 This procedure is known as single-point upstream
weighting, and can be summarized as

  
k rf S f  if P i +1, j,k  P i, j, k
  i 1, j , k 

k  
rf i 1 / 2 , j , k
 k S 
rf  f  if P i+ 1, j,k  P i, j, k

  i , j , k 

Dr. Helmy Sayyouh 01/17/23 20


 A more accurate representation of the relative
permeability at the interface is known as two-
point upstream weighting, and is expressed as

1    
 3 k S  - k S 
rf f rf f
2  i 1, j ,k 
  i 2 , j ,k 


if P P
 i +1, j, k i, j, k
k 
rf    
 1
3 k rf S f  - k rf S f
i1 / 2 ,j , k

 2 
 i , j, k   i 1 , j, k 


 if P  P
 i +1, j, k i, j, k

Dr. Helmy Sayyouh 01/17/23 21


In summary

Transmissibility group consists of three components,


that each is calculated differently:

The constant component is calculated using


harmonic averaging
The weakly non-linear component is estimated using

arithmetic averaging
The strongly non-linear component is obtained using

upstream averaging

Dr. Helmy Sayyouh 01/17/23 22


 To obtain a particular
numerical solution to a
flow problem, we must
impose specific boundary
conditions.
 Figure shows a pure
Dirichlet-type boundary
condition with a mesh-
centered grid system.

01/17/23 Dr. Helmy Sayyouh 23


The boundary conditions imposed on the system translate to
the following equations:

 P
A 
P
i , NY
for i = 1, ...NX
P  P
i ,1 C 
P  P 
i, j
D
for j = 1, ...NY
P P
NX , j B 

01/17/23 Dr. Helmy Sayyouh 24


 Figure shows a body-centered grid with Neumann-type
boundary conditions. In this case, finite-difference
representation of the boundary conditions is as follows:

P  P 
NX 1, j NX, j
 C 
x 1 
 for j = 1, ..., NY
P P 
i, j 0, j
 C 
x 4 

P P 
i,1 i,0
 C 
y 2 
 for i = 1, ..., NX
P P 
1,NY 1 i, NY
 C 
y 3 

01/17/23 Dr. Helmy Sayyouh 25


Figure shows a similar treatment for the mesh-centered grid system.
The important difference is the node being reflected. The implementation of
the finite-difference approximation in this case will be as follows:

P  P 
NX 1, j NX 1, j
 C 
2 x 1 
 for j = 1, ..., NY
P P 
2, j i,0
 C 
2 x 4 

P  P 
i, 2 i, 0
 C 
2 y 2 
 for i = 1, ..., NX
P  P 
2, NY 1 i, NY
 C 
2 y 3 

Dr. Helmy Sayyouh 01/17/23 26


 Strongly-Implicit-Procedure, or SIP (Stone, 1968). For
example, we can write the SIP form as follows:

Z in, j,k Pin, j,k1 1  Bin, j,k Pin, j11,k  D in, j,k Pin1,1j,k  E in, j,k Pin, j,k1  Fin, j,k Pin1,1j,k
 H in, j,k Pin, j11, k  S in, j,k Pin, j,k1 1  Q i , j,k

Z, B, D, F, H and S are the transmissibility terms representing the


interaction of block i, j, k with the neighboring blocks.

Dr. Helmy Sayyouh 01/17/23 27


 Figure graphically
shows the interaction
of block i, j, k with
the surrounding
blocks

01/17/23 Dr. Helmy Sayyouh 28


Table summarizes the possible combinations and
their corresponding SIP coefficients.

 The principal advantage of the SIP notation is its inherent flexibility.

 For instance, having written it for three-dimensional flow, for one- and
two-dimensional flows some of the SIP coefficients simply drop out.

01/17/23 Dr. Helmy Sayyouh 29


 In writing finite-difference analogues for partial
differential equations, we must always consider a
number of important points, which principally
pertain to the accuracy of the resulting solution.

 The specific points of consideration include solution


stability, consistency and truncation error.

 Rarely does the user of a reservoir simulator need to


worry about these problems, but one should be
aware of them.

Dr. Helmy Sayyouh 01/17/23 30


 Stability analysis is meant to ensure that the round-off
error (which arises over time due to the computer’s
finite word length as time evolves) does not magnify
in such a way as to obscure the solution.

 Stability analyses focus on defining the stability


criterion for a given finite-difference scheme.

 These types of analyses provide results such as


conditional stability and unconditional stability or
instability

Dr. Helmy Sayyouh 01/17/23 31


 When we encounter a conditional stability, the
criterion will bring in certain limitations on the
block dimensions and time step sizes.

 Although an unconditional stability implies no


restriction on the block and time step sizes, we
should keep in mind that the physical meaning of
the solution can be lost if we assign unrealistically
large block and time step sizes.

Dr. Helmy Sayyouh 01/17/23 32


 The next important question to answer is
whether the proposed scheme is consistent (i.e.,
compatible) with the original partial differential
equation.

 In other words, does the proposed finite-


difference analogue collapse to the original
partial differential equation in the limit as the
block dimensions and time step size approach
zero?

Dr. Helmy Sayyouh 01/17/23 33


 The truncation error is the difference between the
original partial differential equation and its finite-
difference analogue.

 For a compatible scheme, we should expect that the


truncation error will disappear as the block
dimensions and the time step size become
infinitesimally small.

 If this does not happen, we have a consistency


problem. In other words, the proposed scheme
produces a solution to a different problem (partial
differential equation).

Dr. Helmy Sayyouh 01/17/23 34

You might also like