You are on page 1of 5

TPG4160 Reservoir Simulation 2018 page 1 of 5

Lecture note 3

DISCRETIZATION OF THE FLOW EQUATIONS

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

Constant grid block sizes

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

which applies to the following grid system:

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

Δxi-1 Δxi Δxi+1


the Taylor expansions become (dropping the time index):

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!

[−(Δxi + Δxi −1) / 2] [ −(Δxi + Δxi−1) / 2]


2 3
−(Δxi + Δxi −1 ) / 2
Pi −1 = Pi + Pi′ + Pi′′+ Pi′′.....

1! 2! 3!

to yield

⎛ Δxi + Δxi−1 ⎞ ⎛ Δxi + Δxi +1 ⎞


2⎜ ⎟ Pi+1 − 2 Pi + 2⎜ ⎟ Pi −1
⎝ 2 Δxi + Δxi+1 + Δxi −1 ⎠ ⎝ 2Δxi + Δxi +1 + Δxi−1 ⎠
Pi′′= 4 + O(Δx) .
(Δxi + Δxi +1 )( Δxi + Δxi−1)

Norwegian University of Science and Technology Professor Jon Kleppe


Department of Petroleum Engineering and Applied Geophysics 11.1.2018
TPG4160 Reservoir Simulation 2018 page 2 of 5
Lecture note 3

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

Similarly, we may obtain the following expressions:

æ ¶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

and the flow term approximation thus becomes:

Norwegian University of Science and Technology Professor Jon Kleppe


Department of Petroleum Engineering and Applied Geophysics 11.1.2018
TPG4160 Reservoir Simulation 2018 page 3 of 5
Lecture note 3

( 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

For a flow rate specified at the left side (injection/production),

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

Then, by substituting into the approximation, we get:

( 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

We showed earlier that by expansion backward in time:

−Δt (−Δt) 2 (−Δt) 3


P(x,t ) = P(x,t + Δt ) + P ′( x, t + Δt) + P ′′(x, t + Δt) + P′′′ (x,t + Δt) + .....
1! 2! 3!

the following backward difference approximation with first order error term is obtained:

Norwegian University of Science and Technology Professor Jon Kleppe


Department of Petroleum Engineering and Applied Geophysics 11.1.2018
TPG4160 Reservoir Simulation 2018 page 4 of 5
Lecture note 3

¶P t + Dt Pi t + Dt - Pi t
( ) = + O( Dt ) .
¶t i Dt

An expansion forward in time:

2 3
Dt (Dt) (Dt)
P(x, t + Dt) = P (x, t) + P¢ (x, t) + P¢¢ (x, t) + P ¢¢¢ (x, t) + .....
1! 2! 3!

yields a forward approximation, again with first order error term:

¶P t + Dt Pi t + Dt - Pi t
( ) = + O( Dt ) .
¶t i Dt

Finally, expanding in both directions:

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!

we get a central approximation, with a second order error term:

¶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.

Norwegian University of Science and Technology Professor Jon Kleppe


Department of Petroleum Engineering and Applied Geophysics 11.1.2018
TPG4160 Reservoir Simulation 2018 page 5 of 5
Lecture note 3

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.

Norwegian University of Science and Technology Professor Jon Kleppe


Department of Petroleum Engineering and Applied Geophysics 11.1.2018

You might also like