Solution of Non - Linear Equations

Transcription

Solution of Non - Linear Equations
TPG4160 Reservoir Simulation 2015
Hand-out note 12
page 1 of 4
SOLUTION OF NON-LINEAR EQUATIONS
Considering the one-dimensional saturated three phase equations:
(
)
(
)
Txoi+1 2 Poi+1 − Poi + T xoi−1 2 Poi−1 − Poi − q′oi
(
) (
) (
)] + T [( P − P ) + ( P
)
= Cp oo i Poi − Poit + C sgo i Sgi − Sgti + Cswoi Sw i − Swit ,
[(
) (
Txgi+1 2 Poi+1 − Poi + Pcogi+1 − Pcogi
(
) (
) (
xgi−1 2
) (
oi−1
oi
) (
+ Rs oTxo i+1 2 Poi+1 − Poi + Rs oT xo i−1 2 Poi−1 − Poi − Rso q ′o
(
)
(
)
)i
(
cog i−1
)]
− Pcog i − qgi′
)
= Cp og i Poi − Poit + C sgg i Sgi − Sgti + Cswgi Sw i − Swit ,
[(
) (
)]
[(
) (
i = 1, N
i = 1, N
)]
Txw i+1 2 Poi+1 − Poi − Pcowi+1 − Pcowi + Txoi−1 2 Poi−1 − Poi − P cow i−1 − P cow i − qwi
′
(
)
(
)
(
)
= Cp ow i Poi − Poit + C sgw i Sgi − Sgti + Cswwi Sw i − Swit ,
i = 1, N
All coefficients and caillary pressures in the equations above are functions of the solution, ie. the new saturations
and pressures.
IMPES method
We have so far only discussed the IMPES method for solution of the non-linear equations arising in reservoir
simulation. In this method we made the assumption of all coefficients and capillary pressures are evaluated at old
time step level, and then eliminated unknown saturations by combining the three equations and obtained a
pressure equation. Having thus solved for pressures, saturations could be solved for explicitly from one of the
above equations.
Simultaneous solution method
Obviously, another alternative for this type of simplified solution, is to keep all three phase pressures as unknowns
in the equations, and eliminate saturations by the following operations:
−1
⎛ dP ⎞
Sw i − Sw it = ⎜ cow ⎟ (P oi − Poti ) − (Pwi − Pwti )
⎝ dSw ⎠ i
[
−1
Sg i −
Sg ti
]
⎛ dPcog ⎞
t
t
=⎜
⎟ (Pgi − Pgi ) − (Poi − Poi ) .
⎝ dSg ⎠ i
[
]
Except for the capillary pressures, we now make identical assumptions as for the IMPES method. Then, we may
solve for the three phase pressures. The coefficients would then have the form shown on the next page.
By this method, the simultaneous solution method, we have achieved to keep capillary pressures implicit, while
the other coefficients are explicit. The set of linear equations has tripled in size, however.
Norwegian University of Science and Technology
Department of Petroleum Engineering and Applied Geophysics
Professor Jon Kleppe
17.2.15
TPG4160 Reservoir Simulation 2015
Hand-out note 12
page 2 of 4
c
a
cg
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
Po
cw
cg
cw
cg
cw
cg
cw
cg
cw
cg
cw
cg
cw
cg
co
co
cw
cg
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
co
co
cw
co
cw
co
cw
co
cw
cw
co
cw
cg
cg
cg
cg
cg
Pg
cw
co
cg
cw
cw
co
cg
cw
cg
cg
cg
cg
cg
cg
cg
cg
cg
cg
cg
cg
cg
cg
cw
cw
Pw
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
c
a
b
Having thus obtained the three phase pressures, saturations may be interpolated from the capillary pressuresaturation relationships.
Iterative methods
Today, the IMPES method is still being used for field scale simulation, provided changes in pressures and
saturation are reasonably slow. However, generally we need to solve the flow equations implicitly, and in order to
do so, we apply iterative techniques.
For the purpose of illustration of Newtonian iteration, recall the Newton-Raphson method for solving a non-linear
equation with one unknown. Having a nonlinear equation of the form:
F(x) = 0. ,
for instance:
x 5 − 3x 3 + 2x − 4 = 0 ,
we can, by using Taylor expansion, derive an iterative formula:
x k +1 = x k −
F( xk )
.
F′( x k )
By iteration, provided that the first guess of the solution is sufficiently close to the correct solution, rapidly
converge to the solution.
If we have two simultaneous non-linear equations:
F(x, y) = 0
G(x, y) = 0,
Norwegian University of Science and Technology
Department of Petroleum Engineering and Applied Geophysics
Professor Jon Kleppe
17.2.15
TPG4160 Reservoir Simulation 2015
Hand-out note 12
page 3 of 4
the iterative formula becomes:
x k +1 = x k −
yk +1 = yk −
F(x k , y k )
F(x k , yk )
∂G
∂F
( x , y ) − G(x k , yk )
(x , y )
∂y k k
∂y k k
J(x k , y k )
∂G
∂F
(x , y ) − G(x k , y k ) (x k , yk )
∂x k k
∂x
J(x k , yk )
where the Jacobian is
J(x k , yk ) =
∂F
∂G
∂F
∂G
(x k , y k )
(x k , yk ) −
(x k , yk )
(x , y ) .
∂x
∂y
∂y
∂x k k
Our three phase flow equations may be written on a similar form as the above equations. Generally, in one
dimensional flow, we have 3N unknowns. However, due to the structure of the finite difference method used, each
node equation will have only 9 unknowns, so that our system of equations becomes:
Foi (Poi−1, Poi, Poi+1, Sgi−1, Sgi, Sgi+1, Swi−1, Swi, Swi+1) = 0
Fgi (Poi−1, Poi, Poi+1, Sgi−1, Sgi, Sgi+1, Swi−1, Swi, Swi+1) = 0
Fwi (Poi−1, Poi, Poi+1, Sgi−1, Sgi, Sgi+1, Swi−1, Swi, Swi+1) = 0,
i = 1, N
By first-order Taylor series expansions, we obtain the following expressions:
Foik +1 = Foki +
∂ F oi
∂Foi
∂Foi
+1
+1
(Poki−1
− Poik−1 ) +
(Poik +1 − Poki ) +
(Poik+1
− Poki+1 )
∂Poi −1
∂Poi
∂Poi +1
+
∂ F oi
∂ F oi
∂ F oi
+1
(Sg ki−1
− Sg ik−1 ) +
(Sg ki +1 − Sg ik ) +
(Sg k +1 − Sg ik+1 )
∂ Sgi −1
∂ Sg i
∂ Sgi +1 i +1
+
∂Foi
∂ F oi
∂ F oi
+1
+1
(Sw ik−1
− Sw ki−1 ) +
(Sw ik +1 − Swik ) +
(Sw ki+1
− Sw ik+1 )
∂ Sw i−1
∂ Sw i
∂ Sw i +1
Fgik +1 = Fgik +
∂ F gi
∂Fgi
∂Fgi
+1
+1
(Poki−1
− Poik−1 ) +
(Poik +1 − Poik ) +
(P oik+1
− Poki+1 )
∂P oi −1
∂Poi
∂Poi +1
+
∂ F gi
∂ F gi
∂ F gi
(Sg k +1 − Sg ik−1 ) +
(Sg ki +1 − Sg ik ) +
(Sg k +1 − Sgik+1 )
∂ Sgi −1 i−1
∂ Sg i
∂ Sgi +1 i +1
+
∂Fgi
∂ F gi
∂ F gi
+1
+1
(Sw ik−1
− Sw ki−1 ) +
(Sw ik +1 − Swik ) +
(Sw ki+1
− Sw ik+1 )
∂ Sw i−1
∂ Sw i
∂ Sw i +1
Norwegian University of Science and Technology
Department of Petroleum Engineering and Applied Geophysics
Professor Jon Kleppe
17.2.15
TPG4160 Reservoir Simulation 2015
Hand-out note 12
Fwki +1 = Fwik +
page 4 of 4
∂Fwi
∂Fwi
∂Fwi
+1
+1
(Poik−1
− Poki −1 ) +
(Poik +1 − Poki ) +
(Poki +1
− Poik+1 )
∂Poi−1
∂ P oi
∂Poi +1
+
∂Fwi
∂Fwi
∂Fwi
(Sg k +1 − Sg ik−1 ) +
(Sg ik +1 − Sgik ) +
(Sg k +1 − Sgik+1 )
∂ Sgi −1 i−1
∂ Sgi
∂ Sg i+1 i +1
+
∂Fwi
∂Fwi
∂Fwi
k +1
k
k +1
k
k +1
k
(Sw i −1 − Sw i−1 ) +
(Sw i − Sw i ) +
(Sw i +1 − Swi +1 )
∂ Sw i−1
∂ Sw i
∂ Sw i +1
i = 1, N
Thus, for a one-dimensional system we have 3N equations and 3N unknowns, and we can easily solve for
estimates of oil pressures and gas and water saturations. By applying Newtonian iteration until we converge on a
solution within some tolerance, we may obtain a solution to the equations. Our linear equations for iteration step
k+1 would then take the form:
+1
+1
+1
+1
ap o oi Poki−1
+ b pooi Poik +1 + c pooi Poik+1
+ asgoi Sgik−1
+ b sgoiSg ki +1 + c sgoiSg ik+1
+1
+1
+ aswoi Sw ki−1
+ b swoi Sw ki +1 + c swoiSw ik+1
= doi
+1
+1
+1
+1
ap o gi Poki−1
+ b pogi Poik +1 + c pogi Poki+1
+ asggi Sgik−1
+ b sggiSg ik +1 + csggi Sgik+1
+1
+1
+ aswgi Sw ki−1
+ b swgi Sw ki +1 + c swgiSw ik+1
= dg i
k +1
k +1
k +1
apo wiPoi−1
+ bpo wiPoki +1 + c po wiPoki+1+1 + a sgwiSgi−1
+ b sgw iSgik +1 + csgw iSgi+1
k +1
k+1
+ asww iSwi−1
+ bswwiSw ki +1 + c sww iSwi+1
= dw i
i = 1, N
or, on a compact form
 k +1 ˆ  k +1


aˆi Xi−1
+ bi Xi + cˆi Xik+1+1 = d i ,
i = 1, N
where
ap o oi
asgoi
aswoi
aˆi = ap o gi
apowi
asggi
asgwi
aswgi
aswwi
Poik +1
 k +1
Xi = Sg ki +1
Swik +1
b pooi
ˆ
bi = b pogi
b powi
b sgoi
b swoi
c p o oi
csgoi
cswoi
b sggi
b sgwi
b swgi
bswwi
cˆi = c p o gi
cpowi
csggi
c sgwi
cswgi
c swwi
do i

di = dg i
dw i
A simplified, non-iterative method that was extensively used in the past, uses estimated chord-slopes instead of the
derivatives above, and accepts the solution obtained after the first iteration. This method, called semi-implicit
method, is hardly used today.
Norwegian University of Science and Technology
Department of Petroleum Engineering and Applied Geophysics
Professor Jon Kleppe
17.2.15