Professional Documents
Culture Documents
Lecture note 3
As we already have seen, finite difference approximations of the partial derivatives appearing in the flow equations
may be obtained from Taylor series expansions. We shall now proceed to derive approximations for all terms needed
in reservoir simulation.
Spatial discretization
We showed that the approximation of the second derivative of pressure may be obtained by forward and backward
expansions of pressure:
Dx ( Dx ) 2 ( Dx ) 3
P( x + Dx , t ) = P( x , t ) + P ¢( x , t ) + P ¢¢( x , t ) + P ¢¢¢( x , t ) +.....
1! 2! 3!
( - Dx ) ( - Dx ) 2 ( - Dx ) 3
P( x - Dx , t ) = P( x , t ) + P ¢( x , t ) + P ¢¢( x , t ) + P ¢¢¢( x , t ) +.....
1! 2! 3!
to yield
¶ 2 P t Pi t+1 - 2 Pi t + Pi t-1
( ) = + O( Dx 2 ) ,
¶t 2 i ( Dx ) 2
i-1 i i+1
Δx
Variable grid block sizes
A more realistic grid system is one of variable block lengths, which will be the case in most simulations. Such a grid
would enable finer description of geometry, and better accuracy in areas of rapid changes in pressures and saturations,
such as in the neighborhood of production and injection wells. For the simple one-dimensional system, a variable
grid system would be:
i-1 i i+1
Pi +1 = Pi +
( Dxi + Dxi +1 ) / 2
Pi ¢+
[
( Dxi + Dxi +1 ) / 2 ] 2
P ¢¢+
[( Dx i + Dxi +1 ) / 2 ] 3
Pi ¢¢¢.....
i
1! 2! 3!
to yield
An important difference is now that the error term is of only first order, due to the different block sizes.
¶ é ¶P ù
However, normally the flow terms in our simulation equations will be of the type ê f ( x ) ú , where f ( x ) includes
¶x ë ¶x û
permeability, mobility and flow area. Therefore, we will instead derive a central approximation for the first
derivative, and apply it twice to this flow term.
é ¶P ù é ¶P ù Dxi / 2 ¶ é ¶P ù ( Dxi / 2) 2 ¶ 2 é ¶P ù
êë f ( x ) = f ( x ) + f ( x ) + êë f ( x ) ¶x úû +.....
¶x úû i +1/ 2 êë ¶x úû i 1! ¶x êë ¶x úû i 1! ¶x 2 i
and
é ¶P ù é ¶P ù - Dxi / 2 ¶ é ¶P ù ( - Dxi / 2) 2 ¶ 2 é ¶P ù
êë f ( x ) ¶x úû = ê f ( x) ú + ê f ( x) ú + 2 ê f ( x) +.....
i -1/ 2 ë ¶x ûi 1! ¶x ë ¶x ûi 1! ¶x ë ¶x úû i
which yields
é ¶P ù é ¶P ù
êë f ( x ) ¶x úû - ê f ( x) ú
¶ é ¶P ù i +1/ 2 ë ¶x û i -1/ 2
ê f ( x) ú = + O( Dx 2 ) .
¶x ë ¶x û i Dxi
æ ¶P ö Pi +1 - Pi
ç ÷ = + O( Dx )
è ¶x ø i +1/ 2 ( Dxi + Dxi +1 ) / 2
and
æ ¶P ö Pi - Pi -1
ç ÷ = + O( Dx ) .
è ¶x ø i -1/ 2 ( Dxi + Dxi -1 ) / 2
As we can see, due to the different block sizes, the error terms for the last two approximations are again of first order
only. By inserting these expressions into the previous equation, we get the following approximation for the flow
term:
( Pi +1 - Pi ) ( Pi - Pi -1 )
2 f ( x ) i +1/ 2 - 2 f ( x ) i -1/ 2
¶ é ¶P ù ( Dxi +1 + Dxi ) ( Dxi + Dxi -1 )
f ( x) = + O( Dx ) .
¶x êë ¶x úû i Dxi
Boundary conditions
We have seen earlier that we have two types of boundary conditions, Dirichlet, or pressure condition, and Neumann,
or rate condition. If we first consider a pressure condition at the left side of our slab, as follows:
PL 1 2
Δx1 Δx2
then we will have to modify our approximation of the first derivative at the left face, i = 1 / 2 , to become a forward
difference instead of a central difference:
æ ¶P ö P1 - PL
ç ÷ = + O( Dx ) ,
è ¶x ø 1/ 2 ( Dx1 ) / 2
( P2 - P1 ) ( P1 - PL )
2 f ( x ) 11/ 2 - 2 f ( x ) 1/ 2
¶ é ¶P ù ( Dx 2 + Dx1 ) ( Dx1 )
f ( x) = + O( Dx ) .
¶x êë ¶x úû 1 Dx1
With a pressure PR specified at the right hand face, we get a similar approximation for block N :
(PR − PN ) (PN − PN −1 )
2 f (x) N+1 / 2 − 2 f (x) N −1/ 2
∂ ⎡ ∂P ⎤ (ΔxN ) (ΔxN + Δx N−1 )
⎢ f (x) ⎥ = + O(Δx) .
∂x ⎣ ∂x ⎦ N Δx N
QL 1 2
Δx1 Δx2
we make use of Darcy's equation:
kA æ ¶P ö
QL = - ç ÷
µB è ¶x ø 1/ 2
or
æ ¶P ö µB
.
ç ÷ = -QL
è ¶x ø 1/ 2 kA
( P2 - P1 ) µB
2 f ( x ) 11/ 2 + QL
¶ é ¶P ù ( Dx 2 + Dx1 ) kA
f ( x) = + O( Dx ) .
¶x êë ¶x úû 1 Dx1
With a rate QR specified at the right hand face, we get a similar approximation for block N :
µB ( PN - PN -1 )
- QR - 2 f ( x ) N -1/ 2
¶ é ¶P ù kA ( Dx N + Dx N -1 )
ê f ( x) = + O( Dx ) .
¶x ë ¶x úû N Dx N
For the case of a no-flow boundary between blocks QR and QR , the flow terms for the two blocks become:
( Pi +1 - Pi ) ( Pi - Pi -1 )
2 f ( x ) i +1/ 2 - 2 f ( x ) i -1/ 2
¶ é ¶P ù ( Dxi +1 + Dxi ) ( Dxi + Dxi -1 )
f ( x) = + O( Dx )
¶x êë ¶x úû i Dxi
( Pi +1 - Pi ) ( Pi - Pi -1 )
2 f ( x ) i +1/ 2 - 2 f ( x ) i -1/ 2
¶ é ¶P ù ( Dxi +1 + Dxi ) ( Dxi + Dxi -1 )
f ( x) = + O( Dx )
¶x êë ¶x úû i Dxi
Time discretization
the following backward difference approximation with first order error term is obtained:
¶P t + Dt Pi t + Dt - Pi t
( ) = + O( Dt ) .
¶t i Dt
2 3
Dt (Dt) (Dt)
P(x, t + Dt) = P (x, t) + P¢ (x, t) + P¢¢ (x, t) + P ¢¢¢ (x, t) + .....
1! 2! 3!
¶P t + Dt Pi t + Dt - Pi t
( ) = + O( Dt ) .
¶t i Dt
2 3
Dt (Dt) (Dt)
P(x, t + Dt) = P (x, t) + P¢ (x, t) + P¢¢ (x, t) + P ¢¢¢ (x, t) + .....
1! 2! 3!
2 3
Dt (Dt) (Dt)
P(x, t + Dt) = P (x, t) + P¢ (x, t) + P¢¢ (x, t) + P ¢¢¢ (x, t) + .....
1! 2! 3!
¶P t+ Dt Pi t+D t - Pi t
( ) = + O (Dt)
¶t i Dt
The time approximation used as great influence on the solutions of the equations. Using the simple case of the
flow equation and constant grid size as example, we may write the difference form of the equation for the three
cases above.
Explicit formulation
Here, we use the forward approximation of the time derivative at time level t . Hence, the left hand side is also
at time level Q , and we can solve for pressures explicitly:
R
t t t t+D t t
Pi+1 - 2Pi + Pi-1 fµc Pi - Pi
»( ) , fori = 1,..., N
Dx2 k Dt
As discussed previously, this formulation has limited stability, and is therefore seldom used.
Implicit formulation
Here, we use the backward approximation of the time derivative at time level QR , and thus left hand side is
also at time level QR :
+ Δt
Pit+1 − 2Pit + Δt + Pit−1
+ Δt
φµc Pit + Δt − Pit
= ( )
Δx2 k Δt
Now we have a set of N equations with N unknowns, which must be solved simultaneously, for instance using the
Gaussian elimination method. The formulation is unconditionally stable.
Crank-Nicholson formulation
Finally, by using the central approximation of the time derivative at time level QR , and thus left hand side is
also at time level QR :
1 ⎡ Pi+1
t t +Δ t
− 2Pit + Pit−1 Pi+1 t + Δt ⎤
− 2Pit + Δt + Pi−1 φµc Pit + Δt − Pit
⎢ + ⎥ = ( )
2⎣ Δx2 Δx2 ⎦ k Δt
The resulting set of linear equations may be solved simultaneously just as in the implicit case. The formulation is
unconditionally stable, but may exhibit oscillatory behavior, and is seldom used.