F
UNDAMENTALS
O
F
R
ESERVOIR
S
IMULATION
Dr. Mai Cao Lan,
GEOPET, HCMUT, Vietnam
A
BOUT
T
HE
C
OURSE
C
OURSE
O
BJECTIVE
C
OURSE
O
UTLINE
Course Objective
•
To review the background of petroleum reservoir
simulation with an intensive focus on what and how
things are done in reservoir simulations
•
To provide guidelines for hands-on practices with
Microsoft Excel
I
NTRODUCTION
F
LOW
E
QUATIONS FOR
P
ETROLEUM
R
ESERVOIRS
F
INITE
D
IFFERENCE
M
ETHOD
& N
UMERICAL
S
OLUTION
F
OR
F
LOW
E
QUATIONS
S
INGLE
-
PHASE
F
LOW
S
IMULATION
M
ULTIPHASE
F
LOW
S
IMULATION
T. Eterkin et al., 2001. Basic Applied Reservoir Simulation,
SPE, Texas
J.H. Abou-Kassem et al., 2005. Petroleum Reservoir
Simulation – A Basic Approach, Gulf Publishing Company,
Houston, Texas.
C.Mattax & R. Dalton, 1990. Reservoir Simulation, SPE,
Texas.
I
NTRODUCTION
N
UMERICAL
S
IMULATION
– A
N
O
VERVIEW
C
OMPONENTS OF
A R
ESERVOIR
S
IMULATOR
Mathematical Model
Physical Model
Numerical Model
Computer Code
Reservoir
Simulator
•
A powerful tool for
evaluating reservoir performance
with the purpose of establishing a sound field
development plan
•
A helpful tool for
investigating problems
associated with
the petroleum recovery process and searching for
appropriate solutions to the problems
Reservoir Simulation Basics
•
The reservoir is divided into a number of cells
•
Basic data is provided for each cell
•
Wells are positioned within the cells
•
The required well production rates are specified as a
function of time
•
The equations are solved to give the pressure and
saturations for each block as well as the production of
each phase from each well.
Simulating Flow in Reservoirs
•
Flow from one grid block to the next
•
Flow from a grid block to the well completion
•
Flow within the wells (and surface networks)
Flow = Transmissibility * Mobility * Potential Difference
Geometry &
Properties
Fluid
Properties
Well
Production
S
INGLE
-P
HASE
F
LOW
E
QUATIONS
E
SSENTIAL
P
HYSICS
C
ONTINUITY
E
QUATION
M
OMENTUM
E
QUATION
C
ONSTITUTIVE
E
QUATION
G
ENERAL
3D S
INGLE
-P
HASE
F
LOW
E
QUATION
Essential Physics
The basic differential equations are derived from the
following essential laws:
Mass conservation law
Momentum conservation law
Conservation of Mass
Mass conservation may be formulated across a control element with one fluid
of density
r
, flowing through it at a velocity u:
D
x
u
r
element
the
inside
mass
of
change
of
Rate
Dx
+
at x
element
the
of
out
Mass
at x
element
the
into
Mass
Continuity Equation
Based on the mass conservation law, the continuity equation can be
expressed as follow:
A u
A
x
r
t
r
u
x
r
t
r
Conservation of Momentum
Conservation of momentum for fluid flow in porous materials
is governed by the semi-empirical Darcy's equation, which for
one dimensional, horizontal flow is:
x
P
k
u
Equation Governing Material Behaviors
The behaviors of rock and fluid during the production
phase of a reservoir are governed by the
constitutive
equations
or also known as the
equations of state
.
In general, these equations express the relationships
between rock & fluid properties
with respect to the
reservoir pressure
.
Constitutive Equation of Rock
The behavior of reservoir rock corresponding to the
pressure declines can be expressed by the definition of the
formation compaction
1
f
T
c
P
For isothermal processes, the constitutive equation of rock
becomes
f
d
c
dP
Constitutive Equation of Fluids
The behavior of reservoir fluids corresponding to the
pressure declines can be expressed by the definition of fluid
compressibility (for liquid)
1
,
, ,
l
T
V
c
l
o w g
V
P
For natural gas, the well-known equation of state is used:
Single-Phase Fluid System
Normally, in single-phase reservoir simulation, we would
deal with one of the following fluids:
One Phase Gas
One Phase Water
One Phase Oil
Single-Phase Gas
The gas must be single phase in the reservoir, which means
that crossing of the dew point line is not permitted in order
to avoid condensate fall-out in the pores. Gas behavior is
governed by:
r
g
r
gs
B
g
constant
B
g
Single-Phase Water
One phase water, which strictly speaking means that the
reservoir pressure is higher than the saturation pressure of
the water in case gas is dissolved in it, has a density
described by:
r
w
r
ws
B
w
constant
B
w
Single-Phase Oil
In order for the oil to be single phase in the reservoir, it
must be undersaturated, which means that the reservoir
pressure is higher than the bubble point pressure. In the
Black Oil fluid model, oil density is described by:
r
o
r
oS
r
gS
R
so
B
o
Single-Phase Fluid Model
For all three fluid systems, the one phase density or
constitutive equation can be expressed as:
r
constant
B
Single-Phase Flow Equation
The continuity equation for a one phase, one-dimensional system of
constant cross-sectional area is:
r
r
t
u
x
The conservation of
momentum for 1D,
horizontal flow is:
x
P
k
u
The fluid model:
r
constant
B
Substituting the momentum equation and the fluid model into the
continuity equation, and including a source/sink term, we obtain the
single phase flow in a 1D porous medium:
sc
q
k
P
x
B x
V
t B
(1/ )
,
, ,
l
d
B
c
B
l
o g w
dP
sc
t
f
l
b
q
c
k
P
P
P
c
c
x
B x
V
B
t
B
t
Based on the fluid model, compressibility can now be defined in terms of
the formation volume factor as:
Then, an alternative form of the flow equation is:
(1/ )
f
sc
b
c
q
k
P
d
B
P
x
B x
V
B
dP
t
Single-Phase Flow Equation for Slightly
Compressible Fluids
Single-Phase Flow Equation for Compressible
Fluids
sc
b
q
k
P
x
B x
V
t B
Boundary Conditions (BCs)
Mathematically, there are two types of boundary conditions:
•
Dirichlet
BCs:
Values of the unknown
at the boundaries
are specified or given.
•
Neumann
BCs: The
values of the first derivative
of the
unknown are specified or given.
Boundary Conditions (BCs)
From the
reservoir engineering
point of view:
Dirichlet BCs: Pressure values at the boundaries are
specified as known constraints.
Neumann BCs: The flow rates are specified as the known
constraints.
Dirichlet Boundary Conditions
For the one-dimension single phase flow, the Dirichlet boundary
conditions are the pressure the pressures at the reservoir boundaries,
such as follows:
x
L
t
P
L
R
P
P
t
x
P
0
,
0
,
0
A pressure condition will normally be specified as a bottom-hole
pressure of a production or injection well, at some position of the
reservoir.
Newmann Boundary Conditions
In Neumann boundary conditions, the flow rates at the end faces of the
system are specified. Using Darcy's equation, the conditions become:
For reservoir flow, a rate condition may be specified as a production or
injection rate of a well, at some position of the reservoir, or it is
specified as a zero-rate across a sealed boundary or fault, or between
non-communicating layers.
0
0
x
kA
P
Q
x
x
L
L
x
P
kA
Q
General 3D Single-Phase Flow Equations
The general equation for 3D single-phase flow in field units (customary
units) is as follows:
c
p
Z
g
r
Z: Elevation, positive in downward direction
c
,
c
,
c
: Unit conversion factors
y
y
x
x
c
c
b
z
z
c
sc
c
A k
A k
x
y
x
B
x
y
B
y
V
A k
z
q
z
B
z
t B
D
D
D
3D Single-Phase Flow Equations for
Horizontal Reservoirs
The equation for 3D single-phase flow in field units for horizontal
reservoir is as follow:
y
y
x
x
c
c
b
z
z
c
sc
c
A k
A k
p
p
x
y
x
B
x
y
B
y
V
A k
p
z
q
z
B
z
t B
D
D
D
x
x
Z
B
k
A
x
B
t
V
q
x
x
p
B
k
A
x
x
x
c
c
b
sc
x
x
c
D
D
1D Single-Phase Flow Equation with
Depth Gradient
F
INITE
D
IFFERENCE
M
ETHOD
&
N
UMERICAL
S
OLUTION OF
S
INGLE
-P
HASE
F
LOW
E
QUATIONS
F
UNDAMENTALS OF
F
INITE
D
IFFERENCE
M
ETHOD
Numerical Solution of Flow Equations
The equations describing flui flows in reservoirs are of
partial differential equations (PDEs)
Finite difference method (FDM) is traditionally used for
the numerical solution of the flow equations
Fundamentals of FDM
In FDM,
derivatives are replaced by a proper difference formula
based on
the
Taylor series expansions
of a function:
1 2 2 3 3 4 4 2 3 4
(
)
(
)
(
)
(
)
(
)
( )
1!
x2!
x3!
x4!
xx
f
x
f
x
f
x
f
f x
x
f x
x
x
x
x
D
D
D
D
D
2 2 3 2 3(
)
( )
(
)
2!
3!
x x xf
f x
x
f x
x
f
x
f
x
x
x
x
D
D
D
D
The first derivative can be written by re-arranging the terms:
(
)
( )
(
)
xf
f x
x
f x
O
x
x
x
D
D
D
Denoting all except the first terms by O (
D
x) yields
The difference formula above is of order 1
with the truncation error being
proportional to
D
x
Fundamentals of FDM (cont.)
To obtain
higher order
difference formula for the first derivative, Taylor series
expansion of the function is used from both side of x
2 3 3
(
)
(
)
(
)
2
3!
x xf
f x
x
f x
x
x
f
x
x
x
D
D
D
D
Subtracting the second from the first equation yields
2
(
)
(
)
(
)
2
f
f x
x
f x
x
O
x
x
x
D
D
D
D
The difference formula above is of order 2
with the truncation error being
proportional to (
D
x)
2
1 2 2 3 3 4 4 2 3 4(
)
(
)
(
)
(
)
(
)
( )
1!
x2!
x3!
x4!
xx
f
x
f
x
f
x
f
f x
x
f x
x
x
x
x
D
D
D
D
D
1 2 2 3 3 4 4 2 3 4(
)
(
)
(
)
(
)
(
)
( )
1!
x2!
x3!
x4!
xx
f
x
f
x
f
x
f
f x
x
f x
x
x
x
x
D
D
D
D
D
Typical Difference Formulas
Forward difference for first derivatives (1D)
(
)
( )
(
)
xf
f x
x
f x
O
x
x
x
D
D
D
1(
)
i i if
f
f
O
x
x
x
D
D
or in space index form
i-1
i
i+1
Typical Difference Formulas
Backward difference for first derivatives (1D)
( )
(
)
(
)
xf
f x
f x
x
O
x
x
x
D
D
D
1(
)
i i if
f
f
O
x
x
x
D
D
or in space index form
i-1
i
i+1
Typical Difference Formulas
Centered difference for first derivatives (1D)
2
(
)
(
)
(
)
2
xf
f x
x
f x
x
O
x
x
x
D
D
D
D
2 1 1(
)
2
i i if
f
f
O
x
x
x
D
D
or in space index form
i-1
i
i+1
Typical Difference Formulas
Centered difference for second derivatives (1D)
2 2 2 2
(
) 2 ( )
(
)
(
)
xf
f x
x
f x
f x
x
O
x
x
x
D
D
D
D
2 2 1 1 2 22
(
)
i i i if
f
f
f
O
x
x
x
D
D
or in space index form
i-1
i
i+1
Typical Difference Formulas
Forward difference for first derivatives (2D)
( , )
( ,
)
( , )
(
)
x yf
f x y
y
f x y
O
y
y
y
D
D
D
,
1
,
( , )
(
)
i j
i j
i j
f
f
f
O
y
y
y
D
D
or in space index form
i-1,j
i,j
i+1,j
i,j+1
Typical Difference Formulas
Backward difference for first derivatives (2D)
( , )
( , )
( ,
)
(
)
x y
f
f x y
f x y
y
O
y
y
y
D
D
D
,
,
1
( , )
(
)
i j
i j
i j
f
f
f
O
y
y
y
D
D
or in space index form
i-1,j
i,j
i+1,j
i,j+1
Typical Difference Formulas
Centered
difference for
first derivatives
(2D)
2 ( , )
( ,
)
( ,
)
(
)
2
x yf
f x y
y
f x y
y
O
y
y
y
D
D
D
D
,
1
,
1
2
( , )
(
)
2
i j
i j
i j
f
f
f
O
y
y
y
D
D
or in space index form
i-1,j
i,j
i+1,j
i,j+1
Typical Difference Formulas
Centered
difference for
second derivatives
(2D)
2 2 2 2 ( , )
( ,
) 2 ( , )
( ,
)
(
)
x yf
f x y
y
f x y
f x y
y
O
y
y
y
D
D
D
D
2
,
1
,
,
1
2
2
2
( , )
2
(
)
i j
i j
i j
i j
f
f
f
f
O
y
y
y
D
D
or in space index form
i-1,j
i,j
i+1,j
i,j+1
Solving time-independent PDEs
Divide the computational domain into subdomains
Derive the difference formulation for the given PDE by replacing all
derivatives with corresponding difference formulas
Apply boundary conditions to the points on the domain boundaries
Apply the difference formulation to every inner points of the
computational domain
Exercise 1
Solve the following Poisson equation:
2
2
2
16
sin(4
)
p
x
x
subject to the boundary conditions:
p=2 at x=0 and x=1
1
0
x
Exercise 2
Solve the following Poisson equation:
2
sin(
) sin(
)
0
1, 0
1
u
x
y
x
y
subject to the boundary conditions:
0 along the boundaries
0,
1,
0,
1
Boundary Condition Implementation
b
p
C
x
Newmann BCs:
1
0
1 1/ 2
1
0
0
1
1
p
p
p
C
x
x
x
p
p
C x
D
1
1/ 2
1
1
x x x x x x x xn
n
n
n
n
n
n
n
p
p
p
C
x
x
x
p
p
C x
D
Boundary Condition Implementation
Dirichlet BCs:
b
p
C
1
2
1
1
2
1
p
p
C
x
x
x
D
D D
1
1
1
x x x x xn
n
n
n
n
p
p
C
x
x
x
D
D
D
Exercise 3
Solve the following Poisson equation:
2
2
2
(
) exp(
)
0
1, 0
1,
2,
3
u
x
y
x
y
subject to the boundary conditions:
exp(
);
0,
1
u
x
y y
y
exp(
);
0,
1
u
x
y x
x
x
Solving time-dependent PDEs
Divide the computational domain into
subdomains
Derive the difference formulation for the given PDE by replacing all
derivatives with corresponding difference formulas in both space
and time dimensions
Apply the initial condition
Apply boundary conditions to the points on the domain boundaries
Apply the difference formulation to every inner points of the
computational domain
Exercise 4
Solve the following diffusion equation:
2
2
, 0
1.0,
0
u
u
x
t
t
x
subject to the following initial and boundary conditions:
(
0, )
(
1, ) 0,
0
u x
t
u x
t
t
( ,
0) sin(
),0
1
u x t
x
x
Explicit Scheme
The difference formulation of the original PDE in Exercise 4 is:
1
1
1
2
2
(
)
n
n
n
n
n
i
i
i
i
i
u
u
u
u
u
t
x
D
D
where
n=0,NT: Time step
Implicit Scheme
The difference formulation for the original PDE in Exercise 4
1
1
1
1
1
1
2
2
(
)
n
n
n
n
n
i
i
i
i
i
u
u
u
u
u
t
x
D
D
where
n=0,NT: Time step
Semi-Implicit Scheme
Semi-Implicit Scheme for the Diffusion Equation in Exercise 4 is
1
1
1
1
1
1
1
1
2
2
2
2
(1
)
(
)
(
)
n
n
n
n
n
n
n
n
i
i
i
i
i
i
i
i
u
u
u
u
u
u
u
u
t
x
x
D
D
D
where
0 ≤
≤ 1
n=0,NT: Time step
i =1,NX: Grid point index
Discretization in Conservative Form
2
1/2 1/2( )
( )
( )
i i i iP
P
f x
f x
P
x
x
f x
O
x
x
x
x
D
D
1 1 1/2 2 1(
)
(
)
i i i i iP
P
P
O
x
x
x
x
D
D D
1 1 1/2 2 1(
)
(
)
i i i i iP
P
P
O
x
x
x
x
D
D D
1 1 1/2 1/2 1 1(
)
(
)
2 ( )
2 ( )
(
)
(
)
( )
(
)
i i i i i i i i i i i iP
P
P
P
f x
f x
x
x
x
x
P
f x
O
x
x
x
x
D
D
D D
D
D
( )
P
f x
x
x
i-1
i
i+1
D
x
FDM for Flow Equations
FD Spatial Discretization
For slightly compressible fluids (Oil)
x
x
b
t
c
sc
c
A k
p
V c
p
x
q
x
B
x
B
t
D
For compressible fluids (Gas)
x
x
b
c
sc
c
A k
p
V
x
q
x
B
x
t B
D
FDM for Slightly Compressible Fluid Flow
Equations
FD Spatial Discretization
FD Temporal Discretization
Discretization of the left side term
The discretization of the left side term is then
1 1 2 1 2 1 2 2
( )
( )
( )
(
)
i i i i i iP
P
f x
f x
x
x
P
f x
O
x
x
x
x
D
D
where
f x
( )
cA k
x xB
1 1 1 2(
)
(
) / 2
i i i i iP
P
P
x
x
x
D
D
1 1 1 2(
)
(
) / 2
i i i i iP
P
P
x
x
x
D
D
FD Spatial Discretization of the LHS
1 1 2 2 1 1
(
)
(
)
x x x x x x c i c i i c i i i i iA k
p
A k
A k
x
P
P
P
P
x
B
x
B x
B x
D
D
D
Define
transmissibility
as the coefficient in front of the
pressure difference:
2
1
2
1
1
2
1
D
i
i
x
x
c
x
B
x
k
A
T
i
Transmissibility
FD Spatial Discretization
The left side term of the 1D single-phase flow equation is
now discritized as follow:
1 1 2
1
21
(
)
(
)
x
x
c
i
i
i
i
i
i
i
i
A k
P
x
Tx
P
P
Tx
P
P
x
B
x
D
1
2
1
1
2
2
1
i
x
x
x
c
i
i
A k
T
x
B
D
Transmissibility
1
1
1
1
2
2
x
x
x
x
x
x
i
i
c
c
i
x
x
i
i
x
x
i
i
A k
A k
A k
x
A k
x
A k
x
D
D
D
or
1
1
1
1
1
2
1
2
x x
x x
x x
c
c
c
i
i
i
A k
A k
A k
x
x
x
D
D
D
Transmissibility (cont’d)
i
i
i
i
i
i
i
x
x
x
x
D
D
D
D
1
1
1
2
1
i
i
i
i
i
i
i
x
x
x
x
D
D
D
D
1
1
1
2
1
B
1
2
1
2
1
1
2 1
D
i
i
x
x
c
x
B
x
k
A
T
i
D
D
D
D
D
D
i
i
i
i
i
i
i
i
x
x
i
i
x
x
i
x
x
i
x
x
c
x
B
x
B
x
x
x
x
k
A
x
k
A
k
A
k
A
T
i
1
1
1
2
1
1
1
1
1
1
2 1Discretized Transmissibility
FD Temporal Discretization
Explicit Method
1/2 1/21
1
1
i i in
n
i
i
n
n
n
n
n
n
b
t
x
i
i
x
i
i
sc
c
i
p
p
V c
T
p
p
T
p
p
q
B
t
D
Implicit Method
1/2 1/21
1
1
1
1
1
1
1
1
i i in
n
i
i
n
n
n
n
n
n
b
t
x
i
i
x
i
i
sc
c
i
p
p
V c
T
p
p
T
p
p
q
B
t
D
Semi-implicit Method
1/2 1/2 1/2 1/21
1
1
1
1
1
1
1
1
1
1
1
i i i i in
n
n
n
n
n
sc
x
i
i
x
i
i
n
n
i
i
n
n
n
n
n
n
b
t
x
i
i
x
i
i
c
i
q
T
p
p
T
p
p
p
p
V c
T
p
p
T
p
p
B
t
D
0
1
For the 1D, block-centered grid shown on the screen,
determine the pressure distribution during the first year of
production. The initial reservoir pressure is 6000 psia. The
rock and fluid properties for this problem are:
6
-1
t
1000ft;
1000ft;
75ft
1RB/STB; =10cp;
k =15md; =0.18; c =3.5 10 psi ;
Use time step sizes of =10, 15, and 30 days.
Assume B is unchanged within the pressure range
of interest.
x
x
y
z
B
D
D
D
Exercise 5
1
2
3
4
5
0
p
x
0
p
x
150 STB/D
scq
1000 ft
75 ft
1000 ft
Exercise 5 (cont’d)
For the 1D, block-centered grid shown on the screen,
determine the pressure distribution during the first year of
production. The initial reservoir pressure is 6000 psia. The
rock and fluid properties for this problem are:
6
-1
t
1000ft;
1000ft;
75ft
1RB/STB; =10cp;
k =15md; =0.18; c =3.5 10 psi ;
Use time step sizes of =10, 15, and 30 days.
Assume B is unchanged within the pressure range
of interest.
x
x
y
z
B
D
D
D
Exercise 6
1
2
3
4
5
0
p
x
6000psia
p
150 STB/D
scq
1000
ft
75
ft
1000
ft
Exercise 6 (cont’d)
FDM for Slightly Compressible Fluid Flow
Equations
FD Spatial Discretization
FD Temporal Discretization
1 1 2