100
PE 281- APPLIED MATHEMATICS IN RESERVOIR ENGINEERING Rosalind Archer Stanford University Spring 2000

PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Embed Size (px)

Citation preview

Page 1: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE 281 - APPLIED MATHEMATICS IN RESERVOIR

ENGINEERING

Rosalind ArcherStanford University

Spring 2000

Page 2: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 havesnuck through. If you do find errors please contact me.

Rosalind Archerrosalind@pangea

2

Page 3: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 1

Introduction

1.1 The Diffusion Equation

This course considers slightly compressible fluid flow in porous media. Thedifferential equation governing the flow can be derived by performing a massbalance 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)

where V = ∆xA and q = −kAµ

∂p∂x

Dividing (1.2) through by ∆x and ∆t and taking limits as ∆x → 0 and∆t → 0 gives:

lim∆x→0

qρ|x − qρ|x+∆x

∆x= lim

∆t→o

φAρ|t+∆t − φAρ|t∆t

(1.3)

⇒ − ∂

∂x(qρ) =

∂t(φAρ) (1.4)

Substituting Darcy’s law into (1.4) gives:

∂x

(

kA

µρ∂p

∂x

)

=∂

∂t(φAρ) (1.5)

3

Page 4: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

A

∆x

zy

x

Figure 1.1: One-dimensional control volume

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

⇒ ∂

∂x

(

ρ∂p

∂x

)

k

∂φρ

∂t(1.6)

Now account for the dependence of ρ on pressure by introducing the isother-mal compressibility:

c =1

ρ

(

∂ρ

∂p

)

T

(1.7)

where T denotes that the derivative is taken at constant temperature.Equation (1.7) defines and EOS (equation of state):

∫ p

psc

cdP =∫ ρ

ρsc

ρ(1.8)

⇒ c(p − psc) = lnρ − lnρsc (1.9)

⇒ ρ = ρscec(p−psc) (1.10)

Now substitute ρ(p) (equation 1.10) into equation 1.6):

∂x

(

ρscec(p−psc)

∂p

∂x

)

k

(

ρscec(p−psc)

∂φ

∂t+ φ

∂t

(

ρscec(p−psc)

)

)

(1.11)

The right hand side terms in equation 1.11 require further attention. Firstconsider the final term, φ∂ρ

∂t:

∂ρ

∂t= ρsce

c(p−psc)c∂p

∂t(1.12)

4

Page 5: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Now consider ∂φ∂t

. First define the rock compressibility as:

cr =1

φ

(

∂φ

∂p

)

T

(1.13)

⇒ ∂φ

∂t= φcr

∂p

∂t(1.14)

Substitute equation 1.12 and 1.14 into 1.11:

∂x

(

ρ∂p

∂x

)

kρφ(cr + c)

∂p

∂t(1.15)

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

ρ∂2p

∂x2+

∂p

∂x

∂ρ

∂x=

φµct

kρ∂p

∂t(1.16)

Now consider the second term in equation 1.16:

∂p

∂x

∂ρ

∂x=

∂p

∂x

∂ρ

∂p

∂p

∂x=

∂ρ

∂p

(

∂p

∂x

)2

(1.17)

This term is expected to be small so it is usually neglected.Finally we have:

∂2p

∂x2=

φµct

k

∂p

∂t(1.18)

1.2 Three-dimensional Case

The diffusion equation can be expressed using the notation of vector calculusfor a general coordinate system as:

∇2p =φµct

k

∂p

∂t(1.19)

For the case of the radial coordinates the diffusion equation is:

1

r

∂r

(

r∂p

∂r

)

+1

r2

∂2p

∂θ2+

∂2p

∂z2=

φµct

k

∂p

∂t(1.20)

5

Page 6: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 writtenin dimensionless form by choosing the following dimensionless variables:

pD =pi − p

pi(1.21)

xD =x

L(1.22)

where L is a length scale in the problem.

tD =kt

φµctL2(1.23)

With this choice of dimensionless variables the flow equation becomes:

∂2pD

∂x2D

=∂pD

∂tD(1.24)

1.3.2 Radial Problem

The radial form of the pressure equation is usually written in nondimensionalform taking account of the boundary conditions. When only radial variationsof pressure are considered the pressure equation is:

1

r

∂r

(

r∂p

∂r

)

=φµct

k

∂p

∂t(1.25)

Boundary and initial conditions:

q = −2πkh

µr∂p

∂r, r = rw (1.26)

p = pi, r → ∞, ∀t (1.27)

p = pi, t = 0, ∀r (1.28)

Begin by setting:pD = α(pi − p) (1.29)

6

Page 7: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

where alpha must still be determined. The infinite acting boundary conditionbecomes:

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:

rD =r

rw

(1.32)

Set dimensionless time, tD as:

tD =t

t∗(1.33)

where t∗ must still be determined. Now substitute pD and rD into the pressureequation:

1

rDrw

∂rDrw

(

rDrw∂

∂rDrw

(

−pD

α+ pi

)

)

=φµct

k

∂(

−pD

α+ pi

)

∂tDt∗(1.34)

Simplifying (1.34) gives:

1

r2wα

1

rD

∂rD

(

rD∂pD

∂rD

)

=φµct

kt∗α

∂pD

∂tD(1.35)

⇒ t∗ =φµctr

2w

k(1.36)

1

rD

∂rD

(

rD∂pD

∂rD

)

=∂pD

∂tD(1.37)

Finally determine α from the inner boundary condition:

q =2πkh

µr∂p

∂r(1.38)

(No negative sign is required here because the flow is in the negative r direc-tion)

2πkh= rDrw

∂rDrw

(

−pD

α+ pi

)

(1.39)

7

Page 8: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

⇒ α =2πkh

qµ(1.40)

Nondimensionalise inner boundary condition:

∂pD

∂rD|rD=1 = −1 (1.41)

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 rateat various locations and times. This concept is known as superposition. It isonly applicable to linear problems.

Superposition in Time

Assume we have an analytical solution, pconst(q, r, t), to the problem of a wellproducing at a constant rate in a given reservoir. Using superposition in timethis solution can be extended to handle a well with a variable flow rate. Ifa well begins producing at rate q1 then at time t1 the rate changes to q2 theflow rate can be represented as shown in Figure 1.2.

The analytical solution for the pressure distribution caused by the wellproducing 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 dueto a well located at the origin, flowing at rate q. The solution for a a reservoircontaining two wells as shown in Figure 1.3 can be generated by summingthis solution as follows:

p(r, t) = pconst(q1, r1, t) + pconst(q2, r2, t) (1.43)

wherer1 =

(x − x1)2 + (y − y1)2 (1.44)

r2 =√

(x − x2)2 + (y − y2)2 (1.45)

8

Page 9: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

q2

q1q

t1 t

=

q

t

q1 q

t

+t1

-(q1-q2)

Figure 1.2: Flow rate variation

y

x

Figure 1.3: Well configuration

9

Page 10: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

closed boundary

producer

reservoir

image producer well

Figure 1.4: Closed boundary

constant pressure boundary

producer

reservoir

image 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 closedboundary conditions. To do so fictitious wells known as image wells are placedin the reservoir in such a way that their effect on the pressure distributioncreates the boundary condition. If multiple boundary conditions are involvedthis can lead to an array of images wells whose contribution to the reservoirpressure distribution is summed.

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

10

Page 11: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

1.4.1 Well Boundary Conditions when Superposition

is Applied

The superposition theorem guarantees the pressure distribution obtaining bysumming simple solutions will satisfy the pressure equation. The boundarycondition 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 wellat specified well pressure. This solution will satisfy the pressure equation.However this solution will not satisfy the required bottom hole pressures atthe wells. If both wells are producers then there will be additional drawdownsat each well due to production in the other well. However if the wells are farapart 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 canbe generated from solutions for a single well. Unlike the case of bottom holepressure controlled wells this solution will satisfy the flow rate boundarycondition at each well. This is possible because each superposed solutionconserves mass locally so it does not add any extra flow at the well locations.

11

Page 12: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 2

The Laplace Transform

The Laplace Transform is defined by:

Lf(t) =∫ ∞

0e−stf(t)dt = f(s) (2.1)

Example:f(t) = t (2.2)

Use integration by parts, recall:∫ b

audv

dtdt = uv|ba −

∫ b

avdu

dtdt (2.3)

Choose u = t and v = −1se−st

⇒ Lf(t) = − t

se−st|∞0 +

∫ ∞

0

1

se−stdt (2.4)

= 0 +[

− 1

s2e−st

]∞

0=

1

s2(2.5)

For the Laplace transform to exist the following requirements must hold:a) f(t) have a finite number of maxima, minima and discontinuitiesb) 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 exponentialorder. For t > 0 there is α1 > α such that:

e−α1t|f(t)| < M (2.7)

12

Page 13: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

f(t) = e2t (2.8)

e−αte2t = e−(α−2)t (2.9)

(2.9) remains bounded for α ≤ 2, therefore the abscissa of convergence forthis f(t) is 2.

2.1 Properties of Laplace Transforms

2.1.1 Theorem 1 - Linearity of the Laplace Transform

Operator

Lc1f1(t) + c2f2(t) = c1Lf1(t) + c2Lf2(t) (2.10)

⇒ the Laplace Transform is a linear operator.Proof:

Lc1f1 + c2f2 =∫ ∞

0e−stc1f1 + c2f2dt (2.11)

= c1

∫ ∞

0e−stf1dt + c2

∫ ∞

0e−stf2dt (2.12)

= c1Lf1(t) + c2Lf2(t) (2.13)

2.1.2 Theorem 2 - Laplace Transform of a Time Deriv-

ative

Lf ′(t) = sLf(t) − f(0) (2.14)

Proof:Lf ′(t) =

∫ ∞

0e−stf ′(t)dt (2.15)

Integrate by parts

= e−stf(t)|∞0 −∫ ∞

0f(t)(−se−st)dt (2.16)

= −f(0) + s∫ ∞

0e−stf(t)dt (2.17)

= sLf(t) − f(0) (2.18)

13

Page 14: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

2.1.3 Theorem 3 - Laplace Transform of a Derivative

L

∂nf

∂tn

= snLf(t) −n−1∑

i=0

sifn−i−1(0) (2.19)

This can be proved by repeated application of Theorem 2.

2.1.4 Theorem 4 - Early Time Behaviour

lims→∞

sLf(t) = limt→0+

f(t) = f(0+) (2.20)

Proof:Begin from Theorem 2

Lf ′(t) = sLf(t) − f(0+) (2.21)

Now take limits:

lims→∞

Lf ′(t) = lims→∞

sLf(t) − f(0+) (2.22)

If f ′(t) is of exponential order:

lims→∞

e−stf ′(t)dt → 0 (2.23)

⇒|f ′(t)| < Meαt, ∀t > 0 (2.24)

I(b) =∫ b

0|f ′(t)|e−stdt <

∫ b

0Meαte−stdt =

Me−(s−α)t

−(s − α)

b

0

(2.25)

s > α as b → ∞⇒

limb→∞

I(b) =M

s − α(2.26)

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

0 = lims→∞

sLf(t) − f(0+) (2.27)

proving theorem 4.

14

Page 15: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

2.1.5 Theorem 5 - Late Time Behaviour

lims→0

sLf(t) = limt→∞

f(t) (2.28)

Proof:Begin from Theorem 2

Lf ′(t) = sLf(t) − f(0+) (2.29)

Now take limits:

lims→0

Lf ′(t) = lims→0

sLf(t) − f(0+) (2.30)

Expand the left hand side term:

lims→0

∫ ∞

0e−stf ′(t)dt =

∫ ∞

0f ′(t)lims→0e

−stdt =∫ ∞

0f ′(t)dt (2.31)

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

Substituting (2.32) into (2.29) gives:

lims→0

sLf(t) = limt→∞

f(t) (2.33)

2.1.6 Theorem 6 - Multiplication of a Transform by s

If Lf(t) = sφ(s) then f(t) = ∂∂tL−1φ(s)

Proof:F (t) = L−1φ(s) (2.34)

Use Theorem 2:LF ′(t) = sLF (t) − F (0) (2.35)

and use Theorem 4:

F (0) = lims→∞

sLF (t) = lims→∞

sφ(s) (2.36)

= lims→∞

Lf(t) = 0 (2.37)

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

LF ′(t) = sLF (t) = sφ(s) = Lf(t) (2.38)

15

Page 16: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Taking inverse Laplace Transforms of this gives:

L−1LF ′(t) = L−1sφ(s) = L−1Lf(t) (2.39)

⇒F ′(t) = L−1sφ(s) = f(t) (2.40)

⇒∂

∂tLφ(s) = f(t) (2.41)

Example: Suppose we want to find the inverse transform of:

Lf(t) =s

s2 + a2(2.42)

We know can use the following transform relationship to help us:

Lsin at

a =

1

s2 + a2(2.43)

Using theorem 6 we know:

f(t) =∂

∂t

sin at

a= cos at (2.44)

2.1.7 Theorem 7 - Division of a Transform by s

L∫ t

0f(t)dt

=1

sLf(t) (2.45)

Proof:

L∫ t

0f(t)dt

=∫ ∞

0e−st

(∫ t

0f(t′)dt′

)

dt (2.46)

Use integration by parts:

= −[

1

s

∫ t

0f(t′)dt′

]∞

0+

1

s

∫ ∞

0e−stf(t)dt =

1

sLf(t) (2.47)

Example: Suppose we require the inverse transform of:

Lf(t) =1

s3 + 4s=

1

s

1

s2 + 4(2.48)

We know:

L

1

s2 + 4

=1

2sin 2t (2.49)

⇒ f(t) =∫ t

0

1

2sin 2tdt =

1

4(1 − cos 2t) (2.50)

16

Page 17: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

2.1.8 Theorem 8 - First Shift Theorem

Le−atf(t) = f(s + a) (2.51)

Proof:

Le−atf(t) =∫ ∞

0e−ate−stf(t)dt =

∫ ∞

0e−(s+a)f(t)dt = f(s + a) (2.52)

2.1.9 Theorem 9 - Second Shift Theorem

Lf(t − a)u(t − a) = e−asLf(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:Lf(t − a)u(t − a) =

∫ ∞

0f(t − a)u(t − a)e−stdt (2.57)

=∫ ∞

af(t − a)e−stdt (2.58)

=∫ ∞

0f(τ)e−s(τ+a)dτ (2.59)

where τ = t − a Apply Theorem 8:

= e−sa∫ ∞

0f(τ)e−sτdτ (2.60)

= e−saLf(t)dt (2.61)

2.1.10 Theorem 10 - Multiplication by t

Ltf(t) = −f ′(s) (2.62)

Proof:

f ′(s) =d

ds

∫ ∞

0e−stf(t)dt (2.63)

=∫ ∞

0−te−stf(t)dt (2.64)

= −Ltf(t) (2.65)

17

Page 18: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

2.1.11 Theorem 11 - Division by t

L

f(t)

t

=∫ ∞

sf(s)ds (2.66)

Proof:∫ ∞

sf(s)ds =

∫ ∞

s

∫ ∞

0e−stf(t)dtds (2.67)

=∫ ∞

0

∫ ∞

se−stf(t)dsdt (2.68)

=∫ ∞

0f(t)

[

e−st

−t

]∞

s

dt (2.69)

=∫ ∞

0

f(t)

te−stdt (2.70)

= L

f(t)

t

(2.71)

2.1.12 Theorem 12 - Convolution

Lf(t)Lg(t) = L∫ t

0f(t − λ)g(λ)dλ (2.72)

= L∫ t

0f(λ)g(t− λ)dλ (2.73)

= Lf(t) ∗ g(t) (2.74)

Proof:First use the definition of the Laplace transform:

L∫ t

0f(t − λ)g(λ)dλ =

∫ ∞

0

∫ t

0f(t − λ)g(λ)e−stdλdt (2.75)

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

=∫ ∞

0

∫ ∞

0u(t − λ)f(t − λ)g(λ)e−stdλdt (2.76)

(See Figure 2.1 for the step function.)Change the order of integration:

=∫ ∞

0g(λ)

∫ ∞

0u(t − λ)f(t − λ)e−stdtdλ (2.77)

18

Page 19: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

1

u

t λ

Figure 2.1: Step function as a function of λ

1

λ

u

τ

Figure 2.2: Step function as a function of t

(See Figure 2.2 for the step function.)Take account of step function:

=∫ ∞

0g(λ)

∫ ∞

λf(t − λ)e−stdtdλ (2.78)

Apply first shift theorem:

=∫ ∞

0g(λ)

[∫ ∞

0f(τ)e−s(τ+λ)dτ

]

dλ (2.79)

=∫ ∞

0g(λ)e−sλdλ

∫ ∞

0f(τ)e−sτdτ (2.80)

= Lg(t)Lf(t) (2.81)

where τ = t − λ

19

Page 20: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 alegbraicequation 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′′ + 2y′ + y = te−t (2.82)

wherey(t = 0) = 1 (2.83)

y′(t = 0) = −2 (2.84)

Ly′′ = s2y − sy(0) − y′(0) (2.85)

Ly′ = sy − y(0) (2.86)

Lte−t =1

(s + 1)2(2.87)

⇒ s2y − s + 2 + 2sy − 2 + y =1

(s + 1)2(2.88)

Solve for y:

(s2 + 2s + 1)y − s =1

(s + 1)2(2.89)

(s + 1)y =1

(s + 1)2+ s (2.90)

⇒ y =1

(s + 1)4+

s

(s + 1)2(2.91)

20

Page 21: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

Lt(n) =n!

sn+1(2.92)

Combining this transform with the first shift theorem gives:

L−1

1

(s + 1)4

=e−tt3

3!(2.93)

Now consider the second term:

s

(s + 1)2=

s + 1 − 1

(s + 1)2=

1

s + 1− 1

(s + 1)2(2.94)

We can use the known transforms:

L1 =1

s(2.95)

and

Lt =1

s2(2.96)

Combining this with the first shift theorem again gives:

L−1

s

(s + 1)2

= e−t − e−tt (2.97)

The final solution for y is:

y = e−t

(

t3

3!− t + 1

)

(2.98)

2.3 Computing Laplace Transforms in Math-

ematica

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

21

Page 22: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 noneed to load the Calculus‘LaplaceTransform‘ package.Note: For problem sets please work out any transforms required by handand show working, unless otherwise specified. Feel free to check your workagainst Mathematica output however.

22

Page 23: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 3

Petroleum Engineering

Applications of Laplace

Transforms

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

3.1 Line Source Solution

This section considers infinite acting radial flow in a reservoir where thewell is modelled as a line source. The differential equation and boundaryconditions involved are:

1

r

∂r

(

r∂p

∂r

)

=φµct

k

∂p

∂t(3.1)

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

q =2πkh

µr∂p

∂r(3.2)

The outer boundary condition is:

p = pi, r → ∞ (3.3)

23

Page 24: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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:

pD =2πkh

qµ(pi − p) (3.5)

rD =r

rw(3.6)

tD =kt

φµctr2w

(3.7)

1

rD

∂rD

(

rD∂pD

∂rD

)

=∂pD

∂tD(3.8)

pD(rD, tD = 0) = 0 (3.9)

pD(rD → ∞, tD) = 0 (3.10)

rD∂pD

∂tD|rD→0 = −1 (3.11)

The solution procedure begins by Laplace transforming both sides of thepressure equation:

L

1

rD

∂rD

(

rD∂pD

∂rD

)

= L

∂pD

∂tD

(3.12)

1

rD

∂rD

(

rD∂pD

∂rD

)

= spD − pD(rD, tD = 0) (3.13)

⇒ ∂2pD

∂r2D

+1

rD

∂pD

∂rD− spD = 0 (3.14)

A solution to this differential equation can be found by noting that it is anexample of a modified Bessel equation.

24

Page 25: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

3.1.1 Bessel and Modified Bessel Equations

The Bessel equation is:

x2y′′ + xy′ + (x2 − n2)y = 0 (3.15)

y = c1Jn(x) + c2Yn(x) (3.16)

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

x2y′′ + xy′ − (x2 + n2)y = 0 (3.17)

y = c1In(x) + c2Kn(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:

r2D

∂2pD

∂r2D

+ rD∂pD

∂rD

− r2DspD = 0 (3.19)

Substitute ξ = rD

√s:

ξ2∂2pD

∂ξ2+ ξ

∂pD

∂ξ− ξ2pD = 0 (3.20)

Solve for pD:pD = c1I0(rD

√s) + c2K0(rD

√s) (3.21)

Now consider the boundary conditions. First consider the infinite actingcondition. As rD → ∞, pD must remain bounded, however:

limx→∞

I0(x) = ∞ (3.22)

To prevent pD from going to infinity we set c1 = 0.

⇒ pD = c2K0(rD

√s) (3.23)

25

Page 26: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

The inner boundary condition is:

limrD→0

rD∂pD

∂rD= −1 (3.24)

⇒ limrD→0

L

rD∂pD

∂rD

= limrD→0

rD∂pD

∂rD

= L−1 = −1

s(3.25)

To differentiate the Bessel function we need the following recurrence rela-tionship:

d

dx

(

x−nKn(x))

= −x−nKn+1(x) (3.26)

Substituting (3.26) into (3.25) gives:

limrD→0

rD∂

∂rD

(

c2K0(rD

√s))

= −1

s(3.27)

⇒ limrD→0

[

−c2rD

√sK1(rD

√s)]

= −1

s(3.28)

To evaluate the limit we can use the following limiting form of Kv for smallarguments:

Kv(z) ≈ 1

2Γ(v)(

1

2z)−v (3.29)

⇒ limrD→0

K1(rD

√s) =

1

rD

√s

(3.30)

⇒ −c2 limrD→0

(

rD

√s

1

rD

√s

)

= −1

s(3.31)

⇒ c2 =1

s(3.32)

Finally we have the complete solution for pD:

pD(rD, s) =1

sK0(rD

√s) (3.33)

Now invert pD to find pD. This can be achieved by recalling theorem 7:

L∫ t

0f(t)dt

=1

sLf(t) (3.34)

26

Page 27: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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:

L−1K0(rD

√s) =

1

2tDexp

(

−r2D

4tD

)

(3.35)

⇒ pD =∫ tD

0

1

2tDexp

(

−r2D

4tD

)

dtD (3.36)

This integral can be evaluated by using substitution:

u =r2D

4tD(3.37)

⇒ tD =r2D

4u(3.38)

dtD =−r2

D

4u2du (3.39)

Equation (3.36) becomes:

pD =∫

r2D

4tD

4u

2r2D

exp(−u)−r2

D

4u2du =

1

2

∫ ∞r2D

4tD

exp(−u)

udu (3.40)

Now introduce the exponential integral, Ei(x):

Ei(x) = −∫ ∞

−x

e−u

udu (3.41)

(This definition follows Abramowitz and Stegun, “Handbook of Mathemati-cal Functions”, Dover, 1970. Note that in some references Ei(x) is denotedby E1(x) - be careful!)

⇒ pD = −1

2Ei

(

− r2D

4tD

)

(3.42)

Finally the answer is written in dimensional terms:

p = pi +qµ

4πkhEi

(

−r2φµct

4kt

)

(3.43)

27

Page 28: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 andtaking the limit of pD as s → 0.

pD(s) =1

sK0(rD

√s) (3.44)

The limit can be handled by using a series expansion for K0:

K0(x) = −(lnx

2+ γ)I0(x) +

14z2

(1!)2+ (1 +

1

2)(1

4z2)2

(2!)2+ ... (3.45)

⇒ limx→0

K0(x) = − ln(

x

2

)

− γ (3.46)

where γ = Euler’s constant, 0.5772.

lims→0

pD = −1

s

(

ln rD + ln√

s − ln 2 + γ)

(3.47)

⇒ limt→∞

pD = L−1(

−1

s(ln rD + ln

√s − ln 2 + γ)

)

(3.48)

Using transform pair 95 from the handout to invert the ln√

s term gives:

= − ln rD + ln 2 − γ +1

2(γ + ln tD) (3.49)

=1

2

(

lntDr2D

+ 0.80907

)

(3.50)

3.2 Finite Well Radius Solution

The line source solution applies the constant flow rate condition as r tendsto zero. This simplifies the solution process. However an analytical solutioncan also be obtained when the flow rate condition is applied at r = rw. Thegoverning equation and boundary conditions remain the same as the linesource solution, except for the inner boundary condition which is now:

rD∂pD

∂rD

|rD=1 = −1 (3.51)

28

Page 29: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

⇒ ∂2pD

∂r2D

+1

rD

∂pD

∂rD− spD = 0 (3.52)

As before the general solution to the problem is:

pD = c1I0(rD

√s) + c2K0(rD

√s) (3.53)

The solution must remain bounded as r tends to infinity so as before we setc1 = 0:

pD = c2K0(rD

√s) (3.54)

Now consider the inner boundary condition. It requires that:

∂rD

(c2K0(rD

√s) = −1

s(3.55)

⇒ −c2

√sK1(rD

√s) = −1

srD = 1 (3.56)

⇒ c2 =1

s32 K1(

√s)

(3.57)

The final solution for pD is:

pD =K0(rD

√s)

s32 K1(

√s)

(3.58)

3.2.1 Early Time Behaviour of pD

The early time behaviour of pD can be examined by considering the limit ofpD as s → ∞. To do so the behaviour of the Bessel functions is required forlarge arguments.

Kv(x) ≈√

π

2xe−x(1 +

µ − 1

8x+

(µ − 1)(µ − 9)

2!(8x)2+ .... (3.59)

where x is large and µ = 4v2.

⇒ K0(rD

√s) =

π

2rD

√se−rD

√s (3.60)

29

Page 30: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

and

⇒ K1(√

s) =

π

2√

se−

√s (3.61)

So at late time pD is:

pD =1

s32

π

2rD

√se−rD

√s

2√

s

πe√

s (3.62)

=1

s32

1√rD

e−√

s(rD−1) (3.63)

The solution for pD can be found using transform pair number 85 from thehandout:

pD(rD, tD) =1√rD

2

tDπ

e− (rD−1)2

4tD − (rD − 1)erfc

(

rD − 1

2√

tD

)

(3.64)

pD(rD = 1, tD) = 2

tDπ

(3.65)

3.2.2 Late Time Behaviour of pD

To find the late time behaviour of pD consider the limit of pD at s → 0. Firstconsider the behaviour of the Bessel functions. As before:

limx→0

K0(x) = −[ln(1

2x) + γ] (3.66)

For small arguments Kv(x) can be approximated by:

Kv(x) =1

2Γ(x)(

1

2x)−v (3.67)

where Γ(x + 1) = x!

⇒ limx→0

K1(x) =1

2(1

2x)−1 =

1

x(3.68)

Recall the solution for pD:

pD =K0(rD

√s)

s32 K1(

√s)

(3.69)

30

Page 31: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

The late time behaviour of pD can be found by performing the followinginverse transform:

pD = L−1

1

s32

−[ln(12rD

√s) + γ]

1√s

= L−1−1

s(ln rD+ln

√s−ln 2+γ) (3.70)

=1

2

(

lntDr2D

+ 0.80907

)

(3.71)

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 boundaryconditions. It becomes more convenient to define the dimensionless pressure,pD, in terms of both the initial reservoir pressure, pi, and the well pressure,pw:

pD =pi − p

pi − pw

(3.72)

The dimensionless form of the pressure equation is as before:

1

rD

∂rD

(

rD∂pD

∂rD

)

=∂pD

∂tD(3.73)

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:

pD = c1I0(rD

√s) + c2K0(rD

√s) (3.77)

Again c1 is set to zero to ensure the pressure remains finite as r → ∞. Theinner boundary condition is used to solve for c2:

pD(rD = 1) = c2K0(√

s) =1

s(3.78)

31

Page 32: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

⇒ c2 =1

sK0(√

s)(3.79)

⇒ pD(rD) =K0(rD

√s)

sK0(√

s)(3.80)

The inverse transform to solve this problem was provided by Van Everdin-gen and Hurst, “The Application of the Laplace Transformation to FlowProblems in Reservoirs”, Petroleum Transactions AIME, 305-324, 1949 (seeequation VI-26):

pD(rD, tD) =2

π

∫ ∞

0

(1 − e−u2tD)[J0(u)Y0(urD) − Y0(u)J0(urD)]

u2[J20 (u) + Y 2

0 (u)]du (3.81)

3.3.1 Early Time Behaviour of the Flow Rates

Just as the early time behaviour of the pressure could be considered in theconstant flow rate case, the behaviour of the flow rate can be examined forthe constant pressure case:

qD = −rD∂pD

∂rD(3.82)

qD = −rD∂pD

∂rD= −rD

∂rD

(

K0(rD

√s)

sK0(√

s)

)

(3.83)

Using the previously established expression for the derivative of K0 gives:

qD =rD√

s

K1(rD

√s)

K0(√

s)(3.84)

The cumulative recovery is defined by:

QD =∫ td

0qDdtD (3.85)

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

QD =1

sqD =

rD

s32

K1(rD

√s)

K0(√

s)(3.86)

To consider the early time behaviour of the flow rates consider the limit ofqD as s → ∞. The early time behaviour of the Bessel functions have alreadybeen established:

K1(rD

√s) ≈

π

2√

srDe−rD

√s (3.87)

32

Page 33: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

K0(√

s) ≈√

π

2√

se−

√s (3.88)

⇒ qD =rD√

s

π

2√

srDe−rD

√s

2√

s

πe√

s =

√rD√s

e−√

s(rD−1) (3.89)

qD can now be found by using transform pair 84 from the tables:

qD =

√rD√πtD

e− (rD−1)2

4tD (3.90)

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

QD = rD

2

tDπ

e− (rD−1)2

4tD − (rD − 1)erfc

(

rD − 1

2√

tD

)

(3.91)

Note the similarity between this and Equation (3.64) (early time behaviourof 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 flowrate 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 pressureat the outer boundary (at radius re). The boundary and initial conditions indimensionless form are:

rD∂pD

∂rD= −1 rD = 1 (3.92)

pD = 0 rD =re

rw= rDe (3.93)

pD = 0 tD = 0, ∀rD (3.94)

As before the general solution to this problem is:

pD = c1I0(rD

√s) + c2K0(rD

√s) (3.95)

33

Page 34: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

However in this example the reservoir is bounded so c1 can not be set to zeroby arguing that pD must remain bounded as rD tends to infinity. Instead theouter boundary condition requires:

c1I0(rDe

√s) + c2K0(rDe

√s) = 0 (3.96)

The inner boundary conditions requires:

∂rD[c1I0(rD

√s) + c2K0(rD

√s)] = −1

srD = 1 (3.97)

The derivatives of the Bessel functions can be found from:

d

dx[x−nKn(x)] = −x−nKn+1(x) (3.98)

d

dx[x−nIn(x)] = x−nIn+1(x) (3.99)

Using these derivatives (3.97) becomes:

c1

√sI1(

√s) − c2

√sK1(

√s) = −1

s(3.100)

⇒ c1I1(√

s) − c2K1(√

s) = − 1

s32

(3.101)

The outer boundary condition requires:

c1I0(rDe

√s) + c2K0(rDe

√s) = 0 (3.102)

Equations (3.101) and (3.102) can be solved for c1 and c2 to give:

c1 = − 1

s32

K0(rDe

√s)

K0(rDe

√s)I1(

√s) + K1(

√s)I0(rDe

√s)

(3.103)

c2 =1

s32

I0(rDe

√s)

K0(rDe

√s)I1(

√s) + K1(

√s)I0(rDe

√s)

(3.104)

⇒ pD =1

s32

I0(rDe

√s)K0(rD

√s) − K0(rDe

√s)I0(rD

√s)

K0(rDe

√s)I1(

√s) + K1(

√s)I0(rDe

√s)

(3.105)

The late time (steady state) behaviour of pD can be determined by takingthe limit of pD as s tends to infinity:

pD = lnrD

rDe(3.106)

34

Page 35: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 ofLaplace transforms in petroleum reservoir engineering. One of the interestingresults they proved was the following relationship between the pressure at awell (operating at constant flow rate) and the cumulative production (froma well operating at constant pressure):

spDQD =1

s2rD = 1 (3.107)

Van Everdingen and Hurst also demonstrated how to add wellbore storageto a problem:

pD =spDxx

s(1 + scDspDxx)(3.108)

3.6 Incorporating Storage and Skin

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

3.6.1 Fluid Expansion

qtotal = qreservoir + qexpansion (3.109)

The amount of flow from fluid expansion is defined by:

qexpansion =∂Vw

∂t=

∂Vw

∂p

∂p

∂t= cwVw

∂p

∂t(3.110)

The relevant storage coefficient, C is defined by:

C = cwVw (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

Page 36: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

relevant storage coefficient, C is defined by:

C =Aw

ρg(3.112)

3.6.3 Laplace Space Solution

If the Laplace space solution for a problem which has no storage and no skinis given by pDxx then solution for a problem with a skin, S, and storage, cD

is:

pD =spDxx + S

s[1 + scD(spDxx + S)](3.113)

The dimensionless storage cD is defined by:

CD =5.615C

2πφcthr2w

(3.114)

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:

ω =φfctf

φfctf + φmctm

0 < ω < 1 (3.115)

λ = αkm

kfr2w 10−10 < λ < 10−3 (3.116)

where α depends on the fracture configuration e.g. sugar cube modelThe governing equation in Laplace space for a dual porosity reservoir is:

1

rD

∂rD

(

rD∂pD

∂tD

)

− sf(s)p = 0 (3.117)

where

f(s) =sω(1 − ω) + λ

s(1 − ω) + λ(3.118)

For the case of an infinite acting reservoir with a finite radius the solutionfor pD is:

pD =K0(

sf(s))

s√

sf(s)K1(√

sf(s))(3.119)

36

Page 37: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

3.8 Bourgeois and Horne

Marcel Bourgeois completed an MS degree in the Department of PetroleumEngineering in 1992 (”Well Test Interpretation Using Laplace Space TypeCurves”). This was a key contribution to the use of Laplace transforms in welltesting. The solutions to many well testing problems (beyond the examplespresented here) are known in Laplace space. As part of his study Bourgeoisdefined a quantity known as the Laplace pressure, sp. When plotted against1/s this has similar behaviour as the real pressure

Bourgeois showed that instead of performing parameter estimation usingnonlinear regression in real space the matching could be achieved efficientlyand effectively in Laplace space. The efficiency lies in the removal of theneed for a numerical inverse transform to evaluate the performance of setof paramter estimates. In Bourgeois’ examples fewer iterations were neededwhen matching in Laplace space than in real space.

3.9 Heat Transfer

Laplace transforms are also useful in other petroleum engineering engineeringproblems. During my undergraduate research project I studied heat transferfrom a buried pipeline which connects an offshore platform to onshore pro-duction facilities. Heat transfer was a particular concern because the fluidscould form solid hydrates if the temperature fell below a critical level.

The pipe is buried below the sea floor. This makes the computationaldomain semi-infinite. However in the part of the study that used Laplacetransforms an “effective cylinder” configuration was used as shown in Figure3.1.

Two energy balance equations are required in this problem. The firstgoverns the temperature distribution in the pipe surrounds:

ke∇2Te = ρece∂Te

∂t(3.120)

The second energy balance governs the fluid in the pipe which is flowing

37

Page 38: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Surroundings, T

ro

ri

Burial medium, T

Pipe, Tp

e

o

Figure 3.1: Configuration of pipe and surrounds

at velocity, U :

ρpcp∂Tp

∂t+ ρpcpU

∂Tp

∂x= − 2

ri

q (3.121)

where q is the flux of heat through the pipe wall:

q = −ke∂Te

∂r|r=ri

(3.122)

The solution procedure involved solving for the Laplace transform of Te interms of Tp. This expression was then substituted into the equation governing

the Laplace transform of Tp. Finally the Tp was solved for.An example of this solution given below for the case of the pipeline heating

up at start-up:

Tp(x, s) =Ti − To

sexp(−(

s

U+

2ke

√sκγ

riρpcpUθ)x) +

To

s(3.123)

where

θ = K0(√

sκri)I0(√

sκro) − Ko(√

sκro)I0(√

sκri) (3.124)

κ =ρece

ke

(3.125)

γ = 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 Tp. The results from this approach

38

Page 39: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 quicklymany more cases could be considered to assess the sensitivities to variousparameters in the model.

3.10 Numerical Inversion of Laplace Trans-

forms

The inverse Laplace transform can also be written as an integral:

f(t) = L−1F (s) =1

2πi

∫ γ+∞

γ−i∞estF (s)ds (3.127)

where γ is chosen in such away that any singularities in F (s) are avoided. Thecontour the integral is performed over is known as the Bromwich contour.When an inverse transform is required that can’t be found from tables thisintegral is usually evaluated numerically.

The most commonly used algorithm for numerical inversion of Laplacetransforms is the Stehfest algorithm (Communications of the Association forComputing Machinery, algorithm 368). To invert f(s) the following summa-tion is performed:

f(t) =ln 2

t

N∑

i=1

Vif

(

ln 2

ti

)

(3.128)

where

Vi = (−1)N

2+i

min(i,N/2)∑

k=( i+12 )

kN2 (2k)!

(N/2 − k)!k!(k − 1)!(i − k)!(2k − i)!(3.129)

Theoretically the accuracy of f(t) increases as N increases. However inpractice the Vi grow quickly in magnitude with N and round-offs errors areamplified. Usually N = 8 is used in numerical inversions. This means thatfor every value of f(t) required 8 values of f(s) are required.

The Stehfest algorithm works well for smooth functions but has difficul-ties for oscillatory functions and functions with discontinuities. Oscillatoryfunctions can be inverted if their wavelength is large with respect to halfthe width of the peaks. Stehfest tested his algorithm on 50 functions andreported errors of only 0.1%.

39

Page 40: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

3.11 Summary

This chapter has outlined several petroleum engineering applications of Laplacetransforms 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, skinand dual porosity behaviour can be added readily to the solutions in Laplacespace. The Laplace space solution can also be efficiently incorporated intononlinear regression routines.

A heat transfer case study was discussed to demonstrate how the use ofLaplace space solutions can complement numerical methods. The solutionthat study developed approximated the physics and the geometry of theproblem but ran very quickly and could be used for sensitivity analyses. Itultimately reproduced the field results more accurately than the numericalmodel results.

40

Page 41: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 theFourier transform takes a function from real-space to frequency-space (seelater examples). The Fourier transform is defined by:

F (s) =∫ ∞

−∞f(x)e−i2πxsdx (4.1)

The inverse transform is defined in a similar manner:

f(x) =∫ ∞

−∞F (s)ei2πxsds (4.2)

We will also use the notation f(s) for F (s). The Fourier transform exists iff(x) and f ′(x) are at least piecewise continuous and the following integralexists: ∫ ∞

−∞|f(x)|dx (4.3)

There are also some alternative definitions:

F (s) =∫ ∞

−∞f(x)e−ixsdx (4.4)

f(x) =1

∫ ∞

−∞F (s)eixsds (4.5)

and

F (s) =1√2π

∫ ∞

−∞f(x)e−ixsdx (4.6)

41

Page 42: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

f(x) =1√2π

∫ ∞

−∞F (s)eixsds (4.7)

Example:f(x) = e−πx2

(4.8)

F (s) =∫ ∞

−∞e−πx2

e−i2πsxdx (4.9)

=∫ ∞

−∞e−π(x2+i2xs)dx (4.10)

=∫ ∞

−∞e−π(x2+i2xs−s2+s2)dx (4.11)

=∫ ∞

−∞e−π(x+is)2−πs2

dx (4.12)

= e−πs2∫ ∞

−∞e−π(x+is)2dx (4.13)

= e−πs2∫ ∞

−∞e−πξ2

dx (4.14)

where ξ = x + is The integral in (4.14) is known to be 1.0 so we have:

F (s) = e−πs2

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

f(x) =∫ ∞

−∞F (s)ei2πxsds (4.17)

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

). The ammplitude associated with any given frequency is given by F (s).Example:Consider f = cos(πx). The Fourier transform of f is:

F (s) =1

2δ(−π + 2πs) +

1

2δ(π + 2πs) (4.18)

i.e.

f(x) =1

2(cos(πx) + i sin(πx) + cos(−πx) + i sin(−πx)) (4.19)

=1

2(cos(πx) + cos(πx)) = cos(πx) (4.20)

42

Page 43: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

-1.0

-0.8

-0.6

-0.4

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

cos(

x)

-3 -2 -1 0 1 2 3x

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

-1.0

-0.8

-0.6

-0.4

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

Am

plitu

de

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

Frequency spectrum

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

43

Page 44: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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

IfF (f(x)) = F (s) (4.22)

thenF (f(x − a)) = e−i2πsaF (s) (4.23)

Proof:F (f(x − a)) =

∫ ∞

−∞f(x − a)e−i2πsxdx (4.24)

=∫ ∞

−∞f(x − a)e−i2πs(x−a)−i2πsad(x − a) (4.25)

= e−i2πsa∫ ∞

−∞f(x − a)e−i2πs(x−a)d(x − a) (4.26)

= e−i2πsaF (s) (4.27)

4.1.3 Theorem 3 - Similarity Theorem

IfF (f(x)) = F (s) (4.28)

F (f(ax)) =1

|a|F(

s

a

)

(4.29)

4.1.4 Theorem 4 - Convolution Theorem

IfF (f(x)) = F (s) (4.30)

andF (g(x)) = G(s) (4.31)

thenF (f(x) ∗ g(x)) = F (s)G(s) (4.32)

44

Page 45: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

4.1.5 Theorem 5 - Parseval’s theorem∫ ∞

−∞|f(x)|2dx =

∫ ∞

−∞|F (s)|2ds (4.33)

4.1.6 Theorem 6 - Derivatives

F (fn(x)) = (i2πs)nF (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:

F (f(x)) =∫ ∞

−∞f(x)e−i2πsxdx (4.35)

=∫ ∞

−∞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:

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

Page 46: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

Also note the following integral:

∫ ∞

−∞fo(x)dx = 0 (4.43)

Now substitute these relationships into (4.39):

F (f(x)) =∫ ∞

−∞fe(x) cos(2πsx)dx − i

∫ ∞

−∞fo(x) sin(2πsx)dx (4.44)

= 2∫ ∞

0fe(x) cos(2πsx)dx − 2i

∫ ∞

0fo(x) sin(2πsx)dx (4.45)

The fact that the Fourier transform splits into two terms (sine and cosine)motivates the definition of the sine and cosine transforms:

Fc(f(x)) =

2

π

∫ ∞

0f(x)cos(xs)dx = Fc(s) (4.46)

F−1c (Fc(s)) =

2

π

∫ ∞

0Fc(s)cos(xs)ds = f(x) (4.47)

Fc(f′′) = −s

2

πf ′(0) − s2Fc(s) (4.48)

Fs(f(x)) =

2

π

∫ ∞

0f(x)sin(xs)dx = Fs(s) (4.49)

F−1s (Fs(s)) =

2

π

∫ ∞

0Fs(s)sin(xs)ds = f(x) (4.50)

Fs(f′′) = s

2

πf(0) − s2Fs(s) (4.51)

Use of sine and cosine transforms simplifies the transform procedure whentransforming even and odd functions. The sine and cosines transforms canbe 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 ′ specified at the boundary

46

Page 47: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

4.3 Example 1: 1D Pressure Diffusion

Consider a one dimensional problem governed by:

∂2pD

∂x2D

=∂pD

∂tD(4.52)

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 usethe 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 theboundary conditions.First transform the differential equation (in space):

s

2

πpD(xD = 0, tD) − s2pD =

∂pD

∂tD(4.56)

⇒ ∂pD

∂tD+ s2pD =

2

π(4.57)

This equation can be solved using the integrating factor method:

dy

dx+ P (x)y = Q(x) (4.58)

ye∫

Pdx =∫

Qe∫

Pdxdx + C (4.59)

⇒ pDes2tD =∫ tD

0

2

πses2τdτ + C (4.60)

pD =∫ tD

0

2

πse−s2(tD−τ)dτ (4.61)

=

2

π

1

s(1 − e−s2tD) (4.62)

47

Page 48: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Now invert to find pD:

F−1s (pD) =

2

π

∫ ∞

0pD sin(sxD)ds (4.63)

=2

π

∫ ∞

0

2

π

1

s(1 − e−s2tD) sin(sxD)ds (4.64)

= 1 − Erf

(

xD√4tD

)

= Erfc

(

xD√4tD

)

(4.65)

where Erf(z) and Erfc(z) are the error function and the complimentaryerror function defined by:

Erf(z) =2√π

=∫ z

0e−t2dt (4.66)

Erfc(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 aninfinitely long bar so the full Fourier transform is required. The governingequation is:

κ2 ∂2T

∂x2=

∂T

∂t(4.68)

The boundary conditions are:

T (x ±∞, t) = T ′(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:

F (f ′(x)) =1√2π

∫ ∞

−∞e−isxf ′(x)dx (4.71)

=1√2π

f(x)e−isx|∞−∞ − 1√2π

∫ ∞

−∞(−is)f(x)e−isxdx (4.72)

48

Page 49: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Since f(x) vanishes at ±∞

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

Similar arguments require f ′(x) vanishes at ±∞. The transformed differen-tial equation is:

∂T

∂t+ κ2s2T = 0 (4.74)

⇒ T = c1e−(κs)2t (4.75)

Now consider the initial condition:

T (t = 0) = T0 = c1 (4.76)

⇒ T = T0e−(κs)2t (4.77)

Now invert to find T :

T =1√2π

∫ ∞

−∞eisxT0e

−(κs)2tds (4.78)

The transform of T0 is:

T0 =1√2π

∫ ∞

−∞T0(λ)e−isλdλ (4.79)

⇒ T =1

∫ ∞

−∞eisx

∫ ∞

−∞e−isλT0(λ)e−(κs)2tdλds (4.80)

=1

∫ ∞

−∞T0(λ)

∫ ∞

−∞e−is(λ−x)−(κs)2tdsdλ (4.81)

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

T =1√

4κ2πt

∫ ∞

−∞T0(λ)e−

(λ−x)2

4κ2t dλ (4.82)

4.5 Example 3: Elliptic Problem

Consider a steady-state problem in a two-dimensional semi-infinite domaingoverned by:

∇2p = 0 (4.83)

49

Page 50: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 boundarywe will use the sine transform to transform the differential equation:

Fs

(

∂2p

∂x2+

∂2p

∂y2

)

= 0 (4.88)

⇒ s

2

πp(0, y) − s2p +

∂2p

∂y2= 0 (4.89)

⇒ ∂2p

∂y2− s2p = 0 (4.90)

This equation can be solved for T to give:

T = c1cos(isy) + c2sin(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:

p = F1sinh(s(a − y))

sinh(sa)(4.94)

wheresinh(z) = −isin(iz) (4.95)

Now invert to find p:

p =

2

π

∫ ∞

0F1

sinh(s(a − y))

sinh(sa)sin(xs)ds (4.96)

50

Page 51: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

where

F1 =

2

π

∫ ∞

0f(λ)sin(sλ)dλ (4.97)

Substituting F1 into the expression for p gives:

2

π

∫ ∞

0

∫ ∞

0f(λ)

sinh(s(a − y))

sinh(sa)sin(sλ)sin(sx)dλds (4.98)

=y

π

∫ ∞

0f(λ)

(

1

y2 + (x − λ)2− 1

y2 + (x + λ)2

)

dλ (4.99)

4.6 Radial Problems

All the examples presented have been for linear problems. Radial problemsare often of more interest to petroleum engineers. Is the Fourier transformhelpful in these cases?

∂2pD

∂r2D

+1

rD

∂pD

∂rD=

∂pD

∂tD(4.100)

- The sine and cosine transforms won’t work because the pressure equationin 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 ofthe 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 tomake that claim at r = −∞. Applying the full Fourier transform in timeis another option. However transforming the time derivative requires thebehaviour of the pressure at t = −∞. This is not such a problem since itis likely p = pi would be suitable. However now the boundary conditionsbecome time dependent if the flow begins at t = 0.

The Hankel transform is better suited to radial problems.

Hv(λ) =∫ ∞

0rJv(λr)f(r)dr (4.101)

f(r) =∫ ∞

0λJv(λr)Hv(λ)dλ (4.102)

We’ll discuss this in a later section.

51

Page 52: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

4.7 Inverting Fourier Transforms Numerically

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

4.8 Discrete Fourier Transforms

Instead of considering the Fourier transform of a continuous function considera 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:

sn =n

N∆(4.104)

The Fourier transform at sn is:

F (sn) =∫ ∞

−∞f(x)e−2πixsndx ≈

N−1∑

k=0

fke−2πisnxk∆ = ∆

N−1∑

k=0

fke−2πikn/N

(4.105)Similarly the inverse transform is:

fk =1

N

N−1∑

n=0

F (sn)e2πikn/N (4.106)

For instance if we have 100 data points sampled from the following functionover 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 takingthe Fourier transform, (Figure 4.4) we can extract the original sine wave

52

Page 53: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

20 40 60 80 100

-2

-1.5

-1

-0.5

0.5

1

1.5

Figure 4.3: Noisy signal

quite easily. The Fourier transform shows two distinct spikes, one at then = 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 Fouriertransform correspond to frequencies of 0 < f < fmax. The second N/2 valuesof the Fourier transform correspond to the frequencies −fmax < f < 0. Notethat the value at n = N/2 corresponds to both f = fmax and −fmax.

Note the discrete Fourier transform (DFT) only considers a finite rangeof frequencies because it uses a finite number of sn. If there are frequenciesbeyond this present in the true Fourier transform and effect known as alias-ing occurs. As shown in Figure 4.5 aliasing occurs when frequencies beyondthe range of the chosen set of sn are present. Aliasing “folds” these frequen-cies back into the computed Fourier transform. Aliasing can be avoided byfiltering 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(N2) operations to compute. In fact the discrete Fourier transformcan be computed much more efficiently than that (O(Nlog2N) operations)by using the fast Fourier transform (FFT).

The concept of the FFT is outlined below (based on “Numerical Recipesin 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

Page 54: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

20 40 60 80 100

1

2

3

4

5

Figure 4.4: Fourier transform

f

aliased Fourier transform

true Fourier transform

0

H( f )

1

2∆

1

2∆

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

54

Page 55: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

written as the sum of two Fourier transforms each of length N/2. One ofthese transforms is formed from the even-numbered points of the original N,the other from the odd-numbered points.

F (sk) =N−1∑

j=0

e−2πijk/Nfj (4.108)

=N/2−1∑

j=0

e−2πik(2j)/Nf2j +N/2−1∑

j=0

e−2πik(2j+1)/Nf2j+1 (4.109)

=N/2−1∑

j=0

e−2πikj/(N/2)f2j + W kN/2−1∑

j=0

e−2πikj/(N/2)f2j+1 (4.110)

whereW = e−2πi/N (4.111)

⇒= F e(sk) + W kF o(sk) (4.112)

This expansion can be performed recursively i.e. a transform a length N/2can be written as the sum of two transforms of length N/4 etc.

55

Page 56: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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, p1010, 1984 ). It is an alternative to the Fourier transform. The transform isdefined by:

F (s) =1√2π

∫ ∞

−∞f(t)[cos(2πst) + sin(2πst)]dt (5.1)

f(t) =1√2π

∫ ∞

−∞F (s)[cos(2πst) + sin(2πst)]ds (5.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:

F (s) =1

∫ ∞

−∞f(t)[cos(2πst) + sin(2πst)]dt (5.4)

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 afunction of frequency. Unlike the Fourier transform this function of frequency

56

Page 57: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

is real not complex. If the transform is being computed analytically thismay make the algebra involved easier. If the transform is being performednumerically there is a considerable decrease in the amount of computationrequired. A complex multiplication or division requires four operations anda complex addition or subtraction requires a two operations. Also real dataarrays require only half the storage of complex data arrays. So the FastHartley transform (FHT) requires considerably less memory and CPU timethan the Fast Fourier Transform (FFT). Another attractive feature of theHartley transform is that the transform and its inverse are symmetrical sothe 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 particularyappropriate for the spatial domain of semi infinite (or bounded) radial prob-lems because we must make assumptions about the behaviour of the pressureat ±∞. The Hankel transform is a more suitable choice:

Fv(λ) =∫ ∞

0rJv(λr)f(r)dr (5.6)

f(r) =∫ ∞

0λJv(λr)Fv(λ)dλ (5.7)

The Hankel transform is in fact a family of transforms, depending on theorder v of the Bessel function involved. For our applications we will considerBessel 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 transformshowever the following theorem can be readily proved:

∫ ∞

0Fv(λ)Gv(λ)λdλ =

∫ ∞

0f(x)g(x)xdx (5.8)

57

Page 58: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Derivatives

Consider the Hankel transform of g(x) = f ′(x).

Gv(λ) =∫ ∞

0f ′(x)Jv(λx)xdx (5.9)

= [xf(x)Jv(λx)]∞0 −∫ ∞

0f(x)

d

dx[xJv(λx)]dx (5.10)

Assume that f(x) is such that the first term is zero. Now consider thederivatives of the Bessel functions:

d

dx[xJv(λx)] =

λx

2v[(v + 1)Jv−1(λx) − (v − 1)Jv+1(λx)] (5.11)

⇒ Gv(λ) = −λ[v + 1

2vFv−1(λ) − v − 1

2vFv+1(λ)] (5.12)

Note that v = 0 is a special case.

Bessel’s Equation

One of the most useful features of the Hankel transform is what happens whenit is applied to Bessel’s equation. If f(x) is an arbitrary function considerthe transform of:

g(x) =d2

dx2f(x) +

1

x

d

dxf(x) − v2

x2f(x) (5.13)

Gv(λ) = −λ2Fv(λ) (5.14)

Note that the terms in the radial diffusivity equation, ∂2p∂r2 + 1

r∂p∂r

, are aninstance of Bessels equations so in radial (no θ, z) coordinates:

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

For more information on Hankel transforms see: “Integral Transforms andtheir Applications”, Brian Davies, Springer-Verlag, 1978.

58

Page 59: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

r

line sink

z=h

z=0porous media

z

Figure 5.1: Source/sink configuration

5.2.2 Hankel Transform Example

Barry, Aldis and Mercer, “Injection of Fluid into a Layer of DeformablePorous 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 shownin Figure 5.1.

Barry et al. solve equations for both pressure and stress, however we willconsider only the pressure equation. The pressure is governed by:

∂2p

∂r2+

1

r

∂p

∂r+

∂2p

∂z2= α

[

δ(r − ρ)

r− δ(r)

rδ(z − zo)

]

(5.16)

The Dirac delta terms are used to impose the rate boundary conditions atthe source and sink. When this equation is Hankel transformed it becomes:

∂2p

∂z2− λ2p = −α(δ(z − z0) − J0(λp)) (5.17)

where p is the Hankel transform of p;The solution for p is:

p = αcosh(λz0)

λsinh(λ)cosh(λ(z − 1)) − J0(λρ)

λ2, z[z0, 1] (5.18)

59

Page 60: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

p = αcosh(λ(z0 − 1))

λsinh(λ)cosh(λ(z)) − J0(λρ)

λ2, z[0, z0] (5.19)

These expressions were inverted by Barry et al. using a routine from theNAG library.

60

Page 61: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 6

Green’s Functions

6.1 Theoretical Concepts

a.) adjoint operatorsb.) Dirac delta functionc.) Green’s function

“Green’s Functions”, G.F. Roach, Cambridge University Press, 1967“Application of Green’s Functions in Science and Engineering”, MichaelGreenberg, Prentice-Hall, 1971

6.1.1 Adjoint Operator

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

L =d2

dx2+

d

dx(6.1)

Lu =d2u

dx2+

du

dx(6.2)

The adjoint of L is written L∗. It is defined by multiplying Lu by another(arbitrary) function v and integrating:

vLu dx = boundary terms +∫

uL∗v dx (6.3)

61

Page 62: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Example:

L = a(x)d2

dx2+ b(x)

d

dx+ c(x) (6.4)

i.e.

Lu = a(x)d2u

dx2+ b(x)

du

dx+ c(x)u (6.5)

What is L∗?A =

v[au′′ + bu′ + cu]dx (6.6)

Integrate by parts (term by term):

vau′′ dx = vau′ −∫

u′(va)′ dx = vau′ − (va)′u +∫

u(va)′′ dx (6.7)

vbu′ dx = uvb −∫

u(vb)′ dx (6.8)

⇒ A = vau′ − (va)′u + uvb +∫

u[(va)′′ − (vb)′ + vc] dx =∫

uL∗v dx (6.9)

Now consider L∗v a little more:

L∗v = (va)′′ − (vb)′ + vc = (v′a + a′v′)′ − v′b − b′v + vc (6.10)

= v′′a+a′v′+a′′v+a′v′−v′b−b′v+vc = av′′+(2a′−b)v′+(a′′−b′+c)v (6.11)

⇒ L∗ = a(x)d

dx2+ (2a′(x) − b(x))

d

dx+ (a′′(x) − b′(x) + c(x)) (6.12)

Self-Adjointness

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

2a′ − b = b (6.13)

a′′ − b′ + c = c (6.14)

⇒ b = a′ (6.15)

i.e. if b = a′ then L is self adjoint. The importance of self adjoint operatorswill become clearer we discuss Green’s functions.

62

Page 63: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

-1 -1/2 -1/3 0

k=1

1/3 1/2 1

1/2

1

3/2k=3

k=2

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 pointsource. Begin by considering a function, Wk:

Wk = k2, |x| < 1

k

0, otherwise

(6.16)

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

limk→∞

∫ 1k

− 1k

k

2dx =

k

2

∫ 1k

− 1k

dx (6.17)

=k

2

[

1

k+

1

k

]

= 1 (6.18)

Define δ(x) = limk→∞ Wk

⇒∫ ∞

−∞δ(x) = 1.0 (6.19)

δ(x) = 0, x 6= 0

∞, x = 0

(6.20)

63

Page 64: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

H(x-a)

1

x=a

Figure 6.2: Heavisde function

Integrals Involving δ(x)∫ ∞

−∞δ(x)h(x)dx = h(0) (6.21)

i.e. multiplying by δ(x) and integrating gives h(0). Similarly:∫ ∞

−∞δ(x − a)h(x)dx = h(a) (6.22)

Derivatives Involving δ(x)

This is easier to consider in integral form.∫ ∞

−∞δ′(x)h(x)dx = δ(x)h(x)|∞−∞ −

∫ ∞

−∞δ(x)h′(x) dx (6.23)

= −∫ ∞

−∞δ(x)h′(x) dx (6.24)

More generally:∫ ∞

−∞δn(x − a)h(x)dx = (−1)nhn(a) (6.25)

Heaviside Step Functions and the Dirac Delta Function

The Heaviside step function is written H(x − a).Consider:∫ ∞

−∞H ′(x − a)h(x) dx = H(x − a)h(x)|∞−∞ −

∫ ∞

−∞H(x − a)h′(x) dx (6.26)

64

Page 65: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

= h(∞) −∫ ∞

−∞H(x − a)h′(x)dx (6.27)

= h(∞) −∫ ∞

ah′(x)dx (6.28)

= h(∞) − (h(∞) − h(a)) = h(a) (6.29)∫ ∞

−∞δ(x − a)h(x) dx (6.30)

⇒ 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 berelaxed. Using operator notation:

u = L−1f (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−1L = I (6.34)

Now define the inverse operator as:

L−1f =∫

ΩG(x, xi)f(xi)dxi (6.35)

To find the Green’s function G(x, xi) for the problem consider what happenswhen Lu = f is multiplied by G and integrated over the domain:

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

u =∫

ΩG(x, xi)f(xi)dxi (6.38)

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

65

Page 66: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

6.2 Green’s Function Examples

6.2.1 Self Adjoint Problem

Use Green’s functions to solve:

u′′(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).

∫ 1

0Gu′′dxi = Gu′|10 −

∫ 1

0u′G′dxi (6.41)

= Gu′|10 − uG′|10 +∫ 1

0uG′′dxi (6.42)

i.e.

L∗ =d2

dx2(6.43)

Step 2: Consider Boundary Terms

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

G(x, 1)u′(1) − G(x, 0)u′(0) = 0 (6.44)

G′(x, 1)u(1) − G′(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

Page 67: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Step 3: Solve for G

d2G

dx2i

= δ(xi − x) (6.48)

⇒ dG

dxi

= H(xi − x) + Axi (6.49)

⇒ 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

u(x) =∫ 1

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

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 responseto an incremental load φ(xi)dxi at point xi.

67

Page 68: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

6.2.2 Non-Self Adjoint Problem

Use Green’s functions to solve:

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

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

u′(1) = a (6.62)

Step 1: Find L∗

∫ 1

0GLudxi = Gu′|10−

∫ 1

0u′G′dxi +3Gu|10−3

∫ 1

0uG′dxi +2

∫ 1

0uGdxi (6.63)

= Gu′|10 − G′u|10 +∫ 1

0uG′′dxi + 3Gu|10 − 3

∫ 1

0uG′dxi + 2

∫ 1

0uGdxi (6.64)

⇒ L∗ =d2

dx2− 3

d

dx+ 2 (6.65)

The problem is not self adjoint.

Step 2: Consider Boundary Terms

G(x, 1)u′(1) − G′(x, 1)u(1) + 3G(x, 1)u(1)

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

Substitute in the boundary conditions for u:

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

G(x, 0) = 0 (6.68)

We can only specify two boundary conditions on G. The mixed boundarycondition 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:

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

As in the self adjoint problem we will multiply Lu by G and integrateover Ω.

∫ 1

0GLudxi = boundary terms +

∫ 1

0uL∗Gdxi =

∫ 1

0Gfdxi (6.70)

68

Page 69: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

By zeroing out as many boundary terms as possible and choosing L∗G =δ(xi − x) this becomes:

∫ 1

0Gfdxi = aG(x, 1) + u(x) (6.71)

Step 3: Solve for G

It is convenient to solve the problem in two parts.

d2G

dx2i

− 3dG

dxi+ 2G = 0, 0 ≤ xi < x (6.72)

d2G

dx2i

− 3dG

dxi+ 2G = 0, x < xi ≤ 1 (6.73)

The singularity at xi = x will be handled by imposing conditions on theconstants 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 boundaryconditions and some additional conditions to handle the singularity:

G(x, 0) = 0 (6.76)

⇒ A + B = 0 (6.77)

−2G′(x, 1) + 6G(x, 1) + G′(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:

∫ x+0

x−0G′′ − 3G′ + 2Gdxi =

∫ x+0

x−0δ(xi − x)dxi (6.82)

69

Page 70: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

⇒ dG

dxi|x+0x−0 − 3G|x+0

x−0 + 2∫ x+0

x−0Gdxi = 1 (6.83)

Because we have required G to be continuous the second and third terms inthis 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 forG is:

G =1

k(2e2(1−x) − 4e1−x)(exi − e2xi), 0 ≤ xi ≤ x (6.85)

G =1

k(2e2−x−2e2−1)exi−x +(4e−4e1−x +e−x)e2xi−x, x ≤ xi <= 1 (6.86)

wherek = 1 − 4e + 2e2 (6.87)

Step 4: Solve for u

u(x) = −aG(x, 1) +∫ 1

0G(x, xi)f(xi)dxi (6.88)

6.3 Partial Differential Equations

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

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

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

B2 − AC < 0, ellipticB2 − AC = 0, parabolicB2 − AC > 0, hyperbolic

70

Page 71: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

dy

Γ

i

d

θ n

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

ΩvLu dΩ = boundary terms +

∫ ∫

uL∗v dΩ (6.90)

We will work out the first term in the general case for the adjoint operator:

∫ ∫

vAuxxdΩ =∫ y2

y1

∫ x2

x1

vAuxxdx

dy (6.91)

=∫ y2

y1

vAux|x2x1

−∫ x2

x1

(vA)xuxdx

dy (6.92)

=∫ y2

y1

[vAux − (vA)xu]x2x1

+∫ x2

x1

(vA)xxudx

dy (6.93)

=∫ y2

y1

[vAux − (vA)xu]x2x1

dy +∫ ∫

(vA)xxudΩ (6.94)

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

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

Therefore the integral being evaluated is:∫

Γ[vAux − (vA)xu]~i · ~ndΓ +

∫ ∫

Ω(vA)xxudΩ (6.96)

71

Page 72: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Treating all terms in this manner gives the following relationship betweenL nand L∗:

∫ ∫

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 + Fv (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∗vLaplace ∇2u ∇2vHelmholtz ∇2u + k2u ∇2v + k2vDiffusion κut − uxx −κvt − vxx

Wave c2uxx − utt c2vxx − 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)

andBx + 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)

wherer =

(x − xi)2 + (y − yi)2 (6.104)

72

Page 73: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

and

Wk =k2

π, r ≤ 1

k(6.105)

= 0, r >1

k(6.106)

and/or

Wk(r) =ke−kr2

π(6.107)

The two dimensional delta function has similar properties to the one dimen-sional delta function:

∫ ∫

dΩδ(x − xi, y − yi)h(x, y)dΩ = h(xi, yi) (6.108)

δ(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’sfunction 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 anyparticular boundary conditions on G or Gf . The function Gf is known as afree-space Green’s function. The function Gb takes account of the boundaryterms for a particular problem.

Example: Two-Dimensional Laplace Equation

L∗Gf = ∇Gf = δ(xi − x, yi − y) (6.111)

As before we will begin by solving the problem away from the singularitywhere the delta function is zero, then will consider the singularity separately.

∇2Gf =1

r

∂r(r

∂Gf

∂r) = 0 (6.112)

⇒ r∂Gf

∂r= A (6.113)

73

Page 74: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

x,yΓe

Γy

x

i

i

Ω

Figure 6.4: Integration around singularity

⇒ ∂Gf

∂r=

A

r(6.114)

⇒ ∂Gf

∂r=

A

r(6.115)

⇒ Gf = Alnr + B (6.116)

wherer =

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

∫ ∫

Ωe

∇2GfdΩ =∫ ∫

Ωe

δ(xi − x, yi − y)dΩ (6.118)

Use Green’s second identity to convert the domain integral on the left to aboundary integral. In general for two function f and g Green proved:

∫ ∫

Ω(f∇2g − g∇2f)dΩ =

Γ

(

f∂g

∂n− g

∂f

∂n

)

dΓ (6.119)

74

Page 75: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

⇒∫ ∫

Ωe

∇2GfdΩ =∫

Γe

∂Gf

∂rdr (6.120)

=∫ 2π

0

∂Gf

∂rrdθ (6.121)

Now substitute Gf = Alnr + B:

⇒= A∫ 2π

0

1

rrdθ (6.122)

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 forB explicity so we will set it (arbitrarily) to zero, i.e.:

Gf =1

2πlnr (6.125)

Example: One-Dimensional Diffusion Equation

The diffusion equation is:

Lu = κ∂u

∂t− ∂2u

∂x2(6.126)

Referring to the general expression for L and L∗ we have the following L∗:

L∗ = −κ∂

∂t− ∂2

∂x2(6.127)

To find the (free-space) Green’s function we will solve:

L∗Gf = κ∂Gf

∂τ+

∂2Gf

∂x2i

= −δ(xi − x)δ(τ − t) (6.128)

We’ll use a Fourier transform to do this, specifically:

F (s) =1√2π

∫ ∞

−∞f(xi)e

−ixisdxi (6.129)

75

Page 76: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

⇒ κ∂Gf

∂τ− s2Gf = −δ(τ − t)

1√2π

e−ixs (6.130)

As before consider solving two problems, one on each side of the singularity(where the delta function is zero):

κ∂Gf

∂τ− s2Gf = 0, τ > t (6.131)

κ∂Gf

∂τ− s2Gf = 0, τ < t (6.132)

This equation can be readily solved for Gf :

Gf = Aes2τκ, τ > t (6.133)

Gf = Bes2τκ, τ < t (6.134)

Now take account of the singularity by integrating past it:

κ∫ t+0

t−0

dGf

dτdτ − s2

∫ t+0

t−0Gfdτ = − 1√

∫ t+0

t−0δ(τ − t)e−ixsdτ (6.135)

We require Gf to be continuous so the second integral in the above equationvanishes to give:

κ(Aes2τκ − Bes2τκ) = − 1√2π

e−ixs (6.136)

To solve for A and B we need one more equation. This time we will consider aphysical argument. The Green’s function represent the response of a systemto a unit input applied at time τ and location xi. So before time τ we donot expect change in the system i.e G will be zero for t < τ . Therefore theconstant A is zero.Now solve for B:

B =1

κ√

2πe−ixse

−s2tκ (6.137)

Gf = 0, τ > t (6.138)

Gf =1

κ√

2πe−ixs− s2t

κ+ s2τ

κ τ > t (6.139)

76

Page 77: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Gf can be written more compactly as:

Gf =H(t − τ)

κ√

2πe−ixs− s2t

κ+ s2τ

κ (6.140)

The Fourier transform can be inverted to give:

Gf =H(t − τ)

4πκ(t − τ)e

−κ(xi−x)2

4(t−τ) (6.141)

6.4 The Newman Product Theorem

This theorem is not specific to the solution of the differential equations thatgive rise to Green’s functions (L∗G = δ(xi−x) etc). The theorem allows us tofind solutions to differential equations in multiple dimensions from solutionsto one-dimensional problems. We will consider the diffusion equation in threedimensions:

∂2u

∂x2+

∂2u

∂y2+

∂2u

∂z2=

1

κ

∂u

∂t(6.142)

on the domaina1 ≤ 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 isessential.

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

Now consider solving three one-dimensional problems:

∂2u1

∂x2=

1

κ

∂u1

∂t, a1 ≤ x ≤ b1 (6.147)

77

Page 78: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

∂2u2

∂y2=

1

κ

∂u2

∂t, a2 ≤ y ≤ b2 (6.148)

∂2u3

∂z2=

1

κ

∂u3

∂t, a3 ≤ y ≤ b3 (6.149)

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

∂x2+

∂2u

∂y2+

∂2u

∂z2=

∂2u1u2u3

∂x2+

∂2u1u2u3

∂y2+

∂2u1u2u3

∂z2(6.154)

Expanding the derivatives gives:

= u2u3∂2u1

∂x2+ u1u3

∂2u2

∂y2+ u1u2

∂2u3

∂z2(6.155)

Now substitute in (6.147):

= u2u31

κ

∂u1

∂t+ u1u3

1

κ

∂u2

∂t+ u1u2

1

κ

∂u3

∂t(6.156)

=1

κ

∂u

∂t(6.157)

For an example involving radial coordinates see Carslaw and Jaegar, page33.

78

Page 79: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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’sfunctions and Green’s functions satisfying boundary conditions for rectangu-lar, homogeneous, anisotropic reservoirs. Gringarten and Ramey define bothGreen’s functions and “source” functions. Source functions act over a regionwhile Green’s functions act a given point in one, two or three dimensions.Source functions can be determined by integrating Green’s functions over anappropriate region (corresponding to a well or fracture).

The basic result that Gringarten and Ramey use is the Green functionsfor a point source in a one dimensional reservoir:

G =1√4πηt

e−(x−xw)2

4ηt (6.158)

where

η∇2p − ∂p

∂t= 0 (6.159)

Note that this one dimensional source corresponds to an infinite planarsource in three dimensions (see Figure 6.5). This source can be integratedover a region of width xf to produce a slab source as shown in Figure 6.6:

S =1

2

[

erf

(

x − (xw − xf/2)√4ηt

)

− erf

(

x − (xw + xf/2)√4ηt

)]

(6.160)

The product of the inifinite plan source and the infinite line source givesthe point source solution (see Figure 6.7).

The set of free-space solutions Gringarten and Ramey generated is givenby 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 wediscussed at the start of the course. These solutions are VII(x) to XII(x) inTable 2 of their paper. For instance consider constant pressure boundaries

79

Page 80: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

x

y

z

x = xw

Figure 6.5: Planar source

x

y

zxf

x = xw

Figure 6.6: Slab source

80

Page 81: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 wewill require that G = 0 on these boundaries (since G represent the effect of aunit flow rate at the well at any location in space). The sequence of imagesis shown in Figure 6.8.

The sequence extends infinitely in both directions. The Green’s function thatcorresponds with this sequence is:

G =1√4πηt

e−(x−xw)2

4ηt − e−(x+xw)2

4ηt − e−(x−2xe+xw)2

4ηt + e−(x+2xe−xw)2

4ηt + ...

(6.161)

G =1√4πηt

∞∑

n=−∞e−

(x−xw−2nxe)2

4ηt − e−(x+xw−2nxe)2

4ηt

(6.162)

This series can have convergence problems. It is better to expand it usingPoisson’s summation formula, which is:

∞∑

−∞f(αn) =

√2π

α

∞∑

n=−∞F(

2πn

α

)

(6.163)

where F is the Fourier transform of f .

F (s) =1√2π

∫ ∞

−∞f(x)e−ixsdx (6.164)

81

Page 82: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

xw xe 2x e-x w 2xe

+ve

+x w

+ve

-ve

x=0-x w-2x e+xw

-ve

+ve

Figure 6.8: Sequence of image wells

We will need

F(

e−(x−xw−2nxe)2

4ηt

)

(6.165)

and

F(

e−(x+xw−2nxe)2

4ηt

)

(6.166)

Begin by defining a new variable, x = 2nxe. We will do the Fourier transformin terms of this variable. The first shift theorem can be applied to give:

F(

e−(x−xw−2nxe)2

4ηt

)

= e−is(x−xw)F(

e−−(2nxe)2

4ηt

)

(6.167)

= e−is(x−xw)F(

e−x2

4ηt

)

(6.168)

= e−is(x−xw) 1√2π

∫ ∞

−∞e−isxe−

x2

4ηt dx (6.169)

We will evaluate this integral by completing the square in the exponent. Theexponent is:

−(

x2

4ηt+ isx

)

=

(

(x√4ηt

+

√4ηtis

2)2 + ηts2

)

(6.170)

Recall the following useful integral which will help us evaluate the integralwe require for the Fourier transform:

∫ ∞

−∞e

−z2

A2 dz =√

πA (6.171)

82

Page 83: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Using this result the Fourier transform we need is:

e−is(x−xw) 1√2π

√π√

4πηte−s2ηt =√

2ηte−is(x−xw)e−s2ηt (6.172)

Now return to the summation:

∞∑

n=−∞e−

(x−xw−2nxe)2

4ηt =∞∑

n=−∞

√2π

2xe

2ηte−is(x−xw)e−s2ηt (6.173)

where we have replace the α in Poission’s summation formula by 2xe. Westill need to consider the s.

s =2πn

α=

2πn

2xe=

πn

xe(6.174)

So the summation for the Green’s function is:

G =1√4πηt

∞∑

n=−∞e−

(x−xw−2nxe)2

4ηt − e−(x+xw−2nxe)2

4ηt

(6.175)

=1√4πηt

√4πηt

2xe

∞∑

n=−∞e−

iπn(x−xw)xe e

−π2n2ηt

x2e − e−

iπn(x+xw)xe e

−π2n2ηt

x2e

(6.176)

=1

2xe

∞∑

n=−∞e−−π2n2ηt

x2e

[

e−iπn(x−xw)

xe − e−iπn(x+xw)

xe

]

(6.177)

The terms in square brackets can be expanded in terms of sines and cosinesto give:

[

e−iπn(x−xw)

xe − e−iπn(x+xw)

xe

]

=(

cos(πnx

xe) − isin(

πnx

xe))

2isin(πnxw

xe)

(6.178)The product of the cosine and sine terms is zero when summed (recall theintegral of an even function times an odd function is also zero), so only thesine terms remain. Finally when we substitute back into G we have:

G =1

xe

∞∑

n=−∞e−π2n2ηt

x2e sin(

πnx

xe)sin(

πnxw

xe)

(6.179)

Because of the symmetry in the sine terms we have

G =2

xe

∞∑

n=1

e−π2n2ηt

x2e sin(

πnx

xe)sin(

πnxw

xe)

(6.180)

83

Page 84: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

w

yw

y=0

x=0 x

Figure 6.9: Well/boundary geometry

6.5.2 General Rectangular Reservoirs

The appropriate source functions for bounded rectangular reservoirs can begenerated by applying Newmans’s product theorem and using suitable one-dimensional solutions e.g. consider a fully completed well in a reservoir thatis 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

µ∇2p − φc

∂p

∂t= q (6.181)

where q represent sources and sinks caused by wells. This can be rearrangedto give:

η∇2p − ∂p

∂t=

1

φcq (6.182)

84

Page 85: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Once the appropriate source function has been determined the drawdowncan be found by evaluating the following integral:

∆p(t) =1

φc

∫ t

0q(τ)S(t − τ)dτ (6.183)

6.6 Green’s Function Summary

- Trying to solve a differential equation of the form Lu(x, t) = f(x, t) whereu is an unknown function and f is a known forcing function.- The first step is to determine the adjoint operator, L∗:

∫ ∫

ΩvLudΩ = boundary terms +

uL∗vdΩ (6.184)

- Determine specific boundary conditions for G by zeroing the boundaryterms arising from L∗. If you only want a free-space Green’s function don’tworry about the boundary conditions.- Solve for G: Multiply Lu = f by G and integrate. Work in terms of dummyvariables xi and τ .

∫ ∫

ΩG(x, xi, t, τ)Lu(xi, τ)dΩ =

∫ ∫

ΩGf(xi, τ)dΩ (6.185)

Now refer back to the adjoint equation:∫ ∫

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

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 theeffect on u (in the domain x, t) of a singularity at xi, τ .

85

Page 86: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 7

Numerical Methods

7.1 Boundary Element Method

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

∂2p

∂x2+

∂2p

∂y2= 0 (7.1)

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:

∫ ∫

Ω(f∇2g − g∇2f)dΩ =

Γf

∂g

∂n− g

∂f

∂ndΓ (7.2)

where n is the normal to the boundary.In our case we will take:

f = p (7.3)

g = G =1

2πln(1/r) (7.4)

wherer =

(xi − x)2 + (yi − y)2 (7.5)

86

Page 87: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Γ

Figure 7.1: Location of singularity

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

⇒∫ ∫

Ω(p∇2G − G∇2p)dΩ =

Γp∂G

∂n− G

∂p

∂ndΓ (7.6)

This equation is key to the derivation of BEM. It shows how we canconvert domain integrals into boundary integrals for the same problem. Toproceed further we’ll break up the domain Ω into the sume of a circle sur-rounding the singularity (Ωe) and the remainder, Ω−Ωe. First consider theremainder:

⇒∫ ∫

Ω−Ωe

(p∇2G − G∇2p)dΩ =∫

Γ+Γe

p∂G

∂n− G

∂p

∂ndΓ (7.7)

Within this domain both ∇2G = 0 and ∇2p = 0.

⇒ 0 =∫

Γp∂G

∂n− G

∂p

∂ndΓ +

Γe

p∂G

∂n− G

∂p

∂ndΓ (7.8)

Now consider the integral over Γe further, noting that dΓ = rdθ:

∂G

∂n=

∂G

∂r

∂r

∂n=

1

−1

r(−1) =

1

2πr(7.9)

Γe

p∂G

∂n− G

∂p

∂ndΓ =

1

∫ 2π

0[p

1

r− ln

1

r

∂p

∂n]rdθ (7.10)

=1

∫ 2π

0(p + rln(r)

∂p

∂n)dθ (7.11)

87

Page 88: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

node

linear element

Figure 7.2: Boundary Discretisation

Consider the limit as r → 0:

=1

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

Now substitute this result back into equation 7.8:

p(xi, yi) +∫

Γp∂G

∂ndΓ =

ΓG

∂p

∂ndΓ (7.13)

If the point (xi, yi) is on the boundary this equation must be modified to:

θ

2πp(xi, yi) +

Γp∂G

∂ndΓ =

ΓG

∂p

∂ndΓ (7.14)

where θ is the boundary angle (pi at smooth boundaries, pi/2 at rightangle etc).

Note that at this stage no approximations have been introduced. Thedifferential 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 intonodes 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

Page 89: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

x=x x=x

ξ=+1

1 2

ξ=−1

Figure 7.3: Local coordinate

functions (Nj). Figure 7.2 shows a linear element i.e. the boundary geometryis approximated by a straight line connecting the nodes. Higher order ele-ments are also possible. To improve the accuracy of the solution the elementscan 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 runsfrom -1 to 1 along the element.

The linear shape functions are:

x(ξ) = N1x1 + N2x2 (7.15)

y(ξ) = N1y1 + N2y2 (7.16)

p(ξ) = N1p1 + N2p2 (7.17)

where

N1 =1

2(1 − ξ) (7.18)

N2 =1

2(1 + ξ) (7.19)

The quadratic shape functions are:

x(ξ) = N1x1 + N2x2 + N3x3 (7.20)

N1 =−ξ

2(1 − ξ) (7.21)

N2 = (1 + ξ)(1 − ξ) (7.22)

N3 =ξ

2(1 + ξ) (7.23)

89

Page 90: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 geometryof the elements in terms of shape functions we have:

θ

2πp(xi, yi)+

M∑

m=1

2∑

j=1

pj

∫ 1

−1

∂G(ri)

∂nNj(ξ)J(ξ)dξ =

M∑

m=1

2∑

j=1

∂pj

∂n

∫ 1

−1G(ri)Nj(ξ)J(ξ)dξ

(7.24)where M is the number of elements and J(ξ) is a Jacobian which takesaccount of the integral being performed over ξ.

J(ξ) =dΓ

dξ=

(

dx(ξ)

)2

+

(

dy(ξ)

)2

(7.25)

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

Ap = B∂p

∂n(7.26)

Each row of this matrix equation arises from placing the source nodeof the Green’s function at a given node i on the boundary. The terms inmatrices A and B are usually too difficult to evaluate analytically.

Aij =∫ 1

−1

∂G(ri)

∂nNj(ξ)J(ξ)dξ +

θ

2πδij (7.27)

Bij =∫ 1

−1G(ri)Nj(ξ)J(ξ)dξ (7.28)

7.1.3 Gauss Quadrature

The following integral can be evaluated (approximately) using Gauss quadra-ture if f(ξ) is not singular:

∫ 1

−1f(ξ)dξ =

N∑

n=1

f(ξn)Wn (7.29)

The integral is evaluated as the weighted (weights, Wn) sum of functionvalues at a set of special points known as Gauss points (ξn). The integralbecomes more accurate as N increases.

N = 2±ξn = 0.5773 (7.30)

90

Page 91: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

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 aphysical arguement can be used to evaluate these diagonal terms once the off-diagonals have been evaluated. For this problem if p is constant everywherewe expect ∂p

∂nat every node to be zero i.e.

Apconst = B∂p

∂n= 0 (7.36)

⇒ Aii = −N∑

j=1,j 6=i

Aij (7.37)

7.1.4 Boundary Conditions

The solution is not uniquely determined until boundary conditions have beenimposed. At every node pressure, pressure derivative or mixed boundaryconditions must be imposed. Note that for the problem being considered atleast one node must have a specified pressure. Once boundary conditionshave been set half the unknown p and ∂p

∂nvalues can be eliminated from the

matrix equation to give:A′x = b (7.38)

where x is a vector containing the unknown p and ∂p∂n

values.

At smooth boundaries either p or q = ∂p∂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

Page 92: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

q

p

Figure 7.4: Boundary conditions at a smooth boundary

q

p

q

Figure 7.5: Boundary conditions at a corner

If the last option is being used and extra equation is required. This canbe generated from the physics of the problem, or by breaking the boundaryup.

7.1.5 Matrix Solution

The matrix A′ is fully populated and has the same dimension as the numberof boundary nodes. Direct solvers are usually used. The reduced size of thematrix involved in BEM is one of it’s chief advantages. For instance, considersolving a problem one a 100 by 100 grid. If finite differences were being usedthe matrix would be 10,000 by 10,000. The matrix would be sparse. If BEMis used only the boundary nodes are required in the matrix problem so thematrix 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 internalmesh) by placing the source point (xi, yi) of the Green’s function at the point

92

Page 93: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

qp p

q

Figure 7.6: Broken boundary

of interest and revaluating the boundary integral equation.

θ

2πp(xi, yi) = −

M∑

m=1

2∑

j=1

pj

∫ 1

−1

∂G(ri)

∂nNj(ξ)J(ξ)dξ+

M∑

m=1

2∑

j=1

∂pj

∂n

∫ 1

−1G(ri)Nj(ξ)J(ξ)dξ

(7.39)

Since we are considering internal points θ = 2π. All the pj and∂pj

∂nare known

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 matrixsolve, only revaluation of the element integrals. The internal solutions canbe calculated sequentially, and only need to be calculated at the points ofinterest.

7.1.7 Transient Problems

Suppose we wanted to solve:

∂2p

∂x2+

∂2p

∂y2= η

∂p

∂t(7.40)

If we begin from Green’s second identity as before:

∫ ∫

Ω(f∇2g − g∇2f)dΩ =

Γf

∂g

∂n− g

∂f

∂ndΓ (7.41)

We’ll start by considering what happens when we divide Ω into a small circlesurrounding the singularity and the remainder:

−∫ ∫

Ω−Ωe

Gη∂p

∂tdΩ =

Γ+Γe

p∂G

∂n− G

∂p

∂ndΓ (7.42)

93

Page 94: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

since ∇p = η ∂p∂t

. We’re using the steady state Green’s function used in theprevious section.

We could approximate ∂p∂t

with a finite difference i.e.:

∂p

∂t=

pt2 − pt1

∆t(7.43)

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 andsolving 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 theform:

∂2p

∂x2+

∂2p

∂y2= η

∂p

∂t(7.44)

.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 byG and integrating by parts. The Aij and Bij terms are now time dependent sothe element integrals must be reevaluated each time step. Computationallyefficient 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 differentialequation is:

∂2p

∂x2+

∂2p

∂y2= sp (7.46)

The Green’s function is available (in Laplace space) for this problem:

G =1

2πKo(

√sr) (7.47)

94

Page 95: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

Using this Green’s function a BEM scheme can be built which will solvefor 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 marchforward in time.

7.1.10 Advantages of BEM

- No internal grid. The only discretisation errors come from the boundarydiscretisation. 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 twodimensional problem, two dimensional grid required for a three dimensionalproblem. 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. Forreservoir 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. Thislimits it’s applicability. The theory can be extended to a wider class of prob-lems by considering alternative boundary element based methods includingthe Dual Reciprocity Boundary Element Method (DRBEM) and the GreenElement Method (GEM). DRBEM is the more commonly used approachhowever my Ph.D. research suggests GEM has some attractive properties forreservoir engineering problems. The two approaches will be introduced inthe following sections.

95

Page 96: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

7.2.1 Dual Reciprocity Boundary Element Method

Suppose we want to solve a problem of the form:

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

The function b is arbitrary so the Green’s function for this problem is notneccessarily available. The essence of the DRBEM approach is the followingexpansion:

b ≈N∑

j=1

αjfj (7.49)

where the αj are weights and the fj are a set of approximating functions. Theonly restriction on the approximating functions is that they are the Laplacianof some other function:

∇2pj = 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:

∇2p =N∑

j=1

αjfj =N∑

j=1

αj∇2pj (7.51)

This introduces a ∇2 operator on each side of equation so well can applythe same procedure we used for the ∇2p = 0 problem to derive a boundaryintegral equation:

θ

2πp(xi, yi)+

Γ

∂G

∂npdΓ−

ΓG

∂p

∂n=

N∑

j=1

αj(θ

2πpj(xi, yi)+

Γ

∂G

∂npj −

ΓG

∂pj

∂n)

(7.52)This can be written in matrix form as:

Ap − Bq = (AP − BQ)α (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 isrequired at internal points. So the matrix problem is larger than it would befor BEM and it remains dense.

96

Page 97: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

- the weighting vector α may require a significant amount of calculation. Intransient problems this vector must be updated at each timstep.- DRBEM does extend the theory of BEM to arbitrary problems (as longas they include a ∇2 operator somewhere. Convective problems, such as theconvection-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 fullyexplained is his book “The Green Element Method”. It’s chief attraction isit’s flexibility and the fact that it generates a sparse matrix problem. Thematrix problem is however large.Suppose we want to solve:

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

Again we will start from Green’s second identity:

∫ ∫

Ωp∇2G − G∇2pdΩ =

Γp∂G

∂n− G

∂p

∂ndΓ (7.55)

Substituing ∇2p = b and splitting the domain into a circle surrounding thesingularity and the remainder (as before) gives:

− θ

2πp(xi, yi) +

Γp∂G

∂n− G

∂p

∂ndΓ =

∫ ∫

ΩGbdΩ (7.56)

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

If both the boundary and the domain integrals are broken into the sum ofelement integrals we have:

− θ

2πp(xi, yi) +

M∑

e=1

Γe

p∂G

∂n− G

∂p

∂ndΓ =

M∑

e=1

∫ ∫

Ωe

GbdΩ (7.57)

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

Page 98: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

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

functions:

p =4∑

j=1

Njpj (7.58)

q =4∑

j=1

Njqj (7.59)

b =4∑

j=1

Njbj (7.60)

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

− θ

2πp(xi, yi)+

M∑

e=1

4∑

j=1

Γe

pjNj∂G

∂n−GqjNjdΓ =

M∑

e=1

4∑

j=1

∫ ∫

Ωe

GbjNjdΩ (7.61)

A matrix equation can be formed from this:

M∑

e=1

Reijpj + Le

ijqj + Vijbj = 0 (7.62)

where

Reij =

Γe

∂G

∂nNjdΓ (7.63)

Leij =

Γe

GiNjdΓ (7.64)

V eij =

∫ ∫

Ωe

GiNjdΩ (7.65)

98

Page 99: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

PE281 - Applied Mathematics in Reservoir Engineering

7.2.3 Dealing with Heterogeneity

Single phase flow in heterogeneous reservoirs is governed by:

∇ · (k

µ∇p) = φct

∂p

∂t(7.66)

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 thefollowing manner:

∇2p = −∇lnk · ∇p +φµct

k

∂p

∂t(7.67)

99

Page 100: PE 281 - APPLIED MATHEMATICS IN RESERVOIR ENGINEERINGweb.stanford.edu/class/energy281/ArcherLectureNotes.pdf · PE281 - Applied Mathematics in Reservoir Engineering These notes were

Chapter 8

Errata

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

Eqn 2.20 should read lim s → ∞ sLf(t), the first = sign is incorrectEqn 2.22 should have lim s → ∞ as the second limitEqn 2.63 should not have the first negative signEqn 2.66 should have limits of integration from s to infinityEqn 2.81 should have lim t → ∞ on the right hand sideEqn 3.48 should be lim t → ∞Eqn 3.73 should be pd = (pi-p)/(pi-pw)Eqn 3.74 should be rd=1Eqn 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 ≤ 1Eqn 6.171 should have −z2/A2 as the exponent

100