computer application on well test mathematical model computation

12
IJRRAS 11 (1) April 2012 www.arpapress.com/Volumes/Vol11Issue1/IJRRAS_11_1_05.pdf 41 COMPUTER APPLICATION ON WELL TEST MATHEMATICAL MODEL COMPUTATION OF HOMOGENOUS AND MULTIPLE-BOUNDED RESERVOIRS Elradi Abass* & Cheng Lin Song Faculty of Petroleum Engineering, China University of Petroleum-Beijing (CUPB) 18 Fuxue Road Changping, Beijing China 102249 *Email: [email protected] ABSTRACT This paper presents a reasonable computer application solution of the modern well test analysis mathematical model, concerning the mathematical model and its analytical solution. The works of this paper are conducted to develop a computer program package designed in VISUAL BASIC6, and the utility of this program is to follow the procedure for solving well test mathematical model and establishing the most widely known as theoretical type curves. The appropriate calculations that are provided by the program, are that for each reservoir boundaries' situation the program has an ability to establish multi-type curve for a variety of well and reservoir parameters. Here it is worth mentioning that many publications have no clearly integrated explanation of the mathematical background of establishing well test type curves. Therefore the paper would be considered as a technical guide to what has been done so far regarding the current Computer Aided Application of modern well test theory for the condition of homogeneous and multiple linear boundaries reservoir. Keyword: Well test mathematical model; homogeneous; type curves; boundaries; computer application. 1. INTRODUCTION The Paper focuses on homogeneous multiple-linear boundaries model, in which the homogeneous reservoir model is considered as a benchmark against which well test data are matched. All methods for the analysis of data from well testing are based on the diffusivity equation for fluid flow through porous media; this work covers the methods of analytical and numerical solution to diffusivity equation. A common method for solving the diffusivity equation is to use the Laplace transformation; the advantages of this method have been described by Van Everdingen (1949). By this method, the equations are transformed into a system of ordinary differential equations, which can be solved analytically. The resulting solution in the transformed space is a function of the Laplace variable. To invert the solution to real time and space, the inverse Laplace transformation is used. Stehfest (1970) presented a numerical inversion algorithm used to invert the Laplace space solution to real space. The analytical solution to diffusivity equation lead to generate Bessel equation, this equation makes use of Bessel functions, Abramowitz (1970) and Stegum present polynomial approximation to compute the modified Bessel function, Giovanni (1990). Type curves are the graphical representation or numerical solutions to the diffusivity equation for specified case of initial condition, boundary conditions and geometry. According to the literature review, many scientists have presented intensive works on the subject of well test interpretation type curves. To review the tasks of the type curves in well test interpretation, Bourdet (1983) presents a most known set of type curves which simplifies well test analysis and diagnoses. In modern graphical analyses, the uses of pressure derivative curves have become standard because the curves have greatest precision in the parts of the response of greatest interest and have easily identifiable characteristics. The introduction of the pressure derivative can be considered as a major breakthrough in the use of type curves, since it facilitates interpretation and uniqueness of match. Modern analysis has been greatly enhanced by the use of the derivative plot introduced by Bourdet(1983) (1989)and Pirard,(1986);E.A.Proano(1986) presented the application of the derivative to bounded reservoirs. Ehlig (1988) showed the visual impression afforded by the log- log presentation has been greatly enhanced by the introduction of the pressure derivative. Because the presence of a fault in a reservoir is of great importance, considerable numbers of pressure analysis techniques dealing with this situation have been proposed in literature. Djebbar (1979) shows a type curves matching technique for interpretation of the pressure transient behavior of wells located in various Multiple Sealing-fault systems, Tiab and Kumar (1980) presents study on the behavior of a well located between two parallel boundaries. A.C.Gringarten (1986) discusses the use of computer in analyzing well tests effectively. I.M.Buhidma and W.C.chu (1992) present state-of-the-art computer application of pressure transient analysis. Horne (1994) has summarized modern approaches to well test analysis-using computers. This paper establishes a computer package application based on the previous conceptions, techniques and methods

Upload: trantram

Post on 04-Jan-2017

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 www.arpapress.com/Volumes/Vol11Issue1/IJRRAS_11_1_05.pdf

41

COMPUTER APPLICATION ON WELL TEST MATHEMATICAL MODEL

COMPUTATION OF HOMOGENOUS AND MULTIPLE-BOUNDED

RESERVOIRS

Elradi Abass* & Cheng Lin Song

Faculty of Petroleum Engineering, China University of Petroleum-Beijing (CUPB)

18 Fuxue Road Changping, Beijing China 102249

*Email: [email protected]

ABSTRACT

This paper presents a reasonable computer application solution of the modern well test analysis mathematical model,

concerning the mathematical model and its analytical solution. The works of this paper are conducted to develop a

computer program package designed in VISUAL BASIC6, and the utility of this program is to follow the procedure

for solving well test mathematical model and establishing the most widely known as theoretical type curves. The

appropriate calculations that are provided by the program, are that for each reservoir boundaries' situation the

program has an ability to establish multi-type curve for a variety of well and reservoir parameters. Here it is worth

mentioning that many publications have no clearly integrated explanation of the mathematical background of

establishing well test type curves. Therefore the paper would be considered as a technical guide to what has been

done so far regarding the current Computer Aided Application of modern well test theory for the condition of

homogeneous and multiple linear boundaries reservoir.

Keyword: Well test mathematical model; homogeneous; type curves; boundaries; computer application.

1. INTRODUCTION

The Paper focuses on homogeneous multiple-linear boundaries model, in which the homogeneous reservoir model is

considered as a benchmark against which well test data are matched. All methods for the analysis of data from well

testing are based on the diffusivity equation for fluid flow through porous media; this work covers the methods of

analytical and numerical solution to diffusivity equation. A common method for solving the diffusivity equation is to

use the Laplace transformation; the advantages of this method have been described by Van Everdingen (1949). By

this method, the equations are transformed into a system of ordinary differential equations, which can be solved

analytically. The resulting solution in the transformed space is a function of the Laplace variable. To invert the

solution to real time and space, the inverse Laplace transformation is used. Stehfest (1970) presented a numerical

inversion algorithm used to invert the Laplace space solution to real space. The analytical solution to diffusivity

equation lead to generate Bessel equation, this equation makes use of Bessel functions, Abramowitz (1970) and

Stegum present polynomial approximation to compute the modified Bessel function, Giovanni (1990).

Type curves are the graphical representation or numerical solutions to the diffusivity equation for specified case of

initial condition, boundary conditions and geometry. According to the literature review, many scientists have

presented intensive works on the subject of well test interpretation type curves. To review the tasks of the type

curves in well test interpretation, Bourdet (1983) presents a most known set of type curves which simplifies well test

analysis and diagnoses.

In modern graphical analyses, the uses of pressure derivative curves have become standard because the curves have

greatest precision in the parts of the response of greatest interest and have easily identifiable characteristics.

The introduction of the pressure derivative can be considered as a major breakthrough in the use of type curves,

since it facilitates interpretation and uniqueness of match. Modern analysis has been greatly enhanced by the use of

the derivative plot introduced by Bourdet(1983)

(1989)and Pirard,(1986);E.A.Proano(1986) presented the

application of the derivative to bounded reservoirs. Ehlig (1988) showed the visual impression afforded by the log-

log presentation has been greatly enhanced by the introduction of the pressure derivative.

Because the presence of a fault in a reservoir is of great importance, considerable numbers of pressure analysis

techniques dealing with this situation have been proposed in literature. Djebbar (1979) shows a type curves matching

technique for interpretation of the pressure transient behavior of wells located in various Multiple Sealing-fault

systems, Tiab and Kumar (1980) presents study on the behavior of a well located between two parallel boundaries.

A.C.Gringarten (1986) discusses the use of computer in analyzing well tests effectively. I.M.Buhidma and W.C.chu

(1992) present state-of-the-art computer application of pressure transient analysis. Horne (1994) has summarized

modern approaches to well test analysis-using computers.

This paper establishes a computer package application based on the previous conceptions, techniques and methods

Page 2: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

42

that are currently applied in well test analysis.

2. MATHEMATICAL MODEL

Based on hypotheses of dimensionless group, the basis flow equations through porous media, and well test

mathematical model conditions can be drawn as follows:

Flow control equation

D

D

D

D

DD

D

t

p

r

p

rr

p

12

2

(1)

The above diffusivity equation defines how an element of reservoir will react to a local pressure disturbance. To

completely define the problem, the following information needs to be defined:

Initial condition: 0)0,( DD rp (2)

Inner boundary condition:

Skin effect condition 1

DrD

DDwd

r

pSpp (3)

Inner boundary condition:

wellbore storage condition 1

1

DrD

DD

D

wDD

r

pr

dt

dpC (4)

Outer boundary condition: 0)],([lim

DDDr

trpD

(5)

3. PRESSURE AFFECTED BY AN OUTER BOUNDARY

The effect of outer boundary on characteristics of well testing type curve can be demonstrated by using the method

of Images and the principle of superposition.

Superposition of image wells:

The principle of superposition, applied in time to flow periods, can also be applied in space, in order to reproduce

the effects of nearby wells and/or boundaries, this principle is used in interference testing, and can also be used to

model sealing and constant pressure boundaries

The assumption is that the pressure responses at the flowing well, due to a nearby fault, and is physically equivalent

to the pressure that would be observed at the active well with the presence of a nearby producing well. This is the

„method of images, with a virtual image well replacing the fault and creating the same effect.

The dimensionless bottom hole pressure (pwD) for well testing of homogenous reservoir with outer boundary effect

can be expressed as follows:

wDbwDiwD ppp (6)

pwDi, dimensionless bottom hole pressure infinite homogenous reservoir

pwDb, dimensionless bottom hole pressure affected by outer boundary

The pwDb is dimensionless line source solution pressure of infinite homogenous reservoir, which is a function in the

principle of superposition.

The expression of dimensionless line source solution pressure of infinite homogenous reservoir given by follows:

)4

(2

1),(

2

D

DDDD

t

rEitrp (7)

Where (Ei) is a mathematical function known as Exponential Integral Function, for this reason the line source

solution sometimes is called the Exponential Integral solution.

The Ei (-x) is exponential integral function, can be expressed as: duu

exEi

x

u

)(

3.1 The Equations of Pressure Affected By An Outer Boundary

When more than one sealing boundary or constant pressure boundary is presented, the solution to pressure affected

by outer boundary pwDb can involve a large number (hundreds) of image wells, depending upon the geometry of the

system. This will lead to the generation of a flow of theoretical solution equations, and it can describe the geometry

of the system.

Here we are just to deal with the flow of equations that can be use to describe the most common geometrical system

of faults and constant pressure:

Page 3: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

43

3.1.1 Linear System

Linear sealing fault

D

DwDb

t

LEip

2

5.0w

Dr

LL (8)

Where: L the distance from well to boundary, (m) rw Wellbore radius, m

Linear constant pressure

D

DwDb

t

LEip

2

5.0w

Dr

LL (9)

3.1.2 Two - Perpendicular System

Perpendicular-sealing faults

D

DD

D

D

D

DwDb

t

LLEi

t

LEi

t

LEip

2

2

2

1

2

2

2

1

2

1 (10)

Perpendicular constant

pressures

D

DD

D

D

D

DwDb

t

LLEi

t

LEi

t

LEip

2

2

2

1

2

2

2

1

2

1 (11)

Perpendicular mixed boundaries

D

DD

D

D

D

DwDb

t

LLEi

t

LEi

t

LEip

2

2

2

1

2

2

2

1

2

1 (12)

3.1.3 Two – Parallel System

Parallel sealing

faults

1j

D

2

1D2D

D

2

2D1D

wDb

t

int(j/2)LL1)/2(jintEi

t

int(j/2)LL1)/2(jintEi

2

1p (13)

Parallel constant

pressures

1j

D

2

1D2D

D

2

2D1D

j

wDb

t

int(j/2)LL1)/2(jintEi

t

int(j/2)LL1)/2(jintEi

2

1p )1( (14)

Parallel mixed

boundaries

1j

D

2

1D2D

j

D

2

2D1D

j

wDb

t

int(j/2)LL1)/2(jintEi

t

int(j/2)LL1)/2(jintEi

2

1p

2

1

2

)1(

)1(

(15)

3.1.4 Intersecting System

Intersecting

faults

5

1

2

22

1

j D

j

wDbt

aEip (16)

Intersecting

constant

pressures

5

1

2

2)1(

2

1

j D

jj

wDbt

aEip (17)

Page 4: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

44

Intersecting

mixed

boundaries

5

1

2

1

2)1(

2

1

j D

jj

wDbt

aEip ,

2

2

2sin

)cos(1Dj L

ja

, j = 1,2,3,4,5 θ= 600 (18)

4. THE ANALYTICAL SOLUTION TO THE WELL TEST MODEL

Based on an analytical solution to the diffusivity equation, on which all methods for the analysis of data from well

testing are based. The concept of dimensionless parameters is used to generalize the solutions. The boundary

conditions are applied to obtain solutions applicable to well test pressure analysis. A brief discussion on the

application of Laplace transforms, and inverse Laplace transforms (Stehfest numerical inversion) will be presented

in obtaining a line source solution for infinite homogeneous reservoirs. Skin effect and storage effect are also

included as a condition applied to obtain solutions applicable to well test pressure analysis.

4.1 Laplace Transforms

The Laplace transform of a function (here the dimensionless pressure) is the convolution of this function with a

negative exponential function. The Laplace transform function represented by the same symbol of a dash"—"above

the function.

dttpup eut

0

___

)()( (19)

We will not go into details here, but we can present the result of applying this tool .The effect of applying the

Laplace transform to the terms of a partial differential equation is to convert the equation to ordinary differential

equation in which term (Laplace Space), Reasonable solution equations and mathematical derivation using Laplace

transformation was presented by Van Everdingen (1949).The main advantage of the Laplace transform is that it will

simplify the equation and that once the solution is found in Laplace space the reverse process is possible, either

analytically for simple solutions, or numerically using algorithms such as Stehfest(1990).

4.2 Modified Bessel Function

The modified Bessel functions K0(x), K1(x), I0(x) and I1(x), are generated as a result of the solution of the

mathematical model, and the calculations of these functions are based on the polynomial method of computing

Bessel functions, which is presented by Abramowitz(1970) and Stegum, Giovanni(1990)

4.3 Stehfest’s Numerical Inversion Method

The previous section introduced the application of Laplace transformation on solving the diffusivity equation.

Because the use of Laplace in this way is very complicated, and therefore, using any analytical methods to convert

Laplace space is even more complicated. Nowadays, in common use is a numerical empirical formula provided by

Stehfest (1970) and is used to transform the solution from “Laplace space” to “real space”. This method is

considered as a simple way among several applicable methods for transforming Laplace space” to “real space”.

The main formula is as follow:

)()()2ln(

)(1

~

sfiVt

tfN

i

(20)

Where )(tf

the transformed real space function ,)(

~

sf The function in Laplace space

)2/,min(

2/)1(

2/2/

)!2()!()!1()!1(!)!2/(

)!2()1()(

Ni

ik

NiN

ikkikkkkN

kkiV ,

tiS

)2ln( (21)

Where(S)is Laplace transform factor. (K,i,N ) an integers for summation

By using the main formula and giving values to t and i, the values of f (t) And Vi can be calculated. Therefore,

the value of the real space function f (t) can be solved out.

5. COMPUTER APPLICATIONS

This section describes and lists basic computer programs in visual basic language that solve the general behavior of

homogeneous affected by outer linear boundaries. The appropriate result to be obtained by this program that a

friendly user interfaces can be used to create a various type curves for the mathematical model and also can create

Page 5: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

45

the most common theoretical type curves used in well test interpretation. The programs provide appropriate

development of color visualizations for type curves that can be easily created and easily identified.

5.1 The Computer Program Calculation Procedures

According to an analytical expression of

___

wDpwhere obtained by using Laplace transform as a method of solution.

In general the solution in Laplace space involves the computation of the modified Bessel function (K0, K1) Second

kind as follows:

)}()]()([{

)()(

110

10___

uKuuKuSuKuCu

uKuSuKp

D

wD

(22)

}/()/(/{

)/(

01

0___

DDD

D

wDCuuKCuKCuu

CuKp

(23)

To obtain wDp as a function of Dt

, what we need to do is to invert wDp___

to real space. This can be done in several

ways. The simplest numerical method that is going to be used here is an algorithm for the approximate numerical

inversion of the Laplace transforming solution. The algorithm already discussed above, which has been presented by

Stehfest (1970) is coded as a function to find the inverse of Laplace space, see (Appendix B)

The program includes the calculation of the function pwD (tD) in two Public Functions, Pwds and PwdR. The

calculation procedure of these two functions achieves related to the above questions of Laplace space solution (22) -

(23) (see Appendix C). These two functions compute the Laplace transform inverse of)(

___

up wD .

These pressure functions make use of the functions BessI0, BessK0, BessI1, and BessK1, where they are called the

modified Bessel functions, and a simple algorithm is presented by Abramowitz(1970) and Stegum to evaluate this

modification, Giovanni (1990).The polynomial approximations for the modified Bessel functions can be used to

calculate the Bessel function, where it is coded as a functions (Appendix D) to be called for the solution of the

homogenous reservoir with the conditions of wellbore storage, skin effect and boundary effect, and bases on

applying of these conditions the calculation model yield either as families of type curves like Ramey, Gringarten,

Bourdet and combined type curves or as a single type curve. See the Figure (2) the program‟s reproduced type

curves. Note: The value of ( ) in modified Bessel function is too small, and so it can be neglected.

5.2 The Calculation Of Pressure Affected By Outer Boundary:

Basically, the input parameters to calculate Pwd and PwdR functions are also a function of which the inverse

transform is desired to be calculated. These functions are written as Pwds (cd, td, S, n), PwdR (cd, td, S, n) and

PwdK (cd, td, S, Boud, n) (see Appendix B), where PwdK is a function designed to compute the summation of both

dimensionless bottom hole pressure for infinite homogenous reservoir (pwDi) and dimensionless bottom hole

pressure affected by outer boundary ( pwDb ) as expressed in equation (24) and illustrated in the flow chart figure (1).

wDbwDiwD ppp (24)

(pwDb) Calculated as a function of dimensionless time, dimensionless distance Ld and Ei function, and all these

function are coded as Bou*(td, Ld). Note: as briefly summarizing the calculation the sign (*) that attached with

(Bou) function is indicated to the letter or number, which can describe the specific geometrical boundary condition

for all equations from (8) to (18), for example Bou1 (td, Ld) to describe the effect of linear constant pressure

boundary, Bou2c (td, Ld1, Ld2) to describe the effect of Two-Perpendicular sealing faults, etc. As example

(Appendix C) shows the calculation code of Bou, Bou1 functions, which are represent the closed and constant

pressure linear boundary respectively.

)4

(2

1),(

2

D

DDDD

t

rEitrp (25)

The calculation of (pwDb) is line source solutions, which make use of Ei (x) function; equation (25) represents the

exponential integral function. Therefore, the calculations involve the evaluation of Ei (x) function in all equations

that designed to evaluate the pressure affected by the geometrical condition of the reservoir boundary. These

equations illustrated before where numbered from (8) to (18).

Page 6: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

46

5.3 The Exponential Integral Function and Polynomial Approximations

The exponential integral function of order n, written as a function of a variable x, is defined as

dtetxEi xtn

n

1

)( : Let Ei1(x) be the Ein with n = 1: duu

edt

t

exEi

x

utx

n

1

)(

Then define the exponential integral Ei1(x) by: Ei1(x)=- Ei1(-x)

x

t

t

dtexEi )(

To evaluate Ei(x), the program utilizes Abramowitz(1970) and Stegun Rational Approximations that presented by

E.E.Allen for 0 < x < 1 and C.Hastings for 1< x < , the calculation of Ei (x) function coded in (Appendix A)

For 0 < x < 1 75

5

4

4

3

3

2

210 102)(:)(ln)( xxxaxaxaxaxaaxxEi

a0 = -0.57721566, a1= 0.99999193, a2= -0.024991055,

a3= 0.05519968, a4= -0.00976004, a5= 0.00107857.

For 1< x < ∞

)()(43

2

2

3

1

4

43

2

2

3

1

4

xbxbxbxbx

axaxaxaxxEixe x

a1= 8.5733287401, a2= 18.0590169730, a3=8.6347608925, a4= 0.2677737343 b1= 9.5733223454, b2= 25.6329561486, b3=21.0996530827, b4= 3.9584969228

5.4 Derivative Pressure Methods

The analysis of the differential of pressure, which has been introduced by D.Bourdet (1983)(1989), T.M.Whittle

in(1983), From a practical point of view, it was founded that a preferable way to plot the type curves as:

)/(,

DDD Ctp Versus )/( DD Ct , )2.141/()/(,,

qBkhptCtp DDD

5.5 Three Point’s Derivative Algorithm

The algorithm presented here is simple, and is best adapted to test interpretation needs. This differentiation

algorithm reproduces the type curve over the complete time interval better than others. It uses one point before and

one point after the point of interest, to calculate the corresponding derivatives, and places their weighted mean at the

point considered as derived in the below equation.

)/(])/()/[()/( 21122211 XXXXpXXpdXdp i

6. THE PROGRAM’S REPRODUCED TYPE CURVES

Type curves are reproduced as output of this program package, which derived from mathematical solutions to the

flow equations under specific geometrical boundaries conditions. For the sake of generality, type curves are usually

presented in dimensional less terms, here we deal with dimensionless pressure vs. a dimensionless time, a given

interpretation model yield either as a single type curve or one or more families of type curves like Ramey,

Gringarten, Bourdet and combined type curve. See the program‟s reproduced type curves diagram figure (2).

The program uses the same theoretical model as the pressure and derivative type curves of Gringarten and Bourdet

and combines them into a group set of type curves figure(3)as known by combined type curves.

6.1 Reproduced Single Type Curve

The appropriate calculations that are provided by the program, is that for each reservoir boundaries situation the

program has ability to establish multi type curve for a variety of well and reservoir parameters, based on the time

rate of change of dimensionless pressure for interpreting the homogenous behavior of well located in various

multiple-sealing-fault system combined with constant pressure boundary system. Figure (4) illustrates the program

user interface for establishing type curve for a variety of well and reservoir Parameters, the parameters including

skin factor, distances between well and outer boundary and wellbore radius were entered as input data in an input

dialog box, When the single type curve was established, the program simultaneously shows the shape of location in

distance (meter) of the well in the reservoir geometrical boundary system. See Figure (5).

7. CONCLUSION

This computer application can be considered as a technical guide to those who are interested in knowing the

Page 7: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

47

mathematical background of reproduce theoretical type curves, the program reflect the establishment of the most

important bases concepts for the analyzing well test software.

Several publications do not exclusively discuss the computation of the pressure response affected by outer boundary,

and the program addresses the investigation of the type curve based on source solution of pressure affected by the

outer boundary, and provides reasonable calculation for establishing theoretical type curves that can be easily used

in determining the distance between well and outer boundary.

Using VISUAL BASIC6 provides good capability in graphics and color visualization, which enables the best

presentation of the type curves, and can also be used for future development of the type curves matching process.

ACKNOWLEDGEMENTS

Authors would like to express sincere appreciation and gratitude to Professor, Liao Xin Wei, for his technical

support, and tutorship during the preparation of this paper. Extra special thanks must go to Professor, Sun Xudong

for his advice on reviewing the paper.

We would like also to express our deepest gratitude and appreciation to Sudan University of Science and

Technology and China University of Petroleum (Beijing), for their financial support.

Appendix (A)

******Stehfest (Laplace transforms numerical inversion method) ******

Public Function Li (ByVal k As Integer) As Double

Dim i As Integer

Li = 1

For i = 2 To k Step 1

Li = Li * i

Next i

End Function

Public Function Vi (ByVal i As Integer, ByVal n As Integer) As Double

Dim j, k, min As Integer

Dim M As Double j = Int ((i + 1) / 2)

M = 0

If i <= (n / 2) Then min = i Else min = (n / 2)

For k = j To min Step 1

Vi = (k ^ (n / 2) * Li (2 * k)) / (Li (n / 2 - k) * Li (k) * Li (k - 1) * Li (i - k) * Li (2 * k - i))

M = M + Vi

Next k

Vi = (-1) ^ (n / 2 + i) * M

End Function

****** (The calculations of Ei (x) function) ******

Public Function Ei (ByVal x As Double) As Double

Dim x2, x3, x4, x5 As Double

Dim MM, NN As Double

x2 = x * x, x3 = x2 * x, x4 = x3 * x, x5 = x4 * x

If x > 1# Then

MM = 0.2677737343 + 8.6347608925 * x + 18.059016973 * x2 + 8.5733287401 * x3 + x4

NN = 3.9584969228 + 21.0996530827 * x + 25.632956486 * x2 + 9.5733223454 * x3 + x4

Ei = Exp(-x) * MM / (x * NN)

Else

x = Abs(x)

Ei = -Log(x) - 0.57721566 + 0.99999193 * x - 0.24991055 * x2 + 0.05519968 * x3 - 0.00976003999 * x4 + 0.00107857 *

x5

End If

Ei = -Ei

End Function

Appendix (B)

****** (The Calculation of the Pressure drop for Homogeneous with skin equal zero) ******

Public Function Pwds (ByVal cd As Double, ByVal td As Double, ByVal S, ByVal n As Integer) As Double

Dim i As Integer, Dim a, R, M, Pwd1, Cd2s, u As Double, Pwds = 0

For i = 1 To n Step 1

Page 8: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

48

u = i * Log (2) / td

Cd2s = cd * Exp (2# * S)

If Cd2s >= 100 Then

a = Log10 (2# / (1.781 * Sqr(u / Cd2s)))

R = u * u + u / M = 1# / R

Pwds = M

Else

a = Sqr (u / Cd2s) R = a * BessK1 (a) / BessK0 (a) M = 1 / (u * R + u * u)

Pwds = M

End If

Pwds = Vi(i, n) * M + Pwds ' transform to real space

Next i

Pwds = (Log(2) / td) * Pwds „calculation of log

End Function

****** (The Calculation Of the Pressure drop for Homogeneous with skin) ******

Public Function PwdR( ByVal cd As Double, ByVal td As Double, ByVal S, ByVal n As Integer) As Double

Dim i As Integer, Dim p1, p2, u As Double, PwdR = 0

For i = 1 To n Step 1

u = i * Log(2) / td : 'The solution of homogeneous model in Laplace space

p1 = BessK0(Sqr(u)) + S * Sqr(u) * BessK1(Sqr(u))

p2 = u * Sqr(u) * BessK1(Sqr(u)) + cd * u ^ 2 * BessK0(Sqr(u)) + cd * u ^ 2 * S * BessK1(Sqr(u)) * Sqr(u)

PwdR = Vi(i, n) * (p1 / p2) + PwdR ' transform to real space

Next i

PwdR = (Log(2) / td) * PwdR „calculation of log

End Function

Appendix (C)

****** (The calculation code of the closed and constant pressure linear boundary functions) ******

Public Function Bou(ByVal td As Double, ByVal Ld As Double) As Double

'Closed linear Boundary

g = -(Ld ^ 2 / td)

Bou = -0.5 * Ei(g)

Bou = Bou

End Function

Public Function Bou1(ByVal td As Double, ByVal Ld As Double) As Double

'Constant Pressure linear Boundary

g = -(Ld ^ 2 / td)

Bou1 = 0.5 * Ei(g)

Bou1 = Bou1

End Function

Appendix (D)

****** (Modified Bessel function First Kind Zero Order (I0)) ******

Public Function BessI0 (ByVal x As Double) As Double

Dim ax, ax1, y, ans As Double

If Abs(x) < 3.75 Then

y = x * x / (3.75 * 3.75)

ans = 1# + y * (3.5156229 + y * (3.0899424 + y * (1.2067492 + y * (0.2659732 + y * (0.0360768 + y * 0.0045813)))))

Else

ax = Abs(x),ax1 = Exp (ax), y = 3.75 / ax

ans = (ax1 / Sqr(ax)) * (0.39894228 + y * (0.01328592 + y * (0.00225319 + y * ( -0.00157565 + y * (0.00916281 + y * (-

0.02057706 + y * (0.02635537 + y * (-0.01647633 + y * 0.00392377))))))))

End If

BessI0 = ans

End Function

****** (Modified Bessel function Second Kind Zero Order (K0)) ******

Page 9: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

49

Public Function BessK0 (ByVal x As Double) As Double

Dim ax, ax1 ,y, ans As Double

If x <= 2# Then , y = x * x / 4#

ans = (-Log(x / 2#) * BessI0(x)) + (-0.57721566 + y * (0.4227842 + y * (0.23069756 + y * (0.0348859 + y * (0.00262698 + y *

(0.0001075 + y * 0.0000074))))))

Else , y = 2# / x

ans = (Exp(-x) / Sqr(x)) * (1.25331414 + y * (-0.07832358 + y * (0.02189568 + y * (-0.01062446 + y * (0.00587872 + y * (-

0.0025154 + y * 0.00053208))))))

End If

BessK0 = ans

End Function

*****(Modified Bessel function First Kind First Order (I1))*****

Public Function BessI1 (ByVal x As Double) As Double

Dim ax, ax1 ,y, ans As Double

If Abs(x) < 3.75 Then y = x * x / (3.75 * 3.75)

ans = x * (0.5 + y * (0.87890594 + y * (0.51498869 + y * (0.15084934 + y * (0.02658733 + y * (0.00301532 + y *

0.00032411))))))

Else ax = Abs(x) , ax1 = Exp(ax) , y = 3.75 / ax

ans = 0.02282967 + y * (-0.02895312 + y * (0.01787654 - y * 0.00420059))

ans = 0.39894228 + y * (-0.03988024 + y * (-0.00362018 + y * (0.00163801 + y * (-0.01031555 + y * ans))))

ans = (ax1 / Sqr(ax)) * ans

End If

BessI1 = ans

End Function

******(Modified Bessel function Second Kind First Order (K1))******

Public Function BessK1(ByVal x As Double) As Double

Dim ax, ax1, y, ans As Double

If x <= 2# Then

y = x * x / 4#

ans = (Log(x / 2#) * BessI1(x)) + (1# / x) * (1# + y * (0.15443144 + y * (-0.672778579 + y * (-0.18156897 + y * (-0.01919402

+ y * (-0.00110404 + y * (-0.00004686)))))))

Else

y = 2# / x

ans = (Exp(-x) / Sqr(x)) * (1.25331414 + y * (0.23498619 + y * (-0.0365562 + y * (0.01504268 + y * (-0.00780353 + y *

(0.00325614 + y * (-0.00068245)))))))

End If

BessK1 = ans

End Function

Page 10: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

50

Figure (1) the main calculation steps flow chart

Figure (1) the main calculation steps flow chart

Calculation Pwd function In

Laplace space when S=0 or S≠0

Inverse Laplace space

Vi (i, n) & factorial Functions

Calculation of Modified Bessel Functions K0, I0, K1, I1

Calculation of Derivative

Cd, S, td, Ld, N

Ei function

Calculation PwdR function

summation Pwd+Boundary

Boundary

Effectt

No

Yes

Plot type Log-Log curve function

Td=t2

N = 8,10,12

No

Plotting type curves End

Derivative

Calculation Pwd for specific

situation with td= (t1, t2, t3)

Start

Bou (Ld, td)

While td < 10000000

Yes

Page 11: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

51

Figure (2) the program’s reproduced type curves

Figure (3) Homogeneous with skin and wellbore storage Combined type curves

Page 12: computer application on well test mathematical model computation

IJRRAS 11 (1) ● April 2012 Abass & Song ● Computer Application on Well Test Mathematical Model

52

Figure (4) the user input dialog box for a variety conditions of well and reservoir parameters

Figure (5) the distance between well and outer boundaryL1, L2 [by default set in (1000m)]

REFERENCES [1]. Abramowitz and Stegun, (November 1970) “Handbook of Mathematical Functions”, „with formula graphic and mathematical tables‟

National Bureau of Standards, pp. 231,378-379 [2]. A.F Van Everdingen (1949) “The application of the Laplace transformation to flow problems in reservoir” petroleum transactions, AIME,

pp. 305-324

[3]. D.Bourdet, T.M. Whittle (May 1983) “A new set of type curves simplifies well test analysis” - world oil, , pp. 95-106 [4]. D. Bourdet, Ayoub, and Pirard, Y.M. (June, 1989) “Use of pressure derivative in Well Test Interpretation.”SPEFE, pp. 293-302

[5]. Djebbar Tiab, Henry B.Crichlow. (Dec, 1979) “Pressure analysis of multiple-Sealing-Fault Systems and Bounded Reservoirs” SPE, pp.

378-392

[6]. E.A.Proano and I.J.Lilley (October 1986) “Derivative of pressure: Application to Bounded Reservoir Interpretation” SPE., pp. 137-143

[7]. Ehlig-Economides, C. (1988) “Use of the Pressure Derivative for Diagnosing Pressure-Transient Behavior” Schlumberger JPT, p. 1280 [8]. Giovanni Da. Prat (1990) “Well test analysis for fractured reservoir evaluation” by Elsevier Science Publishing, pp. 159-160& 162

[9]. Gringarten, A.C (March1986) “Computer-Aided Well Test Analysis” the SPE 14099, pp 373-392

[10]. I.M Buhidma, and W.C.Chu (October, 1992), “The Use of computer in Pressure Transient Analysis” SPE, pp.723-734 [11]. Pirard, Y.M.Bocock, (1986) “Pressure Derivative Enhances Use of Type Curves for the Analysis of Well Tests” Schlumberger, p.641

[12]. Roland N. Horne (July 1994) “Advances in computer - Aided Well test Interpretation” JPT, pp. 599-605

[13]. Stehfest, H (Jan. 1970) “Numerical Inversion of Laplace Transforms," Communication of the ACM” [14]. Taib, D.and Kamar. (October1980) “Detection and location of two parallel sealing Faults around a well” J.P.T. Techpp. 1701-1708