Professional Documents
Culture Documents
Lecture note 3
page 1 of 5
to yield
i+1
Dx
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
Dxi-1 Dxi
i+1
Dxi+1
1!
2!
3!
2
1!
2!
3!
to yield
Dx i + Dx i-1
Dxi + Dx i +1
2
Pi+1 - 2Pi + 2
Pi -1
2Dx i + Dx i+1 + Dx i -1
2Dxi + Dx i +1 + Dx i-1
Pi= 4
+ O(Dx) .
(Dx i + Dx i +1 )(Dx i + Dx i-1)
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 Geophysics
page 2 of 5
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.
However, normally the flow terms in our simulation equations will be of the type
f (x)
i+1 / 2
P Dx / 2
P (Dxi / 2) 2 2
P
= f (x) + i
f
(x)
+
f (x)
+ .....
x i
1! x
x i
1!
x 2
x i
and
P
P - Dx i / 2
P (-Dxi / 2) 2 2
= f (x) +
f (x)
+
f (x) x
x i
1! x
x i
1!
x 2
i-1 / 2
f (x) x + .....
i
which yields
P
P
f (x)
- f (x)
x i+1 / 2
x i -1/ 2
P
f
(x)
=
+ O(Dx 2 ).
x
x i
Dx i
Similarly, we may obtain the following expressions:
Pi +1 - Pi
P
=
+ O(Dx)
x i +1/ 2 (Dx i + Dx i +1 ) / 2
and
Pi - Pi -1
P
=
+ O(Dx) .
x i -1/ 2 (Dx i + Dx 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
P
(Dxi +1 + Dx i )
(Dx i + Dx i-1)
f (x) =
+ O(Dx) .
x
x i
Dx 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
Dx1
Dx2
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(Dx) ,
x 1 / 2 (Dx1 ) / 2
and the flow term approximation thus becomes:
P
f (x) =
x
x 1
2 f (x)1 1 / 2
page 3 of 5
(P2 - P1 )
(P - PL )
- 2 f (x)1/ 2 1
(Dx 2 + Dx1 )
(Dx 1 )
+ O(Dx) .
Dx1
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
(Dx N )
(Dx N + Dx N-1 )
+ O(Dx) .
Dx N
QL
Dx1
Dx2
k A P
mB x 1/ 2
or
mB
P
= -Q L
.
x 1 / 2
kA
Then, by substituting into the approximation, we get:
P
f (x) =
x
x 1
2 f (x)11 / 2
(P2 - P1 )
mB
+ QL
(Dx 2 + Dx1 )
kA
+ O(Dx) .
Dx1
With a rateQR specified at the right hand face, we get a similar approximation for block N :
P
f (x) =
x
x N
-QR
mB
(PN - PN -1 )
- 2 f (x) N -1/ 2
kA
(Dx N + Dx N-1 )
+ O(Dx) .
Dx N
For the case of a no-flow boundary between blocks i and i + 1, the flow terms for the two blocks become:
P
(Pi - Pi-1 )
f (x) = -2 f ( x)i -1/ 2
+ O(Dx)
x
x i
Dx i (Dxi + Dx i -1 )
P
(Pi + 2 - Pi +1 )
f (x) = 2 f ( x)i +11/ 2
+ O(Dx)
x
x i+1
Dx i +1 (Dxi + 2 + Dx i +1 )
Time discretization
We showed earlier that by expansion backward in time:
P(x,t ) = P(x,t + Dt ) +
- Dt
(- Dt) 2
(- Dt) 3
P ( x, t + Dt) +
P (x, t + Dt) +
P (x,t + Dt) + .....
1!
2!
3!
the following backward difference approximation with first order error term is obtained:
page 4 of 5
P t + Dt Pit + Dt - Pit
)
=
+ O(Dt) .
t i
Dt
P(x,t + Dt ) = P(x,t ) +
P t Pit + Dt - Pit
) =
+ O(Dt) .
t i
Dt
P(x,t + Dt ) = P(x,t +
Dt
2)
- D2t
P( x,t +
1!
1!
P( x,t +
Dt
2)
Dt
2)
( Dt
)2
2
P (x, t +
2!
Dt
2 )+
( D2t ) 3
P (x,t + D2t ) + .....
3!
(- Dt
)2
(- Dt
)3
2
2
P (x,t + D2t ) +
P (x, t +
2!
3!
Dt
2 ) + .....
P t + Dt2
P t +D t - Pi t
)i
= i
+ O(Dt )
t
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 t , and we can solve for pressures explicitly:
t
Pit+1 - 2Pit + Pi-1
fmc Pit + Dt - Pit
=(
)
2
Dx
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 t + Dt , and thus left hand side is
also at time level t + Dt :
+ Dt
+ Dt
Pit+1
- 2Pit + Dt + Pit-1
fmc Pit + Dt - Pit
=(
)
2
Dx
k
Dt
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 + D2t :
Dt
2
page 5 of 5
t
t +D t
t + Dt
1 Pi+1
- 2Pit + Pit-1 Pi+1
- 2Pit + Dt + Pi-1
fmc Pit + Dt - Pit
+
=
(
)
2
Dx 2
Dx 2
k
Dt
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.