You are on page 1of 194

What is Reservoir Simulation ?

• Understand flow and transport in our


reservoirs to make engineering decisions

• Develop mathematical models to


describe pressure, velocity, saturation,
etc.

• Described by coupled, nonlinear partial


differential equations (PDEs)

• Solution to PDEs can’t be found


analytically – we are left with solving
numerically
Reservoir Simulators Help Us Answer Several
Questions

1. How should a field be developed to maximize economic recovery?

2. What is the best enhanced recovery scheme for the reservoir?

3. Why is the reservoir not behaving according to predictions made by


previous engineering studies?

4. What is the ultimate economic recovery of the field?

5. What type of laboratory data is required?

6. Is it necessary to do physical model studies of the reservoir?

7. What is the best completion scheme for wells?

8. From what portion of the reservoir is the production coming?


Modeling and Simulation

Engineering Engineering

Problem Solution

Mathematical Numerical

Problem Solution
All Steps in Simulation are Important

1. Conversion to mathematical model requires understanding physics


– Fluid and rock properties of the reservoir
– Laws that describe flow and transport (conservation of mass, energy, and momentum)

2. Numerical solution to the mathematical problem requires simplifications


and approximations that are still accurate
– Assume that fluid and rock properties are constant over a control volume
– Transform non-linear PDEs into linear system of algebraic equations
– Solve the system of equations

3. Using the math solution to find an engineering solution requires


economics, experience, and good decision-making skills
General Idea

• Break up the reservoir into individual “blocks” or “grids”

• Write algebraic equations for pressure, saturation, etc. each block

• Each block depends on the adjacent block equations so we get a


system of linear equations

• Solve the system of equations. More blocks means more accuracy, but
longer computation time
Simulation Schematic...

Grid block Out Out


or cell
z y

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

• Equations come from a mass balance and implementing Darcy’s law:


∂ ∂po ∂z ∂ φ So
λo −γo =
∂x ∂x ∂x ∂t Bo
∂ ∂pw ∂z ∂ φ Sw
λw −γw =
∂x ∂x ∂x ∂t Bw

• These equations are very complicated.


1. Coupled equations (water and oil)
2. PDEs (time and space – 1, 2 ,or 3D)
3. Variable properties (like permeability and porosity)

• Approximations allow us to get a problem that is easier to solve

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?

• Write equations for fluid transport in porous media, rock/fluid properties,


and conservation of mass, momentum, and energy

• Use and perform error analysis of approximate numerical techniques to


solve math problems
– Root finding
– Systems of equations
– Interpolation, Integration, etc.
– Solution to differential equations

• Develop computer programs to solve these massive numerical problems


Class Exercise: List up to 3 examples of problems in
the last 2 years you had to:

• Use Matlab and/or program

• Find the root of a nonlinear equation

• Solve a system of equations (Ax=b)

• Curve fit/regression analysis

• Find an integral numerically

• Solve a differential equation numerically


Why can’t I just use a commercial simulator (CMG,
Eclipse) that someone smart already made?

• Great danger in using software if you don’t understand the fundamentals it


was built on

• 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

Mass In – Mass Out +/- Generation/Consumption = Accumulation

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

Mass in Mass out

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

Divide the mass balance by A∆x∆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

In 3D Cartesian coordinates the equation becomes

∂( ρux ) ∂( ρu y ) ∂( ρuz ) ∂ ( ρφ )
− + + = −m
∂x ∂y ∂z ∂t

More general form of the Continuity Equation

Other names:
- Mass Conservation Equation
- Material Balance Equation
Continuity Equation: What is ?

- accounts for mass entering or leaving a control volume from a


source or sink (e.g. well)

- We model injection/production wells as discrete sources/sinks so they


occupy no volume

- Taking limits without using this variable creates difficulty

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

PRINCIPLES TO FOLLOW AND FORMULAS TO BE USED

IN THE QUESTION

OF

THE DISTRIBUTION OF WATER


WORK FINISHES WITH

AN APPENDIX RELATING TO THE WATER SUPPLIES OF SEVERAL CITIES

THE FILTERING OF WATER

AND

THE MANUFACTURE OF STRONG PIPES OF LEAD, SHEET METAL AND BITUMEN

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.)

1 darcy = 9.869 x 10-9 cm2


PARIS

VICTOR DALMONT, EDITOR,


Successor of Carilian-Gaery and Vor Da lmont,
BOOKSELLER OF THE IMPERIAL CORPS OF BRIDGES, HIGHWAYS AND MINES,

1 darcy = 1.062 x 10-11 ft2 Quay of Augustins, 49.

1856

Darcy’s Experiment
"The Public Fountains of the Town of Dijon”, Dalmont, Paris (1856)
Permeability (k)

Medium is homogeneous if permeability does not vary with space, but


heterogeneous if non-uniform, k=k(x,y,z)

Medium is isotropic if permeability is the same in all directions,


but anisotropic if kx≠ky≠kz. Oftentimes kx ≈ ky but kx /kz≈1-10

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

Medium could be homogenous and anisotropic or heterogeneous and isotropic


Darcy’s Law into Continuity Equation

In 1D and horizontal flow (gravity neglected)

Replacing fluid velocity in the continuity equation

Assuming homogenous and isotropic permeability and viscosity (NOT always the
case!)
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 ρ SC
ρ RC =
depth Bw

Reservoir Conditions
P = PR ; T = TR ; V = VR

Formation volume factor and ρ depend on both pressure and temperature


• Bo = formation volume factor for oil (> 1.0)
• Bg = formation volume factor for gas (<< 1.0)
• Bw = formation volume factor for water (~1.0)
Formation Volume Factor—Continuity Equation

At reservoir conditions, density is:

Replacing density in continuity equation and divide through by ρSC (a constant)

k ∂ 1 ∂p ∂ φ m
= −
µ ∂x Bw ∂x ∂t Bw ρ sc

Using the product rule on the left-hand side of the equation

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

Chain and product rule on time derivative (right hand side)


2
k 1 ∂2 p ∂ 1 ∂p ∂ 1 1 ∂φ ∂p m
+ = φ + −
µ Bw ∂x 2 ∂p Bw ∂x ∂p Bw Bw ∂p ∂t ρ sc

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)

With some manipulation:

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.

1D diffusivity (with homogenous fluid and reservoir properties) can be written:


k
Diffusivity constant ≡ α =
µφ ct
k
Mobility ≡ λ =
µ Bw
m
Source ≡ qSC =
ρ SC

If no sources or sinks (wells) are present, we get the “heat equation”

∂ 2 p 1 ∂p
=
∂x 2
α ∂t
Generalized Diffusivity (Heat) Equation

In 2D (x-y plane)

In 3D and potential Φ accounting for gravity


Slightly Compressible Fluids: Liquids

P1 P2

More Pressure

V1 V2

Recall fluid compressibility factor (cf) at constant temperature

1 ∂V 1 ∂ρ ∂ 1 −1 ∂Bw
cf = − = = Bw =
V ∂p T
ρ ∂p T
∂p Bw Bw ∂p

Integrating from a reference point (p0, ρ0), to any other point

p ρ 1
∫ p0
c f dp = ∫
ρ0 ρ

Taylor Series Expansion
1 1
f ( x + ∆x) = f ( x) + f ′( x)∆x + f ′′( x)∆x 2 + f "'( x)∆x3 + ...
2! 3!

Using Taylor series to expand density around a reference density,

∂ρ 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

p ( x, 0 ) = pinit = 0.0 psi


p ( 0, t ) = pB1 = 1000.0 psi
p ( L, t ) = pB 2 = 0.0 psi

Analytical Solution to PDE


α (2 n +1)n π 2t
4 pinit ∞
(−1) n
(2n + 1)π x
p ( x, t ) = pB1 −
π

n = 0 2n + 1
e 4 L2
cos
2L
Analytical Solution
α (2 n +1)n π 2t
4 pinit ∞
(−1)n
(2n + 1)π x
p ( x, t ) = pB1 −
π

n = 0 2n + 1
e 4 L2
cos
2L

Steady state
solution

Time
increasing
Real Reservoirs

That was the easy solution

Real reservoirs have:


• Spatially varying permeability, porosity, etc.

• Time-varying viscosity, formation volume factor


• Geometries that are 2D or 3D and are not on a regular grid
• Sources and sinks (called wells) spaced irregularly throughout the reservoir

• Complex boundary conditions

k φ ct ∂p
∇ ( ∇p + ρ g ∇z ) = − qSC
µ Bw Bw ∂t

(and this is just for single phase flow )


Solving “ugly” PDE

So how do we solve this complex, nonhomogeneous, 3D PDE?

1. Break the reservoir into manageable blocks that have contain reservoir and fluid
properties

2. Write algebraic equations for each block by “discretizing” PDE


3TP1 − TP2 = Q1
−TP1 + 2TP2 − TP3 = Q2
−TP2 + 2TP3 − TP4 = Q3

−TPN −1 + TPN = QN

3. Solve system of linear equations


B B
T+ P n +1 = P n +1 + Q
∆t ∆t
CHAPTER 2.
FINITE DIFFERENCES
Solution to Partial Differential Equations (PDEs)

Analytical solutions to PDEs are rare:

α (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

More generally we seek a numerical approximation to the PDE:

• 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

Analytical Solution Numerical Solution


Need to solve a complex PDE Need to solve algebraic equations

p ( x, t ) time step

Grid block

Continuous Solution P Discrete Solution


P

x
x
Finite Difference Approximations

• Finite differences are used to approximate the numerical value


of a derivative at a point, x.
∂f
f ′( x) =
∂x x

f(x)

• Begin by using a truncated Taylor Series approximation of a


function
1 1
f ( x + ∆x) = f ( x) + f ′( x)∆x + f ′′( x)∆x 2 + f "'( x)∆x3 + ...
2! 3!

• Various finite difference schemes can be employed, with varying


degrees of accuracy. Three common methods employed here:
• Forward difference
• Backward difference
• Centered difference
Forward Difference Approximation
P(x) Tangent line
Secant line

∂P P( x + ∆x) − P( x)

∂x forward ∆x

x x+∆x
x

• Derivative is defined as the “slope of the line tangent to the curve”

• This is difficult because you need two points to make a line

• Secant connects P(x) to P(x+∆x). Slope of the secant line is the “rise”
over the “run”

• Using smaller ∆x should give more accuracy to slope of the tangent


line, in fact they are the same in the limit that ∆x 0
Derivation of Forward Difference

Recall a Taylor Series:


∂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

Re-arrange for the first derivative:

∂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

forward difference approximation truncation error

Forward approximation is as before; error is proportional to ∆x:

∂P P( x + ∆x) − P( x) P" P "'


≈ R= (∆x) + (∆x) 2 + = O(∆x)
∂x forward ∆x 2! 3!
Backward Difference Approximation for

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”

• Using smaller ∆x should give more accuracy to slope of the tangent


line, in fact they are the same in the limit that ∆x 0

• Backward difference is not necessarily “better” or “worse” than forward


difference
Derivation of Backward Difference

Even terms are now negative in Taylor Series:


∂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

Re-arrange for the first derivative:

∂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

backward difference approximation truncation error

Error in the backward difference approximation is proportional to ∆x, just


like the forward difference:

∂P P( x) − P ( x − ∆x) P" P "'


≈ R= (∆x) − (∆x) 2 + = O(∆x)
∂x backward ∆x 2! 3!
Central Difference Approximation

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”

• Using smaller ∆x should give more accuracy to slope of the tangent


line, in fact they are the same in the limit that ∆x 0

• Centered difference is potentially more accurate than forward or


backward difference
Derivation of Central Difference Approximation

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

Rearranging gives the centered approximation with only O(∆x2) error!

∂P P( x + ∆x) − P( x − ∆x) P "'


≈ R=− (∆x) 2 + = O(∆x 2 )
∂x centered 2∆x 3!
What about 2nd Derivative?
• Can derive a forward or backward, 2nd derivative
• Here, we’ll derive a centered difference approximation
• Add forward and backward Taylor series together

∂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

Centered difference approximation is O(∆x2)


P( x + ∆x) − P( x) P( x) − P( x − ∆x)

∂2 P P( x + ∆x) − 2 P ( x) + P ( x − ∆x) (∆x) (∆x)
≈ =
∂x 2 centered (∆x) 2 (∆x)
Summary of Important Finite Difference
Approximations

Derivative Finite Difference Approximation Type Error


∂P P ( t + ∆t ) − P ( t ) Forward Difference O ( ∆t )
∂t ∆t
∂P P ( t ) − P ( t − ∆t ) Backward Difference O ( ∆t )
∂t ∆t
∂P P ( t + ∆t ) − P ( t − ∆t ) Centered Difference O ( ∆t 2 )
∂t 2∆t
∂2 P P ( x + ∆x ) − 2 P ( x ) + P ( x − ∆x ) Centered Difference O ( ∆x 2 )
∂x 2 ∆x 2
CHAPTER 3.
EXPLICIT, IMPLICIT, AND
CRANK-NICHOLSON
METHODS
We Want to Solve Flow Problems that are
Functions of Space and Time

P(x,t)=?

1D diffusivity equation describes this flow problem

∂ 2 p 1 ∂p
=
∂x 2
α ∂t
PDE is subject to initial and boundary conditions

P( x, 0) = Pinitial • Boundary conditions can be


• Dirichlet (constant pressure)
∂P • Neumann (constant flow)
P(0, t ) = PB1 or (0, t ) = 0
∂x • Recall that flux is proportional to
∂P pressure gradient (Darcy’s Law)
P( L, t ) = PB 2 or ( L, t ) = 0
∂x
Idea: Use Taylor Series to Approximate Derivatives

Derivative Finite Difference Approximation Type Error


∂P P ( t + ∆t ) − P ( t ) Forward Difference O ( ∆t )
∂t ∆t
∂P P ( t ) − P ( t − ∆t ) Backward Difference O ( ∆t )
∂t ∆t
∂P P ( t + ∆t ) − P ( t − ∆t ) Centered Difference O ( ∆t 2 )
∂t 2∆t
∂2 P P ( x + ∆x ) − 2 P ( x ) + P ( x − ∆x ) Centered Difference O ( ∆x 2 )
∂x 2 ∆x 2
Discretize Our Domain in N Grid-Blocks

1 2 3 i-1 i i+1 N-1 N

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, φ)

• In a “cell-centered” approach, we solve for discrete pressures, Pi,


located at the center of every block
Substitute Finite Difference Approximation in Each
Grid Block ∂ 2 p 1 ∂p
=
∂x 2
α ∂t
Use centered difference approximation for space

∂ 2 P Pi −1 − 2 Pi + Pi +1

∂x 2
(∆x) 2 Subscript indicates
block index

Pressure at block “i” depends on pressures at neighbors “i-1” and “i+1”

Use forward or backward difference approximation for time

∂P Pi n +1 − Pi n
= Superscript indicates
∂t ∆t time index

Pressure changes in “i” from time “n” to time “n+1”


Explicit versus Implicit Solutions

Explicit Method Implicit Method

Pi n +1 − Pi n 1 Pi −n1 − 2 Pi n + Pi +n1 Pi n +1 − Pi n 1 Pi −n1+1 − 2 Pi n +1 + Pi +n1+1


= =
∆t α (∆x) 2 ∆t α (∆x) 2
Spatial derivative evaluated at “n” Spatial derivative evaluated at “n+1”
time level time level

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

An initial condition is provided,

α∆t
Pi1 = Pi 0 + [ P 0
i −1 − 2 Pi
0
+ P 0
i +1 ]
(∆x) 2

• Solve for P1 in every block i=1 to N using initial condition


• Use pressures in P1 to solve for pressures at P2
• Continue until final time step
More on Explicit Solution

α∆t
P =P +
1
1
1
0
[ P0
0
− 2 P1
0
+ P 0
2 ]
(∆x) 2

α∆t 0 In explicit solution, each


P21 = P20 + [ P1 − 2 P2
0
+ P3
0
] equation is independent (they
(∆x) 2
are coupled with the other
α∆t 0 equations)
P31 = P30 + [ P2 − 2 P3
0
+ P 0
4 ]
( ∆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

These grid blocks


don’t exist!!

We can use the boundary conditions defined for problem

0 1 2 3 i-1 i i+1 N-1 N N+1

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)

0 1 2 3 i-1 i i+1 N-1 N N+1

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

New eqn block #1:


P1
n +1
−P 1
n

( 2Pn
B1 − P1n ) − 2 P1n + P2n
∆t (∆x) 2
Boundary Conditions: Neumann (Constant/No Flux)

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

Explicit method is only stable (errors do not propagate over time) if

• η 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

• Implicit method is unconditionally (always) stable; no restriction on size of ∆x!


Implicit Method

1 2 3 i-1 i i+1 N-1 N

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

Re-arranging and grouping “like terms” gives:

α∆t n +1 α∆t n +1 α∆t


− P
i −1 + 1+ 2 Pi − Pi +n1+1 = Pi n
(∆x) 2 (∆x) 2 (∆x) 2

Pressures at n+1 are unknown known


Implicit Solution for Pressure Diffusivity Equation

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

block #1 − η P0n +1 + (1 + 2η ) P1n +1 − η P2n +1 = P1n


block #2 − η P 1
n +1
+ (1 + 2η ) P 2
n +1
−η P
3
n +1
=P2
n

block #3 − η P2n +1 + (1 + 2η ) P3n +1 − η P4n +1 = P3n

block #i − η Pi −n1+1 + (1 + 2η ) Pi n +1 − η Pi +n1+1 = Pi n

block #N − η PNn−+11 + (1 + 2η ) PNn +1 − η PNn++11 = PNn

Boundary conditions can be used to eliminate two imaginary grid pressures


and then we are left N linear equations and N unknown pressures
Dirichlet Boundary Condition Revisted

0 1 2 3 i-1 i i+1 N-1 N N+1

P(0, t ) = PB1 P( L, t ) = PB 2

Approximate edge pressure as average of two neighboring grid pressures.


P0 + P1
PB1 = ⇒ P0 = 2 PB1 − P1
2
New eqn block #1:
−η P0n +1 + (1 + 2η ) P1n +1 − η P2n +1 = P1n

−η ( 2 PB1 − P1n +1 ) + (1 + 2η ) P1n +1 − η P2n +1 = P1n

(1 + 3η ) P1n+1 − η P2n+1 = P1n + 2η PB1


Neumann Boundary Conditions Revisted

N N+1

Use “reflection technique” at the


boundary
dP
∂P PN − PN +1 ( L, t ) = 0
≈ = 0 => PN = PN +1 dx
∂x ∆x

New eqn blockfor


#N:
−η PNn−+11 + (1 + 2η ) PNn +1 − η PNn++11 = PNn

−η PNn−+11 + (1 + 2η ) PNn +1 − η PNn +1 = PNn

−η PNn−+11 + (1 + η ) PNn +1 = PNn


We Can Express Equations in Matrix form
*Dirichlet on left and Neumann on right were used in this example

Dirichlet BC Dirichlet BC

1 + 3η −η 0 ... 0 P1n +1 P1n 2η PB1


−η 1 + 2η −η 0 ... ... ... ...
0 ... ... ... 0 Pi n +1 = Pi n + 0
... 0 −η 1 + 2η −η ... ... ...
0 ... 0 −η 1 + η PNn +1 PNn 0
tridiagonal matrix unknown pressures old pressures boundary conditions
Neumann BC

• PDE problem has been transformed into linear system of equations, APn+1=b

• Matrix is tridiagonal, symmetric, and diagonally dominant

• 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

Identify a few terms here:

Viφ ct Refers to the volume accumulation. How much


Bi = the fluid is expanded/contracted when pressure is
Bw increased/decreased

kA Refers to transmissibility. By Darcy’s law,


T= measures how much fluid flows in or out of the
µ Bw ∆x grid block

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

Boundary conditions can be used to eliminate two imaginary grid pressures


and we are left N linear equations and N unknown pressures
System of Equations Written in Matrix Form:

B1 0 0 0 3T −T 0 0 P1n +1 B1 0 0 0 P1n 2TPin


1 0 B2 0 0 −T 2T −T 0 P2 n +1 1 0 B2 0 0 P2 n 0
+ = +
∆t 0 0 B3 0 0 −T 2T −T P3n +1 ∆t 0 0 B3 0 P3n 0
0 0 0 B4 0 0 −T T P4 n +1 0 0 0 B4 P4 n 0
B T P n+1 B Pn Q

1 1
T+ B P n +1 = BP n + Q
∆t ∆t

• T (transmissibility) matrix is tri-diagonal for 1D problems

• B (accumulation) matrix is diagonal

• Q (source) vector includes boundary conditions and wells (discussed


later)
All Units are Now Rates

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

Explicit Method Implicit Method


Bi n +1 B Bi B
Pi = TPi −n1 + i − 2T Pi n + TPi +n1 −TPi −n1+1 + + 2T Pi n +1 − TPi +n1+1 = i Pi n
∆t ∆t ∆t ∆t

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

After some rearrangement we get,

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

Both explicit and implicit methods are O(∆x2) accurate in space


because a centered difference was used but are only O(∆t) accurate in
time because forward/backward difference was used

∂P P n +1 − P n
= + O(∆t )
∂t ∆t

Equation is a forward difference for the explicit method (current time is


“n”) but a backward difference for the implicit method (current time is
n+1)

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

Crank-Nicholson is second-order accurate in both time and space!!


Implicit and Analytical Solutions to 1D Diffusivity
Equation

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

• PDEs describing flow in transport in porous media can be solved


numerically using finite difference approximations

• Explicit method is relatively easy to solve because new pressures are


calculated “explicitly”, but solution is only conditionally stable (if time
steps are too large, or grids are too small it becomes unstable)

• Implicit method requires solving a system of N equations, but is


unconditionally stable. Both explicit and implicit are second order
accurate in space and first order in time

• Both the implicit and explicit equations can be written in “rate” units,
introducing transmissibility (T), accumulation (B), and source (Q)
terms

• Mixed methods are “hybrids” between implicit and explicit. Crank


Nicholson is a special mixed method (θ=1/2) that is second order
accurate in BOTH space and time
CHAPTER 4.
“CONTROL VOLUME”
APPROACH
Control Volume Approach

Goal: Write a mass balance on each grid block “i” at reservoir conditions
(RC) and attempt to recover finite difference matrix equations

mass in - mass out + injected/produced = accumulation

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

In the mass balance equation, mass of fluid in block “i”:

mi = ρ RCφVi (mass of fluid in pore volume times fluid density)

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)

Substituting these variables in gives,

( ρ 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

Dividing by ρ SC ∆t gives the following balance equation


n +1 n
Vi φ φ
Ti −1/2 ( Pi − Pi −1 ) + Ti +1/2 ( Pi − Pi +1 ) + Qi SC = −
∆t Bw Bw
i
Doing Some Algebra on the Right Hand Side

Expand time difference to include extra term in brackets


n +1 n n +1 n
φ φ φ φ n +1 φ n +1 φ 1 1 1
− = − n
− n
− = φ n +1 n +1
− n
+ n (φ n +1 − φ n )
Bw Bw Bw Bw Bw Bw Bw Bw Bw
these terms cancel

And recalling linear approximations for fluid and rock compression


1 1
n
≈ 0
1 + c f (Pn − P0 ) φ n ≈ φ 0 1 + cr ( P n − P 0 )
Bw Bw

Change in formation volume factor and porosity then simplify


1 1 1 1 cf
0 (
− ≈ 1 + c f ( P n +1
− P 0
) − 1 + c f ( P n
− P 0
) = P n +1 − P n )
Bw n +1 Bw n
Bw 0
Bw 0
Bw
(φ n +1
− φ n ) ≈ φ 0 1 + cr ( P n +1 − P 0 ) − φ 0 1 + cr ( P n − P 0 ) = φ 0 cr ( P n +1 − P n )

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

Real reservoirs are often not homogenous in permeability

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

Add pressure drops across green and yellow “half blocks”


q µ Bw ∆x q µ Bw ∆x
( Pi +1/2 − Pi ) + ( Pi +1 − Pi +1/2 ) = +
2 ki A 2ki +1 A
Simplifying yields:
−1
q µ Bw ∆x 1 1 A 1 1
( Pi +1 − Pi ) = + ⇒ q= 2 + ( Pi +1 − Pi )
2A ki ki +1 µ Bw ∆x ki k i+1
k
i+ 1
2

Inter-block permeability and transmissibility can then be defined as:


−1
1 1 ki + 1 A
ki + 1 =2 + ; Ti +1/2 = 2
2 ki k i+1 µ Bw ∆x
Non-Uniform Grid Size?
We may use varying grid sizes when we want more resolution in some
areas of the reservoir (e.g near wells)

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

Mass balance gives:

q µ Bw ∆xi ∆xi +1 1 ∆xi + ∆xi +1


( Pi +1 − Pi ) = + ⇒ q= ( Pi +1 − Pi )
2 ki Ai ki +1 Ai +1 µ Bw ∆xi + 1 1
+
1
2
ki Ai k i+1 Ai +1
kA
i+ 1
2

Equivalently we can say,

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

Option 1. Evaluate at some arithmetic “average” pressure between blocks


1 1
pi + 1 = ω pi + (1 − ω ) pi +1 ⇒ = @ pi + 1
2 µ Bw i+ 1
µ Bw 2
2
(V φ )i
ω = 1 2 or
(V φ )i +1
Option 2. Take arithmetic “average” of block fluid properties

1 1 1
=ω + (1 − ω )
µ Bw i+ 1
µ Bw i
µ Bw i +1
2

Option 3. Use technique called upwinding (discussed later in multiphase flow)


Change in Transmissibility Matrix

Mass balance on block “i” now includes interblock transmissibility


Viφ ct n +1
T ( Pi −1 − Pi ) + T ( Pi +1 − Pi ) = ( Pi − Pi n ) − Qi SC
Bw ∆t

Viφ ct n +1
Ti −1/2 ( Pi −1 − Pi ) + Ti +1/2 ( Pi +1 − Pi ) = ( Pi − Pi n ) − Qi SC
Bw ∆t

B matrix and Q vector is the same. T (transmissibility) matrix is still symmetric


and tri-diagonal, e.g.

T1/2 + T3/2 −T3/2 0 0


−T3/2 T3/2 + T5/2 −T5/2 0
T=
0 −T5/2 T5/2 + T7/2 −T7/2
0 0 −T7/2 T7/2 + T9/2
Boundary Conditions
For a Neumann (no flow) boundary, no flow goes through the
boundary, which is equivalent to having no interblock transmissibility

N qN + 1 = TN +1/2 ( PN − PN +1 ) = 0 ⇒ TN +1/2 = 0
2

For a Dirichlet (constant pressure) boundary, pressure is defined at the


edge, which is ∆x/2 distance away from the block center

q 1 = T1/2 ( P0 − P1 ) = 2T1 ( PB1 − P1 )


1 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

General diffusivity equation for 2D flow with anisotropic, heterogeneous


permeability (without gravity) is given as:
∂ k x ∂p ∂ k y ∂p φ c ∂p ~
+ = t + qsc
∂x µ Bw ∂x ∂y µ Bw ∂x Bw ∂t

Two types of 2D problems:


1. Areal view. Reservoir is flat so no gravity acting on system
(we’ll focus on these problems)
2. Side view. Gravity adds to potential gradient

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

• 2D grid systems have NX grids in the x-


direction and NY grids in the y-direction.
(Example problem: NX=3 and NY=4)
j=NY=4 10 11 12
• Label grids by i,j numbering. Block
highlighted in red is i = 2, j = 3
j=3 7 8 9
• Can also number grids using “l” numbering,
which is related to i and j. Block highlighted
in red is also block l = 8. j=2 4 5 6

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 )

qi , j +1 2 qi +1/2, j = TX i +1/2, j ( Pi +1, j − Pi , j ) = TX i +1/2, j ( Pl +1 − Pl )


qi −1/2, j qi +1/2, j
qi , j −1/2 = TYi , j −1/2 ( Pi , j −1 − Pi , j ) = TYi , j −1/2 ( Pl − NX − Pl )
i-1,j or l-1 i+1,j or l+1
qi , j −1 2 qi , j +1/2 = TYi , j +1/2 ( Pi , j +1 − Pi , j ) = TYi , j +1/2 ( Pl + NX − 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

Mass Balance on block “i,j” or “l”


Vl ctφl n +1
TX i −1/2, j ( Pl −1 − Pl ) + TX i +1/2, j ( Pl +1 − Pl ) + TYi , j −1/2 ( Pl − NX − Pl ) + TYi , j +1/2 ( Pl + NX − Pl ) = ( Pl − Pl n ) − Ql
Bw ∆t sources
left right bottom top
accumulation
Heterogeneities and Anisotropy
• Three complications can occur in multidimensions regarding the interblock
transmissibility:
1. Heterogeneities in permeability and grid size
2. Anisotropy (kx ≠ ky)
3. Grid sizes may be different in each direction (∆x ≠ ∆y)

• Therefore, transmissibility in all 4 connecting blocks may be different, e.g.

∆xi , j + ∆xi +1, j kxi +1 2, j ( ∆yi , j h )


kxi +1 2, j = ; TX i +1 2, j =
∆xi , j ∆xi +1, j µ Bw ∆xi +1 2, j
+
kxi , j kxi +1, j

∆yi , j + ∆yi , j +1 kyi +1 2, j ( ∆xi , j h )


kyi , j +1 2 = ; TYi , j +1 2 =
∆yi , j ∆yi , j +1 µ Bw ∆yi , j +1 2
+
kyi , j kyi , j +1
• If reservoir is homogeneous, isotropic and uniform, square (∆x = ∆y)
grids employed transmissibility same in all directions
kA
TX i +1 2, j = TX i −1 2, j = TYi , j +1 2 = TYi , j −1 2 = T =
µ Bw ∆x
An Example Problem:

• 2D grid with NX=3 and NY=4


10 11 12
• “No flow” boundary conditions on 3
edges (sealed boundaries)
7 8 9
• “Constant pressure” on right edge
P=PB
(open boundary)
4 5 6
• Assume homogeneous and isotropic
permeability along with uniform,
1 2 3 square grids
“Interior” Blocks Have 4 Neighbors 10 11 12

8 7 8 9

4 5 6
Note: Block l=5 is also block
4 5 6
i=2, j=2
1 2 3

Mass balance on block #5


V5ctφ5 n +1
T ( P4 − P5 ) + T ( P6 − P5 ) + T ( P2 − P5 ) + T ( P8 − P5 ) = ( P5 − P5n ) − Q5
Bw ∆t

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

i=1 i=2 i=3

Mass Balance: There is no flow from the “top”!


V11ctφ11 n +1
T ( P10 − P11 ) + T ( P12 − P11 ) + T ( Ptop − P11 ) + T ( P8 − P11 ) = ( P11 − P11n ) − Q11
Bw ∆t

After grouping terms:

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

Mass Balance in “l” numbering:


V9 ctφ9 n +1
T ( P8 − P9 ) + 2T ( PB − P9 ) + T ( P6 − P9 ) + T ( P12 − P9 ) = ( P9 − P9n ) − Q9
Bw ∆t

Grouping Terms and moving known values to right hand side:

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

• Nothing really special about corner 7 8 9


grids
10 11
4 5 6
• Just treat each boundary separate

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

Equation for block #10

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

Simple rules for homogeneous, isotropic 2D systems


• Matrix is square and the # rows= total # grid blocks
• Off diagonals are –T if that row (block) is connected to that column (block)
• Main diagonal = (# connected blocks + 2*dirichlet boundaries)T
• Blocks 5 and 8 are interior blocks and have 4 neighbors, so “4T”
• Blocks 2,4,7, and 11 have 3 neighbors and no flow boundaries, so “3T”
• Blocks 1 and 10 have 2 neighbors and no flow boundaries, so “2T”
• Blocks 6 and 9 have 3 neighbors and one dirichlet boundary, so “5T”
• Blocks 3 and 12 have 2 neighbors and one dirichlet boundary, so “4T”
System of Equations in Matrix Notation

1 1
T+ B P n +1 = BP n + Q
∆t ∆t

The B and Q arrays are listed as follows (assumes no wells)


V1ctφ1
Bw
V2ctφ2
0
Bw 0
V3ctφ3 2TPB
Bw
V4ctφ4
0
Bw 0
V5ctφ5
2TPB Constant P boundary
Bw Q= condition
V6 ctφ6 0
B=
Bw 0
V7 ctφ7
2TPB
Bw
V8ctφ8 0
Bw 0
V9 ctφ9
2TPB
Bw
V10 ctφ10
Bw
V11ctφ11
Bw
V12 ctφ12
Bw
Irregular Geometries and Inactive Grids
• Inactive grids allow for irregular geometries

• Mathematically, assume the grid still exists but assign a


permeability of zero

• This automatically gives harmonic mean of interblock


transmissibilities equal to zero

• Result is the T matrix is different in the inactive block and its


neighbors

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:

• Mass balance is written on each block. Important to be careful with boundary


conditions. We obtain the usual system of equations
1 1
T+ B P n +1 = BP n + Q
∆t ∆t
• Matrix equations are “penta-diagonal” and symmetric. Thomas’ algorithm
CANNOT be used

• “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

• Heterogeneities, anisotropy, and non-uniform/non-square grids handled using


harmonic mean of permeability

• If reservoir geometry is not a rectangle, we can fill with “inactive” grids;


interblock transmissibility is then zero
CHAPTER 7.
WELLS AND WELL MODELS
Treatment of Wells in Reservoir Simulation

• Wells are treated as sources (injectors) or sinks (producers)


of mass

• 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 pressure is DIFFERENT than block pressure, which is


the average pressure in the block and we locate it at its
center

• Well and block pressure are linked to each other through a


well model. It can be constrained either by pressure (Pwf is
given) or by rates (qw is given).

Rate Need to calculate Pwf

Well constraints

Pressure Need to calculate rate


Radial Flow around the Well

We assume that flow occurs radially around a well. Radial


Diffusivity equation around a well is given by the following
equation; we assume flow is steady state
Steady state

φµ 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

Solution to ODE with BCs can be solved using separation of variables

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

Now, let the reference pressure be the well pressure,


Pwf. The reference radius is the well radius, rw.
rw
req
Define req as radius where pressure, P(req) equals
average block pressure, Pl. Evaluate the pressure at
the equivalent radius (req) and we get:
∆x
qw µ Bw req
Pl = Pwf − ln
2π kh rw Pl

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

Evaluate the pressure in the adjacent block (for example q2 ∆x


Block #2), which is exactly ∆x away from block #1
∆x
qw µ Bw ∆x P2
P2 = Pl − ln
2π kh req Pl

Similar expressions can be made for 3 other


neighboring blocks
Pwf

rw req ∆x
Basic Well Model
Recall the equation from the mas balance:
kh
qw = − ( P1 + P2 + P3 + P4 − 4 Pl ) q3
µ Bw req

Derived equations for neighboring block


pressures: q4 q2 ∆x
qw µ Bw ∆x qw µ Bw ∆x
P1 = Pl − ln P3 = Pl − ln
2π kh req 2π kh 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

Mass balance equation can be simplified:

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

And simplified further:

2 qw∆x
qw = ln
π req

Solving for req we get the famous “Peaceman Correction”


π
π ∆x −
= ln ⇒ req = ∆xe 2
⇒ req = 0.2078∆x ≈ 0.2∆x
2 req
*So radius at which the pressure is equal to the average grid block pressure is about 20% of the grid block
size
Wells can be constrained by rate or bottom hole
pressure
Rate Constraint
We can solve for well pressure
qw
qw µ Bw 0.2078∆x qw
Pwf = Pl + ln = Pl + w
2π kh rw Jl

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

Well model can be written with a “productivity index” or “well index”


2π kh
qw = − J ( Pl − Pwf )
w J lw =
l req
µ Bw ln +s Skin factor
rw

Mass balance equation written implicitly in 1D:

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

For a constant bottom hole pressure well:

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

Grouping like terms of Pressure and multiplying through by “-1”

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

Diagonal Matrix Includes J*Pwf terms + constant


rate wells + BCs
Matrix Equations for Constant BHP Well
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

• Q is source vector; it includes a positive (J*Pwf) regardless of whether we have


an injector or producer BHP well. Note: This is different from constant rate wells
where the sign depends on producer or injector
Anisotropy and Rectangular Grids
If the porous medium is anisotropic and/or has rectangular grids:
1

(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

• Numerator of productivity index includes


geometric mean of permeability
∆y
• Equivalent radius has ratios of
permeability and includes rectangular
∆x
grid sizes

• Note that the expressions reduce to the


simpler case when medium is isotropic
and grids are square
Horizontal Wells
Horizontal wells have the following issues:
1. Much more likely anisotropic (kz ≠ kx or ky)
2. Well traverses horizontally, so dimensions changed
3. Well passes through multiple grids in x-y plane, so J
matrix has entries in each grid

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

Well traverses through blocks 4,5, and 6


Ch 8. Multiphase Flow
in Porous Media
Review of Numerical Simulation of Single Phase Flow

1. Derived continuity and diffusivity equations

2. Derived finite difference approximations for derivatives

3. Discretized PDE to obtain algebraic equations

4. Included reservoir heterogeneities in model

5. Extended to multidimensions

6. Added wells (constant rate and BHP) into model


Multiphase Flow

Applications: water flooding, aquifer support, saturated reservoirs, gas


flooding, and more!

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)

Gas component in oil or flowing separately

Gas does not dissolve in water

Water and oil do not mix


Mass Balance of Water
Balance of water component:
mw − mw A∆t + mw, well ∆V ∆t = ( mw t +∆t − mw t )
x x +∆x
mass in from well mass accumulated
mass in-out water in aqueous phase water in aqueous phase
water in aqueous phase

mass of water component


Recognizing: m w = ρ wu w mw = ρ w S wφ∆V ρw ≡
volume aqueous phase

(ρ 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

Divide by A∆x∆t and taking limits gives differential mass balance:

∂ ( ρ 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

Note: Bw (formation volume factor for water) ~1.0


Mass Balance of Water
∂ ( ρ wu w ) ∂ ( ρ wφ S w )
− + mw, well =
∂x ∂t

Divide by density at standard conditions, ρwsc, and use our definition of


formation volume factor of water

ρ 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:

mo − mo A∆t + mo , well ∆V ∆t = ( mo t +∆t − mo t )


x x +∆x
mass in from well mass accumulated
mass in-out oil in oileic phase oil in oileic phase
oil in oileic phase

mass of oil component


Recognizing: m o = ρ o uo mo = ρo Soφ∆V ρo ≡
volume oleic phase

(ρ 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

Fig. 4-10, Lake and Walsh (2003)


Oil Formation Volume Factor (Bo)
Reservoir Surface
(high pressure) (low pressure)
Oil formation volume factor is defined as:
res. vol. of oleic (oil + dissolved gas) phase VoRC RB oleic
Bo = = SC [=]
std. volume oleic phase ( oil only ) Vo STB oil

Mass of oleic phase at RC is mass of liquid + mass of dissolved gas at SC

mass oileic RC =mass oilSC + mass gasSC


ρoleic
RC RC
Voleic =ρoSC VoSC + ρ gSC VdgSC

Divide through by volume of oleic phase we get:

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

Note: Bo>1(usually, 1.0<Bo<2.0) because dissolved gas comes out of solution


Mass Balance of Oil

∂ ( ρ o uo ) ∂ ( ρoφ So )
− + mo , well =
∂x ∂t

Divide by density at standard conditions, ρosc, and use our definition of


formation volume factor of oil

ρ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 − mg A∆t + m dg − m dg A∆t + mg , well ∆V ∆t + mdg , well ∆V ∆t


x x +∆x x x +∆x
mass in from well mass in from well
mass in-out mass in-out gas in gaseous phase dissolved gas in oil phase
gas in gaseous phase dissolved gas in oileic phase

(
= mg
t +∆t
− mg
t
) + (m dg t +∆t − mdg
t
)
mass accumulated mass accumulated
gas in gaseos phase dissolved gas in oil phase

mass of gas component


m g = ρ g ug mg = ρ g S gφ∆V ρg ≡
Recognizing: volume gaseous phase
mdg = ρ dg Soφ∆V mass of dissolved gas
m dg = ρ dg uo ρ dg ≡
volume oleic 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

Divide by A∆x∆t and taking limits:

∂ ( ρ g u g + ρ dg uo ) ∂

∂x
+ mg , well + mdg , well =
∂t
( ρ gφ S g + ρ dgφ So )
Solution Gas-Oil Ratio (Rs)

Solution Gas-Oil Ratio is volume of dissolved gas at surface conditions


divided by the volume of oil at surface conditions
Gas Formation Volume Factor (Bg)
Definition of gas formation volume factor:
RC
reservoir volume of gaseous (gas + volatile oil) phase Vg ft 3
Bg = = [=]
std. volume gaseous phase ( gas only ) Vg
SC
scf

Mass of gaseous phase is mass of gas + liquids at SC:

mass gaseous RC = mass gasSC + mass oilSC


ρ gRC VgRC =ρ gSC VgSC + ρoSC VvoSC
Divide through by volume of gaseous phase at reservoir conditions
VgSC SC
VvoSC Vg ρ gSC + Rv ρoSC
ρ gRC =ρ gSC + ρoSC ⋅ SC =
VgRC RC
Vg Vg Bg
If no liquid comes out of the gaseous phase, Rv = 0 (Black Oil Model)
ρ gSC
ρ gRC =
Bg
Mass Balance of Gas

∂ ( ρ g u g + ρ dg uo ) ∂
− + mg , well + mdg , well = ( ρ gφ S g + ρ dgφ So )
∂x ∂t

Divide by density (ρgsc) at standard conditions and recall:

ρ 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

ρ w g ≈ 0.433 psi/ft ( water )

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

𝑘𝑘𝑟𝑟𝑟𝑟𝑟𝑟 𝑘𝑘𝑟𝑟𝑟𝑟𝑟𝑟

𝑘𝑘𝑟𝑟𝑟𝑟

𝑘𝑘𝑟𝑟𝑟𝑟

Brooks-Corey empirical models


nw no ng
S w − S wr 1 − So − Sor S g − S gc
krw = krw
0
; kro = krow krog = kro0 ; krg = krg0
1 − Sor − S wr − S gc 1 − Sor − S wr − S gc 1 − Sor − S wr − S gc
Capillary Pressure Curves


Pc ( S w ) = Po − Pw

• Most simulators include Pc


• Small (at the reservoir scale)
compared to the reservoir
pressure
• We will assume Pc =0

• Van Genuchten empirical model

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

∂ 1 R ∂ 1 kkrg ∂Pg 1 kkro ∂Po


φ S g + s So = + Rs + qg + Rs qo
∂t Bg Bo ∂x Bg µ g ∂x Bo µo ∂x

Auxiliary Equations Required


krw = f ( S w )
Pc ,ow ( S w ) = Po − Pw
S w + So + S g = 1 kro = f ( S w , S g )
Pc ,og ( S w ) = Pg − Po
krg = f ( S g )

Rarely can these coupled PDEs be solved analytically. An exception is the Buckley-Leverett problem

S = saturation k = perm [L2] B = FVF µ = viscosity [M/L/time] ρ = density [M/V]


Buckley-Leverett Theory for 1D Displacement
Semi-analytical solution saturation equation in 1D

Useful for benchmarking reservoir simulation (numerical) solutions

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

Initial and Boundary conditions


Core initially saturated with water at residual water saturation (Swi=Swr)

Constant injection rate (q) at x=0

Constant production rate (q) at x=L

Water
Water +
Oil
Buckley-Leverett Theory for 1D Displacement

Swf = saturation at water front

Injected Water “Shock Front”

Initial Water

Water front displaces as a shock wave


Buckley-Leverett Equations

Recall mass balance equation for water:


No sources/sinks
∂ φ Sw ∂ uw
=− + qw
∂t Bw ∂x Bw
Since rock and fluids are incompressible, porosity and FVF are constant
∂S w ∂u
φ =− w
∂t ∂x
Let fw be fractional flow, qw be water rate, and q the total rate (which is constant):

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

Velocity of constant-saturation front is proportional to the derivative of the


fractional flow curve:
∂x q ∂f w
=
∂t Sw Aφ ∂S w
φ = porosity Sw= wat. sat. t = time x = dist. [ft] u = velocity [ft/day] fw=fract. flow A=Area [ft2] q = flow rate [ft3/day]
Dimensionless Variables

It is convenient to introduce some dimensionless variables .

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

Integrating and recognizing that xD =0 at tD =0

∂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)

4. Compute xD at that Sw and tD. Plot point on Sw vs. xD 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

ρ w qw x ∆t − ρ w qw x +∆x ∆t = ρ w Aφ∆xS w t +∆t − ρ w Aφ∆xS w t


Swi
mass into CV mass out of CV accumulation
xDf, 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

Using some algebra and using dimensionless variables:

∆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

Equation suggests a secant line can be drawn connecting two points on a fw


versus Sw plot; (Swi, fwi) and (Swf, fwf)

∂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

Secant line connecting Swr to


the fw curve gives the value
of Swf

Swf
Steps for Generating Saturation Profile

1. Compute Swf by using secant method on fractional flow curve

𝜕𝜕𝑓𝑓
2. For all Sw > Swf, compute 𝜕𝜕𝑆𝑆𝑤𝑤 |𝑆𝑆𝑤𝑤 , numerically
𝑤𝑤

3. Compute dimensionless distance, xD at each Sw > Swf

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)

1. Identify the water pressure at a reference point, e.g. the WOC

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 )

1. Compute Pc at all depths: Pci = Poi − Pwi


2. Use the computed Pc’s and the Pc curve to compute saturations at each
depth
Pci = f ( S wi )
Initial Conditions for Multiphase Flow
Gas cap (oil/water at residual sat, only gas is mobile)

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)

Water zone (Below water-oil contact)

• Goal: determine Pw, Po and Sw as a function of depth


• Oil migrated to rock displacing water. This is drainage
• Pc @ WOC determined from Pc drainage curve. Called displacement pressure Pd
• Starting point is the water-oil contact (WOC); Sw=1
• No oil at or below WOC
• Cap pressure calculated from density difference
Pc Found Using Density Differences

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

5. Use the computed Pc’s


Pd and the Pc curve to compute
z saturations at each depth

P
Pci = f ( S wi )
Saturation Profile with Depth

Water Saturation Profile Saturation in


grid-blocks
z

Get z

Compute Pc

Read Sw
From Pc
table

WOC

Swir 1 Sw
Steps in Reservoir Initialization (Pw, Po, Sw)

1. Identify the water pressure at a reference point, e.g. the WOC

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 )

4. Compute Pc at all depths: Pci = Poi − Pwi


5. Use the computed Pc’s and the Pc curve to compute saturations at each
depth
Pci = f ( S wi )
Chapter 9:
1D IMPES for Multiphase Flow
(no capillary pressure, gravity)
Review: 2 Phase Flow: Oil/Water (No Gravity or Pc)

∂ φ 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

Chain rule to get derivative in terms of pressure (Oil Equation)

∂ φ So φ ∂So ∂ 1 S ∂φ ∂p
= + φ So + o
∂t Bo Bo ∂t ∂p Bo Bo ∂p ∂t

Recall definition of compressibilities:

∂ 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

φ ct ∂pBo ∂ kkro ∂p ∂ kkrw ∂p Bo


Overall: = + + qo + qw
Bw ∂t Bw ∂x µo Bo ∂x ∂x µ w Bw ∂x Bw

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

Using Finite Differences and the “implicit” method

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

Using Finite Differences and the “implicit” method

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

Using Finite Differences:


n +1
φi S w,i − S w,i
n
φi S wn ,i ( cw + cr ) Pi n +1 − Pi n 1 Pi −n1+1 − Pi n +1 Pi +n1+1 − Pi n +1
+ = λw,i −1 2 + λw,i +1 2 + qw , i
Bw,i ∆t Bw,i ∆t ∆xi ∆xi −1 2 ∆xi +1 2

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:

1. Solve pressure equation (a system of linear equations) implicitly

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

or in Matrix Form: S nw+1 = S nw + d12


−1
−Tw P n +1 + Q w − Ctw ( P n +1 − P n )
Viφi
Ctw,ii = S wn ,i ( cw,i + cr ,i ) ; d12,ii =
Bw,i ∆t
*** Since the solution is partially explicit it is only conditionally stable!!!
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)]
B B
Pressure Matrix Eqn (Implicit) T+ P n +1 = P n + Q
∆t ∆t
Total Transmissibility: sum of the water and oil transmissibility
Bo
T = Tw + To
Bw
Tw,1 2 + Tw,3 2 −Tw,3 2 0 0 To,1 2 + To,3 2 −To,3 2 0 0
−Tw,3 2 Tw,3 2 + Tw,5 2 −Tw,5 2 0 −To,3 2 To,3 2 + To,5 2 −To,5 2 0
Tw = To =
0 −Tw,5 2 Tw,5 2 + Tw,7 2 −Tw,7 2 0 −To,5 2 To ,5 2 + To ,7 2 −To ,7 2
0 0 −Tw,7 2 Tw,7 2 + Tw,9 2 0 0 −To ,7 2 To ,7 2 + To ,9 2

ki −1 2 krw,i −1/2 A ki −1 2 kro ,i −1/2 A


Tw,i −1/2 = To ,i −1/2 =
∆xi −1 2 µ w Bw ∆xi −1 2 µo Bo

Accumulation and Source Matrices


V1φ1ct ,1
Qw,1 Qo ,1
Bw,1
Bo Qw,2 Bo Qo ,2
B= ... Q = Qw + Qo = +
Bw Bw
VN φN ct , N
Qw, N Qo , N
Bw, N

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

S nw+1 = S nw + d12 −1 −Tw P n +1 + Q w − Ctw ( P n +1 − P n )


Saturation at
last timestep water saturation change due to flow water saturation change to accumulation
and injection/production from well (often small and negligible)

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

• Accumulation term is often small and can be neglected


• Note that d12 would be a little different if capillary pressure were present
Review IMPES method (2 phase)

Discretized mass balances for oil and water


1. Implicitly calculate pressure (overall mass balance) by solving system of equations
2. Explicitly update the saturation equation (water mass balance)

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

Explicit methods are only conditionally stable (and IMPES is partially


explicit). So time step (∆t) needs to be reasonably small

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

Absolute permeability: use harmonic mean as in single-phase flow:


−1
1 1 kA 2ki Ai ki +1 Ai +1
ki + 1 = 2 + =
2 ki k i+1 ∆x i+ 1 ki Ai ∆xi +1 + ki +1 Ai +1∆xi
2

Relative permeability: use technique called “upwinding”


• Harmonic and arithmetic mean can lead to errors
• Upwinding involves evaluation relative permeability in block flow comes from

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

Pressure and Saturation Equations::

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

Constant BHP wells have Pwf specified:

Qw,i = J w ( Pwf − Pi )

Productivity indices for each phase:

2π krw k h 2π kro k h
Jw = ; Jo =
r r
µ w Bw ln eq + s µo Bo ln eq + s
rw rw

Total productivity index is the sum of phase indices weighted by FVF’s

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

(CFL) condition is a necessary condition for stability of IMPES

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

Start with a mass balance (continuity equation) but the fluid is


compressible for gases, so density is a funcytion of pressure

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

Capillary pressure and gravity can sometimes be ignored if they are


small relative to the reservoir pressure

However, they are easy to handle if they need to be included


Potential (P+ρgh) is just used to account for gravity
Capillary pressure Pc=Po-Pw relates phase pressures – curve is needed

Mathematically, gravity and capillary pressure are lumped together in the


right hand side of the system of equations

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

For near-well simulations, we must use


radial geometry
Just change our coordinate system and
perform FD approximations
1 Matrix equations look same
∂u v= K ⋅∇P
ρ + u ⋅∇u = ρ g + ∇ ⋅ σ µ
∂t
∂p k 1 ∂ ∂P
= r
∂t µφ ct Bw r ∂r ∂r

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

Horizontal wells span over several grid blocks


Vertical wells had a source/sink for one block
Horizontal wells just distribute fluid over several blocks

http://www.geology.wisc.edu/courses/g115/oil/4.html
History Matching

Reservoir simulators are used as tools to predict


the future, but are only as good as the inputs
(permeabilty, porosity, etc.)

Input parameters generally come from a


geological model, well logs, core data, and /or
upscaled pore-scale results.

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)

History matching adjusts the simulator inputs


(permeability, porosity, etc.) in order to fit existing
production data (production rates, GOR, etc.)
Manual tuning
Global optimization routines

182
History Matching Process

Parameters to change in a history match


1. Aquifer transmissibility, kh
2. Aquifer storage, φhct
3. Reservoir transmissibility kh
4. Relative permeability and capillary pressure functions
5. Reservoir porosity and thickness
6. Structural definition
7. Rock compressibility
8. Reservoir oil and gas properties
9. Water/oil contacts (WOCs) and gas/oil contacts (GOCs)
10. Water properties

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

Traditional Approach: New Approach:


Dual Porosity/Permeability Model Discrete Fracture Modeling

Courtesy of Kamy Sepehnoori, UT-Austin


Upscaling

Upscaling is process of averaging fine-scale processes to coarser scales


Goal is to develop a coarse permeability, porosity field, etc. that produces the same
results as the fine-scale simulation
Inevitably, information will be lost during upscaling
Upscaling continues to be an open area of research
FULLY IMPLICIT (Alternative to IMPES)
• Idea is to solve both pressure and saturation implicitly at the same time
• Two unknowns per block, pressure and saturation; therefore there are 2N
equations and 2N unknowns in the system
• Note that the T matrix is “block” tridiagonal and the D matrix “block” diagonal
• Unconditionally stable, but also more computationally demanding

( 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

The “RHS” are given as follows:


P1 q1, w
S w,1 q1,o
P2 q2, w
X= S w,2 ; Q= q2,o

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

Formulate matrix equations in terms of residuals, R. The arrays T, D, G


etc. are functions of the solution vector X.

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

Step (3) Solve J dX=-R

Step (4) Update X(k+1) =X(k) + dX and repeat


Compositional Simulation

In principle make mass balances for each hydrocarbon component, such as


methane, ethane, propane, etc. but in practice, we limit the number of
components included, and group components into pseudo-components.

Solve PDEs for concentration of each species


∂ k ∂P ∂C ∂
Ci ρ + ρ D i + Ci ρ q = φ ( Ci ρ ) k=1,...N
∂x µ ∂x ∂x ∂t

Can solve the problem fully implicit or using IMPEC (implicit pressure,
explicit concentration)

Equilibrium flash calculations using K values and an equation of state (EOS)


must be used to determine hydrocarbon phase compositions. These are
used to determine densities, etc.

zk
∑ x =∑ 1 + ν ( K
k
k
k − 1)
=1
k
Streamline Simulation

Alternative to IMPES/Fully Implicit for multiphase flow


http://www.ireservoir.com/case_streamline.html

Basic Idea: Fluids are transported over a timestep along streamlines rather
than cell-to-cell as is done in finite difference approaches

3D pressure field is solved first, Darcy’s law is used to compute velocities


and streamlines. Components are traced along streamlines

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

Some of the world’s leaders in simulation are solving hundreds of millions or


billions of simultaneous equations at each time step. Bigger, faster
computers alone won’t do.

Parallel computing is a method that splits the problem into hundreds or


thousands of smaller problems
Each smaller problem is sent to its own computer
Computers must communicate because smaller problems depend on eachother

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

Integrated Parallel Accurate Reservoir Simulation System


State of the art solvers
Highly scalable
Couplings with geomechanics and chemistry
Multiblock approach: non-matching grids (structured or unstructured)

Courtesy of Mary Wheeler, UT-Austin


Where we are: Where we are going:
Numerics Numerics
Millions of unknowns Billions of unknowns
Advanced FEM and unstructured grids Advanced gridding
Parallel processing Bigger, faster computers

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

You might also like