5
SIG4042 Reservoir Simulation 2003 Lecture note 3 Norwegian University of Science and Technology Professor Jon Kleppe Department of Petroleum Engineering and Applied Geophysics 28.1.03 page 1 of 5 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: P( x +Dx, t) = P( x, t) + Dx 1! ¢ P ( x, t) + ( Dx) 2 2! ¢ ¢ P ( x , t ) + ( Dx) 3 3! ¢ ¢ ¢ P ( x , t ) + ..... P( x -Dx, t) = P( x, t) + ( -D x) 1! ¢ P ( x , t ) + ( -D x) 2 2! ¢ ¢ P ( x, t) + ( -D x) 3 3! ¢ ¢ ¢ P ( x, t) + ..... to yield ( 2 P x 2 ) i t = P i +1 t - 2 P i t + P i -1 t ( Dx) 2 + O( Dx 2 ) , which applies to the following grid system: i i-1 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 i-1 i+1 Dx i Dx i-1 Dx i+1 the Taylor expansions become (dropping the time index): P i +1 = P i + ( Dx i +Dx i +1 )/2 1! ¢ P i + ( Dx i +D x i +1 )/2 [ ] 2 2! ¢ ¢ P i + ( Dx i +Dx i+1 )/2 [ ] 3 3! ¢ ¢ ¢ P i ..... P i -1 = P i + -( Dx i +Dx i -1 )/2 1! ¢ P i + -( Dx i +D x i -1 )/2 [ ] 2 2! ¢ ¢ P i + -( Dx i +Dx i-1 )/2 [ ] 3 3! ¢ ¢ ¢ P i ..... to yield ¢ ¢ P i = 4 2 Dx i +Dx i-1 2 Dx i +Dx i+1 +Dx i -1 Ê Ë Á ˆ ¯ ˜ P i+1 - 2 P i + 2 Dx i +Dx i +1 2Dx i +Dx i +1 +Dx i-1 Ê Ë Á ˆ ¯ ˜ P i -1 (D x i +Dx i +1 )( Dx i +Dx i-1 ) + O( Dx) . An important difference is now that the error term is of only first order, due to the different block sizes.

reservoir simulation Note03

Embed Size (px)

DESCRIPTION

Reservoir simulation courselecture#5

Citation preview

Page 1: reservoir simulation Note03

SIG4042 Reservoir Simulation 2003Lecture note 3

Norwegian University of Science and Technology Professor Jon KleppeDepartment of Petroleum Engineering and Applied Geophysics 28.1.03

page 1 of 5

DISCRETIZATION OF THE FLOW EQUATIONS

As we already have seen, finite difference approximations of the partial derivatives appearing in the flow equationsmay be obtained from Taylor series expansions. We shall now proceed to derive approximations for all termsneeded 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 backwardexpansions of pressure:

P(x + Dx, t) = P(x, t) +Dx1!

¢ P ( x, t) +(Dx)2

2!¢ ¢ P (x,t ) +

(Dx) 3

3!¢ ¢ ¢ P (x,t ) + .....

P(x - Dx, t) = P(x, t) +(- Dx)

1!¢ P (x,t ) +

(- Dx) 2

2!¢ ¢ P (x, t) +

(- Dx)3

3!¢ ¢ ¢ P (x, t) + .....

to yield

(∂ 2P∂x 2 ) i

t =Pi +1

t - 2Pit + Pi -1

t

(Dx) 2 + O(Dx2 ) ,

which applies to the following grid system:

ii-1 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 agrid would enable finer description of geometry, and better accuracy in areas of rapid changes in pressures andsaturations, such as in the neighborhood of production and injection wells. For the simple one-dimensionalsystem, a variable grid system would be:

ii-1 i+1

DxiDxi-1 Dxi+1

the Taylor expansions become (dropping the time index):

Pi +1 = Pi +(Dxi + Dxi +1) / 2

1!¢ P i +

(Dxi + Dxi +1) / 2[ ]2

2!¢ ¢ P i +

(Dxi + Dxi+1 )/ 2[ ]3

3!¢ ¢ ¢ P i .....

Pi -1 = Pi +-(Dxi + Dxi -1) / 2

1!¢ P i +

-(Dxi + Dxi -1) / 2[ ]2

2!¢ ¢ P i +

-(Dxi + Dxi-1) / 2[ ]3

3!¢ ¢ ¢ P i .....

to yield

¢ ¢ P i = 42 Dxi + Dxi-1

2Dxi + Dxi+1 + Dxi -1

Ê

Ë Á

ˆ

¯ ˜ Pi+1 - 2Pi + 2 Dxi + Dxi +1

2Dxi + Dxi +1 + Dxi-1

Ê

Ë Á

ˆ

¯ ˜ Pi -1

(Dxi + Dxi +1)(Dxi + Dxi-1)+ O(Dx) .

An important difference is now that the error term is of only first order, due to the different block sizes.

Page 2: reservoir simulation Note03

SIG4042 Reservoir Simulation 2003Lecture note 3

Norwegian University of Science and Technology Professor Jon KleppeDepartment of Petroleum Engineering and Applied Geophysics 28.1.03

page 2 of 5

However, normally the flow terms in our simulation equations will be of the type∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙ , where f ( x)

includes permeability, mobility and flow area. Therefore, we will instead derive a central approximation for thefirst derivative, and apply it twice to this flow term.

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+1 / 2= f (x)

∂P∂x

È Î Í

˘ ˚ ˙

i+

Dxi / 21!

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+

(Dxi / 2)2

1!∂ 2

∂x 2 f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+ .....

and

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i-1 / 2= f (x)

∂P∂x

È Î Í

˘ ˚ ˙

i+

- Dxi / 21!

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+

(-Dxi / 2)2

1!∂ 2

∂x 2 f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+ .....

which yields

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i=

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+1 / 2- f (x)

∂P∂x

È Î Í

˘ ˚ ˙

i -1/ 2Dxi

+ O(Dx 2 ).

Similarly, we may obtain the following expressions:

∂P∂x

Ê Ë Á

ˆ ¯ ˜

i +1/ 2=

Pi +1 - Pi(Dxi + Dxi +1) / 2

+ O(Dx)

and

∂P∂x

Ê Ë Á

ˆ ¯ ˜

i -1/ 2=

Pi - Pi -1(Dxi + Dxi -1) / 2

+ O(Dx) .

As we can see, due to the different block sizes, the error terms for the last two approximations are again of firstorder only. By inserting these expressions into the previous equation, we get the following approximation for theflow term:

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i=

2 f (x)i +1/ 2(Pi +1 - Pi )

(Dxi +1 + Dxi )- 2 f (x) i -1/ 2

(Pi - Pi -1)(Dxi + Dxi-1)

Dxi+ O(Dx) .

Boundary conditions

We have seen earlier that we have two types of boundary conditions, Dirichlet, or pressure condition, andNeumann, or rate condition. If we first consider a pressure condition at the left side of our slab, as follows:

Dx1

1 2

Dx2

PL

then we will have to modify our approximation of the first derivative at the left face, i = 1/ 2 , to become a forwarddifference instead of a central difference:

∂P∂x

Ê Ë Á

ˆ ¯ ˜

1 / 2=

P1 - PL(Dx1 ) / 2

+ O(Dx) ,

and the flow term approximation thus becomes:

Page 3: reservoir simulation Note03

SIG4042 Reservoir Simulation 2003Lecture note 3

Norwegian University of Science and Technology Professor Jon KleppeDepartment of Petroleum Engineering and Applied Geophysics 28.1.03

page 3 of 5

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

1=

2 f (x)1 1 / 2(P2 - P1 )

(Dx2 + Dx1 )- 2 f (x)1/ 2

(P1 - PL )(Dx1)

Dx1+ O(Dx) .

With a pressure PR specified at the right hand face, we get a similar approximation for block N :

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

N=

2 f (x) N+1 / 2(PR - PN )

(DxN )- 2 f (x) N -1/ 2

(PN - PN -1)(DxN + Dx N-1 )

Dx N+ O(Dx) .

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

Dx1

1 2

Dx2

QL

we make use of Darcy's equation:

QL = -k AmB

∂P∂x

Ê Ë Á

ˆ ¯ ˜

1/ 2or

∂P∂x

Ê Ë Á

ˆ ¯ ˜

1 / 2= -QL

mBk A

.

Then, by substituting into the approximation, we get:

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

1=

2 f (x)11 / 2(P2 - P1 )

(Dx2 + Dx1 )+ QL

mBk A

Dx1+ O(Dx) .

With a rateQR specified at the right hand face, we get a similar approximation for block N :

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

N=

-QRmBk A

- 2 f (x) N -1/ 2(PN - PN -1)

(DxN + Dx N-1 )DxN

+ O(Dx) .

For the case of a no-flow boundary between blocks i and i + 1 , the flow terms for the two blocks become:

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i= -2 f ( x)i -1/ 2

(Pi - Pi-1 )Dxi (Dxi + Dxi -1)

+ O(Dx)

∂∂x

f (x)∂P∂x

È Î Í

˘ ˚ ˙

i+1= 2 f ( x)i +11/ 2

(Pi + 2 - Pi +1)Dxi +1(Dxi + 2 + Dxi +1)

+ O(Dx)

Time discretization

We showed earlier that by expansion backward in time:

P(x,t ) = P(x,t + Dt ) +- Dt1!

¢ P (x, t + Dt) +(- Dt)2

2!¢ ¢ P (x, t + Dt) +

(- Dt)3

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

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

Page 4: reservoir simulation Note03

SIG4042 Reservoir Simulation 2003Lecture note 3

Norwegian University of Science and Technology Professor Jon KleppeDepartment of Petroleum Engineering and Applied Geophysics 28.1.03

page 4 of 5

(∂P∂t

)it + Dt =

Pit + Dt - Pi

t

Dt+ O(Dt) .

An expansion forward in time:

P(x,t + Dt ) = P(x,t ) +Dt1!

¢ P (x, t) +(Dt )2

2!¢ ¢ P (x,t ) +

(Dt )3

3!¢ ¢ ¢ P ( x, t) + .....

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

(∂P∂t

)it =

Pit + Dt - Pi

t

Dt+ O(Dt) .

Finally, expanding in both directions:

P(x,t + Dt ) = P(x,t + Dt2 ) +

D t21!

¢ P (x,t + Dt2 ) +

( Dt2 )2

2!¢ ¢ P (x, t + Dt

2 ) +(D t

2 )3

3!¢ ¢ ¢ P (x,t + D t

2 ) + .....

P(x,t ) = P(x,t + D t2 ) +

- D t2

1!¢ P (x,t + Dt

2 ) +(- Dt

2 )2

2!¢ ¢ P (x,t + D t

2 ) +(- Dt

2 )3

3!¢ ¢ ¢ P (x, t + Dt

2 ) + .....

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

(∂P∂t

)it + Dt

2 =Pi

t +D t - Pit

Dt+ O(Dt )

The time approximation used as great influence on the solutions of the equations. Using the simple case of theflow equation and constant grid size as example, we may write the difference form of the equation for the threecases above.

Explicit formulation

Here, we use the forward approximation of the time derivative at time level t . Hence, the left hand side is alsoat time level t , and we can solve for pressures explicitly:

Pi +1t - 2Pi

t + Pi-1t

Dx2 = (fmc

k)

Pit + Dt - Pi

t

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 isalso at time level t + Dt :

Pi +1t + Dt - 2Pi

t + Dt + Pi -1t + Dt

Dx2 = (fmc

k)

Pit + Dt - Pi

t

Dt

Now we have a set of N equations with N unknowns, which must be solved simultaneously, for instance using theGaussian elimination method. The formulation is unconditionally stable.

Crank-Nicholson formulation

Finally, by using the central approximation of the time derivative at time level t + D t2 , and thus left hand side is

also at time level t + D t2 :

Page 5: reservoir simulation Note03

SIG4042 Reservoir Simulation 2003Lecture note 3

Norwegian University of Science and Technology Professor Jon KleppeDepartment of Petroleum Engineering and Applied Geophysics 28.1.03

page 5 of 5

12

Pi+1t - 2Pi

t + Pi -1t

Dx2 +Pi+1

t +D t - 2Pit + Dt + Pi-1

t + Dt

Dx2È

Î Í

˘

˚ ˙ = (

fmck

)Pi

t + Dt - Pit

Dt

The resulting set of linear equations may be solved simultaneously just as in the implicit case. The formulation isunconditionally stable, but may exhibit oscillatory behavior, and is seldom used.