Sunteți pe pagina 1din 77

ENGSCI 442

Week 7/8
Rosalind Archer

1.2

Intro to Petroleum Engineering


Petroleum engineers study the flow of
oil, gas and water through the the rock
comprising oil reservoirs.
Capital and operating expenses in oil
field management are huge and large
computational fluid dynamics (CFD)
models are used in the process of
decision making.

1.3

Intro to Petroleum Engineering


This set of lectures will introduce you to
petroleum engineering problems as an
application of the theoretical material
you studied in the earlier part of the
course.
Many of the numerical issues petroleum
engineers encounter are common to
other CFD problems.

1.4

Vocabulary
Petroleum engineering has a very
particular vocabulary and some peculiar
units.
In all problem we study I will try to
convert all the units to SI. In many
parts of the world however petroleum
engineers do not use SI.

1.5

What is a Reservoir?
An oil/gas reservoir is a permeable rock
formation that contains oil/gas. There
must be some kind of sealing
mechanism to prevent the oil from
escaping e.g. a impermeable rock
formation above.
Reservoirs may be as far as 5km below
the surface of the earth (under land or
under the sea.)

1.6

What is a Reservoir?

Oil producing well

Oil

Water

Zone

Water

Courtesy NExT - BRE

1.7

Reservoir Fluids
Gas may or may not co-exist with oil in
a reservoir. If present it will tend to exist
above the oil.
Water may be present below the oil.
As the reservoir pressure is reduced (by
production of oil) gas and water may
move into the oil zone.

1.8

Reservoir Fluids
One of the things that makes CFD for
petroleum reservoirs interesting/difficult
is that the properties (density, viscosity)
of the fluids can depend strongly on
both pressure and temperature.
As pressure is lowered gas may evolve
from the oil. This is the same process
that occurs when you take the cap of a
carbonated drink.

1.9

Rock Properties
There are three key rock properties we
will be interested in permeability,
porosity and compressibility.
Permeability (k) measures the ability of
fluid to flow through the rock. SI unit m 2,
field unit md.
Porosity () measures the fraction of the
total rock volume that is void space.
Dimensionless.
Compressibility (cf) measures the change
in the volume of the rock per unit change in
pressure. SI unit Pa-1, field unit psi-1.

1.10

Fluid Properties
The fluid properties we are interested in
are density, viscosity, compressibility,
solution gas-oil ratio and formation
volume factor.
Density ( is the mass of fluid per unit
volume. The SI unit is kg/m3 and the field
unit is lb/ft3.
Viscosity () is measured in Pa-s (SI) and
centipoise (abbreviated cp) in field units.

1.11

Fluid Properties
Compressibility (c) measures the change in
the volume of the fluid per unit change in
pressure. SI unit Pa-1, field unit psi-1.
Imagine you have a unit volume of oil (at
reservoir pressure) when this volume of oil
is bought to the surface it will liberate some
gas. The solution gas-oil ratio (Rs) is the
ratio of the gas volume (at surface) to the
oil volume (at surface).
Formation volume factor (B) is the ratio of
a unit volume of oil at surface conditions to
its volume at reservoir conditions.

1.12

Saturation
We keep track of what fraction of the
pore space is filled with oil, water or gas
in terms of phase saturation (volume oil,
water, or gas divided by total volume).
The symbols for these are:
So, Sw, Sg.

1.13

Rock-Fluid Properties
Relative permeability and capillary
pressure are quantities which govern
the interaction of the reservoir rock and
fluids.
Relative permeability (kr) measures the
reduction in permeability in a pore
space due the effects of multiphase
flow, i.e. a mixture of oil and water
needs a greater pressure drop for the
same flow-rate than pure oil or water
does.

1.14

Relative Permeability
Absolute permeability (k) is the
permeability of a porous medium to a
single phase.
If multiphase flow occurs the absolute
permeability must be modified into an
effective permeability (k*kr).
The relative permeability (kr) handles
multiphase flow effects.

Relative Permeability

1.15

krw

kro

1.16

Capillary Pressure
Difference in pressure across the
interface between two fluids
Function of saturation

pc p o p w

Capillary Pressure

1.17

40
30

Pc, psi20

Drainage

10
0
0.2

Imbibition

0.4

0.6

Sw

0.8

1.0

1.18

Standard Conditions
Oil is typically measured in barrels,
1 barrel = 5.615 ft3 = 0.1589 m3.
Volume however is not conserved
only mass is conserved. A volume
balance is appropriate if all volumes are
converted to standard conditions
(atmospheric pressure and
Vreservoir
temperature).

Vstandard

Bo

1.19

CFD Approach
Modelling of fluid flow in oil reservoirs in
based on one simple principle:
conservation of mass.
In some problems conservation of
energy is also considered but we will
treat all our examples as isothermal.

1.20

Domain
The problem
domain may be
highly irregular
and the rock
properties may
be very
heterogeneous.

This figures
shows porosity
values in a
200,000 cell grid
SPE 71596

1.21

Continuity Equation
The general equation for flow in a porous
medium is

u
t
where
is porosity , is density , u is velocity,
and t is time.

This equation is derived by performing a mass


balance on small volume of porous media.

Derivation

1.22

Consider an element of area (dS) and the


flows passing through it:


u n

dS

1.23

Derivation
When u is not normal (perpendicular) to
the surface, we take the normal
component u.n so that:
rate of mass flow out of dS = ( u n)dS
To get the total mass flow rate out of the
element, we integrate over the entire
surface.
total mass flow rate out = ( u n)dS

1.24

Derivation
Now, take a small volume, dV, from
anywhere in the element:

rate of mass loss out of V=

( )

dV
t

We then get the total rate of mass loss by


integrating over the entire element:

total rate of mass loss =

( )

dV
t
V

1.25

Equate both sides:


( )

( u n )dS = t dV
V

Gauss Divergence Theorem:


( u n )dS u dV
S

( )
u dV
dV
t
V
V

1.26

This implies:

()
(u )
t

1.27

Alternative Viewpoint
This is not the only way to derive the
continuity equation. It can also be
derived by summing mass inflows and
outflows and setting this equal to the
mass accumulation in a volume.
The derivative appears in the limit as the
volume being considered shrinks to zero.

1.28

Alternate Derivation
Consider a block shaped volume of the
porous media with side lengths x, y
and z.

y
x

x+x

1.29

Now consider the:


inflows
outflows
rate of accumulation
of mass into/out of this volume.
For simplicity we will consider the case where
there is only flow in the x-direction i.e. u is a
scalar.

1.30

Inflow rate
volume of fluid entering the block
= velocity*area

(u ) |x (yz)
mass of fluid entering the block

(u ) |x (yz)
units = mass/time

1.31

Outflow rate
volume of fluid leaving the block
= velocity*area

(u ) |( x x ) (yz)
mass of fluid entering the block

(u ) |( x x ) (yz)
units = mass/time

1.32

Volume of fluid in the block

(xyz)

Mass of fluid in the block

(xyz)

Rate of mass accumulation

t t () t

(xyz)
t

units = mass/time

1.33

Conservation of Mass
Conservation of mass requires the net
inflow rate i.e. (inflow - outflow), must
equal the accumulation rate.

(u ) x (u ) x x (yz)
() t t () t

(xyz)
t

1.34

Dividing through by xyz gives:

(u ) x (u ) x x () t t () t

x
t
Letting x and t go to zero gives:

(u )
()

x
t
i.e. continuity equation for 1D flow.

1.35

Summary
This equation is very general. It can be
applied to any fluid flow situation. We
will customize the continuity equation to
represent oil and gas flows by
considering the representation of
density and velocity in more detail.

1.36

Diffusivity Equations
Basic equations of fluid flow in a porous
medium combine:

Continuity Equation u
t

k
Darcy' s Law
u p

Equation of State
f p, T

Compressibility

1.37

Also use definition of isothermal


compressibility:
Fluid
Rock

1 V

c
V p
1

cf
p

1 B


B p

m ,T

Derivation

1.38

Start by substituting Darcys Law into


the continuity equation:

k

p
t

Assume constant k,

p
k t

1.39

Expand the left-hand side:


or

()
p () (p)
k t

( )
p ( ) (p)
k t
2

The density gradient term can be


expanded as:
d

p cp
dp

1.40

The middle term now becomes:

c (p ) (p )

This term is nonlinear. It can be


neglected however:
c is small (for liquids)
pressure-gradient squared is also small

We now have:
1 ( )
p
k t
2

1.41

Our goal now is to write the righthand side in terms of pressure not
density. First expand it:
1

p

k t
t
2

Apply the chain rule:


1 d p
d p

k dp t
dp t
2

1.42

Now introduce compressibility:


1
p
p
p
(c ) c f
k
t
t
2

p
p
(c c f )
k
t
2

ct p
p
k t
2

1.43

Linearity
If ct does not depend on p the
k
equation is linear.
ct
k does depend on p the

If
equation is nonlinear.

1.44

Coordinate Systems
Cartesian
2 p 2 p ct p
2
2
x
y
k t

Radial
2 p 1 p ct p

2
r
r r
k t
These equations are for 2D problems. To go to 3D
2
add p .
z 2

1.45

Diffusivity: Numerical Solution


p
p

2
x
t
2

c t
where
0.00633k

First discretize the region on


interest over both space and time.
Xi-2

Xi-1

xi

Xi+1

t t1 , t 2 , t 3 , ...

Xi+2

1.46

Diffusivity: Numerical Solution


Replace the analytical derivatives by
numerical approximations.
Central difference in space
Backward difference in time
n 1
i

p i 1 2p i p i 1
p p

2
t
x

n
i

Right now we are not stating what timestep


(n or n+1) the terms on the left are being
evaluated.

Implicit Solution Template

1.47

x i-1

xi

x i+1

n+1

1.48

Implicit - Time Level of Terms


An implicit solution scheme means
that the pressures at the nodes will be
evaluated at the new timestep (n+1) in
second derivative (space) term.

n 1
i 1

n 1
i
2

2p p
x

n 1
i 1

n 1
i

p
t

n
i

1.49

Alternative Approach
We derived the finite difference form of
the diffusivity equation using by writing
expressions for the derivatives involved
in terms of finite differences.
The same equation can also be derived
by posing the problem as a volume
balance on a grid block.

1.50

Gridblock Mass Balance

Outflow

Inflow
Accumulation

Conservation of Mass
Rate of Inflow - Rate of Outflow = Rate of Accumulation

1.51

Gridblock Mass Balance


z

xi-1

xi

xi+1

Consider a balance on block i:


Inflow

k
dp
0.00633
(yz)
B
dx i 1

i-1/2 denotes
the boundary
between i-1 and i

n 1

n 1

pi 1 pi
k
0.00633
(yz)
B
x

Unit standard ft3/day

1.52

Gridblock Mass Balance


k
dp
Outflow 0.00633 (yz)
B
dx i 1

n 1
i

p p
k
0.00633
(yz)
B
x

n 1
i 1

i+1/2 denotes
the boundary
between i+1 and i
Unit standard ft3/day

1.53

Gridblock Mass Balance


Rate of Accumulation:
(xyz)
Volume of fluid in the gridblock =
B

The pressure in the gridblock is changing


with time so the volume of fluid is also
changing.
Fluid compressibility:
c

1 V

V p

1.54

Gridblock Mass Balance


We are interested in the rate of increase
of fluid volume in the gridblock (dV/dt)

V V p

t
p t
From the definition of compressibility we
V
have:
cV
p
V
p

cV
t
t

1.55

Gridblock Mass Balance


Substituting for V gives:

c t (xyz) dp
V

t
B
dt
Finally substituting a numerical
approximation for dp/dt gives us an
accumulation rate of:
n 1
i

c t (xyz) p p
V

t
B
t

n
i

1.56

Conservation of Mass
Conservation of mass (just as in the
derivation of the continuity equation)
requires
rate of inflow - rate of outflow + rate of
accumulation = 0
If the terms did not sum to zero mass
would be being created or destroyed in
the grid block.

1.57

Conservation of Mass
Combining the inflow, outflow and
accumulation terms gives:
n 1
n 1
n 1
n 1

pi 1 pi
pi pi 1
k
0.00633
(yz)

B
x
x

n 1
n

c t (xyz) pi pi

B
t

Conservation of Mass

1.58

Dividing through by x, y, z gives:


n 1
n 1
n 1

k pi 1 2pi pi 1
0.00633

2
B
(x )

n 1
n

c t pi pi

B to the form
t derived
This is identical
using finite differences.

1.59

Volume versus Mass Balance


Note that the way this is formulated it is
actually a volume balance, not a mass
balance. However since formation
volume factors are introduced to
convert volume at reservoir conditions
to volume at standard conditions this is
equivalent to a mass balance.

Wells

1.60

Note that in this derivation we did not


included any source/sink terms to
represent wells. If the well flow-rate is
know then it can be easily added.
n 1
n 1
n 1

k pi 1 2 pi pi 1
0.00633

2
B
(x)

ct

p
qi
t

n 1
i

n
i

1.61

Wells
If the well flow-rate is not known then it
must be determined in terms on the well
pressure ... more detail than we require
right now!

1.62

Initial and Boundary Conditions


Initial condition

pi0 pinitial i 1, 2,, IMAX

(1D case)

Boundary conditions
Constant pressure at boundaries:
mass balance equation replaced by a
constraint equation.
p1 C1

pIMAX C2

1.63

Initial and Boundary Conditions


Boundary conditions
No flow at boundaries delete flow
term corresponding to that boundary.

No flow
boundary

xi

xi+1

1.64

Original Mass Balance Equation:


n 1
n 1
n 1
n 1

pi 1 pi
pi pi 1
k
0.00633 (yz )

x
x

pin 1 pin
ct (xyz )

Delete
inflow term

1.65

Dividing through by x, y, z gives:

k p p
0.00633
2

( x )
n 1
i 1

ct

n 1
i

n
i

n 1
i

Implicit Solution

1.66

System of equations
Left boundary (i = 1)
n 1
1

C1

(or no flow)

Interior points (i = 2,,IMAX-1)


pin11 2
n 1 pin11
n

pi

pi
2
2
2
t
x x t
x

Right boundary (i = IMAX)


1
p nIMAX
C2

(or no flow)

ct

0.00633k

Implicit Solution

1.67

Matrix Equation

b1
a
2

c1
b2
a3

c2
b3
.

c3
.

.
.
ai

.
bi
.

ci
.
.

.
.
aN

pin11
n 1

pi
di
p n 1

i 1


bN

1.68

Matrix Structure
System is tridiagonal
Size is (IMAX x IMAX)
Solved by the Thomas Algorithm

1.69

Implicit Solution
Advantage
Unconditionally stable

Disadvantage
Matrix solution

Explicit Solution

1.70

Discretize the region of interest


Discretize the diffusivity equation
Central difference in space
Forward difference in time
n
i 1

2p p
x
n
i
2

n
i 1

n 1
i

c
where
0.00633k

p
t

n
i

1.71

Finite Difference Template


t
n+1

t
n
t
t
x i-1

xi

x i+1

1.72

Initial and Boundary Conditions


Initial and boundary conditions are
handled in the same manner as for
the implicit method
but time level of all pressures in the
space derivative term is at n not n+1.

1.73

Explicit Solution
Explicit equations
Left boundary (i = 1)

p1 C1

(or no flow)

Interior points (i = 2,,IMAX-1)

pin1 2
n pin1
n 1

pi

pi
2
2
2
x x t
x t

Right boundary (i = IMAX)


1
p nIMAX
C2

(or no flow)

1.74

Explicit Solution: Summary


Advantage
Simple

Disadvantage
Stability limited
We can explore this stability limit using
a spreadsheet example.

1.75

Explicit.xls
Try entering different dx and dt
values on the spreadsheet.
Each time you make an entry the
solution for u will update.
For some dx and dt values the
solution will go to the steady-state
solution we expect. For others it
wont.
What relationship is required
between dx and dt to maintain
stability?

Stability Limit

1.76
Explicit.xls solves the problem:

You should have discovered that the stability limit is:

p p

2
x
t
2

t
x 2

1
2

Stability Limit

1.77
For the problem:

p 1 p
p 2
x
t

The stability limit is:

x 2

1
2

S-ar putea să vă placă și