Professional Documents
Culture Documents
Discretization of The Flow Equations
Discretization of The Flow Equations
Discretization of The Flow Equations
Lecture note 3
Page 1 of 5
to yield
2 P t Pit+1 2Pi t + Pi t1
2
) =
+ O(x ) ,
x 2 i
(x) 2
i-1
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
xi-1 xi
i+1
xi+1
Pi +1 = Pi +
[(xi + xi 1 ) / 2]
[(x i + x i1 ) / 2]
(x i + xi 1 ) / 2
Pi 1 = Pi +
Pi +
Pi+
Pi.....
1!
2!
3!
2
to yield
x i + x i1
xi + x i +1
2
Pi+1 2Pi + 2
Pi 1
2 x i + x i+1 + x i 1
2xi + x i +1 + x i1
Pi= 4
+ O(x) .
(x i + x i +1 )(x i + x i1 )
An important difference is now that the error term is of only first order, due to the different block sizes.
Norwegian University of Science and Technology
Department of Petroleum Engineering and Applied Geophysic
Reservoir Simulation
Lecture note 3
Page 2 of 5
However, normally the flow terms in our simulation equations will be of the type
P
f (x) , where f ( x)
x
x
includes 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 xi / 2
P (xi / 2) 2 2
=
+
+
(
)
(
)
(
)
f
x
f
x
f
x
1! x
2!
x i +1 / 2
x i
x i
x 2
f ( x) x + .....
i
and
P
P xi / 2
P (xi / 2) 2 2
=
+
+
(
)
(
)
(
)
f
x
f
x
f
x
1!
2!
x i 1 / 2
x i
x
x i
x 2
f ( x) x + .....
i
which yields
P
f (x) =
x
x i
f (x)
f (x)
x i 1/ 2
i+1 / 2
+ O(x 2 ).
x i
and
Pi Pi 1
P
=
+ O(x) .
x i 1/ 2 (x i + x i 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
(xi +1 + x i )
(x i + x i1 )
P
f (x) =
+ O(x) .
x
x i
x i
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
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 PL
P
= 1
+ O(x) ,
x 1 / 2 (x1 ) / 2
Reservoir Simulation
Lecture note 3
Page 3 of 5
P
f ( x) =
x
x 1
2 f ( x) 1/ 2
( P2 P1 )
( P PL )
2 f ( x )1 / 2 1
( x2 + x1 )
(x1 )
+ O ( x ) .
x1
With a pressure PR specified at the right hand face, we get a similar approximation for block N :
P
f (x) =
x
x N
2 f ( x ) N +1 / 2
( PR PN )
( PN PN 1 )
2 f ( x ) N 1/ 2
(x N )
(x N + x N 1 )
+ O(x ) .
x N
QL
x1
x2
or
kA P
B x 1/ 2
B
P
.
= Q L
x 1 / 2
kA
P
f ( x) =
x
x 1
2 f ( x) 1/ 2
( P2 P1 )
B
+ QL
(x2 + x1 )
kA
+ O( x) .
x1
With a rate QR specified at the right hand face, we get a similar approximation for block N :
P
f (x) =
x
x N
QR
B
kA
2 f (x) N 1/ 2
x N
(PN PN 1 )
(x N + x N1 )
+ O(x) .
For the case of a no-flow boundary between blocks i and i + 1 , the flow terms for the two blocks become:
P
( Pi Pi1 )
f ( x ) = 2 f ( x )i 1/ 2
+ O( x )
x
x i
x i ( xi + x i 1 )
( Pi + 2 Pi +1 )
P
+ O ( x )
f ( x) = 2 f ( x) i +1 / 2
x
x i +1
xi +1 (xi + 2 + xi +1 )
Time discretization
We showed earlier that by expansion backward in time:
P(x,t ) = P(x,t + t ) +
t
(t) 2
(t) 3
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
Department of Petroleum Engineering and Applied Geophysic
Reservoir Simulation
Lecture note 3
(
Page 4 of 5
P t + t Pit + t Pit
)
=
+ O(t) .
t i
t
t
(t )2
(t )3
P (x, t) +
P (x,t ) +
P ( x, t) + .....
1!
2!
3!
P t Pit + t Pit
) =
+ O(t) .
t i
t
P( x , t + t ) = P( x , t +
t
2)
P( x , t ) = P( x , t + t2 ) +
2t
P ( x , t +
1!
1!
P ( x , t +
t
2)
t
2)
( 2t ) 2
2!
( t2 )2
2!
P ( x, t +
t
2 )+
P ( x , t + t2 ) +
( 2t ) 3
3!
( t2 )3
3!
P ( x , t + 2t ) + .....
P ( x, t +
t
2 ) + .....
P t + t2 Pi t +t Pi t
)
=
+ O(t )
t i
t
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 t , and we can solve for pressures explicitly:
t
Pit+1 2Pit + Pi1
c Pit + t Pit
=
(
)
k
x2
t
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 t + t , and thus left hand side is
also at time level t + t :
Pit++1t 2 Pit + t + Pit+1t
c Pit + t Pit
=
(
)
x 2
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 t +
also at time level t + 2t :
t
2
Reservoir Simulation
Lecture note 3
Page 5 of 5
t
t +t
t + t
1 Pi+1
2Pit + Pit1 Pi+1
2Pit + t + Pi1
c Pit + t Pit
+
)
=(
2
2
2
k
x
x
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.