You are on page 1of 100

PE 281 - APPLIED MATHEMATICS IN RESERVOIR

ENGINEERING

Rosalind Archer
Stanford University
Spring 2000
PE281 - Applied Mathematics in Reservoir Engineering

These notes were to developed accompany the lecture material for PE281.
I’ve tried hard to avoid losing negative signs etc. but some typos may have
snuck through. If you do find errors please contact me.

Rosalind Archer
rosalind@pangea

2
Chapter 1

Introduction

1.1 The Diffusion Equation


This course considers slightly compressible fluid flow in porous media. The
differential equation governing the flow can be derived by performing a mass
balance on the fluid within in a control volume.

1.1.1 One-dimensional Case


First consider a one-dimensional case as shown in Figure 1.1:

(mass in) − (mass out) = (mass accumulation) (1.1)


⇒ ∆tqρ|x − ∆tqρ|x+∆x = φV ρ|t+∆t − φV ρ|t (1.2)
∂p
where V = ∆xA and q = − kAµ ∂x
Dividing (1.2) through by ∆x and ∆t and taking limits as ∆x → 0 and
∆t → 0 gives:
qρ|x − qρ|x+∆x φAρ|t+∆t − φAρ|t
lim = lim (1.3)
∆x→0 ∆x ∆t→o ∆t
∂ ∂
⇒− (qρ) = (φAρ) (1.4)
∂x ∂t
Substituting Darcy’s law into (1.4) gives:
!
∂ kA ∂p ∂
ρ = (φAρ) (1.5)
∂x µ ∂x ∂t

3
PE281 - Applied Mathematics in Reservoir Engineering

z
y
A
x

∆x

Figure 1.1: One-dimensional control volume

Now assume (for simplicity) that k, µ and A are constant:


!
∂ ∂p µ ∂φρ
⇒ ρ = (1.6)
∂x ∂x k ∂t
Now account for the dependence of ρ on pressure by introducing the isother-
mal compressibility: !
1 ∂ρ
c= (1.7)
ρ ∂p T
where T denotes that the derivative is taken at constant temperature.
Equation (1.7) defines and EOS (equation of state):
Z p Z ρ dρ
cdP = (1.8)
psc ρsc ρ
⇒ c(p − psc ) = lnρ − lnρsc (1.9)
c(p−psc )
⇒ ρ = ρsc e (1.10)
Now substitute ρ(p) (equation 1.10) into equation 1.6):
! !
∂ ∂p µ ∂φ ∂  
ρsc ec(p−psc ) = ρsc ec(p−psc ) +φ ρsc ec(p−psc ) (1.11)
∂x ∂x k ∂t ∂t
The right hand side terms in equation 1.11 require further attention. First
consider the final term, φ ∂ρ
∂t
:
∂ρ ∂p
= ρsc ec(p−psc) c (1.12)
∂t ∂t
4
PE281 - Applied Mathematics in Reservoir Engineering

∂φ
Now consider ∂t
. First define the rock compressibility as:
!
1 ∂φ
cr = (1.13)
φ ∂p T

∂φ ∂p
⇒ = φcr (1.14)
∂t ∂t
Substitute equation 1.12 and 1.14 into 1.11:
!
∂ ∂p µ ∂p
ρ = ρφ(cr + c) (1.15)
∂x ∂x k ∂t

Let ct = cr + c. Now expand the spatial derivative in equation 1.15:

∂ 2 p ∂p ∂ρ φµct ∂p
ρ 2
+ = ρ (1.16)
∂x ∂x ∂x k ∂t
Now consider the second term in equation 1.16:
!2
∂p ∂ρ ∂p ∂ρ ∂p ∂ρ ∂p
= = (1.17)
∂x ∂x ∂x ∂p ∂x ∂p ∂x

This term is expected to be small so it is usually neglected.


Finally we have:
∂2p φµct ∂p
2
= (1.18)
∂x k ∂t

1.2 Three-dimensional Case


The diffusion equation can be expressed using the notation of vector calculus
for a general coordinate system as:
φµct ∂p
∇2 p = (1.19)
k ∂t
For the case of the radial coordinates the diffusion equation is:

1 ∂2p ∂2p
!
1 ∂ ∂p φµct ∂p
r + 2 2+ 2 = (1.20)
r ∂r ∂r r ∂θ ∂z k ∂t

5
PE281 - Applied Mathematics in Reservoir Engineering

1.3 Dimensionless Form


1.3.1 One Dimensional Problem
The pressure equation for one dimensional flow (equation 1.18) can be written
in dimensionless form by choosing the following dimensionless variables:
pi − p
pD = (1.21)
pi
x
xD = (1.22)
L
where L is a length scale in the problem.
kt
tD = (1.23)
φµct L2
With this choice of dimensionless variables the flow equation becomes:

∂ 2 pD ∂pD
2
= (1.24)
∂xD ∂tD

1.3.2 Radial Problem


The radial form of the pressure equation is usually written in nondimensional
form taking account of the boundary conditions. When only radial variations
of pressure are considered the pressure equation is:
!
1 ∂ ∂p φµct ∂p
r = (1.25)
r ∂r ∂r k ∂t

Boundary and initial conditions:


2πkh ∂p
q=− r , r = rw (1.26)
µ ∂r

p = pi , r → ∞, ∀t (1.27)
p = pi , t = 0, ∀r (1.28)
Begin by setting:
pD = α(pi − p) (1.29)

6
PE281 - Applied Mathematics in Reservoir Engineering

where alpha must still be determined. The infinite acting boundary condition
becomes:
pD = α(pi − pi ) = 0, r → ∞, ∀t (1.30)
The initial condition becomes:

pD = α(pi − pi ) = 0, t = 0, ∀r (1.31)

Set the dimensionless length, rD as:


r
rD = (1.32)
rw
Set dimensionless time, tD as:
t
tD = (1.33)
t∗
where t∗ must still be determined. Now substitute pD and rD into the pressure
equation:
 
pD
φµct ∂ − α + pi
!
1 ∂ ∂ pD

rD rw − + pi = (1.34)
rD rw ∂rD rw ∂rD rw α k ∂tD t∗

Simplifying (1.34) gives:


!
1 1 ∂ ∂pD φµct ∂pD
2
rD = (1.35)
rw α rD ∂rD ∂rD kt∗ α ∂tD

φµct rw2
⇒ t∗ = (1.36)
k
!
1 ∂ ∂pD ∂pD
rD = (1.37)
rD ∂rD ∂rD ∂tD
Finally determine α from the inner boundary condition:
2πkh ∂p
q= r (1.38)
µ ∂r
(No negative sign is required here because the flow is in the negative r direc-
tion)
qµ ∂ pD
 
= rD rw − + pi (1.39)
2πkh ∂rD rw α

7
PE281 - Applied Mathematics in Reservoir Engineering

2πkh
⇒α= (1.40)

Nondimensionalise inner boundary condition:
∂pD
|r =1 = −1 (1.41)
∂rD D

1.4 Superposition
Solutions to complex problems can be found by adding simple solutions rep-
resenting the pressure distribution due to wells producing at constant rate
at various locations and times. This concept is known as superposition. It is
only applicable to linear problems.

Superposition in Time
Assume we have an analytical solution, pconst (q, r, t), to the problem of a well
producing at a constant rate in a given reservoir. Using superposition in time
this solution can be extended to handle a well with a variable flow rate. If
a well begins producing at rate q1 then at time t1 the rate changes to q2 the
flow rate can be represented as shown in Figure 1.2.
The analytical solution for the pressure distribution caused by the well
producing at variable rate is:
pvar (r, t) = pconst (q1 , r, t) + pconst(q2 − q1 , r, t − t1 ) (1.42)

Superposition in Space
Production from multiple wells can be handled using superposition also. Sup-
pose again we have a solution pconst (q, r, t) for the pressure distribution due
to a well located at the origin, flowing at rate q. The solution for a a reservoir
containing two wells as shown in Figure 1.3 can be generated by summing
this solution as follows:
p(r, t) = pconst (q1, r1, t) + pconst (q2, r2, t) (1.43)
where q
r1 = (x − x1)2 + (y − y1)2 (1.44)
q
r2 = (x − x2)2 + (y − y2)2 (1.45)

8
PE281 - Applied Mathematics in Reservoir Engineering

q q1

q2

t1 t

=
q q1 q

+
t1
t t

-(q1-q2)

Figure 1.2: Flow rate variation

Figure 1.3: Well configuration

9
PE281 - Applied Mathematics in Reservoir Engineering

closed boundary

reservoir

image producer
producer
well

Figure 1.4: Closed boundary

constant pressure boundary

reservoir

image producer
injector
well

Figure 1.5: Constant pressure boundary

Using Superposition to Handle Boundary Conditions


Superposition in space can be used to impose constant pressure and/or closed
boundary conditions. To do so fictitious wells known as image wells are placed
in the reservoir in such a way that their effect on the pressure distribution
creates the boundary condition. If multiple boundary conditions are involved
this can lead to an array of images wells whose contribution to the reservoir
pressure distribution is summed.

Examples of the use of image wells are shown in Figures 1.4 and 1.5.

10
PE281 - Applied Mathematics in Reservoir Engineering

1.4.1 Well Boundary Conditions when Superposition


is Applied
The superposition theorem guarantees the pressure distribution obtaining by
summing simple solutions will satisfy the pressure equation. The boundary
condition at the well however requires careful consideration.

Wells Controlled by Bottom Hole Pressure


If a reservoir contains two wells with specified bottom hole pressures p1 and p2
a pressure solution can be obtained by summing two solutions for a single well
at specified well pressure. This solution will satisfy the pressure equation.
However this solution will not satisfy the required bottom hole pressures at
the wells. If both wells are producers then there will be additional drawdowns
at each well due to production in the other well. However if the wells are far
apart this effect is likely to be small.

Wells with a Specified Flow Rate


A solution for a reservoir with multiple wells with specified flow rates can
be generated from solutions for a single well. Unlike the case of bottom hole
pressure controlled wells this solution will satisfy the flow rate boundary
condition at each well. This is possible because each superposed solution
conserves mass locally so it does not add any extra flow at the well locations.

11
Chapter 2

The Laplace Transform

The Laplace Transform is defined by:


Z ∞
L{f (t)} = e−st f (t)dt = fˆ(s) (2.1)
0

Example:
f (t) = t (2.2)
Use integration by parts, recall:
b dv b du
Z Z
u dt = uv|ba − v dt (2.3)
a dt a dt
Choose u = t and v = − 1s e−st
t −st ∞ Z ∞ 1 −st
⇒ L{f (t)} = − e |0 + e dt (2.4)
s 0 s
1 −st ∞ 1
 
= 0 + − 2e = 2 (2.5)
s 0 s
For the Laplace transform to exist the following requirements must hold:
a) f (t) have a finite number of maxima, minima and discontinuities
b) there exist constants α, M, T such that

e−αt |f (t)| < M, t>T (2.6)


Functions satisfying this requirement are known as functions of exponential
order. For t > 0 there is α1 > α such that:
e−α1 t |f (t)| < M (2.7)

12
PE281 - Applied Mathematics in Reservoir Engineering

When this just holds α is known as the abscissa of covergence.


Example:
f (t) = e2t (2.8)
e−αt e2t = e−(α−2)t (2.9)
(2.9) remains bounded for α ≤ 2, therefore the abscissa of convergence for
this f (t) is 2.

2.1 Properties of Laplace Transforms


2.1.1 Theorem 1 - Linearity of the Laplace Transform
Operator
L{c1 f1 (t) + c2 f2 (t)} = c1 L{f1 (t)} + c2 L{f2 (t)} (2.10)
⇒ the Laplace Transform is a linear operator.
Proof: Z ∞
L{c1 f1 + c2 f2 } = e−st c1 f1 + c2 f2 dt (2.11)
0
Z ∞ Z ∞
−st
= c1 e f1 dt + c2 e−st f2 dt (2.12)
0 0

= c1 L{f1 (t)} + c2 L{f2 (t)} (2.13)

2.1.2 Theorem 2 - Laplace Transform of a Time Deriv-


ative
L{f 0(t)} = sL{f (t)} − f (0) (2.14)
Proof: Z ∞
0
L{f (t)} = e−st f 0 (t)dt (2.15)
0
Integrate by parts
Z ∞
−st
=e f (t)|∞
0 − f (t)(−se−st )dt (2.16)
0
Z ∞
= −f (0) + s e−st f (t)dt (2.17)
0

= sL{f (t)} − f (0) (2.18)

13
PE281 - Applied Mathematics in Reservoir Engineering

2.1.3 Theorem 3 - Laplace Transform of a Derivative


n−1
∂nf
( )
n
si f n−i−1(0)
X
L = s L{f (t)} − (2.19)
∂tn i=0

This can be proved by repeated application of Theorem 2.

2.1.4 Theorem 4 - Early Time Behaviour


lim sL{f (t)} = lim+ f (t) = f (0+ ) (2.20)
s→∞ t→0

Proof:
Begin from Theorem 2

L{f 0 (t)} = sL{f (t)} − f (0+ ) (2.21)

Now take limits:

lim L{f 0 (t)} = lim sL{f (t)} − f (0+ ) (2.22)


s→∞ s→∞

If f 0 (t) is of exponential order:

lim e−st f 0 (t)dt → 0 (2.23)


s→∞


|f 0 (t)| < Meαt , ∀t > 0 (2.24)
b
Z b Z b Me−(s−α)t
I(b) = |f 0 (t)|e−st dt < Meαt e−st dt = (2.25)
−(s − α)

0 0 0
s > α as b → ∞

M
lim I(b) = (2.26)
b→∞ s−α
then as s → ∞, I(b) → 0
Therefore the left hand side of (2.21) tends to zero, i.e.:

0 = lim sL{f (t)} − f (0+ ) (2.27)


s→∞

proving theorem 4.

14
PE281 - Applied Mathematics in Reservoir Engineering

2.1.5 Theorem 5 - Late Time Behaviour


lim sL{f (t)} = lim f (t) (2.28)
s→0 t→∞

Proof:
Begin from Theorem 2

L{f 0 (t)} = sL{f (t)} − f (0+ ) (2.29)


Now take limits:

lim L{f 0 (t)} = lim sL{f (t)} − f (0+ ) (2.30)


s→0 s→0

Expand the left hand side term:


Z ∞ Z ∞ Z ∞
−st 0 0 −st
lim e f (t)dt = f (t)lims→0 e dt = f 0 (t)dt (2.31)
s→0 0 0 0

= limt→∞ f (t) − f (0) (2.32)


Substituting (2.32) into (2.29) gives:

lim sL{f (t)} = lim f (t) (2.33)


s→0 t→∞

2.1.6 Theorem 6 - Multiplication of a Transform by s


∂ −1
If L{f (t)} = sφ(s) then f (t) = ∂t L {φ(s)}
Proof:
F (t) = L−1 {φ(s)} (2.34)
Use Theorem 2:
L{F 0(t)} = sL{F (t)} − F (0) (2.35)
and use Theorem 4:

F (0) = lim sL{F (t)} = lim sφ(s) (2.36)


s→∞ s→∞

= lim L{f (t)} = 0 (2.37)


s→∞

Now consider F 0 (t) by returning to Theorem 2:

L{F 0 (t)} = sL{F (t)} = sφ(s) = L{f (t)} (2.38)

15
PE281 - Applied Mathematics in Reservoir Engineering

Taking inverse Laplace Transforms of this gives:


L−1 {L{F 0(t)}} = L−1 {sφ(s)} = L−1 {L{f (t)}} (2.39)

F 0 (t) = L−1 {sφ(s)} = f (t) (2.40)


L{φ(s)} = f (t) (2.41)
∂t
Example: Suppose we want to find the inverse transform of:
s
L{f (t)} = 2 (2.42)
s + a2
We know can use the following transform relationship to help us:
sin at 1
L{ }= 2 (2.43)
a s + a2
Using theorem 6 we know:
∂ sin at
f (t) = = cos at (2.44)
∂t a

2.1.7 Theorem 7 - Division of a Transform by s


t 1
Z 
L f (t)dt = L{f (t)} (2.45)
0 s
Proof: Z t  Z ∞ Z t 
L f (t)dt = e−st f (t0 )dt0 dt (2.46)
0 0 0
Use integration by parts:
∞
1 t 1 ∞ 1
 Z Z
0 0
=− f (t )dt + e−st f (t)dt = L{f (t)} (2.47)
s 0 0 s 0 s
Example: Suppose we require the inverse transform of:
1 1 1
L{f (t)} = = (2.48)
s3 + 4s s s2 + 4
We know:
1 1
 
L 2 = sin 2t (2.49)
s +4 2
1 1
Z t
⇒ f (t) = sin 2tdt = (1 − cos 2t) (2.50)
0 2 4

16
PE281 - Applied Mathematics in Reservoir Engineering

2.1.8 Theorem 8 - First Shift Theorem


L{e−at f (t)} = fˆ(s + a) (2.51)
Proof:
Z ∞ Z ∞
L{e−at f (t)} = e−at e−st f (t)dt = ˆ + a)
e−(s+a) f (t)dt = f(s (2.52)
0 0

2.1.9 Theorem 9 - Second Shift Theorem


L{f (t − a)u(t − a)} = e−as L{f (t)} (2.53)
where u(t − a) is a unit step function.

u(t − a) = 1, t−a>0 (2.54)


= 0, otherwise (2.55)
(2.56)
Proof: Z ∞
L{f (t − a)u(t − a)} = f (t − a)u(t − a)e−st dt (2.57)
0
Z ∞
= f (t − a)e−st dt (2.58)
a
Z ∞
= f (τ )e−s(τ +a) dτ (2.59)
0
where τ = t − a Apply Theorem 8:
Z ∞
= e−sa f (τ )e−sτ dτ (2.60)
0
−sa
=e Lf (t)dt (2.61)

2.1.10 Theorem 10 - Multiplication by t


L{tf (t)} = −fˆ0 (s) (2.62)
Proof:
ˆ0 d Z ∞ −st
f (s) = e f (t)dt (2.63)
ds 0
Z ∞
= −te−st f (t)dt (2.64)
0
= −L{tf (t)} (2.65)

17
PE281 - Applied Mathematics in Reservoir Engineering

2.1.11 Theorem 11 - Division by t


( )
f (t) ∞
Z
L = fˆ(s)ds (2.66)
t s

Proof: Z ∞ Z ∞ Z ∞
fˆ(s)ds = e−st f (t)dtds (2.67)
s s 0
Z ∞ Z ∞
= e−st f (t)dsdt (2.68)
0 s
#∞
e−st
"
Z ∞
= f (t) dt (2.69)
0 −t s

f (t) −st

Z
= e dt (2.70)
0 t
( )
f (t)
=L (2.71)
t

2.1.12 Theorem 12 - Convolution


Z t
L{f (t)}L{g(t)} = L{ f (t − λ)g(λ)dλ} (2.72)
0
Z t
= L{ f (λ)g(t − λ)dλ} (2.73)
0

= L{f (t) ∗ g(t)} (2.74)


Proof:
First use the definition of the Laplace transform:
Z t Z ∞ Z t
L{ f (t − λ)g(λ)dλ} = f (t − λ)g(λ)e−stdλdt (2.75)
0 0 0

Change limits on the λ integral by introducing a step function:


Z ∞ Z ∞
= u(t − λ)f (t − λ)g(λ)e−st dλdt (2.76)
0 0

(See Figure 2.1 for the step function.)


Change the order of integration:
Z ∞ Z ∞
= g(λ) u(t − λ)f (t − λ)e−st dtdλ (2.77)
0 0

18
PE281 - Applied Mathematics in Reservoir Engineering

t λ

Figure 2.1: Step function as a function of λ

λ τ

Figure 2.2: Step function as a function of t

(See Figure 2.2 for the step function.)


Take account of step function:
Z ∞ Z ∞
= g(λ) f (t − λ)e−st dtdλ (2.78)
0 λ
Apply first shift theorem:
Z ∞ Z ∞ 
−s(τ +λ)
= g(λ) f (τ )e dτ dλ (2.79)
0 0
Z ∞ Z ∞
= g(λ)e−sλdλ f (τ )e−sτ dτ (2.80)
0 0

= L{g(t)}L{f (t)} (2.81)


where τ = t − λ

19
PE281 - Applied Mathematics in Reservoir Engineering

2.2 Solving Differential Equations with Laplace


Transforms
Laplace transforms can be used as a powerful tool to solve differential equa-
tions. The general procedure is:
- transform both side of the equation
- solve the transformed equation to get an expression for the Laplace trans-
form of the solution
- invert to find the solution in real space

This approach turns an ordinary differential equation into an alegbraic


equation and a partial differential equation in x and t into an ordinary dif-
ferential equation in x or t.

2.2.1 Ordinary Differential Equation Example


Solve:
y 00 + 2y 0 + y = te−t (2.82)
where
y(t = 0) = 1 (2.83)
y 0 (t = 0) = −2 (2.84)
L{y 00} = s2 ŷ − sy(0) − y 0(0) (2.85)
L{y 0} = sŷ − y(0) (2.86)
1
L{te−t } = (2.87)
(s + 1)2
1
⇒ s2 ŷ − s + 2 + 2sŷ − 2 + ŷ = (2.88)
(s + 1)2
Solve for ŷ:
1
(s2 + 2s + 1)ŷ − s = (2.89)
(s + 1)2
1
(s + 1)ŷ = +s (2.90)
(s + 1)2
1 s
⇒ ŷ = 4
+ (2.91)
(s + 1) (s + 1)2

20
PE281 - Applied Mathematics in Reservoir Engineering

Now invert to find y. Consider the first term, we know (from tables):

n!
L{t( n)} = (2.92)
sn+1
Combining this transform with the first shift theorem gives:

e−t t3
( )
−1 1
L = (2.93)
(s + 1)4 3!

Now consider the second term:


s s+1−1 1 1
2
= 2
= − (2.94)
(s + 1) (s + 1) s + 1 (s + 1)2

We can use the known transforms:


1
L{1} = (2.95)
s
and
1
L{t} = (2.96)
s2
Combining this with the first shift theorem again gives:
( )
−1 s
L = e−t − e−t t (2.97)
(s + 1)2

The final solution for y is:

t3
!
−t
y=e −t+1 (2.98)
3!

2.3 Computing Laplace Transforms in Math-


ematica
Laplace transforms can be computed using Mathematica using the Laplace
Transform Calculus package. On wasson the example given in Equation (2.5)
can be computed using:

21
PE281 - Applied Mathematics in Reservoir Engineering

In[1]:= Needs["Calculus‘LaplaceTransform‘"]

In[2]:= LaplaceTransform[t,t,s]

-2
Out[2]= s

The inverse transform can be computed using:

In[4]:= InverseLaplaceTransform[s^-2,s,t]

Out[4]= t

If you’re using the Mathematica version available on WinDD there is no


need to load the Calculus‘LaplaceTransform‘ package.
Note: For problem sets please work out any transforms required by hand
and show working, unless otherwise specified. Feel free to check your work
against Mathematica output however.

22
Chapter 3

Petroleum Engineering
Applications of Laplace
Transforms

This chapter outlines how Laplace transforms can be used to solve problems
of interest to petroleum engineers. The solutions presented consider different
treatments of the well and different boundary conditions.

3.1 Line Source Solution


This section considers infinite acting radial flow in a reservoir where the
well is modelled as a line source. The differential equation and boundary
conditions involved are:
!
1 ∂ ∂p φµct ∂p
r = (3.1)
r ∂r ∂r k ∂t

A constant rate boundary condition is specified at r = 0.


2πkh ∂p
q= r (3.2)
µ ∂r
The outer boundary condition is:

p = pi , r→∞ (3.3)

23
PE281 - Applied Mathematics in Reservoir Engineering

The initial condition is:


p = pi , ∀r, t = 0 (3.4)
This can be written in dimensionless form as:
2πkh
pD = (pi − p) (3.5)

r
rD = (3.6)
rw
kt
tD = (3.7)
φµct rw2
!
1 ∂ ∂pD ∂pD
rD = (3.8)
rD ∂rD ∂rD ∂tD
pD (rD , tD = 0) = 0 (3.9)
pD (rD → ∞, tD ) = 0 (3.10)
∂pD
rD|r →0 = −1 (3.11)
∂tD D
The solution procedure begins by Laplace transforming both sides of the
pressure equation:
( !) ( )
1 ∂ ∂pD ∂pD
L rD =L (3.12)
rD ∂rD ∂rD ∂tD
!
1 ∂ ∂ p̂D
rD = sp̂D − pD (rD , tD = 0) (3.13)
rD ∂rD ∂rD
∂ 2 p̂D 1 ∂ p̂D
⇒ 2
+ − sp̂D = 0 (3.14)
∂rD rD ∂rD
A solution to this differential equation can be found by noting that it is an
example of a modified Bessel equation.

24
PE281 - Applied Mathematics in Reservoir Engineering

3.1.1 Bessel and Modified Bessel Equations


The Bessel equation is:

x2 y 00 + xy 0 + (x2 − n2 )y = 0 (3.15)

y = c1 Jn (x) + c2 Yn (x) (3.16)


where Jn is a Bessel function of the first kind of order n and Yn is a Bessel
function of the second kind or order n.
The modified Bessel equation is:

x2 y 00 + xy 0 − (x2 + n2 )y = 0 (3.17)

y = c1 In (x) + c2 Kn (x) (3.18)


where In and Kn are modified Bessel functions of order n.

3.1.2 Laplace Space Solution for pD


The transformed pressure equation can be written as:

2 ∂ 2 p̂D ∂ p̂D 2
rD 2
+ rD − rD sp̂D = 0 (3.19)
∂rD ∂rD

Substitute ξ = rD s:

∂ 2 p̂D ∂ p̂D
ξ2 2
+ξ − ξ 2 p̂D = 0 (3.20)
∂ξ ∂ξ
Solve for p̂D : √ √
p̂D = c1 I0 (rD s) + c2 K0 (rD s) (3.21)
Now consider the boundary conditions. First consider the infinite acting
condition. As rD → ∞, p̂D must remain bounded, however:

lim I0 (x) = ∞ (3.22)


x→∞

To prevent p̂D from going to infinity we set c1 = 0.



⇒ p̂D = c2 K0 (rD s) (3.23)

25
PE281 - Applied Mathematics in Reservoir Engineering

The inner boundary condition is:


∂pD
lim rD = −1 (3.24)
rD →0 ∂rD
( )
∂pD ∂ p̂D 1
⇒ lim L rD = lim rD = L{−1} = − (3.25)
rD →0 ∂rD rD →0 ∂rD s
To differentiate the Bessel function we need the following recurrence rela-
tionship:
d  −n 
x Kn (x) = −x−n Kn+1 (x) (3.26)
dx
Substituting (3.26) into (3.25) gives:

∂  √  1
lim rD c2 K0 (rD s) = − (3.27)
rD →0 ∂rD s
h √ √ i 1
⇒ lim −c2 rD sK1 (rD s) = − (3.28)
rD →0 s
To evaluate the limit we can use the following limiting form of Kv for small
arguments:
1 1
Kv (z) ≈ Γ(v)( z)−v (3.29)
2 2
√ 1
⇒ lim K1 (rD s) = √ (3.30)
rD →0 rD s

!
1 1
⇒ −c2 lim rD s √ =− (3.31)
rD →0 rD s s
1
⇒ c2 = (3.32)
s
Finally we have the complete solution for p̂D :
1 √
p̂D (rD , s) = K0 (rD s) (3.33)
s
Now invert p̂D to find pD . This can be achieved by recalling theorem 7:
t 1
Z 
L f (t)dt = L{f (t)} (3.34)
0 s

26
PE281 - Applied Mathematics in Reservoir Engineering


To proceed the inverse transform of K0 (rS s) is required. Transform pair
117 from the handout gives the following:

√ 2
!
1 −rD
L−1 {K0 (rD s)} = exp (3.35)
2tD 4tD
2
!
tD 1 −rD
Z
⇒ pD = exp dtD (3.36)
0 2tD 4tD
This integral can be evaluated by using substitution:
2
rD
u= (3.37)
4tD
2
rD
⇒ tD = (3.38)
4u
2
−rD
dtD = du (3.39)
4u2
Equation (3.36) becomes:
r2
D 2
4u −rD 1 ∞ exp(−u)
Z Z
4tD
pD = 2
exp(−u) 2
du = r2 du (3.40)
∞ 2rD 4u 2 D
4tD
u

Now introduce the exponential integral, Ei(x):


∞ e−u
Z
Ei(x) = − du (3.41)
−x u
(This definition follows Abramowitz and Stegun, “Handbook of Mathemati-
cal Functions”, Dover, 1970. Note that in some references Ei(x) is denoted
by E1 (x) - be careful!)

r2
!
1
⇒ pD = − Ei − D (3.42)
2 4tD

Finally the answer is written in dimensional terms:

r 2 φµct
!

p = pi + Ei − (3.43)
4πkh 4kt

27
PE281 - Applied Mathematics in Reservoir Engineering

3.1.3 Late Time Behaviour of pD


We can consider the late time behaviour of pD by recalling theorem 5 and
taking the limit of p̂D as s → 0.
1 √
p̂D (s) = K0 (rD s) (3.44)
s
The limit can be handled by using a series expansion for K0 :
1 2
x 4
z 1 ( 14 z 2 )2
K0 (x) = −(ln + γ)I0 (x) + + (1 + ) + ... (3.45)
2 (1!)2 2 (2!)2
x
 
⇒ lim K0 (x) = − ln −γ (3.46)
x→0 2
where γ = Euler’s constant, 0.5772.
1 √ 
lim p̂D = − ln rD + ln s − ln 2 + γ (3.47)
s→0 s
−1 1

√ 
⇒ lim pD = L − (ln rD + ln s − ln 2 + γ) (3.48)
t→∞ s

Using transform pair 95 from the handout to invert the ln s term gives:
1
= − ln rD + ln 2 − γ + (γ + ln tD ) (3.49)
2
!
1 tD
= ln 2 + 0.80907 (3.50)
2 rD

3.2 Finite Well Radius Solution


The line source solution applies the constant flow rate condition as r tends
to zero. This simplifies the solution process. However an analytical solution
can also be obtained when the flow rate condition is applied at r = rw . The
governing equation and boundary conditions remain the same as the line
source solution, except for the inner boundary condition which is now:
∂pD
rD |r =1 = −1 (3.51)
∂rD D

28
PE281 - Applied Mathematics in Reservoir Engineering

As before when the differential equation is written in Laplace space we have:

∂ 2 p̂D 1 ∂ p̂D
⇒ 2
+ − sp̂D = 0 (3.52)
∂rD rD ∂rD

As before the general solution to the problem is:


√ √
p̂D = c1 I0 (rD s) + c2 K0 (rD s) (3.53)

The solution must remain bounded as r tends to infinity so as before we set


c1 = 0: √
pˆD = c2 K0 (rD s) (3.54)
Now consider the inner boundary condition. It requires that:
∂ √ 1
(c2 K0 (rD s) = − (3.55)
∂rD s
√ √ 1
⇒ −c2 sK1 (rD s) = − rD = 1 (3.56)
s
1
⇒ c2 = 3 √ (3.57)
s 2 K1 ( s)
The final solution for p̂D is:

K0 (rD s)
p̂D = 3 √ (3.58)
s 2 K1 ( s)

3.2.1 Early Time Behaviour of pD


The early time behaviour of pD can be examined by considering the limit of
p̂D as s → ∞. To do so the behaviour of the Bessel functions is required for
large arguments.

π −x µ − 1 (µ − 1)(µ − 9)
r
Kv (x) ≈ e (1 + + + .... (3.59)
2x 8x 2!(8x)2

where x is large and µ = 4v 2 .



s
π √
⇒ K0 (rD s) = √ e−rD s (3.60)
2rD s

29
PE281 - Applied Mathematics in Reservoir Engineering

and
√ π
s

⇒ K1 ( s) = √ e− s (3.61)
2 s
So at late time p̂D is:
s √
1 π 2 s √s
s

p̂D = 3 √ e−rD s e (3.62)
s2 2rD s π

1 1√
√ e− s(rD −1)
= 3 (3.63)
s rD 2

The solution for pD can be found using transform pair number 85 from the
handout:
 s 
1  tD − (rD4t−1)2
!
rD − 1 
pD (rD , tD ) = √ 2 e D − (rD − 1)erf c √ (3.64)
rD  π 2 tD 
s
tD
pD (rD = 1, tD ) = 2 (3.65)
π

3.2.2 Late Time Behaviour of pD


To find the late time behaviour of pD consider the limit of p̂D at s → 0. First
consider the behaviour of the Bessel functions. As before:
1
lim K0 (x) = −[ln( x) + γ] (3.66)
x→0 2
For small arguments Kv (x) can be approximated by:
1 1
Kv (x) = Γ(x)( x)−v (3.67)
2 2
where Γ(x + 1) = x!
1 1 1
⇒ lim K1 (x) = ( x)−1 = (3.68)
x→0 2 2 x
Recall the solution for p̂D :

K0 (rD s)
p̂D = 3 √ (3.69)
s 2 K1 ( s)

30
PE281 - Applied Mathematics in Reservoir Engineering

The late time behaviour of pD can be found by performing the following


inverse transform:

 1 −[ln( 1 r
√ 
D s) + γ]  1 √
pD = L−1 3
2
1 = L−1 − (ln rD +ln s−ln 2+γ) (3.70)
s2 √
s
 s
!
1 tD
= ln 2 + 0.80907 (3.71)
2 rD
This is the same late time behaviour as the line source solution.

3.3 Constant Pressure Inner Boundary Con-


dition
The previous two solutions have considered constant rate boundary condi-
tions at the well. It is also possible to consider constant pressure boundary
conditions. It becomes more convenient to define the dimensionless pressure,
pD , in terms of both the initial reservoir pressure, pi , and the well pressure,
pw :
pi − p
pD = (3.72)
pi − pw
The dimensionless form of the pressure equation is as before:
!
1 ∂ ∂pD ∂pD
rD = (3.73)
rD ∂rD ∂rD ∂tD
For an infinite acting reservoir the boundary and initial conditions in dimen-
sionless form are:
pD (rD , tD ) = 1 rD = 1 (3.74)
pD (rD → ∞, tD ) = 0 (3.75)
pD (rD , tD = 0) = 0 (3.76)
As before the general solution to this problem is:
√ √
p̂D = c1 I0 (rD s) + c2 K0 (rD s) (3.77)
Again c1 is set to zero to ensure the pressure remains finite as r → ∞. The
inner boundary condition is used to solve for c2 :
√ 1
p̂D (rD = 1) = c2 K0 ( s) = (3.78)
s
31
PE281 - Applied Mathematics in Reservoir Engineering

1
⇒ c2 =√ (3.79)
sK0 ( s)

K0 (rD s)
⇒ p̂D (rD ) = √ (3.80)
sK0 ( s)
The inverse transform to solve this problem was provided by Van Everdin-
gen and Hurst, “The Application of the Laplace Transformation to Flow
Problems in Reservoirs”, Petroleum Transactions AIME, 305-324, 1949 (see
equation VI-26):
2t
2 ∞ (1 − e−u D
)[J0 (u)Y0 (urD ) − Y0 (u)J0 (urD )]
Z
pD (rD , tD ) = du (3.81)
π 0 u2 [J02 (u) + Y02 (u)]

3.3.1 Early Time Behaviour of the Flow Rates


Just as the early time behaviour of the pressure could be considered in the
constant flow rate case, the behaviour of the flow rate can be examined for
the constant pressure case:
∂pD
qD = −rD (3.82)
∂rD
√ !
∂ p̂D ∂ K0 (rD s)
q̂D = −rD = −rD √ (3.83)
∂rD ∂rD sK0 ( s)
Using the previously established expression for the derivative of K0 gives:

rD K1 (rD s)
q̂D = √ √ (3.84)
s K0 ( s)
The cumulative recovery is defined by:
Z td
QD = qD dtD (3.85)
0

The Laplace transform of QD can be found readily by recalling theorem 7:



1 rD K1 (rD s)
Q̂D = q̂D = 3 √ (3.86)
s s 2 K0 ( s)
To consider the early time behaviour of the flow rates consider the limit of
qD as s → ∞. The early time behaviour of the Bessel functions have already
been established:
√ π
s

K1 (rD s) ≈ √ e−rD s (3.87)
2 srD

32
PE281 - Applied Mathematics in Reservoir Engineering

π √
s

√ e− s
K0 ( s) ≈ (3.88)
2 s
s √ √
rD π −rD s 2 s rD √
s
√ √
⇒ q̂D = √ √ e e = √ e− s(rD −1)
s
(3.89)
s 2 srD π s
qD can now be found by using transform pair 84 from the tables:

rD − (rD4t−1)2
qD = √ e D (3.90)
πtD

QD (at early time) can be found by using transform pair 85:


 s 
(r −1)2
!
 t D − D rD − 1 
QD = rD 2 e 4tD
− (rD − 1)erf c √ (3.91)
 π 2 tD 

Note the similarity between this and Equation (3.64) (early time behaviour
of the pressure for constant rate, finite radius well).

3.4 Bounded Reservoir Example


The previous examples have considered flow in infinite acting reservoirs. Lin-
ear boundaries in reservoirs with either constant pressure or constant flow
rate wells can be created using superposition as discussed in Chapter 1. Con-
sider a case with a constant flow rate and the well and a constant pressure
at the outer boundary (at radius re ). The boundary and initial conditions in
dimensionless form are:
∂pD
rD = −1 rD = 1 (3.92)
∂rD
re
pD = 0 rD = = rDe (3.93)
rw
pD = 0 tD = 0, ∀rD (3.94)
As before the general solution to this problem is:
√ √
p̂D = c1 I0 (rD s) + c2 K0 (rD s) (3.95)

33
PE281 - Applied Mathematics in Reservoir Engineering

However in this example the reservoir is bounded so c1 can not be set to zero
by arguing that p̂D must remain bounded as rD tends to infinity. Instead the
outer boundary condition requires:
√ √
c1 I0 (rDe s) + c2 K0 (rDe s) = 0 (3.96)
The inner boundary conditions requires:
∂ √ √ 1
[c1 I0 (rD s) + c2 K0 (rD s)] = − rD = 1 (3.97)
∂rD s
The derivatives of the Bessel functions can be found from:
d −n
[x Kn (x)] = −x−n Kn+1 (x) (3.98)
dx
d −n
[x In (x)] = x−n In+1 (x) (3.99)
dx
Using these derivatives (3.97) becomes:
√ √ √ √ 1
c1 sI1 ( s) − c2 sK1 ( s) = − (3.100)
s
√ √ 1
⇒ c1 I1 ( s) − c2 K1 ( s) = − 3 (3.101)
s2
The outer boundary condition requires:
√ √
c1 I0 (rDe s) + c2 K0 (rDe s) = 0 (3.102)
Equations (3.101) and (3.102) can be solved for c1 and c2 to give:

1 K0 (rDe s)
c1 = − 3 √ √ √ √ (3.103)
s 2 K0 (rDe s)I1 ( s) + K1 ( s)I0 (rDe s)

1 I0 (rDe s)
c2 = 3 √ √ √ √ (3.104)
s 2 K0 (rDe s)I1 ( s) + K1 ( s)I0 (rDe s)
√ √ √ √
1 I0 (rDe s)K0 (rD s) − K0 (rDe s)I0 (rD s)
⇒ p̂D = 3 √ √ √ √ (3.105)
s 2 K0 (rDe s)I1 ( s) + K1 ( s)I0 (rDe s)
The late time (steady state) behaviour of pD can be determined by taking
the limit of p̂D as s tends to infinity:
rD
pD = ln (3.106)
rDe

34
PE281 - Applied Mathematics in Reservoir Engineering

3.5 Van Everdingen and Hurst


Van Everdingen and Hurst’s 1949 paper was one of the first applications of
Laplace transforms in petroleum reservoir engineering. One of the interesting
results they proved was the following relationship between the pressure at a
well (operating at constant flow rate) and the cumulative production (from
a well operating at constant pressure):
1
spˆD QˆD = 2 rD = 1 (3.107)
s
Van Everdingen and Hurst also demonstrated how to add wellbore storage
to a problem:
sp̂Dxx
p̂D = (3.108)
s(1 + scD sp̂Dxx )

3.6 Incorporating Storage and Skin


Wellbore storage means that even if a well is produced at constant flow rate
the flow from the reservoir into the wellbore may be transient. The additional
flow can come from either the expansion of fluid in the wellbore or a changing
liquid level in the tubing.

3.6.1 Fluid Expansion


qtotal = qreservoir + qexpansion (3.109)
The amount of flow from fluid expansion is defined by:
∂Vw ∂Vw ∂p ∂p
qexpansion = = = cw V w (3.110)
∂t ∂p ∂t ∂t
The relevant storage coefficient, C is defined by:

C = cw V w (3.111)

3.6.2 Falling Liquid Level


If a well is completed without a packer there may be liquid in the annulus.
This fluid may be produced when the bottom hole pressure is lowered. The

35
PE281 - Applied Mathematics in Reservoir Engineering

relevant storage coefficient, C is defined by:


Aw
C= (3.112)
ρg

3.6.3 Laplace Space Solution


If the Laplace space solution for a problem which has no storage and no skin
is given by p̂Dxx then solution for a problem with a skin, S, and storage, cD
is:
sp̂Dxx + S
p̂D = (3.113)
s[1 + scD (sp̂Dxx + S)]
The dimensionless storage cD is defined by:
5.615C
CD = (3.114)
2πφct hrw2

3.7 Incorporating Dual Porosity


In dual porosity reservoirs flow occurs in both the matrix and in the fractures.
Their are two important parameters in dual porosity reservoirs:
φf ctf
ω= 0<ω<1 (3.115)
φf ctf + φm ctm
km 2
λ=α r 10−10 < λ < 10−3 (3.116)
kf w
where α depends on the fracture configuration e.g. sugar cube model
The governing equation in Laplace space for a dual porosity reservoir is:
!
1 ∂ ∂ p̂D
rD − sf (s)p̂ = 0 (3.117)
rD ∂rD ∂tD
where
sω(1 − ω) + λ
f (s) = (3.118)
s(1 − ω) + λ
For the case of an infinite acting reservoir with a finite radius the solution
for p̂D is: q
K0 ( sf (s))
p̂D = q q (3.119)
s sf (s)K1 ( sf (s))

36
PE281 - Applied Mathematics in Reservoir Engineering

(for more details see “Well Test Analysis”, Rajagopal Raghavan, Englewood
Cliffs, 1993)

3.8 Bourgeois and Horne


Marcel Bourgeois completed an MS degree in the Department of Petroleum
Engineering in 1992 (”Well Test Interpretation Using Laplace Space Type
Curves”). This was a key contribution to the use of Laplace transforms in well
testing. The solutions to many well testing problems (beyond the examples
presented here) are known in Laplace space. As part of his study Bourgeois
defined a quantity known as the Laplace pressure, sp̂. When plotted against
1/s this has similar behaviour as the real pressure
Bourgeois showed that instead of performing parameter estimation using
nonlinear regression in real space the matching could be achieved efficiently
and effectively in Laplace space. The efficiency lies in the removal of the
need for a numerical inverse transform to evaluate the performance of set
of paramter estimates. In Bourgeois’ examples fewer iterations were needed
when matching in Laplace space than in real space.

3.9 Heat Transfer


Laplace transforms are also useful in other petroleum engineering engineering
problems. During my undergraduate research project I studied heat transfer
from a buried pipeline which connects an offshore platform to onshore pro-
duction facilities. Heat transfer was a particular concern because the fluids
could form solid hydrates if the temperature fell below a critical level.
The pipe is buried below the sea floor. This makes the computational
domain semi-infinite. However in the part of the study that used Laplace
transforms an “effective cylinder” configuration was used as shown in Figure
3.1.
Two energy balance equations are required in this problem. The first
governs the temperature distribution in the pipe surrounds:
∂Te
ke ∇2 Te = ρe ce (3.120)
∂t
The second energy balance governs the fluid in the pipe which is flowing

37
PE281 - Applied Mathematics in Reservoir Engineering

Surroundings, T
o

Burial medium, Te

Pipe, Tp

ri

ro

Figure 3.1: Configuration of pipe and surrounds

at velocity, U:
∂Tp ∂Tp 2
ρp cp + ρp cp U =− q (3.121)
∂t ∂x ri
where q is the flux of heat through the pipe wall:
∂Te
q = −ke |r=ri (3.122)
∂r
The solution procedure involved solving for the Laplace transform of Te in
terms of Tp . This expression was then substituted into the equation governing
the Laplace transform of Tp . Finally the T̂p was solved for.
An example of this solution given below for the case of the pipeline heating
up at start-up:

Ti − To s 2ke sκγ To
T̂p (x, s) = exp(−( + )x) + (3.123)
s U ri ρp cp Uθ s
where
√ √ √ √
θ = K0 ( sκri )I0 ( sκro ) − Ko ( sκro )I0 ( sκri ) (3.124)
ρe ce
κ= (3.125)
ke
√ √ √ √
γ = K0 ( sκr0 )I1 ( sκri ) + K1 ( sκri )I0 ( sκro ) (3.126)
The transient pipeline temperature distribution could be found by nu-
merically inverting the expression for T̂p . The results from this approach

38
PE281 - Applied Mathematics in Reservoir Engineering

were much closer to field test results than results from a large finite differ-
ence simulation. Since the numerical inverse can be computed very quickly
many more cases could be considered to assess the sensitivities to various
parameters in the model.

3.10 Numerical Inversion of Laplace Trans-


forms
The inverse Laplace transform can also be written as an integral:
1 Z γ+∞ st
f (t) = L−1 {F (s)} = e F (s)ds (3.127)
2πi γ−i∞
where γ is chosen in such away that any singularities in F (s) are avoided. The
contour the integral is performed over is known as the Bromwich contour.
When an inverse transform is required that can’t be found from tables this
integral is usually evaluated numerically.
The most commonly used algorithm for numerical inversion of Laplace
transforms is the Stehfest algorithm (Communications of the Association for
Computing Machinery, algorithm 368). To invert fˆ(s) the following summa-
tion is performed:
N
!
ln 2 X ˆ ln 2
f (t) = Vi f i (3.128)
t i=1 t
where
min(i,N/2) N
N X k 2 (2k)!
Vi = (−1) 2+i (3.129)
(N/2 − k)!k!(k − 1)!(i − k)!(2k − i)!
k=( i+1
2 )

Theoretically the accuracy of f (t) increases as N increases. However in


practice the Vi grow quickly in magnitude with N and round-offs errors are
amplified. Usually N = 8 is used in numerical inversions. This means that
ˆ are required.
for every value of f (t) required 8 values of f(s)
The Stehfest algorithm works well for smooth functions but has difficul-
ties for oscillatory functions and functions with discontinuities. Oscillatory
functions can be inverted if their wavelength is large with respect to half
the width of the peaks. Stehfest tested his algorithm on 50 functions and
reported errors of only 0.1%.

39
PE281 - Applied Mathematics in Reservoir Engineering

There are other algorithms available for the numerical inversion of Laplace
transforms. The Talbot algorithm (J. Inst. Math. Appl., Jan. 1979, pg 97-
120) is one of the most accurate and widely applicable. Other algorithm seek
ˆ values in the evaluation of subsequent f (t)
to reuse previously evaluated f(s)
values.

3.11 Summary
This chapter has outlined several petroleum engineering applications of Laplace
transforms including:
- the line source solution
- the finite well radius solution
- constant well pressure solution
- bounded reservoir solution

Laplace transforms are attractive for these problems because storage, skin
and dual porosity behaviour can be added readily to the solutions in Laplace
space. The Laplace space solution can also be efficiently incorporated into
nonlinear regression routines.
A heat transfer case study was discussed to demonstrate how the use of
Laplace space solutions can complement numerical methods. The solution
that study developed approximated the physics and the geometry of the
problem but ran very quickly and could be used for sensitivity analyses. It
ultimately reproduced the field results more accurately than the numerical
model results.

40
Chapter 4

Fourier Transforms

Like the Laplace transform the Fourier transform is also an integral trans-
form. When viewed in the context of signal processing the application of the
Fourier transform takes a function from real-space to frequency-space (see
later examples). The Fourier transform is defined by:
Z ∞
F (s) = f (x)e−i2πxs dx (4.1)
−∞

The inverse transform is defined in a similar manner:


Z ∞
f (x) = F (s)ei2πxs ds (4.2)
−∞

˜ for F (s). The Fourier transform exists if


We will also use the notation f(s)
f (x) and f 0 (x) are at least piecewise continuous and the following integral
exists: Z ∞
|f (x)|dx (4.3)
−∞

There are also some alternative definitions:


Z ∞
F (s) = f (x)e−ixs dx (4.4)
−∞

1 ∞
Z
f (x) = F (s)eixs ds (4.5)
2π −∞

and
1 ∞
Z
F (s) = √ f (x)e−ixs dx (4.6)
2π −∞

41
PE281 - Applied Mathematics in Reservoir Engineering

1 ∞
Z
f (x) = √ F (s)eixs ds (4.7)
2π −∞
Example:
2
f (x) = e−πx (4.8)
Z ∞ 2
F (s) = e−πx e−i2πsx dx (4.9)
−∞
Z ∞
−π(x2 +i2xs)
= e dx (4.10)
−∞
Z ∞ 2 +i2xs−s2 +s2 )
= e−π(x dx (4.11)
−∞
Z ∞
2 −πs2
= e−π(x+is) dx (4.12)
−∞
2
Z ∞ 2
= e−πs e−π(x+is) dx (4.13)
−∞
Z ∞
2 2
= e−πs e−πξ dx (4.14)
−∞
where ξ = x + is The integral in (4.14) is known to be 1.0 so we have:
2
F (s) = e−πs (4.15)
The Fourier transform relates a function in real space (either time or distance)
to a function in frequency space. This can be seen by recalling:
ei2πxs = cos(2πxs) + i sin(2πxs) (4.16)
Now consider the inverse transform:
Z ∞
f (x) = F (s)ei2πxs ds (4.17)
−∞

This integral shows that the Fourier transform breaks a function f (x) into a
sum of sines and cosines with frequency s. (Recall the frequency of f (kx) is
|k|

). The ammplitude associated with any given frequency is given by F (s).
Example:
Consider f = cos(πx). The Fourier transform of f is:
1 1
F (s) = δ(−π + 2πs) + δ(π + 2πs) (4.18)
2 2
i.e.
1
f (x) = (cos(πx) + i sin(πx) + cos(−πx) + i sin(−πx)) (4.19)
2
1
= (cos(πx) + cos(πx)) = cos(πx) (4.20)
2

42
PE281 - Applied Mathematics in Reservoir Engineering

1.0

0.8

0.6

0.4

cos(x) 0.2

0.0

-0.2

-0.4

-0.6

-0.8

-1.0
-3 -2 -1 0 1 2 3
x

Figure 4.1: f (x) = cos(πx)

Frequency spectrum
1.0

0.8

0.6

0.4

0.2
Amplitude

0.0

-0.2

-0.4

-0.6

-0.8

-1.0
-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0
Frequency

Figure 4.2: Frequency spectrum of f (x) = cos(πx)

43
PE281 - Applied Mathematics in Reservoir Engineering

4.1 Fourier Transform Theorems


4.1.1 Theorem 1 - Linearity
F (f (x) + g(x)) = F (f (x)) + F (g(x)) (4.21)

4.1.2 Theorem 2 - Shift Theorem


If
F (f (x)) = F (s) (4.22)
then
F (f (x − a)) = e−i2πsa F (s) (4.23)
Proof: Z ∞
F (f (x − a)) = f (x − a)e−i2πsx dx (4.24)
−∞
Z ∞
= f (x − a)e−i2πs(x−a)−i2πsa d(x − a) (4.25)
−∞
Z ∞
= e−i2πsa f (x − a)e−i2πs(x−a) d(x − a) (4.26)
−∞

= e−i2πsa F (s) (4.27)

4.1.3 Theorem 3 - Similarity Theorem


If
F (f (x)) = F (s) (4.28)
1 s
 
F (f (ax)) = F (4.29)
|a| a

4.1.4 Theorem 4 - Convolution Theorem


If
F (f (x)) = F (s) (4.30)
and
F (g(x)) = G(s) (4.31)
then
F (f (x) ∗ g(x)) = F (s)G(s) (4.32)

44
PE281 - Applied Mathematics in Reservoir Engineering

4.1.5 Theorem 5 - Parseval’s theorem


Z ∞ Z ∞
|f (x)|2dx = |F (s)|2ds (4.33)
−∞ −∞

4.1.6 Theorem 6 - Derivatives


F (f n (x)) = (i2πs)n F (s) (4.34)
Note that this assumes the values of the derivatives vanish at ±∞.

4.2 Fourier Sine and Cosine Transforms


The Fourier transform is defined as:
Z ∞
F (f (x)) = f (x)e−i2πsx dx (4.35)
−∞
Z ∞
= f (x)[cos(−2πsx) + i sin(−2πsx)]dx (4.36)
−∞

Now consider a case where f (x) is the sum of an even and an odd function,
fe (x) and fo (x).
Recall for an odd function:

fo (−x) = −fo (x) (4.37)

sin(x) is an example of an odd function.


For an even function:
fe (−x) = fe (x) (4.38)
cos(x) is an example of an even function.
With f (x) defined as the sum of an even and odd function the Fourier trans-
form of f (x) becomes:
Z ∞ Z ∞
F (f (x)) = (fe (x) + fo (x))cos(2πsx)dx−i (fe (x) + fo (x))sin(2πsx)dx
−∞ −∞
(4.39)
Now take account of the way products of even and odd functions behave:

fe (x)ge (x) = he (x) (4.40)

fo (x)go (x) = he (x) (4.41)

45
PE281 - Applied Mathematics in Reservoir Engineering

fo (x)ge (x) = ho (x) (4.42)


Also note the following integral:
Z ∞
fo (x)dx = 0 (4.43)
−∞

Now substitute these relationships into (4.39):


Z ∞ Z ∞
F (f (x)) = fe (x) cos(2πsx)dx − i fo (x) sin(2πsx)dx (4.44)
−∞ −∞
Z ∞ Z ∞
=2 fe (x) cos(2πsx)dx − 2i fo (x) sin(2πsx)dx (4.45)
0 0

The fact that the Fourier transform splits into two terms (sine and cosine)
motivates the definition of the sine and cosine transforms:
s
2 ∞
Z
Fc (f (x)) = f (x)cos(xs)dx = Fc (s) (4.46)
π 0
s
2 ∞
Z
Fc−1 (Fc (s)) = Fc (s)cos(xs)ds = f (x) (4.47)
π 0
s
00 2 0
Fc (f ) = −s f (0) − s2 Fc (s) (4.48)
π
s
2 ∞
Z
Fs (f (x)) = f (x)sin(xs)dx = Fs (s) (4.49)
π 0
s
2 ∞
Z
Fs−1 (Fs (s)) = Fs (s)sin(xs)ds = f (x) (4.50)
π 0
s
2
Fs (f 00 ) = s
f (0) − s2 Fs (s) (4.51)
π
Use of sine and cosine transforms simplifies the transform procedure when
transforming even and odd functions. The sine and cosines transforms can
be used in place of the full Fourier transform for problems with:
- semi-infinite domains
- differential equation that have even orders of derivatives
- either f of f 0 specified at the boundary

46
PE281 - Applied Mathematics in Reservoir Engineering

4.3 Example 1: 1D Pressure Diffusion


Consider a one dimensional problem governed by:

∂ 2 pD ∂pD
2
= (4.52)
∂xD ∂tD

The boundary conditions are:

pD (xD = 0, tD ) = 1 (4.53)

pD (xD → ∞, tD ) = 0 (4.54)
pD (xD , tD =) = 0 (4.55)
Since the pressure and not the pressure derivative is set on the boundary use
the sine transform. The choice of transform is made according to equations
(4.48) and (4.51) which relate the transform of the second derivative to the
boundary conditions.
First transform the differential equation (in space):
s
2 ∂ p̃D
s pD (xD = 0, tD ) − s2 p̃D = (4.56)
π ∂tD
s
∂ p̃D 2
⇒ + s2 p̃D = (4.57)
∂tD π
This equation can be solved using the integrating factor method:
dy
+ P (x)y = Q(x) (4.58)
dx
R Z R
P dx P dx
ye = Qe dx + C (4.59)
s
s2 tD
Z tD 2 s2 τ
⇒ p̃D e = se dτ + C (4.60)
0 π
s
tD 2 −s2 (tD −τ )
Z
p̃D = se dτ (4.61)
0 π
s
21 2
= (1 − e−s tD ) (4.62)
πs

47
PE281 - Applied Mathematics in Reservoir Engineering

Now invert to find pD :


s
2Z∞
Fs−1 (p̃D ) = p̃D sin(sxD )ds (4.63)
π 0
s
2 ∞ 21
Z
2
= (1 − e−s tD ) sin(sxD )ds (4.64)
π 0 πs
! !
x xD
= 1 − Erf √D = Erf c √ (4.65)
4tD 4tD
where Erf (z) and Erf c(z) are the error function and the complimentary
error function defined by:
2 Z z
2
Erf (z) = √ = e−t dt (4.66)
π 0

Erf c(z) = 1 − Erf (z) (4.67)

4.4 Example 2: Heat Equation


Consider the diffusion of heat in a one-dimensional bar. We’ll consider an
infinitely long bar so the full Fourier transform is required. The governing
equation is:
∂2T ∂T
κ2 2 = (4.68)
∂x ∂t
The boundary conditions are:

T (x ± ∞, t) = T 0 (x ± ∞) = 0 (4.69)

The initial condition is a prescribed temperature that varies in space:

T (x, t = 0) = T0 (x) (4.70)

First consider the Fourier transform of the spatial derivatives:


1 ∞
Z
0
F (f (x)) = √ e−isx f 0 (x)dx (4.71)
2π −∞

1 1 ∞
Z
= √ f (x)e−isx |∞
−∞ − √ (−is)f (x)e−isx dx (4.72)
2π 2π −∞

48
PE281 - Applied Mathematics in Reservoir Engineering

Since f (x) vanishes at ±∞

= (is)F (f (x)) (4.73)

Similar arguments require f 0 (x) vanishes at ±∞. The transformed differen-


tial equation is:
∂ T̃
+ κ2 s2 T̃ = 0 (4.74)
∂t
2t
⇒ T̃ = c1 e−(κs) (4.75)
Now consider the initial condition:

T̃ (t = 0) = T̃0 = c1 (4.76)
2t
⇒ T̃ = T̃0 e−(κs) (4.77)
Now invert to find T :
1 Z ∞ isx −(κs)2 t
T =√ e T̃0 e ds (4.78)
2π −∞
The transform of T0 is:
1 Z∞
T̃0 = √ T0 (λ)e−isλ dλ (4.79)
2π −∞
1 ∞ isx ∞ −isλ
Z Z
2
⇒T = e e T0 (λ)e−(κs) t dλds (4.80)
2π −∞ −∞

1 Z ∞ Z ∞
2
= T0 (λ) e−is(λ−x)−(κs) t dsdλ (4.81)
2π −∞ −∞

Finally we have an expression for T in terms of T0 :


1 ∞ (λ−x)2
Z
T =√ T0 (λ)e− 4κ2 t dλ (4.82)
4κ2 πt −∞

4.5 Example 3: Elliptic Problem


Consider a steady-state problem in a two-dimensional semi-infinite domain
governed by:
∇2 p = 0 (4.83)

49
PE281 - Applied Mathematics in Reservoir Engineering

The boundary conditions are:

p(0, y) = 0 (4.84)

p(x → ∞, y) = 0 (4.85)
p(x, 0) = f (x) (4.86)
p(x, a) = 0 (4.87)
Since the domain is semi-infinite and the pressure is specified on the boundary
we will use the sine transform to transform the differential equation:

∂2p ∂2p
!
Fs + =0 (4.88)
∂x2 ∂y 2
s
2 ∂ 2 p̃
⇒s p(0, y) − s2 p̃ + 2 = 0 (4.89)
π ∂y
∂ 2 p̃
⇒ − s2 p̃ = 0 (4.90)
∂y 2
This equation can be solved for T̃ to give:

T̃ = c1 cos(isy) + c2 sin(isy) (4.91)

Now use the boundary conditions to determine c1 and c2 :

Fs (p(x, y = 0)) = Fs (f (x)) = F1 (4.92)

Fs (p(x, y = a)) = 0 (4.93)


After some algebra we can show:
sinh(s(a − y))
p̃ = F1 (4.94)
sinh(sa)
where
sinh(z) = −isin(iz) (4.95)
Now invert to find p:
s
2 ∞ sinh(s(a − y))
Z
p= F1 sin(xs)ds (4.96)
π 0 sinh(sa)

50
PE281 - Applied Mathematics in Reservoir Engineering

where s
2 ∞
Z
F1 =
f (λ)sin(sλ)dλ (4.97)
π 0
Substituting F1 into the expression for p gives:
2 ∞ ∞ sinh(s(a − y))
Z Z
f (λ) sin(sλ)sin(sx)dλds (4.98)
π 0 0 sinh(sa)
!
y ∞ 1 1
Z
= f (λ) 2 2
− 2 dλ (4.99)
π 0 y + (x − λ) y + (x + λ)2

4.6 Radial Problems


All the examples presented have been for linear problems. Radial problems
are often of more interest to petroleum engineers. Is the Fourier transform
helpful in these cases?
∂ 2 pD 1 ∂pD ∂pD
2
+ = (4.100)
∂rD rD ∂rD ∂tD
- The sine and cosine transforms won’t work because the pressure equation
in radial coordinates includes both even and odd orders of derivatives.
- The full Fourier transform is a candidate - consider applying it in space.
When transforming the spatial derivatives we will require the behaviour of
the pressure at ±∞. Ideally the pressure and it’s first derivative would van-
ish at ±∞. This may be the case at r = +∞ however it much harder to
make that claim at r = −∞. Applying the full Fourier transform in time
is another option. However transforming the time derivative requires the
behaviour of the pressure at t = −∞. This is not such a problem since it
is likely p = pi would be suitable. However now the boundary conditions
become time dependent if the flow begins at t = 0.

The Hankel transform is better suited to radial problems.


Z ∞
Hv (λ) = rJv (λr)f (r)dr (4.101)
0
Z ∞
f (r) = λJv (λr)Hv (λ)dλ (4.102)
0
We’ll discuss this in a later section.

51
PE281 - Applied Mathematics in Reservoir Engineering

4.7 Inverting Fourier Transforms Numerically


Unlike the Laplace transform there is no special algorithm (like the Stehfest
algorithm) required to invert Fourier transforms numerically. Since the limits
of the inversion integral are real standard numerical integration routines can
be used to evaluate the integral. The Stehfest routine required eight evalu-
ations of the integrand to determine a numerical inverse Laplace transform
at a given time. Many more evaluations of the integrand may be required
when inverting a Fourier transform. If the Fourier transform is being applied
to discrete data (discrete Fourier transform) instead of a function there are
formal algorithms that can be used to perform the inversion.

4.8 Discrete Fourier Transforms


Instead of considering the Fourier transform of a continuous function consider
a set of sampled points:

fk = f (xk ), xk = k∆, k = 0, 1, 2, ..., N − 1 (4.103)

We will seek estimates of the Fourier transform at discrete values of s:


n
sn = (4.104)
N∆
The Fourier transform at sn is:
Z ∞ N −1 N −1
f (x)e−2πixsn dx ≈ fk e−2πisn xk ∆ = ∆ fk e−2πikn/N
X X
F (sn ) =
−∞ k=0 k=0
(4.105)
Similarly the inverse transform is:

1 NX
−1
fk = F (sn )e2πikn/N (4.106)
N n=0

For instance if we have 100 data points sampled from the following function
over x[0,1]:
f (x) = sin(20πx) + noise (4.107)
The function f(x), shown in Figure 4.3, is quite noisey. However by taking
the Fourier transform, (Figure 4.4) we can extract the original sine wave

52
PE281 - Applied Mathematics in Reservoir Engineering

1.5
1
0.5

20 40 60 80 100
-0.5
-1
-1.5
-2

Figure 4.3: Noisy signal

quite easily. The Fourier transform shows two distinct spikes, one at the
n = 10 and one at n = 90. These correspond to frequencies of ±10 i.e.
the frequency of the original sine wave. The first N/2 values of the Fourier
transform correspond to frequencies of 0 < f < fmax . The second N/2 values
of the Fourier transform correspond to the frequencies −fmax < f < 0. Note
that the value at n = N/2 corresponds to both f = fmax and −fmax .
Note the discrete Fourier transform (DFT) only considers a finite range
of frequencies because it uses a finite number of sn . If there are frequencies
beyond this present in the true Fourier transform and effect known as alias-
ing occurs. As shown in Figure 4.5 aliasing occurs when frequencies beyond
the range of the chosen set of sn are present. Aliasing “folds” these frequen-
cies back into the computed Fourier transform. Aliasing can be avoided by
filtering the function before it is sampled.

4.9 Fast Fourier Transforms


The discrete Fourier transform, as it was presented in the previous section,
requires O(N 2 ) operations to compute. In fact the discrete Fourier transform
can be computed much more efficiently than that (O(Nlog2 N) operations)
by using the fast Fourier transform (FFT).
The concept of the FFT is outlined below (based on “Numerical Recipes
in C”). A more specialized text should be consulted for details of the im-
plementation. The FFT arises by noting that a DFT of length N can be

53
PE281 - Applied Mathematics in Reservoir Engineering

20 40 60 80 100

Figure 4.4: Fourier transform

aliased Fourier transform


H( f )
true Fourier transform

− 1 0 1 f
2∆ 2∆

Figure 4.5: Aliasing effect (from “Numerical Recipes in C”, Cambridge Uni-
versity Press

54
PE281 - Applied Mathematics in Reservoir Engineering

written as the sum of two Fourier transforms each of length N/2. One of
these transforms is formed from the even-numbered points of the original N,
the other from the odd-numbered points.
N −1
e−2πijk/N fj
X
F (sk ) = (4.108)
j=0

N/2−1 N/2−1
−2πik(2j)/N
e−2πik(2j+1)/N f2j+1
X X
= e f2j + (4.109)
j=0 j=0

N/2−1 N/2−1
−2πikj/(N/2) k
e−2πikj/(N/2) f2j+1
X X
= e f2j + W (4.110)
j=0 j=0

where
W = e−2πi/N (4.111)
⇒= F e (sk ) + W k F o (sk ) (4.112)
This expansion can be performed recursively i.e. a transform a length N/2
can be written as the sum of two transforms of length N/4 etc.

55
Chapter 5

Hartley Transforms and Hankel


Transforms

5.1 Hartley Transforms


The Hartley transform was first described by Bracewell in 1984 (Bracewell,
R.N. “The Fast Hartley Transform”, Proceedings of the IEEE, v 72, n 8, p
1010, 1984 ). It is an alternative to the Fourier transform. The transform is
defined by:
1 ∞
Z
F (s) = √ f (t)[cos(2πst) + sin(2πst)]dt (5.1)
2π −∞

1 ∞ Z
f (t) = √ F (s)[cos(2πst) + sin(2πst)]ds (5.2)
2π −∞
The notation cas(2πst) is sometimes used:

cas(2πst) = cos(2πst) + sin(2πst) (5.3)

Like the Fourier transform alternative definitions are possible:


1 ∞
Z
F (s) = f (t)[cos(2πst) + sin(2πst)]dt (5.4)
2π −∞
Z ∞
f (t) = F (s)[cos(2πst) + sin(2πst)]ds (5.5)
−∞
Like the Fourier transform the Hartley transform maps a real signal into a
function of frequency. Unlike the Fourier transform this function of frequency

56
PE281 - Applied Mathematics in Reservoir Engineering

is real not complex. If the transform is being computed analytically this


may make the algebra involved easier. If the transform is being performed
numerically there is a considerable decrease in the amount of computation
required. A complex multiplication or division requires four operations and
a complex addition or subtraction requires a two operations. Also real data
arrays require only half the storage of complex data arrays. So the Fast
Hartley transform (FHT) requires considerably less memory and CPU time
than the Fast Fourier Transform (FFT). Another attractive feature of the
Hartley transform is that the transform and its inverse are symmetrical so
the same piece of code can be used to compute the transform and the inverse.

5.2 Hankel Transforms


As we discussed in an earlier chapter the Fourier transform is not particulary
appropriate for the spatial domain of semi infinite (or bounded) radial prob-
lems because we must make assumptions about the behaviour of the pressure
at ±∞. The Hankel transform is a more suitable choice:
Z ∞
Fv (λ) = rJv (λr)f (r)dr (5.6)
0
Z ∞
f (r) = λJv (λr)Fv (λ)dλ (5.7)
0
The Hankel transform is in fact a family of transforms, depending on the
order v of the Bessel function involved. For our applications we will consider
Bessel functions of order zero.

5.2.1 Properties of Hankel Transforms


Parseval’s Theorem
There is no direct analogue to the convolution theorem for Hankel transforms
however the following theorem can be readily proved:
Z ∞ Z ∞
Fv (λ)Gv (λ)λdλ = f (x)g(x)xdx (5.8)
0 0

57
PE281 - Applied Mathematics in Reservoir Engineering

Derivatives
Consider the Hankel transform of g(x) = f 0 (x).
Z ∞
Gv (λ) = f 0 (x)Jv (λx)xdx (5.9)
0

d ∞
Z
= [xf (x)Jv (λx)]∞
0 − f (x)
[xJv (λx)]dx (5.10)
0 dx
Assume that f (x) is such that the first term is zero. Now consider the
derivatives of the Bessel functions:
d λx
[xJv (λx)] = [(v + 1)Jv−1 (λx) − (v − 1)Jv+1 (λx)] (5.11)
dx 2v
v+1 v−1
⇒ Gv (λ) = −λ[ Fv−1 (λ) − Fv+1 (λ)] (5.12)
2v 2v
Note that v = 0 is a special case.

Bessel’s Equation
One of the most useful features of the Hankel transform is what happens when
it is applied to Bessel’s equation. If f (x) is an arbitrary function consider
the transform of:
d2 1 d v2
g(x) = f (x) + f (x) − f (x) (5.13)
dx2 x dx x2
Gv (λ) = −λ2 Fv (λ) (5.14)
2
Note that the terms in the radial diffusivity equation, ∂∂rp2 + 1 ∂p
r ∂r
, are an
instance of Bessels equations so in radial (no θ, z) coordinates:

F0 (∇2 p) = −λ2 F0 (λ) (5.15)

For more information on Hankel transforms see: “Integral Transforms and


their Applications”, Brian Davies, Springer-Verlag, 1978.

58
PE281 - Applied Mathematics in Reservoir Engineering

z=h

line sink

porous media
z=0
r
Figure 5.1: Source/sink configuration

5.2.2 Hankel Transform Example


Barry, Aldis and Mercer, “Injection of Fluid into a Layer of Deformable
Porous Medium”, Applied Mechanics Reviews, v48, n10, 1995, pg 722, con-
sider fluid injection into a porous medium in the context of biological tissue.
They note though that their solution is also relevant to subsurface fluid flow.
The configuration they considered has a point source and a line sink as shown
in Figure 5.1.
Barry et al. solve equations for both pressure and stress, however we will
consider only the pressure equation. The pressure is governed by:

∂ 2 p 1 ∂p ∂ 2 p
" #
δ(r − ρ) δ(r)
2
+ + 2 =α − δ(z − zo ) (5.16)
∂r r ∂r ∂z r r
The Dirac delta terms are used to impose the rate boundary conditions at
the source and sink. When this equation is Hankel transformed it becomes:
∂ 2 p̄
2
− λ2 p̄ = −α(δ(z − z0 ) − J0 (λp)) (5.17)
∂z
where p̄ is the Hankel transform of p;
The solution for p̄ is:
cosh(λz0 ) J0 (λρ)
p̄ = α cosh(λ(z − 1)) − , z[z0 , 1] (5.18)
λsinh(λ) λ2

59
PE281 - Applied Mathematics in Reservoir Engineering

cosh(λ(z0 − 1)) J0 (λρ)


p̄ = α cosh(λ(z)) − , z[0, z0 ] (5.19)
λsinh(λ) λ2
These expressions were inverted by Barry et al. using a routine from the
NAG library.

60
Chapter 6

Green’s Functions

6.1 Theoretical Concepts


a.) adjoint operators
b.) Dirac delta function
c.) Green’s function

“Green’s Functions”, G.F. Roach, Cambridge University Press, 1967


“Application of Green’s Functions in Science and Engineering”, Michael
Greenberg, Prentice-Hall, 1971

6.1.1 Adjoint Operator


We will work in terms of a differential operator, L (note this is not the same
as L for the Laplace transform). L operates on a function, u for example e.g.

d2 d
L= 2
+ (6.1)
dx dx
d2 u du
Lu = + (6.2)
dx2 dx
The adjoint of L is written L∗ . It is defined by multiplying Lu by another
(arbitrary) function v and integrating:
Z Z
vLu dx = boundary terms + uL∗ v dx (6.3)

61
PE281 - Applied Mathematics in Reservoir Engineering

Example:

d2 d
L = a(x) 2
+ b(x) + c(x) (6.4)
dx dx
i.e.
d2 u du
Lu = a(x) 2
+ b(x) + c(x)u (6.5)
dx dx
What is L∗ ? Z
A= v[au00 + bu0 + cu]dx (6.6)

Integrate by parts (term by term):


Z Z Z
00 0 0 0 0 0
vau dx = vau − u (va) dx = vau − (va) u + u(va)00 dx (6.7)
Z Z
0
vbu dx = uvb − u(vb)0 dx (6.8)
Z Z
⇒ A = vau0 − (va)0 u + uvb + u[(va)00 − (vb)0 + vc] dx = uL∗ v dx (6.9)
Now consider L∗ v a little more:

L∗ v = (va)00 − (vb)0 + vc = (v 0 a + a0 v 0 )0 − v 0 b − b0 v + vc (6.10)

= v 00 a+a0 v 0 +a00 v+a0 v 0 −v 0 b−b0 v+vc = av 00 +(2a0 −b)v 0 +(a00 −b0 +c)v (6.11)
d d
⇒ L∗ = a(x) 2
+ (2a0 (x) − b(x)) + (a00 (x) − b0 (x) + c(x)) (6.12)
dx dx

Self-Adjointness
If L = L∗ and the boundary terms vanish, the operator L is known as a
self-adjoint operator. In the example above, L is self-adjoint if:

2a0 − b = b (6.13)

a00 − b0 + c = c (6.14)
⇒ b = a0 (6.15)
i.e. if b = a0 then L is self adjoint. The importance of self adjoint operators
will become clearer we discuss Green’s functions.

62
PE281 - Applied Mathematics in Reservoir Engineering

k=3
3/2

k=2
1

1/2 k=1

-1 -1/2 -1/3 0 1/3 1/2 1

Figure 6.1: Wk function

6.1.2 The Dirac Delta Function


The Dirac delta function is written as δ(x) and is used to describe point
source. Begin by considering a function, Wk :
k
Wk = 2
, |x| < k1
0, otherwise
(6.16)

Now think about what happens as k → ∞. The area under Wk is:


1 1
k k
Z Z
k k
lim dx = dx (6.17)
k→∞ − 1
k
2 2 − k1

k 1 1
 
= + =1 (6.18)
2 k k
Define δ(x) = limk→∞ Wk
Z ∞
⇒ δ(x) = 1.0 (6.19)
−∞

δ(x) = 0, x 6= 0
∞, x = 0
(6.20)

63
PE281 - Applied Mathematics in Reservoir Engineering

H(x-a)

x=a

Figure 6.2: Heavisde function

Integrals Involving δ(x)


Z ∞
δ(x)h(x)dx = h(0) (6.21)
−∞
i.e. multiplying by δ(x) and integrating gives h(0). Similarly:
Z ∞
δ(x − a)h(x)dx = h(a) (6.22)
−∞

Derivatives Involving δ(x)


This is easier to consider in integral form.
Z ∞ Z ∞
δ 0 (x)h(x)dx = δ(x)h(x)|∞
−∞ − δ(x)h0 (x) dx (6.23)
−∞ −∞
Z ∞
=− δ(x)h0 (x) dx (6.24)
−∞
More generally: Z ∞
δ n (x − a)h(x)dx = (−1)n hn (a) (6.25)
−∞

Heaviside Step Functions and the Dirac Delta Function


The Heaviside step function is written H(x − a).
Consider:
Z ∞ Z ∞
0
H (x − a)h(x) dx = H(x − a)h(x)|∞
−∞ − H(x − a)h0 (x) dx (6.26)
−∞ −∞

64
PE281 - Applied Mathematics in Reservoir Engineering

Z ∞
= h(∞) − H(x − a)h0 (x)dx (6.27)
−∞
Z ∞
= h(∞) − h0 (x)dx (6.28)
a
= h(∞) − (h(∞) − h(a)) = h(a) (6.29)
Z ∞
δ(x − a)h(x) dx (6.30)
−∞
0
⇒ H (x − a) = δ(x − a) (6.31)

6.1.3 Green’s Functions


Consider a differential equation written in operator form on a domain Ω:
Lu = f (6.32)
where u is the unknown function and f is a forcing function. We will assume
(initially) that L is self-adjoint, however this assumption will ultimately be
relaxed. Using operator notation:
u = L−1 f (6.33)
Since L is a differential operator we expect L−1 to be an integral operator.
L−1 must satisfy the usual properties of an inverse:
LL−1 = L−1 L = I (6.34)
Now define the inverse operator as:
Z
L−1 f = G(x, xi )f (xi )dxi (6.35)

To find the Green’s function G(x, xi ) for the problem consider what happens
when Lu = f is multiplied by G and integrated over the domain:
Z Z Z
GLu(xi )dxi = uL∗ Gdxi = Gf (xi )dxi (6.36)
Ω Ω Ω

This equation shows that (6.35) is an appropriate definition of L−1 if:


L∗ G(x, xi ) = LG(x, xi) = δ(xi − x) (6.37)
The boundary conditions for this problem can be found by setting the bound-
ary terms to zero. Z
u = G(x, xi )f (xi )dxi (6.38)

This derivation assumes L is a self adjoint operator, we will return to the
non-self adjoint case in another section.

65
PE281 - Applied Mathematics in Reservoir Engineering

6.2 Green’s Function Examples


6.2.1 Self Adjoint Problem
Use Green’s functions to solve:

u00 (x) = φ(x), x[0, 1] (6.39)

u(0) = u(1) = 0 (6.40)

Step 1: Find L∗
Note we are working with u(xi ) not u(x).
Z 1 Z 1
Gu00dxi = Gu0 |10 − u0G0 dxi (6.41)
0 0
Z 1
= Gu0|10 − uG0 |10 + uG00 dxi (6.42)
0
i.e.
d2
L∗ = (6.43)
dx2

Step 2: Consider Boundary Terms


To ensure the problem is self-adjoint we will zero the boundary terms by
imposing boundary conditions on G:

G(x, 1)u0(1) − G(x, 0)u0(0) = 0 (6.44)

G0 (x, 1)u(1) − G0 (x, 0)u(0) = 0 (6.45)


Since u(1) = u(0) = 0 we require:

G(x, 1) = 0 (6.46)

G(x, 0) = 0 (6.47)

66
PE281 - Applied Mathematics in Reservoir Engineering

Step 3: Solve for G


d2 G
= δ(xi − x) (6.48)
dx2i
dG
⇒ = H(xi − x) + Axi (6.49)
dxi
⇒ G = (xi − x)H(xi − x) + Axi + B (6.50)
Now use boundary conditions to solve for A and B:

G(x, 0) = 0 (6.51)

⇒ B = −xH(−x) = 0 (6.52)
G(x, 1) = 0 (6.53)
⇒ (1 − x)H(1 − x) + A = 0 (6.54)
⇒ A = −(1 − x) (6.55)
Substitute A and B back into G:

G = (xi − x)H(xi − x) + (x − 1)xi (6.56)

Step 4: Solve for u


Z 1
u(x) = [(xi − x)H(xi − x) + (x − 1)xi ]φ(xi )dxi (6.57)
0

Symmetry and Interpretation of G


Note the symmetry in G.

When xi < x:
G = (x − 1)xi (6.58)
When xi > x:
G = (xi − 1)x (6.59)
This symmetry is something that should be expected for self adjoint prob-
lems. Physically G can be interpreted as the deflection of a beam in response
to an incremental load φ(xi )dxi at point xi .

67
PE281 - Applied Mathematics in Reservoir Engineering

6.2.2 Non-Self Adjoint Problem


Use Green’s functions to solve:

u00 (x) + 3u0(x) + 2u = f, x[0, 1] (6.60)

u(1) = 2u(0) (6.61)


0
u (1) = a (6.62)

Step 1: Find L∗
Z 1 Z 1 Z 1 Z 1
GLudxi = Gu0 |10 − u0 G0 dxi + 3Gu|10 − 3 uG0 dxi + 2 uGdxi (6.63)
0 0 0 0
Z 1 Z 1 Z 1
= Gu0 |10 −G 0
u|10 + uG dxi +00
3Gu|10 −3 0
uG dxi + 2 uGdxi (6.64)
0 0 0

d2 d
⇒ L∗ = 2
−3 +2 (6.65)
dx dx
The problem is not self adjoint.

Step 2: Consider Boundary Terms

G(x, 1)u0(1) − G0 (x, 1)u(1) + 3G(x, 1)u(1)

−G(x, 0)u0 (0) + G0 (x, 0)u(0) − 3G(x, 0)u(0) = 0 (6.66)


Substitute in the boundary conditions for u:

aG(x, 1) + u(0)[−2G0 (x, 1) + 6G(x, 1) + G0 (x, 0)] = 0 (6.67)

G(x, 0) = 0 (6.68)
We can only specify two boundary conditions on G. The mixed boundary
condition in this problem means that this is not enough to zero all the boud-
nary terms. We will choose to carry aG(x, 1) through the problem and set:

−2G0 (x, 1) + 6G(x, 1) + G0 (0, x) = 0 (6.69)

As in the self adjoint problem we will multiply Lu by G and integrate


over Ω.
Z 1 Z 1 Z 1

GLudxi = boundary terms + uL Gdxi = Gf dxi (6.70)
0 0 0

68
PE281 - Applied Mathematics in Reservoir Engineering

By zeroing out as many boundary terms as possible and choosing L∗ G =


δ(xi − x) this becomes:
Z 1
Gf dxi = aG(x, 1) + u(x) (6.71)
0

Step 3: Solve for G


It is convenient to solve the problem in two parts.

d2 G dG
2
−3 + 2G = 0, 0 ≤ xi < x (6.72)
dxi dxi

d2 G dG
2
−3 + 2G = 0, x < xi ≤ 1 (6.73)
dxi dxi
The singularity at xi = x will be handled by imposing conditions on the
constants of integration. The general solution to this problem is:

G = Aexi + Be2xi , 0 ≤ xi < x (6.74)

G = Cexi + De2xi , x < xi ≤ 1 (6.75)


The constants A, B, C and D can be solved for using the boundary
conditions and some additional conditions to handle the singularity:

G(x, 0) = 0 (6.76)

⇒A+B =0 (6.77)
−2G0 (x, 1) + 6G(x, 1) + G0 (0, x) = 0 (6.78)
⇒ −2(Ce + 2De2 ) + 6(Ce + De2 ) + (A + 2B) = 0 (6.79)
A + 2B + 4Ce + 2De2 = 0 (6.80)
We will require that G is continuous at xi = x:

⇒ Aex + Be2x = Cex + De2x (6.81)

Finally we will consider what happens when we integrate past xi = x:


Z x+0 Z x+0
00 0
G − 3G + 2Gdxi = δ(xi − x)dxi (6.82)
x−0 x−0

69
PE281 - Applied Mathematics in Reservoir Engineering

dG x+0 x+0 Z
⇒ |x−0 − 3G|x+0
x−0 + 2 Gdxi = 1 (6.83)
dxi x−0

Because we have required G to be continuous the second and third terms in


this equation are zero so we have:

(Cex + 2De2x ) − (Aex + 2Be2x ) = 1 (6.84)

We now have four equations to solve for the constants. The final solution for
G is:
1
G = (2e2(1−x) − 4e1−x )(exi − e2xi ), 0 ≤ xi ≤ x (6.85)
k
1
G = (2e2−x −2e2 −1)exi −x + (4e−4e1−x + e−x )e2xi −x , x ≤ xi <= 1 (6.86)
k
where
k = 1 − 4e + 2e2 (6.87)

Step 4: Solve for u


Z 1
u(x) = −aG(x, 1) + G(x, xi )f (xi )dxi (6.88)
0

6.3 Partial Differential Equations


Consider a general second order partial differential equation, on a domain Ω:

Lu = Auxx + 2Buxy + Cuyy + Dux + Euy + F u = f (6.89)

This assumes the independent variables are x and y but x are t are also
possible. This equation can be classified according to A,B and C.

B 2 − AC < 0, elliptic
B 2 − AC = 0, parabolic
B 2 − AC > 0, hyperbolic

70
PE281 - Applied Mathematics in Reservoir Engineering


θ n
dy
i

Figure 6.3: Relationship of dy to dΓ

6.3.1 Adjoint Operator


As before the adjoint operator is defined in terms of the following integral:
ZZ Z Z
vLu dΩ = boundary terms + uL∗ v dΩ (6.90)

We will work out the first term in the general case for the adjoint operator:
x2
(Z )
Z Z Z y2
vAuxx dΩ = vAuxx dx dy (6.91)
y1 x1

Z y2  Z x2 
= vAux |xx21 − (vA)x ux dx dy (6.92)
y1 x1
Z y2  Z x2 
= [vAux − (vA)x u]xx21 + (vA)xx udx dy (6.93)
y1 x1
Z y2 ZZ
= [vAux − (vA)x u]xx21 dy + (vA)xx udΩ (6.94)
y1

Now consider the boundary integration more carefully. The boundary (Γ) is
an arbitrary function of x and y.

dy = dΓ cos θ = ~i · ~ndΓ (6.95)


Therefore the integral being evaluated is:
Z ZZ
[vAux − (vA)x u]~i · ~ndΓ + (vA)xx udΩ (6.96)
Γ Ω

71
PE281 - Applied Mathematics in Reservoir Engineering

Treating all terms in this manner gives the following relationship between
L nand L∗ :
ZZ Z ZZ
vLu dΩ = (M~i + N~j) · ~ndΓ + uL∗ v dΩ (6.97)
Γ Ω

where

L∗ v = (Av)xx + 2(Bv)xy + (Cv)yy − (Dv)x − (Ev)y + F v (6.98)

M = Avux − u(Av)x + 2vBuy + Duv (6.99)


N = −2u(Bv)x + Cvuy − u(Cv)y + Euv (6.100)

Common Operators

Equation Lu L∗ v
Laplace ∇2 u ∇2 v
Helmholtz ∇2 u + k 2 u ∇2 v + k 2 v
Diffusion κut − uxx −κvt − vxx
Wave c2 uxx − utt c2 vxx − vtt

Of these four the diffusion equation is the only one that is not self-adjoint.
It can be proven that:
Ax + By = D (6.101)
and
Bx + Cy = E (6.102)
are necessary and sufficient conditions for L = L∗ .

6.3.2 The Delta Function is Two Dimensions


Like δ(x), δ(x, y) can be seen as the limit of a sequence of other functions.

δ(x − xi , y − yi ) = limk→∞ Wk (r) (6.103)

where q
r= (x − xi )2 + (y − yi )2 (6.104)

72
PE281 - Applied Mathematics in Reservoir Engineering

and
k2 1
Wk = , r≤ (6.105)
π k
1
= 0, r> (6.106)
k
and/or
2
ke−kr
Wk (r) = (6.107)
π
The two dimensional delta function has similar properties to the one dimen-
sional delta function:
ZZ
δ(x − xi , y − yi )h(x, y)dΩ = h(xi , yi ) (6.108)
dΩ

δ(x − xi , y − yi ) = δ(x − xi )δ(y − yi ) (6.109)

6.3.3 Constructing Green’s Functions


When working in two dimensions is usually easier to construct the Green’s
function for a given problem as the sum of two Green’s functions:

G = Gf + Gb (6.110)

where Gf satisifes L∗ Gf = δ(xi − x, yi − y) without taking account of any


particular boundary conditions on G or Gf . The function Gf is known as a
free-space Green’s function. The function Gb takes account of the boundary
terms for a particular problem.

Example: Two-Dimensional Laplace Equation


L∗ Gf = ∇G
f = δ(xi − x, yi − y) (6.111)
As before we will begin by solving the problem away from the singularity
where the delta function is zero, then will consider the singularity separately.
1 ∂ ∂Gf
∇2 G f = (r )=0 (6.112)
r ∂r ∂r
∂Gf
⇒r =A (6.113)
∂r

73
PE281 - Applied Mathematics in Reservoir Engineering

Γe
x,y

Γ
yi

xi

Figure 6.4: Integration around singularity

∂Gf A
⇒ = (6.114)
∂r r
∂Gf A
⇒ = (6.115)
∂r r
⇒ Gf = Alnr + B (6.116)
where q
r= (xi − x)2 + (yi − y)2 (6.117)
Now consider the singularity by integrating over a disc surrounding the sin-
gularity as shown in Figure 6.4.
ZZ ZZ
∇2 Gf dΩ = δ(xi − x, yi − y)dΩ (6.118)
Ωe Ωe

Use Green’s second identity to convert the domain integral on the left to a
boundary integral. In general for two function f and g Green proved:
!
∂g ∂f
ZZ Z
2 2
(f ∇ g − g∇ f )dΩ = f −g dΓ (6.119)
Ω Γ ∂n ∂n

74
PE281 - Applied Mathematics in Reservoir Engineering

∂Gf
ZZ Z
⇒ ∇2 Gf dΩ = dr (6.120)
Ωe Γe ∂r
2π ∂Gf
Z
= rdθ (6.121)
0 ∂r
Now substitute Gf = Alnr + B:
2π 1
Z
⇒= A rdθ (6.122)
0 r
Recalling the left hand side of Equation 6.118 must equal 1 we have:

2πA = 1 (6.123)

i.e.
A=1 (6.124)
Since we are not considering any boundary conditions we can not solve for
B explicity so we will set it (arbitrarily) to zero, i.e.:
1
Gf = lnr (6.125)

Example: One-Dimensional Diffusion Equation


The diffusion equation is:

∂u ∂ 2 u
Lu = κ − 2 (6.126)
∂t ∂x
Referring to the general expression for L and L∗ we have the following L∗ :

∂ ∂2
L∗ = −κ − 2 (6.127)
∂t ∂x
To find the (free-space) Green’s function we will solve:

∂Gf ∂ 2 Gf
L∗ Gf = κ + = −δ(xi − x)δ(τ − t) (6.128)
∂τ ∂x2i
We’ll use a Fourier transform to do this, specifically:
1 ∞
Z
F (s) = √ f (xi )e−ixi s dxi (6.129)
2π −∞

75
PE281 - Applied Mathematics in Reservoir Engineering

∂ Gˆf 1
⇒κ − s2 Ĝf = −δ(τ − t) √ e−ixs (6.130)
∂τ 2π
As before consider solving two problems, one on each side of the singularity
(where the delta function is zero):

∂ Gˆf
κ − s2 Ĝf = 0, τ >t (6.131)
∂τ

∂ Gˆf
κ − s2 Ĝf = 0, τ <t (6.132)
∂τ
This equation can be readily solved for Ĝf :
2
Ĝf = Aes τ κ, τ >t (6.133)
2
Ĝf = Bes τ κ, τ <t (6.134)
Now take account of the singularity by integrating past it:
t+0 dĜf t+0 1 t+0
Z Z Z
κ dτ − s2 Ĝf dτ = − √ δ(τ − t)e−ixs dτ (6.135)
t−0 dτ t−0 2π t−0

We require Ĝf to be continuous so the second integral in the above equation


vanishes to give:
2 2 1
κ(Aes τ κ − Bes τ κ) = − √ e−ixs (6.136)

To solve for A and B we need one more equation. This time we will consider a
physical argument. The Green’s function represent the response of a system
to a unit input applied at time τ and location xi . So before time τ we do
not expect change in the system i.e G will be zero for t < τ . Therefore the
constant A is zero.
Now solve for B:
1 −s2 t
B = √ e−ixs e κ (6.137)
κ 2π
Ĝf = 0, τ >t (6.138)
1 s2 t s2 τ
Ĝf = √ e−ixs− κ + κ τ >t (6.139)
κ 2π

76
PE281 - Applied Mathematics in Reservoir Engineering

Ĝf can be written more compactly as:

H(t − τ ) −ixs− s2 t + s2 τ
Ĝf = √ e κ κ (6.140)
κ 2π
The Fourier transform can be inverted to give:
2
H(t − τ ) −κ(x i −x)
Gf = q e 4(t−τ ) (6.141)
4πκ(t − τ )

6.4 The Newman Product Theorem


This theorem is not specific to the solution of the differential equations that
give rise to Green’s functions (L∗ G = δ(xi −x) etc). The theorem allows us to
find solutions to differential equations in multiple dimensions from solutions
to one-dimensional problems. We will consider the diffusion equation in three
dimensions:
∂2u ∂2u ∂2u 1 ∂u
2
+ 2+ 2 = (6.142)
∂x ∂y ∂z κ ∂t
on the domain
a1 ≤ x ≤ b1 (6.143)
a2 ≤ y ≤ b2 (6.144)
a3 ≤ z ≤ b3 (6.145)
with initial conditions

u(x, y, z, 0) = U(x)V (y)W (z) (6.146)

Note being able to express the initial condition in this “product” form is
essential.

The boundary conditions can be constant u, constant flux or mixed on each


edge.

Now consider solving three one-dimensional problems:

∂ 2 u1 1 ∂u1
2
= , a1 ≤ x ≤ b1 (6.147)
∂x κ ∂t

77
PE281 - Applied Mathematics in Reservoir Engineering

∂ 2 u2 1 ∂u2
= , a2 ≤ y ≤ b2 (6.148)
∂y 2 κ ∂t
∂ 2 u3 1 ∂u3
2
= , a3 ≤ y ≤ b3 (6.149)
∂z κ ∂t
The initial conditions for this set of equations are:

u1 (x, 0) = U(x) (6.150)

u2 (y, 0) = V (y) (6.151)


u3 (z, 0) = W (z) (6.152)
and the boundary conditions are taken from the original problem. The solu-
tion for u is:
u(x, y, x, t) = u1 (x, t)u2 (y, t)u3(z, t) (6.153)
Proof: Substitute (6.153) into the diffusion equation (6.142):

∂2u ∂2u ∂2u ∂ 2 u1 u2 u3 ∂ 2 u1 u2 u3 ∂ 2 u1 u2 u3


+ + = + + (6.154)
∂x2 ∂y 2 ∂z 2 ∂x2 ∂y 2 ∂z 2
Expanding the derivatives gives:

∂ 2 u1 ∂ 2 u2 ∂ 2 u3
= u2 u3 + u 1 u 3 + u 1 u 2 (6.155)
∂x2 ∂y 2 ∂z 2

Now substitute in (6.147):

1 ∂u1 1 ∂u2 1 ∂u3


= u2 u3 + u1 u3 + u1 u2 (6.156)
κ ∂t κ ∂t κ ∂t
1 ∂u
= (6.157)
κ ∂t
For an example involving radial coordinates see Carslaw and Jaegar, page
33.

78
PE281 - Applied Mathematics in Reservoir Engineering

6.5 Gringarten and Ramey


Gringarten and Ramey, “The Use of Source and Green’s Functions in Solv-
ing Unsteady-Flow Problems in Reservoirs”. SPEJ, October 1973, pg 285,
applied Green’s functions and the Newman product theorem to reservoir en-
gineering problems. Gringarten and Ramey derived both free-space Green’s
functions and Green’s functions satisfying boundary conditions for rectangu-
lar, homogeneous, anisotropic reservoirs. Gringarten and Ramey define both
Green’s functions and “source” functions. Source functions act over a region
while Green’s functions act a given point in one, two or three dimensions.
Source functions can be determined by integrating Green’s functions over an
appropriate region (corresponding to a well or fracture).
The basic result that Gringarten and Ramey use is the Green functions
for a point source in a one dimensional reservoir:
1 (x−xw )2
G= √ e− 4ηt (6.158)
4πηt

where
∂p
η∇2 p − =0 (6.159)
∂t
Note that this one dimensional source corresponds to an infinite planar
source in three dimensions (see Figure 6.5). This source can be integrated
over a region of width xf to produce a slab source as shown in Figure 6.6:
" ! !#
1 x − (xw − xf /2) x − (xw + xf /2)
S= erf √ − erf √ (6.160)
2 4ηt 4ηt

The product of the inifinite plan source and the infinite line source gives
the point source solution (see Figure 6.7).
The set of free-space solutions Gringarten and Ramey generated is given
by I(x) to VI in Table 1 of their paper.

6.5.1 Adding Boundaries


Gringarten and Ramey added boundary conditions to the solutions for infi-
nite plane and infinte slab sources by using the method of images (which we
discussed at the start of the course. These solutions are VII(x) to XII(x) in
Table 2 of their paper. For instance consider constant pressure boundaries

79
PE281 - Applied Mathematics in Reservoir Engineering

y
x

x = xw
Figure 6.5: Planar source

y
x

xf
z

x = xw
Figure 6.6: Slab source

80
PE281 - Applied Mathematics in Reservoir Engineering

Figure 6.7: 3D Point source as a product of a line source and a plane source

at x = 0 and x = xe . To ensure the pressure in the final solution is zero we


will require that G = 0 on these boundaries (since G represent the effect of a
unit flow rate at the well at any location in space). The sequence of images
is shown in Figure 6.8.

The sequence extends infinitely in both directions. The Green’s function that
corresponds with this sequence is:
1 (x−xw )2 (x+xw )2 (x−2xe +xw )2 (x+2xe −xw )2
 
G= √ e− 4ηt − e− 4ηt − e− 4ηt + e− 4ηt + ...
4πηt
( ∞ ) (6.161)
1 X − (x−xw −2nxe )2 (x+xw −2nxe )2
G= √ e 4ηt − e− 4ηt (6.162)
4πηt n=−∞
This series can have convergence problems. It is better to expand it using
Poisson’s summation formula, which is:

√ ∞
2π X 2πn
X  
f (αn) = F (6.163)
−∞ α n=−∞ α

where F is the Fourier transform of f .


1 ∞
Z
F (s) = √ f (x)e−ixs dx (6.164)
2π −∞

81
PE281 - Applied Mathematics in Reservoir Engineering

+ve +ve

-ve -ve
+ve
-2x e+xw -x x=0 xw xe 2x e-x w 2x e +x w
w
Figure 6.8: Sequence of image wells

We will need
(x−xw −2nxe )2
 
F e− 4ηt (6.165)

and
(x+xw −2nxe )2
 

F e 4ηt (6.166)

Begin by defining a new variable, x̃ = 2nxe . We will do the Fourier transform


in terms of this variable. The first shift theorem can be applied to give:
(x−xw −2nxe )2 −(2nxe )2
   
− −is(x−xw) −
F e 4ηt =e F e 4ηt (6.167)

2
 

−is(x−xw) − 4ηt
=e F e (6.168)
1 Z ∞ −isx̃ − 4ηt
x̃2
= e−is(x−xw) √ e e dx̃ (6.169)
2π −∞
We will evaluate this integral by completing the square in the exponent. The
exponent is:

x̃2
! !
x̃ 4ηtis 2 2
− + isx̃ = ( √ + ) + ηts (6.170)
4ηt 4ηt 2

Recall the following useful integral which will help us evaluate the integral
we require for the Fourier transform:
Z ∞ −z 2 √
e A2 dz = πA (6.171)
−∞

82
PE281 - Applied Mathematics in Reservoir Engineering

Using this result the Fourier transform we need is:


1 √ q 2
q 2
e−is(x−xw ) √ π 4πηte−s ηt = 2ηte−is(x−xw ) e−s ηt (6.172)

Now return to the summation:
∞ ∞


(x−xw −2nxe )2 2π q 2
2ηte−is(x−xw ) e−s ηt
X X
e 4ηt = (6.173)
n=−∞ n=−∞ 2xe
where we have replace the α in Poission’s summation formula by 2xe . We
still need to consider the s.
2πn 2πn πn
s= = = (6.174)
α 2xe xe
So the summation for the Green’s function is:

( )
1 (x−xw −2nxe )2 (x+xw −2nxe )2
e− − e−
X
G= √ 4ηt 4ηt (6.175)
4πηt n=−∞
√ ( ∞ 2 2 2 2
)
1 4πηt X −
iπn(x−xw ) − π n ηt
2 −
iπn(x+xw ) − π n ηt
2
=√ e xe e xe − e xe e xe (6.176)
4πηt 2xe n=−∞
∞ 2 n2 ηt
( )
1

− −π iπn(x−xw ) iπn(x+xw )
− −
X
x2
= e e e xe −e xe (6.177)
2xe n=−∞

The terms in square brackets can be expanded in terms of sines and cosines
to give:
πnx πnx πnxw
   
iπn(x−xw ) iπn(x+xw )
e− xe − e− xe ) − isin( ) 2isin(
= cos( )
xe xe xe
(6.178)
The product of the cosine and sine terms is zero when summed (recall the
integral of an even function times an odd function is also zero), so only the
sine terms remain. Finally when we substitute back into G we have:
∞ 2 n2 ηt
( )
1 X −π
x2
πnx πnxw
G= e e sin( )sin( ) (6.179)
xe n=−∞ xe xe
Because of the symmetry in the sine terms we have
∞ 2 n2 ηt
( )
2 X −π
x2
πnx πnxw
G= e e sin( )sin( ) (6.180)
xe n=1 xe xe

83
PE281 - Applied Mathematics in Reservoir Engineering

x=0 x
w

y
w

y=0

Figure 6.9: Well/boundary geometry

6.5.2 General Rectangular Reservoirs


The appropriate source functions for bounded rectangular reservoirs can be
generated by applying Newmans’s product theorem and using suitable one-
dimensional solutions e.g. consider a fully completed well in a reservoir that
is infinite in the y direction and has constant flux boundaries in x.

The appropriate source function is I(y).V II(x)

6.5.3 Recovering the Pressure


The pressure equation is:
k 2 ∂p
∇ p − φc =q (6.181)
µ ∂t
where q represent sources and sinks caused by wells. This can be rearranged
to give:
∂p 1
η∇2 p − = q (6.182)
∂t φc

84
PE281 - Applied Mathematics in Reservoir Engineering

Once the appropriate source function has been determined the drawdown
can be found by evaluating the following integral:
1 t
Z
∆p(t) = q(τ )S(t − τ )dτ (6.183)
φc 0

6.6 Green’s Function Summary


- Trying to solve a differential equation of the form Lu(x, t) = f (x, t) where
u is an unknown function and f is a known forcing function.
- The first step is to determine the adjoint operator, L∗ :
ZZ Z
vLudΩ = boundary terms + uL∗ vdΩ (6.184)

- Determine specific boundary conditions for G by zeroing the boundary
terms arising from L∗ . If you only want a free-space Green’s function don’t
worry about the boundary conditions.
- Solve for G: Multiply Lu = f by G and integrate. Work in terms of dummy
variables xi and τ .
ZZ ZZ
G(x, xi , t, τ )Lu(xi , τ )dΩ = Gf (xi , τ )dΩ (6.185)
Ω Ω
Now refer back to the adjoint equation:
ZZ ZZ
G(x, xi , t, τ )Lu(xi , τ )dΩ = boundary terms + u(xi , τ )L∗ GdΩ
Ω Ω
(6.186)
This equation implies that setting:

L∗ G = δ(xi − x, τ − t) (6.187)
will allow us to solve for u(x, t)
ZZ
u(x, t) = Gf (xi , τ )dΩ − boundary terms (6.188)

- Where’s the singularity?
While we are solving for G the domain of the problem is xi , τ so the singu-
larity is at a point x, t, but ...
... once we have G and are thinking about what it means physically G is the
effect on u (in the domain x, t) of a singularity at xi , τ .

85
Chapter 7

Numerical Methods

7.1 Boundary Element Method


The boundary element method (BEM) is a numerical method which solves
a differential equation (Lu = f ) in an integral form. We’ll begin by con-
sidering the Laplace equation, however other equations (including transient
equations) ca be considered:

∂2p ∂2p
+ =0 (7.1)
∂x2 ∂y 2

7.1.1 Derivation of the Boundary Integral Equation


The derivation of BEM begins from Green’s second identity. For two arbi-
trary functions f and g Green proved the following:
ZZ Z
∂g ∂f
(f ∇2 g − g∇2 f )dΩ = f − g dΓ (7.2)
Ω Γ ∂n ∂n
where n is the normal to the boundary.
In our case we will take:
f =p (7.3)
1
g=G= ln(1/r) (7.4)

where q
r= (xi − x)2 + (yi − y)2 (7.5)

86
PE281 - Applied Mathematics in Reservoir Engineering

Γ
e

Figure 7.1: Location of singularity

and G is the free-space Green’s function for the problem.


∂G ∂p
ZZ Z
2 2
⇒ (p∇ G − G∇ p)dΩ = p − G dΓ (7.6)
Ω Γ ∂n ∂n
This equation is key to the derivation of BEM. It shows how we can
convert domain integrals into boundary integrals for the same problem. To
proceed further we’ll break up the domain Ω into the sume of a circle sur-
rounding the singularity (Ωe ) and the remainder, Ω − Ωe . First consider the
remainder:
∂G ∂p
ZZ Z
⇒ (p∇2 G − G∇2 p)dΩ = p − G dΓ (7.7)
Ω−Ωe Γ+Γe ∂n ∂n
Within this domain both ∇2 G = 0 and ∇2 p = 0.
∂G ∂p ∂G ∂p
Z Z
⇒0= p − G dΓ + p − G dΓ (7.8)
Γ ∂n ∂n Γe ∂n ∂n
Now consider the integral over Γe further, noting that dΓ = rdθ:
∂G ∂G ∂r 1 −1 1
= = (−1) = (7.9)
∂n ∂r ∂n 2π r 2πr
∂G ∂p 1 2π 1 1 ∂p
Z Z
p − G dΓ = [p − ln ]rdθ (7.10)
Γe ∂n ∂n 2π 0 r r ∂n
1 2π ∂p
Z
= (p + rln(r) )dθ (7.11)
2π 0 ∂n

87
PE281 - Applied Mathematics in Reservoir Engineering

node
linear element

Figure 7.2: Boundary Discretisation

Consider the limit as r → 0:


1
= (2πp) = p(xi , yi) (7.12)

Now substitute this result back into equation 7.8:
Z
∂G Z
∂p
p(xi , yi) + p dΓ = G dΓ (7.13)
Γ ∂n Γ ∂n
If the point (xi , yi) is on the boundary this equation must be modified to:
θ Z
∂G Z
∂p
p(xi , yi ) + p dΓ = G dΓ (7.14)
2π Γ ∂n Γ ∂n
where θ is the boundary angle (pi at smooth boundaries, pi/2 at right
angle etc).
Note that at this stage no approximations have been introduced. The
differential equation has been converted to an equivalent integral represen-
tation.

7.1.2 Boundary Discretisation


To obtain a numerical solution to the problem the boundary is divided into
nodes and elements.
The geometry of the boundary and the variation of the unknown (pres-
sure) is interpolated over the elements in terms of nodal values and shape

88
PE281 - Applied Mathematics in Reservoir Engineering

ξ=−1 ξ=+1

x=x 1 x=x 2

Figure 7.3: Local coordinate

functions (Nj ). Figure 7.2 shows a linear element i.e. the boundary geometry
is approximated by a straight line connecting the nodes. Higher order ele-
ments are also possible. To improve the accuracy of the solution the elements
can either be refined into smaller elements, or higher order interpolation e.g.
quadratic can be used.
The shape functions are defined in terms of a local coordinate ξ that runs
from -1 to 1 along the element.
The linear shape functions are:

x(ξ) = N1 x1 + N2 x2 (7.15)

y(ξ) = N1 y1 + N2 y2 (7.16)
p(ξ) = N1 p1 + N2 p2 (7.17)
where
1
N1 = (1 − ξ) (7.18)
2
1
N2 = (1 + ξ) (7.19)
2
The quadratic shape functions are:

x(ξ) = N1 x1 + N2 x2 + N3 x3 (7.20)
−ξ
N1 = (1 − ξ) (7.21)
2
N2 = (1 + ξ)(1 − ξ) (7.22)
ξ
N3 = (1 + ξ) (7.23)
2
89
PE281 - Applied Mathematics in Reservoir Engineering

By breaking the boundary integral in equation 7.14 into the sum of inte-
grals over elements, and writing the expression for the pressure and geometry
of the elements in terms of shape functions we have:
M X 2 M X 2
θ X Z 1
∂G(ri ) X ∂pj Z 1
p(xi , yi)+ pj Nj (ξ)J(ξ)dξ = G(ri )Nj (ξ)J(ξ)dξ
2π m=1 j=1 −1 ∂n m=1 j=1 ∂n −1
(7.24)
where M is the number of elements and J(ξ) is a Jacobian which takes
account of the integral being performed over ξ.
v
u !2 !2
dΓ u dx(ξ) dy(ξ)
J(ξ) = = t
+ (7.25)
dξ dξ dξ

The discretised integral equation can be written in matrix form as:


∂p
Ap = B (7.26)
∂n
Each row of this matrix equation arises from placing the source node
of the Green’s function at a given node i on the boundary. The terms in
matrices A and B are usually too difficult to evaluate analytically.
Z 1 ∂G(ri ) θ
Aij = Nj (ξ)J(ξ)dξ + δij (7.27)
−1 ∂n 2π
Z 1
Bij = G(ri )Nj (ξ)J(ξ)dξ (7.28)
−1

7.1.3 Gauss Quadrature


The following integral can be evaluated (approximately) using Gauss quadra-
ture if f (ξ) is not singular:
Z 1 N
X
f (ξ)dξ = f (ξn )Wn (7.29)
−1 n=1

The integral is evaluated as the weighted (weights, Wn ) sum of function


values at a set of special points known as Gauss points (ξn ). The integral
becomes more accurate as N increases.
N =2
±ξn = 0.5773 (7.30)

90
PE281 - Applied Mathematics in Reservoir Engineering

Wn = 1.0 (7.31)
N =3
±ξn = 0, 0.7745 (7.32)
Wn = 0.8888, 0.5555 (7.33)
N =4
±ξn = 0.8611, 0.3399 (7.34)
Wn = 0.3478, 0.6521 (7.35)
If i = j the integrals are singular special qaudratures can be used, how-
ever these may be computationally intensive or problem specific. Luckily a
physical arguement can be used to evaluate these diagonal terms once the off-
diagonals have been evaluated. For this problem if p is constant everywhere
∂p
we expect ∂n at every node to be zero i.e.

∂p
Apconst = B =0 (7.36)
∂n
N
X
⇒ Aii = − Aij (7.37)
j=1,j6=i

7.1.4 Boundary Conditions


The solution is not uniquely determined until boundary conditions have been
imposed. At every node pressure, pressure derivative or mixed boundary
conditions must be imposed. Note that for the problem being considered at
least one node must have a specified pressure. Once boundary conditions
∂p
have been set half the unknown p and ∂n values can be eliminated from the
matrix equation to give:
A0 x = b (7.38)
∂p
where x is a vector containing the unknown p and ∂n values.
∂p
At smooth boundaries either p or q = ∂n is set as a boundary condition:
At corners there are two values of q however. either
- specify both q values and solve for p
- specify one q value and p, then solve for the other q
- specify p and solve for both q values

91
PE281 - Applied Mathematics in Reservoir Engineering

p
Figure 7.4: Boundary conditions at a smooth boundary

q q
p

Figure 7.5: Boundary conditions at a corner

If the last option is being used and extra equation is required. This can
be generated from the physics of the problem, or by breaking the boundary
up.

7.1.5 Matrix Solution


The matrix A0 is fully populated and has the same dimension as the number
of boundary nodes. Direct solvers are usually used. The reduced size of the
matrix involved in BEM is one of it’s chief advantages. For instance, consider
solving a problem one a 100 by 100 grid. If finite differences were being used
the matrix would be 10,000 by 10,000. The matrix would be sparse. If BEM
is used only the boundary nodes are required in the matrix problem so the
matrix is 400 by 400, however this matrix would be dense.

7.1.6 Calculating Internal Solutions


The pressure can be calculated at any internal point (note there is no internal
mesh) by placing the source point (xi , yi) of the Green’s function at the point

92
PE281 - Applied Mathematics in Reservoir Engineering

q
q
p p

Figure 7.6: Broken boundary

of interest and revaluating the boundary integral equation.


M X 2 M X 2
θ 1 ∂G(ri ) ∂pj 1
X Z X Z
p(xi , yi) = − pj Nj (ξ)J(ξ)dξ+ G(ri )Nj (ξ)J(ξ)dξ
2π m=1 j=1 −1 ∂n m=1 j=1 ∂n −1
(7.39)
∂pj
Since we are considering internal points θ = 2π. All the pj and are known ∂n
since they are located on the boundary and have already been determined.
G is a function of (xi , yi ) so the integrals must be revaluated.
Calculating the pressure at the internal points does not require a matrix
solve, only revaluation of the element integrals. The internal solutions can
be calculated sequentially, and only need to be calculated at the points of
interest.

7.1.7 Transient Problems


Suppose we wanted to solve:
∂2p ∂2p ∂p
2
+ 2 =η (7.40)
∂x ∂y ∂t
If we begin from Green’s second identity as before:
ZZ Z
∂g ∂f
(f ∇2 g − g∇2 f )dΩ = f − g dΓ (7.41)
Ω Γ ∂n ∂n
We’ll start by considering what happens when we divide Ω into a small circle
surrounding the singularity and the remainder:
∂p ∂G ∂p
ZZ Z
− Gη dΩ = p − G dΓ (7.42)
Ω−Ωe ∂t Γ+Γe ∂n ∂n

93
PE281 - Applied Mathematics in Reservoir Engineering

since ∇p = η ∂p
∂t
. We’re using the steady state Green’s function used in the
previous section.
We could approximate ∂p ∂t
with a finite difference i.e.:

∂p pt2 − pt1
= (7.43)
∂t ∆t
however a domain integral is still required so the problem has lost it’s bound-
ary only character.
To handle transient problems in a boundary only manner alternative ap-
proaches are require. We’ll consider two - transient Green’s functions and
solving the problem in Laplace space.

7.1.8 Transient Problems - Transient Green’s Func-


tions
We’ve already discussed how to find Green’s functions for equations of the
form:
∂2p ∂2p ∂p
2
+ 2 =η (7.44)
∂x ∂y ∂t
.
If we have the correct Green’s functions we can build a boundary only
solution method of the form:
Ap = Bq (7.45)
The procedure to do so involves multiplying the governing differential by
G and integrating by parts. The Aij and Bij terms are now time dependent so
the element integrals must be reevaluated each time step. Computationally
efficient ways to do so are an ongoing research topic.

7.1.9 Transient Problems - Laplace Transform


If the initial pressure is zero then the Laplace transform of the differential
equation is:
∂ 2 p̄ ∂ 2 p̄
+ = sp̄ (7.46)
∂x2 ∂y 2
The Green’s function is available (in Laplace space) for this problem:
1 √
G= Ko ( sr) (7.47)

94
PE281 - Applied Mathematics in Reservoir Engineering

Using this Green’s function a BEM scheme can be built which will solve
for p̄. To get p at any time of interest we can numerically invert this solution.
This removes the need to begin the solution procedure from t = 0 and march
forward in time.

7.1.10 Advantages of BEM


- No internal grid. The only discretisation errors come from the boundary
discretisation. Internal solutions are actually more accurate than the bound-
ary solutions. No grid orientation effect.
- Flexible geometry. Good boundary conformance.
- Reduction of dimensionality i.e. one dimensional grid required for a two
dimensional problem, two dimensional grid required for a three dimensional
problem. Smaller matrix to solve.

7.1.11 Disadvantages of BEM


- Only applicable to problems with a ∇2 operator e.g. diffusion equation,
wave equation. Problems with convective terms can not be handled. For
reservoir engineering problems only applicable to single phase flow in homo-
geneous media.
- Transient problems are more complicated than steady-state.
- Dense matrix problem.

7.2 Alternatives to the Boundary Element Method


BEM is only applicable to problems we can find the Green’s function for. This
limits it’s applicability. The theory can be extended to a wider class of prob-
lems by considering alternative boundary element based methods including
the Dual Reciprocity Boundary Element Method (DRBEM) and the Green
Element Method (GEM). DRBEM is the more commonly used approach
however my Ph.D. research suggests GEM has some attractive properties for
reservoir engineering problems. The two approaches will be introduced in
the following sections.

95
PE281 - Applied Mathematics in Reservoir Engineering

7.2.1 Dual Reciprocity Boundary Element Method


Suppose we want to solve a problem of the form:

∇2 p = b(x, y) (7.48)

The function b is arbitrary so the Green’s function for this problem is not
neccessarily available. The essence of the DRBEM approach is the following
expansion:
N
X
b≈ αj fj (7.49)
j=1

where the αj are weights and the fj are a set of approximating functions. The
only restriction on the approximating functions is that they are the Laplacian
of some other function:
∇2 pˆj = fj (7.50)
One of the simplest functions satisfying this requirement is f = 1 + r.
The equation we are trying to solve can now be expressed as:
N N
∇2 p = αj ∇2 pˆj
X X
αj fj = (7.51)
j=1 j=1

This introduces a ∇2 operator on each side of equation so well can apply


the same procedure we used for the ∇2 p = 0 problem to derive a boundary
integral equation:
N
θ ∂G ∂p X θ ∂G ∂ pˆj
Z Z Z Z
p(xi , yi) + pdΓ − G = αj ( pˆj (xi , yi ) + pˆj − G )
2π Γ ∂n Γ ∂n j=1 2π Γ ∂n Γ ∂n
(7.52)
This can be written in matrix form as:

Ap − Bq = (AP̂ − B Q̂)α (7.53)

where P̂ and Q̂ are matrices whose columns contain the functions pj and qj
evaluated at each node i.
Computational issues:
- internal nodes must be included in the matrix problem if the solution is
required at internal points. So the matrix problem is larger than it would be
for BEM and it remains dense.

96
PE281 - Applied Mathematics in Reservoir Engineering

- the weighting vector α may require a significant amount of calculation. In


transient problems this vector must be updated at each timstep.
- DRBEM does extend the theory of BEM to arbitrary problems (as long
as they include a ∇2 operator somewhere. Convective problems, such as the
convection-diffusion equation can be considered using DRBEM.

7.2.2 The Green Element Method


The Green Element was derived by Professor Akpofure Taigbenu and is fully
explained is his book “The Green Element Method”. It’s chief attraction is
it’s flexibility and the fact that it generates a sparse matrix problem. The
matrix problem is however large.
Suppose we want to solve:
∇2 p = b(x, y) (7.54)
Again we will start from Green’s second identity:
∂G ∂p
ZZ Z
2 2
p∇ G − G∇ pdΩ = p − G dΓ (7.55)
Ω Γ ∂n ∂n
Substituing ∇2 p = b and splitting the domain into a circle surrounding the
singularity and the remainder (as before) gives:
θ Z
∂G ∂p ZZ
− p(xi , yi) + p − G dΓ = GbdΩ (7.56)
2π Γ ∂n ∂n Ω

Note that no approximations have been made at this stage. Now GEM
departs from BEM:
- both the boundary and the domain are discretised.
- the boundary integral can be seen as the sum of integrals over the element
boundaries.

If both the boundary and the domain integrals are broken into the sum of
element integrals we have:
M M
θ ∂G ∂p
X Z X ZZ
− p(xi , yi) + p − G dΓ = GbdΩ (7.57)
2π e=1 Γe ∂n ∂n e=1 Ωe

Now shape functions are introduced to interpolate the pressure and q =


∂p
∂n
over the elements in terms of nodal values. In the case of linear shape

97
PE281 - Applied Mathematics in Reservoir Engineering

Figure 7.7: Overall boundary is equivalent to the sum of the element bound-
aries

functions:
4
X
p= Nj pj (7.58)
j=1

4
X
q= Nj qj (7.59)
j=1

4
X
b= Nj bj (7.60)
j=1

When these shape functions are substituted into (7.57) we have:


M X 4 M X 4
θ ∂G
X Z X ZZ
− p(xi , yi )+ pj Nj −Gqj Nj dΓ = Gbj Nj dΩ (7.61)
2π e=1 j=1 Γe ∂n e=1 j=1 Ωe

A matrix equation can be formed from this:


M
e
pj + Leij qj + Vij bj = 0
X
Rij (7.62)
e=1

where
∂G
Z
e
Rij = Nj dΓ (7.63)
Γe ∂n
Z
Leij = Gi Nj dΓ (7.64)
Γe
ZZ
Vije = Gi Nj dΩ (7.65)
Ωe

98
PE281 - Applied Mathematics in Reservoir Engineering

7.2.3 Dealing with Heterogeneity


Single phase flow in heterogeneous reservoirs is governed by:
k ∂p
∇ · ( ∇p) = φct (7.66)
µ ∂t
This is not in a form suitable for solution with any BEM based method.
However a ∇2 operator can be extract by rearranging the equation in the
following manner:
φµct ∂p
∇2 p = −∇lnk · ∇p + (7.67)
k ∂t

99
Chapter 8

Errata

The following is a list of typos that were found after the original handout
was produced. There are inevitably even more. If you find them please let
me know.

Eqn 2.20 should read lim s → ∞ sLf (t), the first = sign is incorrect
Eqn 2.22 should have lim s → ∞ as the second limit
Eqn 2.63 should not have the first negative sign
Eqn 2.66 should have limits of integration from s to infinity
Eqn 2.81 should have lim t → ∞ on the right hand side
Eqn 3.48 should be lim t → ∞
Eqn 3.73 should be pd = (pi-p)/(pi-pw)
Eqn 3.74 should be rd=1
Eqn 6.82 should finish with δ(xi − x)dxi
Eqn 6.84 should have 2B exp(2x) not B exp(2x)
Eqn 6.86 should finish with x ≤ xi ≤ 1
Eqn 6.171 should have −z 2 /A2 as the exponent

100

You might also like