Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Simulation of Subsurface Two-Phase Flow in an Oil
Reservoir
Carsten Volcker, John Bagterp Jørgensen, Per Grove Thomsen andErling Halfdan Stenby
Technical University of Denmark (DTU)Department of Informatics and Mathematical Modeling (IMM)
January 28, 2009
1 / 21
Outline
1 Introduction
2 Two-Phase Isothermal Immiscible FlowConservation EquationsConstitutive Equations
3 Numerical IntegrationODE ModelRunge-KuttaESDIRK Integration
4 Solving The Linear EquationsModified NewtonLinear Solvers
5 Error Control
6 Test Case
2 / 21
Introduction
2D Reservoir
3 / 21
Introduction
Optimizing Production
Maximizing net present value (NPV):
Closed loop optimizer:
4 / 21
Introduction
Water Flooding without/with Optimal Control
Permeability field with two streaks:
Without optimal control:
With optimal control:
5 / 21
Two-Phase Isothermal Immiscible Flow Conservation Equations
Conservation Equations
Mass conservation of water and oil:
∂
∂tCw(Pw, Sw) = −∇Nw(Pw, Sw) +Qw
∂
∂tCo(Po, So) = −∇No(Po, So) +Qo
No flow potential due to gravitation.
Homogenous permeability field.
Capillary pressure neglected.
Incompressible rock.
Mass concentrations:
Cw = φρw(Pw)Sw
Co = φρo(Po)So
Fluxes through the porous medium:
Nw = ρw(Pw)uw(Pw, Sw)
No = ρo(Po)uo(Po, So)6 / 21
Two-Phase Isothermal Immiscible Flow Conservation Equations
Darcy Velocity and Boundary Conditions
Pressure driven flow, Darcy’s law:
uα = −kkrα(Sα)
µα∇Pα α = o,w
No flow across boundaries:
uα · n = 0 and uα · n = 0
Internal sources/sinks due to wells:
Water is injected to maintain pressure and replace the oil.
Oil and water are produced.
7 / 21
Two-Phase Isothermal Immiscible Flow Conservation Equations
Reduction Of State Variables:
Water saturation (volume fraction):
Sw + So = 1
Pressure difference due to capillary pressure:
Pcow = Po − Pw
Reduction of variables:
Sw = 1 − So ⇒ S = Sw = 1 − So
Pcow = 0 ⇒ P = Pw = Po
State variables (S,P ) = (Sw, Po):
S = S(t, s)
P = P (t, s)
8 / 21
Two-Phase Isothermal Immiscible Flow Constitutive Equations
Density and compressibility
Compressible fluids:
ρw = ρw0eP−Pw0
ρo = ρo0eP−Po0
0 100 200 300 400 500 600 700 800 900 1000750
800
850
900
950
1000
1050Densities of water and oil [kg/m3]
P [bar]
ρ
w
ρo
9 / 21
Two-Phase Isothermal Immiscible Flow Constitutive Equations
Relative Permeabilities by The Corey Relations
Relative permeabilities:
krw = krw0snw
kro = kro0(1 − s)nw
Reduced water saturation:
s =S − Swc
1 − Swc − Sor
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
← Swc
← 1−Sor
Rel. perm. of water and oil by the Corey relations
S
k
rw
kro
10 / 21
Numerical Integration ODE Model
Different Formulation
Partial differential equation (PDE) model:
∂
∂tCw(Pw, Sw) = −∇Nw(Pw, Sw) +Qw
∂
∂tCo(Po, So) = −∇No(Po, So) +Qo
Different formulation of an ordinary differential equation (ODE) modelafter discretizing spatially:
d
dtg(x(t)) = f(t, x(t)) x(t0) = x0
11 / 21
Numerical Integration Runge-Kutta
Runge-Kutta Methods
Tailored formulation of an s-stage Runge-Kutta method:
Ti = tn + cihn i = 1, 2, . . . , s
g(Xi) = g(xn) + hn
s∑
j=1
aijf(Tj,Xj) i = 1, 2, . . . , s
g(xn+1) = g(xn) + hn
s∑
j=1
bjf(Tj,Xj)
g(xn+1) = g(xn) + hn
s∑
j=1
bjf(Tj,Xj)
en+1 = g(xn+1) − g(xn+1) = hn
s∑
j=1
djf(Tj,Xj) dj = bj − bj
12 / 21
Numerical Integration ESDIRK Integration
Fast Integration by ESDIRK
Only s− 1 implicit stages:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
1 b1 b2 b3 · · · γ
b1 b2 b3 · · · γ
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
13 / 21
Solving The Linear Equations Modified Newton
Modified Newton Step
The state values Xi are obtained by sequential solution of the residual:
R(Xi) = g(Xi) − hnγf(Ti,Xi) − ψi = 0 i = 2, 3, . . . , s
ψi = g(xn) + hn
i−1∑
j=1
aijf(Tj ,Xj) i = 2, 3, . . . , s
The Jacobian of the residual R(Xi):
J(Xi) =∂R
∂Xi(Xi) =
∂g
∂x(Xi) − hnγ
∂f
∂x(Ti,Xi)
≈∂g
∂x(xm) − hmγ
∂f
∂x(tm, xm)
= J(xm) = LU
Only updating the Jacobian by slow convergence or divergence:
LU∆Xi = R(Xi)
Xi := Xi − ∆Xi
14 / 21
Solving The Linear Equations Linear Solvers
Jacobian Structure
1D: 3 Non-zeros: 2D: 5 Non-zeros: 3D: 7 Non-zeros:
Solving the linear equations:
Sparse direct solver: LU factorization and back sustitution.
Iterative solver: GMRES.
15 / 21
Error Control
Adaptive Time Stepping
In most commercial simulators:
Simple heuritics implemented e.g. maximum variation of saturations.
ESDIRK, embedded error estimator:
en+1 = g(xn+1) − g(xn+1) = hn
s∑
i=1
dif(Ti,Xi)
Measures of the error may be controlled adjusting the time step accordingto
hn+1 =hn
hn−1
(
ε
rn+1
)k2/k (
rn
rn+1
)k1/k
hn
en+1 is an error estimate of the conserved quantities g(xn+1).
16 / 21
Error Control
ESDIRK Performance
ESDIRK23 performance and statistics, 45 × 45 grid blocks:
0 20 40 60
10−6
10−4
10−2
Ste
psiz
e
0 20 40 60
10−2
100
102
Time
Err
/Tol
0 20 40 600
10
20
Sta
ge 2
0 20 40 600
10
20
Time
Sta
ge 3
Method : ESDIRK23absTol : 4050x1relTol : 4050x1
nIter 2 : 4734nIter 3 : 5506
nStep : 1289nFail : 129nDiv : 10nSlow : 1
nFun : 12815nJac : 1279nLU : 1290nBack : 10240
17 / 21
Error Control
Performance by Significant Digits
ESDIRK performance on 1D case, 1000 grid blocks:
ESDIRK12 = red, ESDIRK23 = green, ESDIRK34 = blue.18 / 21
Test Case
2D Test Case, 45 × 45 Grid Blocks
Permeability field with two streaks:
Oil saturation after 31 days:
5 10 15 20 25 30 35 40 45
5
10
15
20
25
30
35
40
45 0.2
0.25
0.3
0.35
0.4
0.45
0.5
0.55
0.6
0.65
0.7
Oil saturation after 62 days:
5 10 15 20 25 30 35 40 45
5
10
15
20
25
30
35
40
45 0.2
0.25
0.3
0.35
0.4
0.45
0.5
0.55
0.6
0.65
0.7
19 / 21
Test Case
Butcher Tableau’s of Runge-Kutta Methods
The explicit Runge-Kutta (ERK) method:
0 0c2 a21 0c3 a31 a32 0...
.... . .
cs as1 as2 as3 · · · 0
b1 b2 b3 · · · bs
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The A-matrix in Runge-Kutta methods:
20 / 21
Test Case
Butcher Tableau’s of Runge-Kutta Methods
The diagonally implicit Runge-Kutta (DIRK) method:
c1 a11
c2 a21 a22
c3 a31 a32 a33
......
. . .
cs as1 as2 as3 · · · ass
b1 b2 b3 · · · bs
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The A-matrix in Runge-Kutta methods:
20 / 21
Test Case
Butcher Tableau’s of Runge-Kutta Methods
The singly diagonally implicit Runge-Kutta (SDIRK) method:
c1 γ
c2 a21 γ
c3 a31 a32 γ...
.... . .
cs as1 as2 as3 · · · γ
b1 b2 b3 · · · bs
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The A-matrix in Runge-Kutta methods:
20 / 21
Test Case
Butcher Tableau’s of Runge-Kutta Methods
The explicit singly diagonally implicit Runge-Kutta (ESDIRK) method:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
cs as1 as2 as2 · · · γ
b1 b2 b3 · · · bs
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The A-matrix in Runge-Kutta methods:
20 / 21
Test Case
Butcher Tableau’s of Runge-Kutta Methods
The fully implicit Runge-Kutta (FIRK) method:
c1 a11 a12 a13 · · · a1s
c2 a21 a22 a23 a2s
c3 a31 a32 a33 a3s...
.... . .
...cs as1 as2 as3 · · · ass
b1 b2 b3 · · · bs
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The A-matrix in Runge-Kutta methods:
20 / 21
Test Case
Fast Integration by ESDIRK
Only s− 1 implicit stages:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
1 b1 b2 b3 · · · γ
b1 b2 b3 · · · γ
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
21 / 21
Test Case
Fast Integration by ESDIRK
Only s− 1 implicit stages:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
1 b1 b2 b3 · · · γ
b1 b2 b3 · · · γ
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The first stage is explicit, which implies that:
X1 = xn
xn+1 = Xs
21 / 21
Test Case
Fast Integration by ESDIRK
Only s− 1 implicit stages:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
1 b1 b2 b3 · · · γ
b1 b2 b3 · · · γ
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The Butcher tableau is constructed such that:
X1 = xn
xn+1 = Xs
21 / 21
Test Case
Fast Integration by ESDIRK
Only s− 1 implicit stages:
0 0c2 a21 γ
c3 a31 a32 γ...
.... . .
1 b1 b2 b3 · · · γ
b1 b2 b3 · · · γ
b1 b2 b3 · · · bsd1 d2 d3 · · · ds
The state values Xi are obtained by sequential solution of the residual:
R(Xi) = g(Xi) − hnγf(Ti,Xi) − ψi = 0 i = 2, 3, . . . , s
ψi = g(xn) + hn
i−1∑
j=1
aijf(Tj ,Xj) i = 2, 3, . . . , s
21 / 21