Professional Documents
Culture Documents
Engineering Engineering
Problem Solution
Mathematical Numerical
Problem Solution
All Steps in Simulation are Important
• Solve the system of equations. More blocks means more accuracy, but
longer computation time
Simulation Schematic...
In Out x
In
In
Conservation law...
• {Rate In} - {Rate Out} = {Accumulation}
• For each component (oil, gas, water, energy)
• For each cell
Solving the PDEs that describe flow
T1 −T1
2 P1 b1
−T1 T2 −T3 P2 b
2 2
= 2 ⇒ Ax = b
−T3 T3 −T5/2 P3 b3
2
−T5 T4 P4 b4
2
What tools do I need to create my simulator?
• Simulators have lots of limitations. They can give very misleading results
and only an understanding of the problem and mathematics will help your
recognize when they do.
• Understanding the math and physics separates you from the technician
• Who knows you might be the smart person that creates the next
commercial reservoir simulator
Categories of Reservoir Simulators
• Commercial
– CMG
– Eclipse (Schlumberger)
– Intersect (Schlumberger + Chevron)
– Nexus (Halliburton)
• In House
– Empower (ExxonMobil)
– Cheers (Chevron)
– PSim (ConocoPhillips)
– MoReS – (Shell)
– Powers – (Saudi)
• Academic
– UT-CHEM (UT Chemical Flooding)
– IPARS (UT Multiscale Simulation)
– GPAS (UT compositional)
– TOUGH2 (Lawrence Berkley National Labs)
CHAPTER 1.
SINGLE PHASE FLOW
EQUATIONS
Single Phase Flow Equations
z Mass in
Control volume can be any
shape
Control
Volume Mass enters and leaves the
Mass out x control volume in any direction
y
Mass Balance in 1D
mx x A∆t − mx x +∆x
A∆t + m∆V ∆t = ρφ∆V t +∆t
− ρφ∆V t
generation
mass in mass out accumulation
mx x A∆t − mx A∆t + m∆V ∆t = ρφ∆V − ρφ∆V
Continuity Equation in 1D mass in
x +∆x
mass out
generation
t +∆t
accumulation
t
mx x − mx ρφ t +∆t − ρφ t
x +∆x
+m=
∆x ∆t
Making ∆x and ∆t very small, they become dx and dt
mx x − mx ∂mx ρφ t +∆t − ρφ t ∂ ( ρφ )
lim x +∆x
=− and lim =
∆x → 0 ∆x ∂x ∆t → 0 ∆t ∂t
Expressing mass flux in terms of velocity ( ), and subtracting
we get the continuity equation to be
Continuity Equation
Continuity Equation in Multi-Dimensions
∂( ρux ) ∂( ρu y ) ∂( ρuz ) ∂ ( ρφ )
− + + = −m
∂x ∂y ∂z ∂t
Other names:
- Mass Conservation Equation
- Material Balance Equation
Continuity Equation: What is ?
mass Mass
m= Time • Unit Volume
time-volume
Units of mass/time per volume
of the control volume
0 Distance
Darcy’s Law
kA∆Φ
Q=−
THE
PUBLIC FOUNTAINS
OF THE CITY OF DIJON
µL
EXPERIENCE AND APPLICATION
IN THE QUESTION
OF
AND
BY
HENRY DARCY
INSPECTOR GENERAL OF BRIDGES AND HIGHWAYS
The good quality o f water is one of things which contribute the most to
the health of citizen of a city. There is nothing that the magistrate
should have more of interest in then maintaining the quality of that
which is useful for the drink commune of man and of animal, and
remedies accidents by which these water can be altered, be in the read of
fountain, of river, of brook or they run, be in the place or be conserved
that that one in derive, be finally in the well of or be born of source.
(De JUSSIEU, Hist. de I'Acadimie. royale des sciences, 1733, p. 351.)
1856
Darcy’s Experiment
"The Public Fountains of the Town of Dijon”, Dalmont, Paris (1856)
Permeability (k)
kzz
k xx k xy k xz kx 0 0
k = k yx k yy k yz ≈ 0 ky 0
kxx
kyy
k zx k zy k zz 0 0 kz
Off-diagonal terms are only zero if we choose a coordinate system
that makes this true, but generally assume this is the case
Assuming homogenous and isotropic permeability and viscosity (NOT always the
case!)
Formation Volume Factor (Bw)
Surface/Standard Conditions
P = 14.7 psi; T = 60 °F; V = Vsc ρ SC
ρ RC =
depth Bw
Reservoir Conditions
P = PR ; T = TR ; V = VR
k ∂ 1 ∂p ∂ φ m
= −
µ ∂x Bw ∂x ∂t Bw ρ sc
k 1 ∂ 2 p ∂ 1 ∂p ∂ φ m
+ = −
µ Bw ∂x 2 ∂x Bw ∂x ∂t Bw ρ sc
And chain rule on the left hand side,
2
k 1 ∂2 p ∂ 1 ∂p ∂ φ m
+ = −
µ Bw ∂x 2 ∂p Bw ∂x ∂t Bw ρ sc
Expansion of the Time Derivative
A few definitions:
1 ∂VP 1 ∂φ
cr = = (rock compressibility)
VP ∂p φ ∂p
1 ∂V 1 ∂ρ ∂ 1 −1 ∂Bw
cf = − = = Bw = (fluid compressibility)
V ∂p T
ρ ∂p T
∂p Bw Bw ∂p
ct = cr + c f (total compressibility)
2
k 1 ∂2 p 1 ∂ 1 ∂P φ ∂ 1 1 ∂φ ∂p m
+ B = Bw + −
µ Bw ∂x 2 Bw w ∂p Bw ∂x Bw ∂p Bw φ ∂p ∂t ρ sc
cf cf cr
LT 2 LT 2
c f ≡ fluid compressibility cr ≡ rock compressibility
M M
1D Diffusivity Equation
≈0 slightly compressible fluid
2
k 1 ∂ 2 p c f ∂p φ ct ∂p m
+ = −
µ Bw ∂x Bw ∂x
2
Bw ∂t ρ sc
If the fluid is “slightly compressible” (liquid), the compressibility is small (< 10-5)
and constant and terms involving can be ignored.
∂ 2 p 1 ∂p
=
∂x 2
α ∂t
Generalized Diffusivity (Heat) Equation
In 2D (x-y plane)
P1 P2
More Pressure
V1 V2
1 ∂V 1 ∂ρ ∂ 1 −1 ∂Bw
cf = − = = Bw =
V ∂p T
ρ ∂p T
∂p Bw Bw ∂p
p ρ 1
∫ p0
c f dp = ∫
ρ0 ρ
dρ
Taylor Series Expansion
1 1
f ( x + ∆x) = f ( x) + f ′( x)∆x + f ′′( x)∆x 2 + f "'( x)∆x3 + ...
2! 3!
∂ρ 0 1 1
ρ ( p 0 + ∆p) = ρ ( p 0 ) + ( p )∆p + ρ "( p 0 )∆p 2 + ρ "( p 0 )∆p 3 + ...
∂p 2! 3!
∂ρ 0
Differentiate exponential equation for density:
∂p
( p ) = ρ cf e
0 c f ( p0 − p0 )
= ρ 0c f
For slightly compressible (cf < 10-5 psi-1) liquids, higher order terms are small:
Negligible for small cf
1 2 0 2 1 3 0 3
ρ ( p + ∆p) = ρ + c f ρ ∆p +
0 0
c f ρ ∆p + c f ρ ∆p + ...
0
2! 3!
Therefore,
1
ρ ≈ ρ 1+ cf ( p − p )
0 0
≈ 1 + c f ( p − p0 ) Bw0=1 (assume reference is
Bw standard conditions)
Simple 1D Problem: Core Flooding
PB1 PB2
“Heat” Equation
p=pinit
∂ 2 p 1 ∂p
=
∂x 2
α ∂t
x=0 x=L
Steady state
solution
Time
increasing
Real Reservoirs
k φ ct ∂p
∇ ( ∇p + ρ g ∇z ) = − qSC
µ Bw Bw ∂t
1. Break the reservoir into manageable blocks that have contain reservoir and fluid
properties
−TPN −1 + TPN = QN
α (2 n +1)n π 2t
∂ p 1 ∂p
2
4 pinit ∞
(−1)n
(2n + 1)π x
∂x 2
=
α ∂t
⇒ p ( ) B1
x , t = p −
π
∑
n = 0 2n + 1
e 4 L2
cos
2L
• Usually we transform the PDE into algebraic equations which are easier
to solve
• We “discretize” the derivatives
• Assume constant pressure and properties over an area/block
Solutions for PDEs ∂ 2 p 1 ∂p
=
∂x 2
α ∂t
p ( x, t ) time step
Grid block
x
x
Finite Difference Approximations
f(x)
∂P P( x + ∆x) − P( x)
≈
∂x forward ∆x
x x+∆x
x
• Secant connects P(x) to P(x+∆x). Slope of the secant line is the “rise”
over the “run”
∂P P( x + ∆x) − P ( x) 1 ∂2 P 1 ∂3 P
= − ( ∆x ) + ( ∆x ) 2
+
∂x x ∆x 2! ∂x x
2
3! ∂x x
3
Secant line
Tangent line
P(x)
∂P P( x) − P( x − ∆x)
≈
∂x backward ∆x
x-∆x x
• Secant now connects P(x) to P(x-∆x). Slope of the secant line is the
“rise” over the “run”
∂P P( x) − P ( x − ∆x) 1 ∂2 P 1 ∂3 P
= + ( ∆x ) − ( ∆x ) 2
+
∂x x ∆x 2! ∂x x
2
3! ∂x x
3
Tangent
P(x) line
Secant line
∂P P ( x + ∆x) − P( x − ∆x)
≈
∂x centered 2∆x
x-∆x x x+∆x
• Secant now connects P(x+∆x) to P(x-∆x). Slope of the secant line is the
“rise” over the “run”
You can subtract forward and backward Taylor series to get centered
∂P 1 ∂2 P 1 ∂3 P
P( x + ∆x) = P( x) + ∆x + ( ∆x ) 2
+ ( ∆x ) 3
+
∂x x 2! ∂x x
2
3! ∂x x
3
∂P 1 ∂2 P 1 ∂3 P
− P( x − ∆x) = P( x) − ∆x + ( ∆x ) 2
− ( ∆x ) 3
∂x x 2! ∂x 2 x 3! ∂x 3 x
∂P 2 ∂3 P
P( x + ∆x) − P( x − ∆x) = 2 ∆x + ( ∆x ) 3
+ ...
∂x x 3! ∂x x
3
∂P 1 ∂2 P 1 ∂3 P
P( x + ∆x) = P( x) + ∆x + ( ∆x ) 2
+ ( ∆x ) 3
+
∂x x 2! ∂x 2 x 3! ∂x 3 x
∂P 1 ∂2 P 1 ∂3 P
+ P( x − ∆x) = P ( x) − ∆x + (∆x) −
2
(∆x)3 + ...
∂x x 2! ∂x x
2
3! ∂x x
3
∂2 P
P( x + ∆x) + P( x − ∆x) = 2 P( x) + 2 (∆x) 2 + ...
∂x x
P(x,t)=?
∂ 2 p 1 ∂p
=
∂x 2
α ∂t
PDE is subject to initial and boundary conditions
L
∆x =
N
• Each block has a finite size, ∆xi. Although it can vary block to block, for
now we’ll assume ∆x1=∆x2= ∆xi=∆x
• Each block has constant fluid (e.g. µ, Bw) and rock properties (k, φ)
∂ 2 P Pi −1 − 2 Pi + Pi +1
≈
∂x 2
(∆x) 2 Subscript indicates
block index
∂P Pi n +1 − Pi n
= Superscript indicates
∂t ∆t time index
Pressure at “n+1” time level depends only Pressure at “n+1” time level depends on
on known pressures at “n” time level unknown pressures at “n+1” time level
Explicit Solution uses Pressure at Old Time Level
Called explicit method because one can solve explicitly for Pin+1
Pi n +1 − Pi n 1 Pi −n1 − 2 Pi n + Pi +n1
=
∆t α (∆x) 2
Rearranging for pressures at n+1 gives,
α∆t
Pi n +1 = Pi n + [ P n
i −1 − 2 Pi
n
+ P n
i +1 ]
(∆x) 2
α∆t
Pi1 = Pi 0 + [ P 0
i −1 − 2 Pi
0
+ P 0
i +1 ]
(∆x) 2
α∆t
P =P +
1
1
1
0
[ P0
0
− 2 P1
0
+ P 0
2 ]
(∆x) 2
α ∆t
PN1 = PN0 + [ PN
0
−1 − 2 PN
0
+ PN
0
+1 ]
( ∆x ) 2
What to do at the boundaries?
α∆t
P =P +
1
1
1
0
[ P0
0
− 2 P1
0
+ P 0
2 ]
(∆x) 2
x=0 x=L
∂P ∂P
P(0, t ) = PB1 or (0, t ) = 0 P ( L, t ) = PB 2 or ( L, t ) = 0
∂x ∂x
Boundary Conditions: Dirichlet (Constant Pressure)
P(0, t ) = PB1 P( L, t ) = PB 2
Dirichlet condition states P is known exactly at boundary. But grid pressures are
defined at center (not edge) of the block. Options?
1. Approximate pressure in block #1 (or block #N). This is only O(∆x) accurate:
P1 = PB1
2. Better approximation: edge pressure are average of two neighboring grid
pressures. O(∆x2) accurate!
P0 + P1
PB1 = ⇒ P0 = 2 PB1 − P1
2
N N+1
Recall Darcy’s law relates flux to
pressure gradient
−k dP dP
ux = ( L, t ) = 0
µ dx dx
dP
“No flux” implies zero pressure gradient at the boundary u x ( L, t ) = 0 ⇒ ( L, t ) = 0
dx
Use a finite difference formula for pressure gradient at the boundary
∂P PN − PN +1
≈ = 0 => PN = PN +1 Often called “reflection” technique
∂x ∆x
Finite difference equation at boundary then becomes:
n +1
P −P n PNn−1 − 2 PNn + ( PNn ) PNn−1 − PNn
N
=α
N
=α
∆t (∆x) 2 (∆x) 2
Stability of Explicit Method
• η is dimensionless
• Might want to make ∆x small for better accuracy, but that could make it unstable
• Would have to use really small time steps (∆t) to maintain stability which is a lot
of computations
In the implicit method, the spatial derivatives evaluated at the “n+1” time level
∂p ∂ p 2
Pi n +1 − Pi n Pi −n1+1 − 2 Pi n +1 + Pi +n1+1
=α 2 =α
∂t ∂x ∆t (∆x) 2
Implicit Eqn:
α∆t
where: η= dimensionless
(∆x) 2
This means that the pressure of block i at the next time level n+1 depends on the
pressure at the neighbors i-1 and i+1 also at time level n+1
Need more equations because we have 3 unknowns and 1 equation per grid
block
Implicit Solution for all Grid Blocks
We can write the same equation for all blocks from i=1 to i=N
P(0, t ) = PB1 P( L, t ) = PB 2
N N+1
Dirichlet BC Dirichlet BC
• PDE problem has been transformed into linear system of equations, APn+1=b
• Solve N×N system of equations for each time step. Need good solver for linear
system of equations
Transmissibility Form of Problem
−η Pi −n1+1 + (1 + 2η ) Pi n +1 − η Pi +n1+1 = Pi n [ ≡ psi]
Recall definition of η and α (diffusivity constant)
α∆t k ∆t
η= =
(∆x) 2 µφ ct (∆x) 2
Multiply both sides of balance equation by a constant:
A∆xφ ct Viφ ct
=
Bw ∆t Bw ∆t
Original equation for block “i” now has units of flow rate
kA V φc kA kA V φc ft 3
− Pi −n1+1 + i t + 2 Pi n +1 − Pi +n1+1 = i t Pi n ≡
µ Bw ∆x Bw ∆t µ Bw ∆x µ Bw ∆x Bw ∆t day
Transmissibility Form
kA V φc kA kA V φc
− Pi −n1+1 + i t + 2 Pi n +1 − Pi +n1+1 = i t Pi n
µ Bw ∆x Bw ∆t µ Bw ∆x µ Bw ∆x Bw ∆t
T Bi T T Bi
Bi B
−TPi −n1+1 + + 2T Pi n +1 − TPi +n1+1 = i Pi n
∆t ∆t
*Note: Don’t confuse Bw (fluid formation volume factor) with Bi (accumulation). They are different
Implicit Solution for all Grid Blocks
Consider a 4-block system with Dirichlet BC on left, Neumann on right
B1 n +1 n +1 B1 n
block #1 + 3T P1 − TP2 = P1 + 2TPB1
∆t ∆t
n +1 B2 n +1 n +1 B2 n
block #2 − TP 1 + + 2T P2 − TP3 = P2
∆t ∆t
n +1 B3 n +1 n +1 B3 n
block #3 − TP 2 + + 2T P3 − TP4 = P3
∆t ∆t
n +1 B4 n +1 B4 n
block #4 − TP 3 + + T P4 = PN
∆t ∆t
1 1
T+ B P n +1 = BP n + Q
∆t ∆t
1 n +1 1
T + B P = BP + Q
n
∆t ∆t
3 3 3 3
L L L ft
= + ≡
T T T day
Explicit vs. Implicit in Transmissibility form
1 1 1 1
TP n + BP n +1 = BP n + Q TP n +1 + BP n +1 = BP n + Q
∆t ∆t ∆t ∆t
1 1 1 1
BP n +1 = −T + B P n + Q T+ B P n +1 = BP n + Q
∆t ∆t ∆t ∆t
−1
P n +1 = P n + ∆tB −1 ( Q − TP n ) n +1 1 1
P = T+ B BP n + Q
∆t ∆t
Both the explicit and implicit method are O(∆x2) and O(∆t) accurate. The explicit method is conditionally
stable while the implicit method is unconditionally stable
Mixed Methods: Combination of Implicit and
Explicit Methods
Mixed methods weight explicit method by 0<θ<1 and implicit by 1-θ
1 1
θ TP n + BP n +1 = BP n + Q Explicit Method
∆t ∆t
+
1 1
(1 − θ ) TP n+1 + BP n +1 = BP n + Q Implicit Method
∆t ∆t
1 1
θ TP n + (1 − θ )TP n +1 + BP n +1 = BP n + Q Mixed Method
∆t ∆t
1 1
(1 − θ )T + B P =
n +1
B − θ T Pn + Q * If θ=1/2, it is called “Crank Nicholson”
∆t ∆t
Crank-Nicholson is More Accurate in Time
∂P P n +1 − P n
= + O(∆t )
∂t ∆t
Alternatively, we could take the current time to be “n+1/2” and then the
approximation is a “centered” difference. The spatial derivative would be
a hybrid of the “n” and “n+1” time level
n+ 1 n+ 1
∂P 2
P n +1
−P n
∂ P
2 2
1 Pi −n1 − 2 Pi n + Pi +n1 1 Pi −n1+1 − 2 Pi n +1 + Pi +n1+1
= + O(∆t 2 ) ≈ + + O(∆x 2 )
∂t ∆t ∂x 2 2 (∆x) 2
2 (∆x) 2
P − PB 2 x
PD = ; xD =
Pinitial − PB 2 L
αt
tD = = 0.1
L2
N = 30; ∆t D = 2.4 E − 5
Error is Proportional to ∆x2 for Implicit Method
Implicit
Method
slope-= 2.0
1
∑(P − PDi ,numerical )
2
error = Di , analytical
N i
P − PB 2 x
PD = ; xD =
Pinitial − PB 2 L
αt
tD = = 0.1
L2
N = 40 : 300; ∆t D = 2.4 E − 7
Error is Proportional to ∆t for Implicit Method
Implicit
Method
slope-= 1.0
1
∑(P − PDi ,numerical )
2
error = Di , analytical
N i
P − PB 2 x
PD = ; xD =
Pinitial − PB 2 L
αt
tD = = 0.1
L2
N = 5000; ∆t D = 1.5 E − 6 :1.0 E − 03
Summary
• Both the implicit and explicit equations can be written in “rate” units,
introducing transmissibility (T), accumulation (B), and source (Q)
terms
Goal: Write a mass balance on each grid block “i” at reservoir conditions
(RC) and attempt to recover finite difference matrix equations
i-1 i i+1
ρ RC qi −1/2 ∆t − ρ RC qi +1/2 ∆t + ρ RC qi RC ∆t = mi n +1 − mi n
mass into CV mass out of CV mass injected/produced accumulation n to n+1
Control Volume Approach
ρ RC qi −1/2 ∆t − ρ RC qi +1/2 ∆t + ρ RC qi RC ∆t = mi n +1 − mi n
kA
qi −1/2 = ( Pi − Pi −1 ) = Ti −1 2 Bw ( Pi − Pi −1 ) (Darcy’s law)
µ∆x
qi RC = BwQi SC (formation factor converts from standard to reservoir conditions)
( ρ RCφ ) − ( ρ RCφ )
n +1 n
ρ RC BwTi −1/2 ( Pi − Pi −1 )∆t + ρ RC BwTi +1/2 ( Pi − Pi +1 )∆t + ρ RC BwQi SC ∆t = Vi
i
Therefore,
n +1 n
φ φ c f φ n +1 φ 0 cr
Bw
−
Bw
=
Bw 0 (P n +1
−P n
)+ B n (P n +1
− Pn )
w
And Some More Manipulation
n +1 n
φ φ c f φ n +1 φ 0 cr
Bw
−
Bw
=
Bw 0 (P n +1
−P n
)+ B n (P n +1
− Pn )
w
If Bw0 and ϕ0 are evaluated at a reference pressure,P0, near Pn then Bw0 = Bw and
φ0 =φ
n +1 n
φ φ φ φ ct
Bw
−
Bw
=
Bw
( c f + cr ) ( P n+1 − P n ) = Bw
(P n +1
− Pn )
Mass balance then becomes the same as was found from finite differences
Viφ ct n +1
Ti −1/2 ( Pi −1 − Pi ) + Ti +1/2 ( Pi +1 − Pi ) = ( Pi − Pi n ) − Qi SC
Bw ∆t
Explicit, Implicit, and Mixed Methods
Implicit Method
n +1 n +1 n +1 n +1 Viφ ct n +1
Ti −1/2 ( P
i −1 − Pi ) + Ti +1/2 ( P
i +1 − Pi )= ( Pi − Pi n ) − Qi SC
Bw ∆t
−1
1 1
P n +1 = T + B BP n + Q
∆t ∆t
Explicit Method
Viφ ct n +1
Ti −1/2 ( Pi −n1 − Pi n ) + Ti +1/2 ( Pi +n1 − Pi n ) = ( Pi − Pi n ) − Qi SC
Bw ∆t
P n +1 = P n + ∆tB −1 Q − TP n ( )
Mixed Method
1 1
(1 − θ )T + B P n +1 = B − θ T Pn + Q
∆t ∆t
CHAPTER 5.
HETEROGENEITIES
Heterogeneities in Reservoir Simulation
i-1 i i+1
ki −1 ≠ ki ≠ ki +1
Consider flow from center of block “i” to “i+1” which is governed by Darcy’s Law
i i+1
i+1/2
ki + 1 A q µ Bw ∆x
q= ( P − P ) ⇒ ( Pi +1 − Pi ) =
2
µ Bw ∆x i +1 i ki + 1 A
2
Averaging Permeability: Harmonic Average
∆x/2 ∆x/2
q µ Bw ∆x q µ Bw ∆x
( Pi +1/2 − Pi ) = ( Pi +1 − Pi +1/2 ) =
2 ki A 2ki +1 A
i i+1 Pressure drop in green “half block” Pressure drop in yellow “half block”
i+1/2
ki + 1 A
Interblock transmissibility can now be defined as: Ti +1/2 = 2
µ Bw ∆xi + 1
2
Where the interblock grid size is an arithmetic means and interblock permeability
is a harmonic mean:
∆xi ∆xi +1
+
∆xi + ∆xi +1 ki + 1 = 2 2 = ∆xi + ∆xi +1
∆xi + 1 = 2 ∆xi ∆xi +1 ∆xi ∆xi +1
2 2 + +
2ki 2ki +1 ki ki +1
What if Area Changes Too?
Cross sectional area (Ai) can vary from one grid block to the next
1 kA kA 2ki Ai ki +1 Ai +1
Ti +1/2 = =
µ Bw i+ 1
∆x i+ 1 ∆x i+ 1 ki Ai ∆xi +1 + ki +1 Ai +1∆xi
2 2 2
Fluid Properties Can Vary from Block to Block
1 kA
Ti +1/2 =
µ Bw i+ 1
∆x i+ 1
2 2
1 1 1
=ω + (1 − ω )
µ Bw i+ 1
µ Bw i
µ Bw i +1
2
N qN + 1 = TN +1/2 ( PN − PN +1 ) = 0 ⇒ TN +1/2 = 0
2
Replace flow equation between blocks with equation describing flow from
edge to center of block, all of which has permeability k1. But the distance
traveled is ∆x/2 so the effective transmissibility is 2T1
PB1
CHAPTER 6.
2D AND 3D FLOW
2D Flow problems
Could discretize the PDE using finite differences, but here we’ll use the
“control volume” approach. Either way, we get a system of equations of
the form:
1 1
T+ B P n +1 = BP n + Q
∆t ∆t
Where T is “pentadiagonal” in 2D
Block Numbering for 2D Grids
j=1 1 2 3
• We’ll use both block numbering systems
interchangeably in slides that follow i=1 i=2 i=NX=3
• “i,j” numbering useful when writing mass
balance and interblock T’s
• “l” numbering useful for creating matrix
Equations for 2D Grids: Control Volume Approach
i,j+1 or l+NX Flux in/out of grid “l”
qi −1/2, j = TX i −1/2, j ( Pi −1, j − Pi , j ) = TX i −1/2, j ( Pl −1 − Pl )
Accumulation
i-1,j or l-NX Vi , j ctφi , j Vl ctφl n +1
( Pi ,nj+1 − Pi ,nj ) = ( Pl − Pl n )
Bw ∆t Bw ∆t
8 7 8 9
4 5 6
Note: Block l=5 is also block
4 5 6
i=2, j=2
1 2 3
Grouping terms & multiplying through by “-1” gives eqn for block #5
n +1 n +1 V5ctφ5 n +1 n +1 n +1 V5ctφ5 n
TP2 + TP4 − + 4T P5 + TP6 + TP8 = P5 + Q5
Bw ∆t Bw ∆t
“No Flow” Boundary Blocks 10 11 12
7 8 9
• Block #l=11 is also i=2, j=4
j=4 10 11 12
• Neighbors to left, right, 4 5 6
bottom
• No flow BC on top
1 2 3
j=3 8
n +1 n +1 V11ctφ11 n +1 n +1 V11ctφ11 n
−TP 8 − TP
10 + 3T + P11 − TP12 = P11 + Q11
Bw ∆t Bw ∆t
“Constant” Pressure Boundary Condition 10 11 12
12 7 8 9
• Block #9 has no neighbor to its right
• But, pressure at boundary is fixed (PB)
• Q= 2T (PB-P9) 4 5 6
8 9 P=PB • “2T” appears because the boundary is only
a half ∆x away from block center
1 2 3
6
n +1 n +1 V9 ctφ9 n +1 n +1 V9 ctφ9 n
−TP6 − TP8 + 5T + P9 − TP12 = P9 + Q9 + 2TPB
Bw ∆t Bw ∆t
What about corner grids? 10 11 12
1 2 3
7
V10 ctφ10 n +1
T ( Pleft − P10 ) + T ( P11 − P10 ) + T ( P7 − P10 ) + T ( Ptop − P10 ) = ( P10 − P10n ) − Q10
Bw ∆t
V10 ctφ10 n +1 V cφ
−TP7n +1 + 2T + P10 − TP11n +1 = 10 t 10 P10n + Q10
Bw ∆t Bw ∆t
Final T Matrix is Pentadiagonal
2T −T −T
−T 3T −T −T
−T 4T −T
−T 3T −T −T
−T −T 4T −T −T
• Pentadiagonal, banded matrix
−T −T 5T −T
• Diagonally dominant
T= • Symmetric
−T 3T −T −T
−T −T 4T −T −T
−T −T 5T −T
−T 2T −T
−T −T 3T −T
−T −T 4T
1 1
T+ B P n +1 = BP n + Q
∆t ∆t
2T −T −T
−T 3T −T −T
10 11 12
−T 4T −T
−T 2T −T 0
7 8 9 −T −T 4T −T −T
−T −T 5T −T
T=
0 0 0 0
4 5 6 −T 0 3T −T −T
−T −T 5T −T
0 T −T
1 2 3 −T −T 3T −T
−T −T 4T
Summary and Important Notes
• 2 different numbering systems are useful in 2D geometries “i,j” and “l”. They are
related:
• “No flow” boundary conditions are most common. Some commercial simulators
do not even have option of “constant pressure”
• “Areal” models view the reservoir from above. “Side-view” models are
sometimes used too, but then gravity must be included
• Well is a line source or sink inside the grid block. Mass flux
for the source/sink is distributed over the whole grid block
Well constraints
φµ ct ∂P 1 ∂ ∂P
= r =0
k ∂t r ∂r ∂r
∂P q µB
BC #1: lim r =− w w
r →0 ∂r 2π kh
BC # 2 : P = Pref @ r = rref
P(r)
qw µ Bw r
P(r ) = Pref − ln
2π kh rref
Pressure is known (Pref) at reference radius, rref r
Radial Flow around Well
Consider the analytical solution for radial flow at steady state:
qw µ Bw r
P(r ) = Pref − ln
2π kh rref
Pwf
But how do we compute req?
rw req
Steady Mass Balance on Grids w/ Wells in 2D
Now consider steady state (no accumulation) flow in a grid, “l”. Flow “in-
out” from its 4 neighbors is equal to that injected/produced from a well
qw + ( q1 + q2 + q3 + q4 ) = 0
q3
kh∆x
q1 = ( P1 − Pl )
µ Bw ∆y
kh∆y
q2 = (P − P ) q4 q2
µ Bw ∆x 2 l
kh∆x
q3 = ( P3 − Pl )
µ Bw ∆y
q1
kh∆y
q4 = ( P4 − Pl )
µ Bw ∆x
If the block is square, ∆x=∆y, then the mass balance reduces to:
kh
qw = − ( P1 + P2 + P3 + P4 − 4 Pl )
µ Bw
Radial Flow around Well to Adjacent Blocks
Recall our radial solution for pressure around a well
qw µ Bw r
P(r ) = Pref − ln
2π kh rref
Now, let the reference pressure be the average block pressure of grid “l”, Pl. The
reference radius is the equivalent radius, req, which again is the radius where the
pressure is equal to the average block pressure rw
r eq
rw req ∆x
Basic Well Model
Recall the equation from the mas balance:
kh
qw = − ( P1 + P2 + P3 + P4 − 4 Pl ) q3
µ Bw req
q µB ∆x
rw
q µB ∆x P4 = Pl − w w ln q1
P2 = Pl − w w ln
2π kh req 2π kh req
∆x
Substituting into the mass balance gives:
kh 4
qw µ Bw ∆x
qw = −
µ Bw
∑
j =1
Pl −
2π kh
ln
req
− 4 Pl
Basic Well Model
kh 4
qw µ Bw ∆x kh 4qw µ Bw ∆x
qw = −
µ Bw
∑
j =1
Pl −
2π kh
ln
req
− 4 Pl = −
µ Bw
4 Pl −
2π kh
ln
req
− 4 Pl
2 qw∆x
qw = ln
π req
Pressure Constraint
We can solve for well rate Pwf
2π kh
qw = − ( Pl − Pwf ) = − J lw ( Pl − Pwf )
0.2078∆x
µ Bw ln
rw
Basic Well Model in Simulation Equations
n +1 n +1 n +1 n +1 1
T (P l −1 − Pl ) + T (P
l +1 − Pl ) = Bl ( Pl n +1 − Pl n ) − Ql
∆t
1
T ( Pl −1n +1 − Pl n +1 ) + T ( Pl +1n +1 − Pl n +1 ) = Bl ( Pl n +1 − Pl n ) + J lw ( Pl n +1 − Pwf )
∆t
Forming the System of Equations
n +1 n +1 n +1 n +1 1
T (P
l −1 − Pl ) + T (P
l +1 − Pl ) = Bl ( Pl n +1 − Pl n ) − J lw ( Pwf − Pl n +1 )
∆t
1 1
−TPl −n1+1 + (2T + J lw + Bl ) Pl n +1 − TPl +n1+1 = Bl Pl n + J lw Pwf
∆t ∆t
We get a system of equations of the usual form, but with a new diagonal J matrix
1 1
T+J+ B P n +1 = BP n + Q
∆t ∆t
Consider a 1D, 4-block homogeneous problem with no-flow BCs a constant BHP
well in block #3
T −T 0 B1 0
−T 2T −T 0 B2 0
T= J= B= Q=
−T 2T −T J3 B3 J 3 Pwf
−T T 0 B4 0
• B and T matrix are no different now that wells are present
• J is a diagonal matrix and diagonal elements are non-zero if a BHP well exists
in that block. In which case Ji is always positive
(k k x ) ∆x + ( k x k y ) ∆y
1 1 2
2 2 2 2
2π h k x k y y
J =
w
; req = 0.28
( k y kx ) 4 + ( kx k y )
l 1 1
req 4
µ Bw ln +s
rw
kx≠ky
2π∆x k y k z
J lw = ;
req
µ Bw ln +s 0
rw
0
1
(k k y ) 2 ∆y 2 + ( k y k z ) 2 ∆z 2
1 1 2
0
z
req = 0.28 J4
(k k y ) 4 + ( k y kz )
1 1
4 J= J5
z
J6
0
• Assumes that well is in x-direction, not
y-direction 0
• ∆z = h, the reservoir thickness in 2D 0
5. Extended to multidimensions
Modeling Approaches:
1. Compositional: Models several
individual components. Accurate but very Component 1
slow and computationally demanding
• Component : any identifiable chemical
entity
• Phase : a homogeneous region of matter
Single Phase
• Can have gas component in the oil phase! Region
• Balance on the component, not the phase
Two Phase
2. Black Oil: Models 3 components (oil, Region
gas, and water) in 3 phases: Oil (oileic), Component 2 Component 3
Water (aqueous), and Gas (gaseous)
Black Oil Models (or β-model)
(ρ u
w w x − ρ wu w x +∆x ) A∆t + mw, well ∆V ∆t = ( ρ w S wφ∆V t +∆t
− ρ w S wφ∆V t )
mass in-out mass in from well mass accumulated
water in aqueous phase water in aqueous phase water in aqueous phase
∂ ( ρ wu w ) ∂ ( ρ wφ S w )
− + mw, well =
∂x ∂t
Water Formation Volume Factor (Bw)
We measure volume at surface but do the mass balance at the reservoir
Surface/Standard Conditions
P = 14.7 psi; T = 60 °F; V = Vsc
depth
Reservoir Conditions
P = PR ; T = TR ; V = VR
[Vw ]
RC
reservoir volume of aqueous phase ρ w SC
Bw = = = RC
[Vw ] ρw
SC
std. volume aqueous phase
ρ w SC
Bw = RC
ρw
We get balance equation in terms of formation volume factor
∂ uw ∂ φ Sw
− + qw =
∂x Bw ∂t Bw
Mass Balance of Oil
Balance of oil component:
(ρ u
o o x − ρ o uo x +∆x ) A∆t + m o , well ∆V ∆t = ( ρo Soφ∆V t +∆t
− ρo Soφ∆V t )
mass in-out mass in from well mass accumulated
oil in oileic phase oil in oileic phase oil in oileic phase
∂ ( ρ o uo ) ∂ ( ρoφ So )
Divide by A∆x∆t and taking limits: − + mo , well =
∂x ∂t
Formation Volume Factors and Solubility Ratios
VoSC V SC
V SC
ρ SC
+ R ρ SC
ρ SC
R ρ SC
ρolRCeic =ρoSC RC
+ ρ gSC RC ⋅ oSC =
dg o s g
= o + s g
Voleic Voleic Vo Bo Bo Bo
ρoRC RC
ρ dg
∂ ( ρ o uo ) ∂ ( ρoφ So )
− + mo , well =
∂x ∂t
ρo SC
Bo = RC
ρo
We get balance equation in terms of formation volume factor
∂ uo ∂ φ So
− + qo =
∂x Bo ∂t Bo
Mass Balance of Gas
Balance of gas component:
(
= mg
t +∆t
− mg
t
) + (m dg t +∆t − mdg
t
)
mass accumulated mass accumulated
gas in gaseos phase dissolved gas in oil phase
(ρ u
g g x − ρ g ug
x +∆x
) A∆t + ( ρ u
dg o x − ρ dg uo
x +∆x
) A∆t + mg , well ∆V ∆t + mdg , well ∆V ∆t =
mass in-out mass in-out mass in from well mass in from well
gas in gaseous phase dissolved gas in oileic phase gas in gaseous phase dissolved gas in oil phase
( ρ S φ∆V
g g t +∆t
− ρ g S gφ∆V
t
) + (ρ dg Soφ∆V
t +∆t
− ρ dg Soφ∆V
t
)
mass accumulated mass accumulated
gas in gaseos phase dissolved gas in oil phase
Mass Balance of Gas
(ρ u
g g x − ρ g ug
x +∆x
) A∆t + ( ρ u
dg o x − ρ dg uo
x +∆x
) A∆t + mg , well ∆V ∆t + mdg , well ∆V ∆t =
mass in-out mass in-out mass in from well mass in from well
gas in gaseous phase dissolved gas in oileic phase gas in gaseous phase dissolved gas in oil phase
( ρ S φ∆V
g g t +∆t
− ρ g S gφ∆V
t
) + (ρ dg Soφ∆V
t +∆t
− ρ dg Soφ∆V
t
)
mass accumulated mass accumulated
gas in gaseos phase dissolved gas in oil phase
∂ ( ρ g u g + ρ dg uo ) ∂
−
∂x
+ mg , well + mdg , well =
∂t
( ρ gφ S g + ρ dgφ So )
Solution Gas-Oil Ratio (Rs)
∂ ( ρ g u g + ρ dg uo ) ∂
− + mg , well + mdg , well = ( ρ gφ S g + ρ dgφ So )
∂x ∂t
ρ gSC Rs ρ gSC
ρg = ρ dg =
Bg Bo
We get:
∂ ug u ∂ 1 R
− + Rs o + qg , well + Rs qo , well = φ S g + s So
∂x Bg Bo ∂t Bg Bo
Summary of 3 Phase Balance Equations
∂ uw ∂ φ Sw
water: − + qw =
∂x Bw ∂t Bw
∂ uo ∂ φ So
oil: − + qo =
∂x Bo ∂t Bo
∂ ug uo ∂ 1 Rs
gas: − + Rs + qg + Rs qo = φ S g + So
∂x Bg Bo ∂t Bg Bo
Darcy’s Law for Multiphase Flow
−kkrw ∂pw ∂z
uw = − ρw g
µw ∂x ∂x
−kkro ∂po ∂z
uo = − ρo g
µo ∂x ∂x
−kkrg ∂pg ∂z
ug = − ρg g
µg ∂x ∂x
u = velocity [L/time] k = perm [L2] D = depth [L] µ = viscosity [M/L/time] g = gravity [L/time2]
Pressure Dependent Fluid Properties
Brooks-Corey Relative Permeability Model
𝑘𝑘𝑟𝑟𝑟𝑟𝑟𝑟 𝑘𝑘𝑟𝑟𝑟𝑟𝑟𝑟
𝑘𝑘𝑟𝑟𝑟𝑟
𝑘𝑘𝑟𝑟𝑟𝑟
•
Pc ( S w ) = Po − Pw
1
1 −1 n
Pc = S m
−1
α
(Aziz and Settari, 1979)
Note: “n” and “m” parameters are different than in Corey-
Brooks relative permeability model
Substituting Darcy’s Law into Mass Balance:
PDEs (without gravity) describing 3-phase flow in porous media
∂ φ Sw ∂ 1 kkrw ∂Pw
= + qw
∂t Bw ∂x Bw µ w ∂x
∂ φ So ∂ 1 kkro ∂Po
= + qo
∂t Bo ∂x Bo µo ∂x
Rarely can these coupled PDEs be solved analytically. An exception is the Buckley-Leverett problem
Assumptions
1. 2-phase flow only (oil and water)
2. 1D flow
3. Incompressible fluids
4. no capillary pressure/gravity,
5. no sources or sinks
Water
Water +
Oil
Buckley-Leverett Theory for 1D Displacement
Initial Water
qw qf w
uw = =
A A
Mass balance equation for water can be simplified:
∂S w q ∂f w
φ =−
∂t A ∂x
φ = porosity Sw= wat. sat. B = vol. factor [rB/STB] x = dist. [ft] u = velocity [ft/day] fw=fract. flow A=Area [ft2] q = flow rate [ft3/day]
Buckley-Leverett Equations
Using chain rule, the mass balance equation becomes:
∂S w q ∂f w ∂S w
=−
∂t Aφ ∂S w ∂x
Note that Sw = f(x,t), so the partial (dSw)can be expanded as:
∂S w ∂S
dS w = dx + w dt
∂x ∂t
Search for velocity front of constant saturation (i.e. dSw = 0). Setting the
above expression to zero we get:
∂x ( ∂Sw / ∂t ) Sw q ∂f w
u= =− =
∂t Sw ( ∂S w / ∂x ) S Aφ ∂S w w
xD = x / L ≡ dimensionless distance
qt pore volumes injected
tD = ≡
φ AL pore volume of core
Dimensionless velocity front can then be written as:
∂x q ∂f w ∂xD ∂f w
= =
∂t Sw Aφ ∂S w ∂t D Sw
∂S w
∂f w
xD ( S w ) = t D
∂S w Sw
φ = porosity Sw= wat. sat. t = time x = dist. [ft] u = velocity [ft/day] fw=fract. flow A=Area [ft2] q = flow rate [ft3/day]
Fractional flow curve is function of Sw through
relative permeability
krw
qw µw
f w ( Sw ) = =
qo + qw krw +
kro
µw µo
∂f w
∂S w Sw
φ = porosity Sw= wat. sat. B = vol. factor [rB/STB] x = dist. [ft] u = velocity [ft/day] fw=fract. flow A=Area [ft2] q = flow rate [ft3/day]
Steps for Generating Saturation Profile at
Snapshot in time (tD)
qt
1. Choose a time/dimensionless time to make the plot t D =
φ AL
2. Create fractional flow curve (fw vs. Sw) using relative permeability curves
krw
µw
f w ( Sw ) =
krw kro
µw + µo
𝜕𝜕𝑓𝑓
3. At a given Sw (e.g. 1-Sor), compute 𝜕𝜕𝑆𝑆𝑤𝑤 |𝑆𝑆𝑤𝑤 , numerically (slope of tangent to
𝑤𝑤
the fractional flow curve)
∂f w
xD ( S w ) = t D
∂S w Sw
5. Repeat for all Sw (Swr < Sw < 1-Sor) to make an “Sw versus xD” curve
Resulting saturation plot is non-physical; at a given
distance in the core, more than one saturation exists
Swf
xDf
In realty, a shock front occurs at some xDf at snapshot in time, tD. Saturation has a
“step change” from Swf to Swi at that distance xDf. But how do we determine xDf?
Fractional Flow Curve has an inflection point. As a
result, the derivative goes through a maximum
∂f w
∂S w S
w
φ = porosity Sw= wat. sat. B = vol. factor [rB/STB] x = dist. [ft] u = velocity [ft/day] fw=fract. flow A=Area [ft2] q = flow rate [ft3/day]
Obtaining a “Physical” Solution and determine Swf
Mass balance on water in the core where Sw=Swf
We know from shock front that Sw goes from Swi to Swf and therefore fw goes
from fwi to fwf. Mass balance becomes:
q ( f wf − f wi ) ∆t = Aφ ( S wf − S wi ) ∆x
∆x u ( f wf − f wi ) ∆xD f wf
= ⇒ =
∆t φ ( S wf − S wi ) ∆t D ( S wf − S wi )
Obtaining a “Physical” Solution Swi
xDf, Swf
We have two equations describing velocity at “shock front” and they must
be equal for mass conservation
∆xD f wf ∂xD ∂f w
= =
∆t D ( S wf − S wi ) ∂t D S wf
∂S w S wf
∂f w
f wf =
∂S w
(S wf − S wi )
S wf
So right at the shock front (xD=xDf, Sw=Swf), the slope of the line tangent to the
fractional flow curve must equal the line intersecting (Swi, fwi); i.e. the point of
interest (Swf, fwf)
krw ( S w )
qw µw
Fractional Flow Curve f w ( Sw ) = =
qw + qo krw ( S w ) kro ( S w )
+
µw µo
∂f w f wf
=
∂S w S wf
S wf − S wi
Swf
Steps for Generating Saturation Profile
𝜕𝜕𝑓𝑓
2. For all Sw > Swf, compute 𝜕𝜕𝑆𝑆𝑤𝑤 |𝑆𝑆𝑤𝑤 , numerically
𝑤𝑤
4. Plot Sw versus xD using points obtained from #3 and use Sw=Swi for
xD>xDf
Water Saturation Profile from BL Theory
∂f w
xD ( S w ) = t d if S w > S wf
Swf ∂S w Sw
S w = S wi otherwise
xDf
Steps in Reservoir Initialization (Pw, Po, Sw)
Pw = Pw,WOC @ z = WOC
2. At the WOC, Pc = PD( the “capillary entry pressure”):
Po = Pw,WOC + PD @ z = WOC
3. Compute Po and Pw at various depths (grid block centers) using the
hydrostatic head
Poi = Po ,WOC + ρo g ( z i − zWOC )
Pwi = Pw,WOC + ρ w g ( z i − zWOC )
Gas-oil transition zone (Water at residual sat, gas and oil depend on capillary
pressure. P<Pb)
Oil zone (Water at residual sat, gas in solution P>Pb, Only oil is
movable)
Water-oil zone (Water and oil are movable, saturation depends on capillary pressure)
1. Identify Pw at a reference
Pc
ow
= Po − Pw = ∆ρow gz point, e.g. the WOC
Pw = Pw,WOC @ z = WOC
2. At the WOC, Pc = Pd
(“capillary entry pressure”)
Po = Pw,WOC + PD @ z = WOC
Oil
= ρ gz
PPressure
o o
3. Compute Po and Pw at various
depths (grid block centers)
using the hydrostatic head
WOC Pd Poi = Po ,WOC + ρo g ( z i − zWOC )
Water Pressure Pwi = Pw,WOC + ρ w g ( z i − zWOC )
Pw = ρ w gz
4. Compute Pc at all depths:
z
Pci = Poi − Pwi
Pw Po P
Pc Found Using Density Differences
Pcow
,i + 2
Pcow
,i +1 Pd
S w ,i + 2 S w,i +1
WOC
P
Pci = f ( S wi )
Saturation Profile with Depth
Get z
Compute Pc
Read Sw
From Pc
table
WOC
Swir 1 Sw
Steps in Reservoir Initialization (Pw, Po, Sw)
Pw = Pw,WOC @ z = WOC
2. At the WOC, Pc = PD( the “capillary entry pressure”):
Po = Pw,WOC + PD @ z = WOC
3. Compute Po and Pw at various depths (grid block centers) using the
hydrostatic head
Poi = Po ,WOC + ρo g ( z i − zWOC )
Pwi = Pw,WOC + ρ w g ( z i − zWOC )
∂ φ So ∂ kkro ∂p
OIL: = + qo
∂t Bo ∂x µo Bo ∂x
∂ φ Sw ∂ kkrw ∂p
WATER: = + qw
∂t Bw ∂x µ w Bw ∂x
Expand the time derivative (No Gravity or Pc)
∂ φ So ∂ kkro ∂p
OIL: = + qo
∂t Bo ∂x µo Bo ∂x
Expand the time derivative using the product rule (Oil Equation)
∂ φ So φ ∂ ∂ 1 S ∂
= ( So ) + φ So + o (φ )
∂t Bo Bo ∂t ∂t Bo Bo ∂t
∂ φ So φ ∂So ∂ 1 S ∂φ ∂p
= + φ So + o
∂t Bo Bo ∂t ∂p Bo Bo ∂p ∂t
∂ 1 ∂ 1 1 ∂φ
co = Bo ; cw = Bw ; cr = ;
∂p Bo ∂p Bw φ ∂p
Oil and water balance equations become
φ ∂So φ So φ So ∂p ∂ kkro ∂p
Oil: + co + cr = + qo
Bo ∂t Bo Bo ∂t ∂x µo Bo ∂x
Water: φ ∂S w φ Sw φ Sw ∂p ∂ kkrw ∂p
+ cw + cr = + qw
Bw ∂t Bw Bw ∂t ∂x µ w Bw ∂x
Determining Component and Overall Balances:
Multiplying the “oil” equation by Bo/Bw and add mass balances become:
φ ∂S w φ Sw φ Sw ∂p ∂ kkrw ∂p
Water: + cw + cr = + qw
Bw ∂t Bw Bw ∂t ∂x µ w Bw ∂x
+
Bo φ ∂So Bo φ So φS ∂p Bo ∂ kkro ∂p B
Oil: + co + o cr = + o qo
Bw Bo ∂t Bw Bo Bo ∂t Bw ∂x µo Bo ∂x Bw
=
Overall (total) balance:
φ ∂So ∂S w φ So φS φS φS ∂p Bo ∂ kkro ∂p ∂ kkrw ∂p B
+ + co + w cw + o cR + w cR = + + o qo + qw
Bw ∂t ∂t Bw Bw Bw Bw ∂t Bw ∂x µo Bo ∂x ∂x µ w Bw ∂x Bw
terms cancel φ ct
Bw
∂So ∂S w
(1) + = 0 since Sw +So =1
∂t ∂t
(2) define: ct = So co + S wcw + cr
Summary of oil, water, and “overall” balance
φ ∂So φ So φ So ∂p ∂ kkro ∂p
Oil: + co + cr = + qo
Bo ∂t Bo Bo ∂t ∂x µo Bo ∂x
Water: φ ∂S w φ Sw φ Sw ∂p ∂ kkrw ∂p
+ cw + cr = + qw
Bw ∂t Bw Bw ∂t ∂x µ w Bw ∂x
Note: We can use any 2 of the above 3 equations to define the problem. Usually
we will use the overall balance with one component balance (e.g. water)
Focusing on the “Overall” Balance (Pressure Eqn)
Bo ∂ kkro ∂p ∂ kkrw ∂p φ c ∂p B
Overall: + = t − o qo − qw
Bw ∂x µo Bo ∂x ∂x µ w Bw ∂x Bw ∂t Bw
Bo ∂ kkro ∂p
=
1 Bo
λo ,i −1 2
(P n +1
i −1 − Pi n +1 )
+ λo ,i +1 2
(P n +1
i +1 − Pi n +1 )
Bw ∂x µo Bo ∂x ∆xi Bw ∆xi −1 2 ∆xi +1 2
∂ kkrw ∂p
=
1
λw,i −1 2
( Pi −n1+1 − Pi n +1 )
+ λw,i +1 2
( Pi +n1+1 − Pi n +1 )
∂x µ w Bw ∂x ∆xi ∆xi −1 2 ∆xi +1 2
φ ct ∂p φ ct Pi n +1 − Pi n
=
Bw ∂t Bw ∆t
Where the mobility ratio is defined as:
ki −1 2 kro ,i −1 2
λo ,i −1 2 =
µo Bo
Focusing on the “Overall” Balance (Pressure Eqn)
Bo ∂ kkro ∂p ∂ kkrw ∂p φ c ∂p B
Overall: + = t − o qo − qw
Bw ∂x µo Bo ∂x ∂x µ w Bw ∂x Bw ∂t Bw
1 Bo
λo ,i −1 2
( Pi −n1+1 − Pi n +1 )
+ λo ,i +1 2
( Pi +n1+1 − Pi n +1 )
+
1
λw,i −1 2
( Pi −n1+1 − Pi n +1 )
+ λw,i +1 2
( Pi +n1+1 − Pi n +1 )
∆xi Bw ∆xi −1 2 ∆xi +1 2 ∆xi ∆xi −1 2 ∆xi +1 2
φ ct Pi n +1 − Pi n Bo
= − qo ,i − qw,i
Bw ∆t Bw i
Multiplying through by Vi=A∆xi , and lumping terms gives the pressure equation
Bo Bo Viφ ct Pi n +1 − Pi n Bo
Bw
To ,i −1 2 + Tw,i −1 2 (P n +1
i −1 − Pi n +1
) B To,i+1 2 + Tw,i+1 2
+ (P n +1
i +1 − Pi n +1
) B
=
∆t
−
Bw
Qo ,i − Qw,i
w w i
Now Consider “Water” Balance (Saturation Eqn)
φ ∂S w φ Sw φ Sw ∂p ∂ kkrw ∂p
Water: + cw + cr = + qw
Bw ∂t Bw Bw ∂t ∂x µ w Bw ∂x
Multiplying through by Bwi∆t/φ, and lumping terms gives the Saturation Equation
Bw,i ∆t
S wn ,+i1 = S wn ,i + Tw,i −1 2 ( Pi −n1+1 − Pi n +1 ) + Tw,i +1 2 ( Pi +n1+1 − Pi n +1 ) + Qw,i − S wn ,i ( cw + cr ) ( Pi n +1 − Pi n )
Viφi
IMPES: IMplicit in Pressure, Explicit in Saturation
For each time step:
Bo Viφ ct Pi n +1 − Pi n
Bw
To ,i −1 2 + Tw,i −1 2 (P n +1
i −1 − Pi n +1
) + BBo To,i+1 2 + Tw,i+1 2 (P n +1
i +1 − Pi n +1
)= B ∆t
B
− o
Bw
Qo ,i − Qw,i
w w i
B B
or in Matrix Form: T + P n +1 = P n + Q
∆t ∆t
2. Using pressure solution for n+1, solve for saturation explicitly for n+1
Bw,i ∆t
S n +1
=S n
+ Tw,i −1 2 ( Pi −n1+1 − Pi n +1 ) + Tw,i +1 2 ( Pi +n1+1 − Pi n +1 ) + Qw,i − S wn ,i ( cw + cr ) ( Pi n +1 − Pi n )
Viφi
w ,i w ,i
S=Saturation Bo=Volumetric Factor [rB/STB] k=perm [mD] q=rate [ft3/day] A=Area [ft2] V=Volume[ft3] T=Transmissibiltiy [(ft3/day.psi)]
Saturation Matrix Equation: Explicit
V1φ1 Sw,1
∆tBw,1 S w1 ( cw + cr )
Sw,2
d12 = ... S nw = Ctw = Sw2 ( cw + cr )
VN φN S wN ( cw + cr )
∆tBw, N Sw,N
B B
T+J+ P n +1 = P n + Q S nw+1 = S nw + d12
−1
−Tw P n +1 + Q w − Ctw ( P n +1 − P n )
∆t ∆t
u ∆t
<1
∆x
Upwinding must be used to determine half relative perms!!!
kr ( S w,i −1 ) if Pi −1 > Pi
kr ,i −1 2 =
k r ( S w ,i ) if Pi > Pi −1
Boundary conditions and wells are treated similarly to single phase flow
ki −1 2 krw,i −1/2 A
Interblock Transmissibility? Tw,i −1/2 =
∆xi −1 2 µ w Bw
kr ( S w,i −1 ) if Pi −1 > Pi
kr ,i −1 2 =
k r ( S w ,i ) if Pi > Pi −1 Pi-1, Sw,i-1 Pi, Sw,i
kr ( S w,i −1 )
k r ( S w ,i )
S=Saturation k=perm [mD] kr = rel perm q=rate [ft3/day] A=Area [ft2] V=Volume[ft3] T=Transmissibilty [(ft3/day.psi)]
Wells and well models
As in single phase flow, wells can be constant rate or BHP. Think of
each block being composed of rate and BHP wells
qw,i = qw,i ,rate + qw,i , BHP ; q o ,i = qo ,i ,rate + qo ,i , BHP
∴
qw,i = qw,i ,rate + J w,i ( Pwf ,i − Pi ) ; q o ,i = qo ,i ,rate + J o ,i ( Pwf ,i − Pi )
In matrix form:
Q w = Q w,rate + J w ( Pwf − P n +1 ) ; Q o = Q o ,i ,rate + J o ( Pwf − P n +1 )
Bo Bo
Q = Q w,rate + Q o ,i ,rate + J w + J o Pwf
Bw Bw
Q rate J
B B Bo
T+J+ P n +1 = P n + Q J = Jw +
Bw
Jo
∆t ∆t
S nw+1 = S nw + d12
−1
−Tw P n +1 + Q w − Ctw ( P n +1 − P n )
Bw=Volumetric Factor [rB/STB] k=perm [mD] Q=rate [ft3/day] kr = rel perm J’=Productivity [(ft3/day-psi)] h = thickness [ft] s = skin
Productivity Index for BHP wells
Qw,i = J w ( Pwf − Pi )
2π krw k h 2π kro k h
Jw = ; Jo =
r r
µ w Bw ln eq + s µo Bo ln eq + s
rw rw
Bo 2π k h krw kro
J = Jw + Jo = +
Bw req µ w µo
Bw ln +s
rw
Bw=Volumetric Factor [rB/STB] k=perm [mD] Q=rate [ft3/day] kr = rel perm J’=Productivity [(ft3/day-psi)] h = thickness [ft] s = skin
Courant–Friedrichs–Lewy (CFL) condition
u ∆t
<1
∆x
SPECIAL TOPICS
• Capillary Pressure and Gravity
• Gas Flow
• 3D and Radial Flow
• History Matching
• Hydraulic and Natural Fractures
• Horizontal Wells
• Upscaling
• State-of-the-Art Simulation and the Future
Categories of Reservoir Simulators
Commercial
CMG
Eclipse (Schlumberger)
Intersect (Schlumberger + Chevron)
Nexus (Halliburton)
In House
Empower (ExxonMobil)
Cheers (Chevron)
PSim (ConocoPhillips)
MoReS – (Shell)
Powers – (Saudi)
Academic
UT-CHEM (UT Chemical Flooding)
IPARS (UT Multiscale Simulation)
GPAS/UT-COMP (UT compositional)
TOUGH2 (Lawrence Berkley National Labs)
Single Phase Gas Flow
Use gas law for density, our PDE (diffusivity equation) is now
nonlinear:
∂ p k ∂ p ∂p
( )= ( )
∂t z φ ∂x µ z ∂x
Two options to solve this problem:
1. Convert to “pseudopressure” and solve the linear problem
p p φµ c g ∂m( P) ∂ 2 m( p )
m( p ) = ∫ dp =
p µz
o k ∂t ∂x 2
2. Solve the nonlinear PDE directly. This gives a “nonlinear” system of equations. Solve
it using a multidimensional Newton Raphson method
B ( P n +1 ) B ( P n +1 )
F = T(P n +1
)+ P n +1
− Pn − Q = 0
∆t ∆t
1 1
Capillary Pressure and Gravity T+J+
∆t
B P n +1 = BP n + Q + G
∆t
G = ρ gTz + TPc
z1 Pc ,1
z2 Pc ,2
z= Pc =
z3 Pc ,3
z4 Pc ,4
3D and radial geometry
Although 2D geometries often suffice,
3D simulations are sometimes
necessary
Matrix equations are “heptadiagonal”
Gravity included
1 1
T+J+ B P n +1 = BP n + Q + G
∆t ∆t
1 1
T+J+ B P n +1 = BP n + Q
∆t ∆t
Fractures, Horizontal Wells, etc.
Permeability of fractures is drastically different than the reservoir
Usually too thin to justify grids just for fractures
Inaccurate to use “average” permeability for blocks with rock and fracture in it
“Dual Porosity/Dual Permeability” models sometimes used
http://www.geology.wisc.edu/courses/g115/oil/4.html
History Matching
A model cannot be expected to predict the future History match at six wells of the watercut (blue) given the oil rate (green)
if it cannot predict the past used as input in the black oil reservoir simulator.
(http://www.worldoil.com/Simulation-workflow-for-a-fractured-reservoir-
aids-CO2-flood-planning-November-2010.html)
182
History Matching Process
Data to match
1. Pressure (e.g. Bottom-hole flowing pressure)
2. Water/oil ratios (WORs)
3. Gas/oil ratios (WGRs)
4. Water and gas arrival times
5. Fluid saturations from cores, well logs, and chemical tracer
tests.
183
Mattax, C.C. and Dalton, R.L., “Reservoir Simulation”, SPE Monograph, v13
GPAS: Natural Fracture Modeling
Fracture
( T + D ) Xn+1 = DXn + Q + G
Tw, 1 + Tw, 3 0 −Tw, 3 0
2 2 2
To , 1 + To , 3 0 −To , 3 0
T1 + T3 −T3 2 2 2
2 2 2 −Tw, 3 0 Tw, 3 + Tw, 5 0 −Tw, 5 0
−T3 T3 + T5 −T5 2 2 2 2
T= 2 2 2 2 = −To , 3 0 To , 3 + To , 5 0 −To , 5 0
2 2 2 2
−Ti − 1 Tn − 1 + Tn + 1
2 2 2
−Tw,n −1 0 Tw,n −1 + Tw,n +1 0
2 2 2
−To ,n −1 0 To ,n −1 + To ,n +1 0
2 2 2
S=Saturation Bo=Volumetric Factor [rB/STB] k=perm [mD] φ = porosity μ=viscosity [cP] q = Flow rate [ft3/day]
For the entire system we get
( T + D ) Xn+1 = DXn + Q + G
The “D” matrix is block diagonal
d1,11 d1,12
d1,21 d1,22
D1
d 2,11 d 2,12
D2
D= = d 2,21 d 2,22
Dn
d n ,11 d n ,12
d n ,21 d n ,22
Pn qn , w
* If capillary pressure is included, the pressure, P, is
S w, n qn ,o of the non-wetting phase (e.g. oil)
S=Saturation Bo=Volumetric Factor [rB/STB] k=perm [mD] φ = porosity μ=viscosity [cP] q = Flow rate [ft3/day]
FULLY IMPLICIT method requires iteration using
Newton Raphson
R ( X n +1 ) = ( T + D ) X n +1 − DX n − Q − G = 0
Step (1) Guess the solution, Xk+1
Step (2) Calculate R and J, the matrix of partial derivatives
∂R1 ∂R1 ∂R1
∂X 1 ∂X 1 ∂X n
R1
∂R2 ∂R2 ∂R2
R
J = ∂X 1 ∂X 2 ∂X n ; R = 2
Rn
∂Rn ∂Rn
∂X 1 ∂X n
Can solve the problem fully implicit or using IMPEC (implicit pressure,
explicit concentration)
zk
∑ x =∑ 1 + ν ( K
k
k
k − 1)
=1
k
Streamline Simulation
Basic Idea: Fluids are transported over a timestep along streamlines rather
than cell-to-cell as is done in finite difference approaches
Advantages Disadvantages
• Computational speed and memory • Diffusive-dominated flows (e.g. gas
• Slightly compressible expansion and capillary pressure)
systems/convective-dominated flow
Thiele, M.R. “ Streamline Simulation for Modern Reservoir-Engineering Workflows”, JPT January 2010
Advances in Computation
All these complexities have led to bigger, more computationally difficult
problems
http://en.wikipedia.org/wiki/Parallel_computing http://www.cfd-online.com/Wiki/Parallel_computing
UT-CHEM is UT-Austin’s 3D multi-component,
multiphase compositional model
Numerics
IMPEC (implicit pressure; explicit concentrations)
Flash calculations for phases in each cell
Cell-centered grids
Energy balance employed for thermal effects
Higher-order finite differences
Physics
Polymers with non-Newtonian rheology
Tracers
Surfactant/foam model
Vertical and horizontal wells
Full-tensor dispersion coefficients
Applications
Waterflooding
NAPL spill and migration
Geochemical reactions
Enhanced Oil Recovery – especially CHEMICAL EOR
192
IPARS
Applications Applications
Enhanced Oil Recovery Unconventional resources (shale oil and
Carbon Sequestration gas)
Tight-gas formations More carbon sequestration
Physics Physics
Better modeling of natural fractures Coupled hydraulic fractures with fracture
Nonlinear flow (e.g. polymer flooding) Horizontal wells
Compositional models and 3 phase Coupled flow and geomechanics
flash calculations Advanced characterization, especially for
Improved history matching shale formations
Better Upscaling
194