Académique Documents
Professionnel Documents
Culture Documents
t
_
o
(1 c) S
o
_
+ div
_
(1 c)
o
k
r ,o
(S
o
)
o
V
o
_
= 0,
t
_
o
c S
o
+
g
S
g
__
+ div
_
c
o
k
r ,o
(S
o
)
o
V
o
_
+ div
_
g
k
r ,g
(S
g
)
g
V
g
_
= 0,
V
o
= K
_
P
o
g
_
, V
g
= K
_
P
g
g
_
,
S
o
+S
g
= 1.
Oil phase properties:
o
(P, c),
o
(P, c)
Gas phase properties:
g
(P),
g
(P)
Black Oil Model: thermodynamical equilibrium
If the oil and gas phases are both present, the thermodynamical equilibrium
imposes that c = c(P).
_
_
_
S
g
( c(P) c) = 0,
S
g
0,
( c(P) c) 0.
Black Oil Model
_
t
_
o
(P, c) (1 c) S
o
_
+ div
_
(1 c)
o
(P, c)
k
r ,o
(S
o
)
o
(P,c)
V
o
_
= 0,
t
_
o
(P, c) c S
o
+
g
(P) S
g
__
+ div
_
c
o
(P, c)
k
r ,o
(S
o
)
o
(P,c)
V
o
_
+ div
_
g
(P)
k
r ,g
(S
g
)
g
(P)
V
g
_
= 0,
V
o
= K
_
P
o
(P, c)g
_
, V
g
= K
_
P
g
(P)g
_
,
S
o
+S
g
= 1,
S
g
( c(P) c) = 0,
S
g
0,
( c(P) c) 0.
Remarks:
Only one set of unknowns P, S
o
, S
g
, c and equations because the oil phase
is always present.
No ash needed.
Black Oil Model: B
o
, B
g
and R
s
B
o
=
V
o
V
o,h,s
=
h,s
o
(P, c) (1 c)
, B
g
=
V
g
V
g,l ,s
=
l ,s
g
(P)
R
s
=
V
o,l ,s
V
o,h,s
=
1 c
c
l ,s
h,s
h,s
and
l ,s
are the oil and gas densities at surface conditions. T is xed.
Black Oil Model: phase properties in terms of B
o
, B
g
and
R
s
B
o
(P),
R
s
(P),
o
(P) are given at equilibrium (saturated oil).
B
g
(P) and
g
(P) are given.
For saturated oil (c = c(P) or P = P
b
(c))
and undersaturated oil (c < c(P) or P > P
b
(c))
B
o
(P, P
b
) =
B
o
(P
b
) +c
B
o
(P P
b
),
o
(P, P
b
) =
o
(P
b
) +c
o
(P P
b
)
_
o
(P, c) =
h,s
(1 c)
_
B
o
(P
b
(c)) +c
B
o
(P P
b
(c))
_
,
o
(P, c) =
o
(P
b
(c)) +c
o
(P P
b
(c)),
c(P) =
l ,s
h,s
R
s
(P) +
l ,s
,
P
b
(c) = c
1
(c),
g
(P) =
l ,s
B
g
(P)
.
Discretization of Black Oil model: 2D vespots test case
2D horizontal reservoir with 4 gas injectors at the corners and 1 producer
at the center.
Prescribed pressures P
inj
for the injection wells and P
prod
for the
production well
Initial state: under saturated oil at P
prod
< P
init
< P
inj
and
P
b
_
P
prod
, P
init
_
Gas will appear around the producer due to pressure drop
Gas front will propagate from injectors to producer and saturate the oil
phase behind the front
Discretization of Black Oil model: diusion uxes and
upwinding (without gravity)
Diusion uxes (without gravity for simplicity)
_
_
F
int
1
(),
= F
int
2
(),
= T
int
_
p
1
()
p
2
()
_
,
int
,
F
prod
w
= WI
prod
w
_
p
prod
(
w
)
p
prod
w
_
,
w
prod
,
F
inj
w
= WI
inj
w
_
p
inj
(
w
)
p
inj
w
_
,
w
inj
,
Upwinding (without gravity): for all
int
up
() =
_
1
() = si F
int
1
(),
> 0,
2
() = si F
int
1
(),
0.
Five Spots example:
prod
= one producer,
inj
= the four injectors.
Discretization of Black Oil Model: discrete system
(without gravity)
Heavy HC residual
_
_
R
h,
=
_
o
(P
, c
) S
o
(1 c
) m
n1
h,
_
||
t
+
int
(1 c
up
()
)
o
(P
up
()
, c
up
()
)
k
r
o
(S
o
up
()
)
o
(P
up
()
, c
up
()
)
F
int
,
+
prod
|
prod
(
w
)=
o
(P
, c
) (1 c
)
k
r
o
(S
o
o
(P
, c
)
_
F
prod
w
_
+
= 0,
Discretization of Black Oil Model: discrete system
(without gravity)
Light HC residual
_
_
R
l ,
=
_
o
(P
, c
) S
o
+
g
(P
) S
g
m
n1
l ,
_
||
t
+
int
up
()
o
(P
up
()
, c
up
()
)
k
r
o
(S
o
up
()
)
o
(P
up
()
, c
up
()
)
F
int
,
+
int
g
(P
up
()
)
k
r
g
(S
g
up
()
)
g
(P
up
()
)
F
int
,
+
prod
|
prod
(
w
)=
_
c
o
(P
, c
)
k
r
o
(S
o
o
(P
, c
)
+
g
(P
)
k
r
g
(S
g
g
(P
)
__
F
prod
w
_
+
= 0,
+
inj
|
inj
(
w
)=
g
(P
inj
w
)
k
r
g
(1)
g
(P
inj
w
)
_
F
inj
w
_
= 0,
Discretization of Black Oil Model: discrete system
(without gravity)
Local closure laws (volume conservation an thermodynamical equilibrium)
_
_
S
o
+S
g
= 1,
S
g
( c(P
) c
) = 0,
S
g
0,
( c(P
) c
) 0.
Discretization of Black Oil Model: Newton type algorithm
The oil phase is always present in all cells (S
or
> 0)
Gas phase indicator for all cell K
I
=
_
1 if gas phase is present
0 if gas phase is absent
Given I
for all cells, the closure laws are eliminated at the non linear level:
_
if I
= 1 : S
o
= 1 S
g
, c
= c(P
),
if I
= 0 : S
g
= 0, S
o
= 1,
the unknowns X
= 1 : X
=
_
P
, S
g
_
,
if I
= 0 : X
=
_
P
, c
_
.
Solution of the discrete system of equations: Newton type
algorithm
The conservation equations are linearized with respect to the set of
unknowns X =
_
X
_
K
taking into account the previous elimination of
the closure laws for a given I:
R
(X) =
_
R
h,
(X)
R
l ,
(X)
_
R =
_
R
_
K
, dX =
_
R
X
_
1
R
On each cell update of the unknowns P
, S
, c
0 and c c(P
),
K.
Solution of the discrete system of equations: algorithm
P = (P
)
K
, I = (I
)
K
, S = (S
= S
g
)
K
,c = (c
)
K
.
R =
_
R
h,
, R
l ,
_
K
.
Initialization of P = P
0
, I = I
0
, S = S
0
, c = c
0
and t at t = 0.
Time loop: while t < t
f
: t = t + t
Compute the initial residual R(P, S, c, P
0
, S
0
, c
0
, t) and its norm
R
0
= R
Newton Loop: while
R
R
0
< or Nit
newton
< Nit
max
Linearization of the residuals R(X) +
R
X
dX = 0
dX =
R
X
1
R
Update of P, S, c and I
Compute the residual R(P, S, c, P
0
, S
0
, c
0
, t) and its norm R
If Nit
newton
= Nit
max
and
R
R
0
> then Restart the time step: t = t t,
t = t/2, P = P
0
, I = I
0
, S = S
0
, c = c
0
Else new time step: update t and set P
0
= P, I
0
= I, S
0
= S, c
0
= c
Solution of the discrete system of equations: update of
P, S, c and I
dX = J
1
R
Newton update: for = 1, , N:
P
+ dX(2 1),
if I
= 1 then S
+ dX(2), c
= c(P
)
else c
+ dX(2), S
= 0.
Gas phase indicator update: for = 1, , N:
If I
= 1 then
if S
< 0 then
I
0, S
0, c
c(P
)
else if S
> 1 S
or
then
S
1 S
or
,
Else if I
= 0 then
if c
> c(P
) then
I
1, S
0, c
c(P
)
Solution of the discrete system of equations: computation
of the residual R(P, S, c, P
0
, S
0
, c
0
, t)
numbering of the cells: = 1, , N
numbering of the equations:
_
R
h
R(2k 1), = 1, , N
R
l
R(2k), = 1, , N
Loop on cells = 1, , N
_
=
o
(P
, c
),
=
g
(P
),
R(2 1) R(2 1) +
_
(1S
) (1c
)
o
(P
0
,c
0
) (1S
0
) (1c
0
)
_
||
t
R(2) R(2) +
_
(1S
) c
+
g
o
(P
0
,c
0
) (1S
0
) c
0
g
(P
0
) S
0
_
||
t
Solution of the discrete system of equations: computation
of the residual R(P, S, c, P
0
, S
0
, c
0
, t)
Loop on interior faces:
_
_
F
h
= (1 c
up
()
)
o
up
()
k
r
o
(1S
up
()
)
o
F
int
1
(),
F
l
=
_
c
up
()
o
up
()
k
r
o
(1S
up
()
)
o
+
g
up
()
k
r
g
(S
up
()
)
g
_
F
int
1
(),
R(2
1
() 1) R(2
1
() 1) +F
h
R(2
2
() 1) R(2
2
() 1) F
h
R(2
1
()) R(2
1
()) +F
l
R(2
2
()) R(2
2
()) F
l
w
)
k
r
g
(1)
g
_
F
inj
w
_
Producer well
w
_
_
_
R(2
prod
(
w
) 1) R(2
prod
(
w
) 1) +
o
(1 c
)
k
r
o
(1S
o
_
F
prod
w
_
+
R(2
prod
(
w
)) R(2
prod
(
w
)) +
_
c
k
r
o
(1S
o
+
g
k
r
g
(S
g
__
F
prod
w
_
+
Solution of the discrete system of equations: Newton
linearization R(X) +
_
R
X
_
dX = 0
Unknowns numbering for the Newton linearization: = 1, , N
_
_
_
dX(2 1) = dP
,
dX(2) =
_
dS
if I
= 1,
dc
if I
= 0.
Notation
_
X
1
, X
2
_
=
_
_
_
_
P, S
_
if I = 1 c = c(P),
_
P, c
_
if I = 0 S = 0.
Derivatives: example of
o
(P, c):
o
X
1
=
_
o
P
(P, c) +
o
c
(P, c)
c
P
(P)
_
I +
_
o
P
(P, c)
_
(1 I)
o
X
2
=
_
o
c
(P, c)
_
(1 I)
Solution of the discrete system of equations: Newton
linearization R(X) +
_
R
X
_
dX = 0
Jacobian: example of the accumulation term for R
h
:
_
(1 S
) (1 c
)
o
(P
0
, c
0
) (1 S
0
) (1 c
0
)
_
||
t
Loop on cells
J(2 1, 2 1) J(2 1, 2 1) +I
(1 S
)
c
P
(P
)
+(1 S
) (1 c
)
_
o
P
(P
, c
) +
o
c
(P
, c
)
c
P
(P
)
__
||
t
+(1 I
)
_
o
P
(P
, c
) (1 S
) (1 c
)
_
||
t
J(2 1, 2) J(2 1, 2) +I
(1 c
)
_
||
t
+(1 I
)
_
o
c
(P
, c
) (1 S
) (1 c
)
o
(1 S
)
_
||
t
Solution of the discrete system of equations: Newton
linearization R(X) +
_
R
X
_
dX = 0
Jacobian: example of the interior face ux term:
F
h
= (1 c
up
()
)
o
up
()
k
r
o
(1S
up
()
)
o
F
int
1
(),
Loop on interior faces :
1
=
1
(),
2
=
2
(),
up
=
up
()
G
h
= (1 c
up
)
o
up
k
r
o
(1S
up
)
o
J(2
1
1, 2
1
1) J(2
1
1, 2
1
1) +G
h
T
int
J(2
2
1, 2
2
1) J(2
2
1, 2
2
1) +G
h
T
int
J(2
1
1, 2
2
1) J(2
1
1, 2
2
1) G
h
T
int
J(2
2
1, 2
1
1) J(2
2
1, 2
1
1) G
h
T
int
to be continued ...
Solution of the discrete system of equations: Newton
linearization R(X) +
_
R
X
_
dX = 0
suite of the interior ux term F
h
=
_
I
_
(1 c
up
)
o
P
(P
up
, c
up
) + (1 c
up
)
o
c
(P
up
, c
up
)
c
P
(P
up
)
c
P
(P
up
)
o
up
_
+ (1 I
)
_
(1 c
up
)
o
P
(P
up
, c
up
)
__
k
r
o
(1S
up
)
o
F
int
1
,
= I
(1c
up
)
o
up
o
k
r
o
S
((1 S
up
)
_
F
int
1
,
+(1 I
)
_
up
+ (1 c
up
)
o
c
(P
up
, c
up
)
_
k
r
o
(1S
up
)
o
F
int
1
,
J(2
1
1, 2
up
1) J(2
1
1, 2
up
1) +
J(2
2
1, 2
up
1) J(2
2
1, 2
up
1)
J(2
1
1, 2
up
) J(2
1
1, 2
up
) +
J(2
2
1, 2
up
) J(2
2
1, 2
up
)
to be continued for all remaining terms of the Jacobian ...