Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Well Test
Analysis
Final Project
23.05.2015
505132501
EMRE CENGZ
Sayfa 1 / 18
Eq. 1 in the question booklet inverted using Stehfest Algorithm and compared with the time domain
solution and it shows pretty good match. All these calculations can be found in both matlab codes
and excel calculations. Excel sheet and matlab codes provided as attachment.
9
8
7
PDFWS (RD=1)
PDFWS (RD=2)
PDFWS (RD=5)
PDFWS (RD=10)
PDFWS (RD=20)
pD
Inversion (RD=1)
3
Inversion (RD=2)
Inversion (RD=5)
Inversion (RD=10)
1
Inversion (RD=20)
0
0,E+00
2,E+06
4,E+06
6,E+06
8,E+06
1,E+07
1,E+07
tD
Delta pressure and pressure derivative calculations are done by using the pressure solution
hereafter, compared with Ecrin test design solution.
dp&dp', psi
1000
100
Ecrin DP
Ecrin DP'
Calc DP
10
Calc DP'
1
1,00E-03
1,00E-02
1,00E-01
1,00E+00
1,00E+01
time,hr
Figure 1:Calculated pressure and pressure derivative compared with test design data from ecrin. It shows pretty good
match for early and middle time. As the model does not have WBS and skin there is no 1 slope and hump appared in the
log log graph.
Sayfa 2 / 18
There are 6 different flow period in during the test and during 2 of them the well is shut in.
Therefore, the pressure change in the reservoir is calculated and compared with simulated synthetic
data with ecrin.
4550
Pressure, psi
4500
4450
4400
4350
Ecrin
4300
Calc
4250
4200
0
20
40
60
80
100
time, hr
Figure 2: Calculated pressure history during the test compared with simulated data with ecrin. Plots validate each other
for the all flow periods. There is tiny contention in the final flow period. It has been tried several times to fix this error.
However, MatLAB wins.
In the second step, WBS and Skin added to pressure model and compared with ecrin data then log
log derivative response are compared. First shut in period is calculated and evaluated in this
example.
1000
100
Ecrin Dp
Ecrin Dp'
10
Calc DP
Calc DP'
1
0,1
1,00E-03
1,00E-02
1,00E-01
1,00E+00
1,00E+01
Figure 3: Good match is observed with ecrin dp and calculated dp. Also, Caclulated ecrin delta pressure derivative and
calculated pressure derivative shows good match. As the model defines wellbore storage:0.015 bbl/psi and 2.5 skin
factor, there is hump and 1 slope is observer in the early time behaviour of the pressure derivative data.
Sayfa 3 / 18
Regarding the the pressure behaviour due to production, and shut in periods, simulated data from
ecrin and calculated data shows a good match during all flow periods except the latest one.
4550
4500
4450
4400
Ecrin
4350
Calc
4300
4250
4200
4150
0
20
40
60
80
100
120
Calculated pressure derivative analysis of the reservoir system with 0.015 bbl/psi WBS and 2.5 skin
and a fault located at 200 ft shows good match with the ecrin simulated data. The unconformity at
the late time region of the pressure derivative as a cause of miscalculated pressure data after 5
hours.
1000
DP and Dp'
100
Ecrin DP
10
Ecrin DP'
Calc. DP
Calc. DP'
0,1
1,00E-03
1,00E-02
1,00E-01
1,00E+00
1,00E+01
time, hr
For the last part of the problem a single sealing fault is located at the 200 ft away from the well.
Fairly good pressure match is observed with ecrin pressure history.
Sayfa 4 / 18
As we can see pressure history has a good work, however, like previous pressure histories last build
up data is problematic. Ecrin solution and calculated solution match at the end however during build
up period there is a small gap between them.
4550
4500
Pressure, psi
4450
4400
4350
Ecrin
4300
Calc
4250
4200
4150
0
20
40
60
80
100
120
time, hr
q(t)=500-180ln(t)
500
400
300
200
100
0
-100 0
20
40
60
-200
-300
-400
time, hr
80
100
120
4600
4700
Pressure, psi
Pressure, psi
Sayfa 5 / 18
Ecrin
Pressure
History
4500
4400
Calc.
Pressure
History
4300
4200
0
50
4600
Ecrin
Pressure
History
4500
4400
Calc.
Pressure
History
4300
4200
0
100
50
100
time, hr
time, hr
4800
Pressure, Psi
4700
4600
4500
4400
Calc.Pressure History
4300
4200
0
NOWBS NO SKIN
20
40
60
80
100
120
time,hr
550
500
450
400
350
0
20
40
60
time, hr
Figure 4: Production rate is 500STB/D during 100 hours test for all 3 cases.
80
100
Sayfa 6 / 18
1. A well with NO WBS and NO Skin
1.000
100
Pressure, psi
Ecrin pD
Ecrin pD'
Calc. pD
10
Calc. pD'
1,00E-03
1,00E-02
1
1,00E+00
1,00E-01
1,00E+01
1,00E+02
time, hr
Figure 5: Ecrin pD and pD' shows a good match with the calculated pD and pD'.
4550
Pressure,psi
4500
4450
4400
4350
4300
4250
0
20
40
60
80
time, hr
Figure 6: Pressure history is some how problematic for all cases especially in the late time region.
100
120
Sayfa 7 / 18
2. A well with C:0.015bbl/psi, and S=2,5
1000
Pressure, psi
100
Ecrin dP
Ecrin dP'
Calc. dP
10
1,00E-03
1,00E-02
Calc. dP'
1
1,00E+00
1,00E-01
1,00E+01
1,00E+02
time, hr
4550
4500
Pressure, psi
4450
4400
4350
4300
4250
4200
4150
0
20
40
60
time, hr
80
100
120
Sayfa 8 / 18
3.WBS=0.015, S=2,5 a fault located at 200 ft away.
1000
Pressure, psi
100
Ecrin dP
Ecrin dP'
Calc. dP
10
1,00E-03
1,00E-02
Calc dP''
1
1,00E+00
1,00E-01
1,00E+01
1,00E+02
time,hr
4550
4500
Pressure, psi
4450
4400
4350
4300
4250
4200
4150
0
20
40
60
time, hr
80
100
120
Sayfa 9 / 18
APPENDIX
Excel files and MatLAB codes will be provided by mail. Also, MatLab code can be found as follows.
Code used in Excel File to get inverted PD from laplace domain by using stehfest.
Function fact(n As Double) As Double
fact = 1
For t = 1 To n
fact = fact * t
Next t
End Function
Function v(i As Double, n As Double) As Double
Dim g As Double
Dim k As Double
Dim h As Double
Dim start1 As Integer
Dim finish As Integer
g=0
k=0
h=0
If i > (n / 2) Then
finish = (n / 2)
Else
finish = i
End If
If ((i + 1) Mod 2) = 0 Then
start1 = (i + 1) / 2
Else
start1 = (i / 2)
End If
h = (-1) ^ ((n / 2) + i)
For k = start1 To finish
up = 0
down = 0
up = (k ^ (n / 2)) * fact(2 * k)
Sayfa 10 / 18
down = fact((n / 2) - k) * fact(k) * fact(k - 1) * fact(i - k) * fact((2 * k) - i)
g = g + (up / down)
Next k
v=h*g
End Function
Matlab Script
%% Inputs
Pi=4500;
Bo=1.2;
h=50;
rw=0.3;
ct=0.00001;
viscosity=2.3;
porosity=0.18;
k=150;
qs=500;
skin=2.5;
wbs=0.015;
cd=5.615*wbs/(2*pi*porosity*ct*h*rw^2);
t=[logspace(3,1,100),mylog(10.001,15,100),mylog(15.001,25,1000),mylog(25.001,40,100),my
log(40.001,50,100),mylog(50.001,100,100)]; t=t'; tt=numel(t);
a=[1 100 200 1200 1300 1400 1500];
td=(0.000264*k*t)/(porosity*ct*viscosity*rw^2); %dimensionless time
rd=[1 2 5 10 20 50 100]; rr=numel(rd); %dimensionless radius
pdfws=zeros(tt,rr); pdsth=zeros(tt,rr); pdsths=zeros(tt,rr);
dp1=zeros(tt,rr); dp2=zeros(tt,rr); dp3=zeros(tt,rr); dp12=zeros(tt,rr);
dp22=zeros(tt,rr);
q=zeros(tt,1);
q(1:a(2))=500;
q((a(2)+1):a(3))=300;
q((a(3)+1):a(4))=0;
q((a(4)+1):a(5))=200;
q((a(5)+1):a(6))=600;
q((a(6)+1):a(7))=0;
q2=2583.3-180*log(td);
% q1, q2 and qs are flowrate functions
% dp1: pressure difference with no wellbore storage & skin in q1 function
% dp2: pressure difference with wellbore storage & skin in q1 function
% dp3: pressure difference with wellbore storage & skin & 200ft fault in q1
function
% dp501: pressure difference with no wellbore storage & skin in 500 stb/day
% dp502: pressure difference with wellbore storage & skin in 500 stb/day
% dp503: pressure difference with wellbore storage & skin & 200ft fault in
500 stb/day
% pdsth: dimensionless pressure function with no wellbore storage & skin
% pdsths: dimensionless pressure function with wellbore storage & skin
% pdfws: dimensionless pressure function of finite wellbore solution in
time domain with no wellbore storage and skin
Sayfa 11 / 18
% dp12: pressure difference with no wellbore storage & skin in q2 function
% dp22: pressure difference with wellbore storage & skin in q2 function
%% Calculation
for i=1:rr
for j=1:tt
if j>=1 && j<=a(2)
pdsth(j,i)=Stehfest(td(j),rd(i),8);
pdsths(j,i)=Stehfest2(td(j),rd(i),8);
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*(pdsth(j,i)*q(j));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*(pdsths(j,i)*q(j));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((pdsths(j,i)*q(j))+(Stehfest(td(j),(
4000/3),8)*q(j)));
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*(pdsth(j,i)*q2(j));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*(pdsths(j,i)*q2(j));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((pdsths(j,i)*q2(j))+(Stehfest(td(j)
,(4000/3),8)*q2(j)));
else if j>=a(2)+1 && j<=a(3)
pdsth(j,i)=Stehfest((td(j)-td(a(2))),rd(i),8);
pdsths(j,i)=Stehfest2((td(j)-td(a(2))),rd(i),8);
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q(a(2)))+(p
dsth(j,i)*(q(j)-q(a(2)))));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
pdsths(j,i)*(q(j)-q(a(2)))));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest(td(j),(4000/3),8)*q(a(2)))+(pdsths(j,i)*(q(j)q(a(2))))+(Stehfest((td(j)-td(a(2))),(4000/3),8)*(q(j)-q(a(2)))));
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q2(a(2)))+
(pdsth(j,i)*(q2(j)-q2(a(2)))));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(pdsths(j,i)*(q2(j)-q2(a(2)))));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest(td(j),(4000/3),8)*q2(a(2)))+(pdsths(j,i)*(q2(j)q2(a(2))))+(Stehfest((td(j)-td(a(2))),(4000/3),8)*(q2(j)-q2(a(2)))));
else if j>=a(3)+1 && j<=a(4)
pdsth(j,i)=Stehfest((td(j)-td(a(3))),rd(i),8);
pdsths(j,i)=Stehfest2((td(j)-td(a(3))),rd(i),8);
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q(a(2)))+(S
tehfest((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+(pdsth(j,i)*(q(j)q(a(3)))));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest2((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+(pdsths(j,i)*(q(j)q(a(3)))));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest(td(j),(4000/3),8)*q(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+...
Sayfa 12 / 18
(Stehfest((td(j)-td(a(2))),(4000/3),8)*(q(a(3))q(a(2))))+(pdsths(j,i)*(q(j)-q(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q(j)-q(a(3)))));
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q2(a(2)))+
(Stehfest((td(j)-td(a(2))),rd(i),8)*(q2(a(3))q2(a(2))))+(pdsth(j,i)*(q2(j)-q2(a(3)))));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest2((td(j)-td(a(2))),rd(i),8)*(q2(a(3))q2(a(2))))+(pdsths(j,i)*(q2(j)-q2(a(3)))));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest(td(j),(4000/3),8)*q2(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest((td(j)-td(a(2))),(4000/3),8)*(q2(a(3))q2(a(2))))+(pdsths(j,i)*(q2(j)-q2(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q2(j)-q2(a(3)))));
else if j>=a(4)+1 && j<=a(5)
pdsth(j,i)=Stehfest((td(j)-td(a(4))),rd(i),8);
pdsths(j,i)=Stehfest2((td(j)-td(a(4))),rd(i),8);
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q(a(2)))+(S
tehfest((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+...
(Stehfest((td(j)-td(a(3))),rd(i),8)*(q(a(4))q(a(3))))+(pdsth(j,i)*(q(j)-q(a(4)))));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest2((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+...
(Stehfest2((td(j)-td(a(3))),rd(i),8)*(q(a(4))q(a(3))))+(pdsths(j,i)*(q(j)-q(a(4)))));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest(td(j),(4000/3),8)*q(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+...
(Stehfest((td(j)td(a(2))),(4000/3),8)*(q(a(3))-q(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q(a(4))-q(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q(a(4))-q(a(3))))+...
(pdsths(j,i)*(q(j)-q(a(4))))+(Stehfest((td(j)td(a(4))),(4000/3),8)*(q(j)-q(a(4)))));
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q2(a(2)))+
(Stehfest((td(j)-td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest((td(j)-td(a(3))),rd(i),8)*(q2(a(4))q2(a(3))))+(pdsth(j,i)*(q2(j)-q2(a(4)))));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest2((td(j)-td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest2((td(j)-td(a(3))),rd(i),8)*(q2(a(4))q2(a(3))))+(pdsths(j,i)*(q2(j)-q2(a(4)))));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest(td(j),(4000/3),8)*q2(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest((td(j)td(a(2))),(4000/3),8)*(q2(a(3))-q2(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q2(a(4))-q2(a(3))))+...
(pdsths(j,i)*(q2(j)q2(a(4))))+(Stehfest((td(j)-td(a(4))),(4000/3),8)*(q2(j)-q2(a(4)))));
Sayfa 13 / 18
else if j>=a(5)+1 && j<=a(6)
pdsth(j,i)=Stehfest((td(j)-td(a(5))),rd(i),8);
pdsths(j,i)=Stehfest2((td(j)td(a(5))),rd(i),8);
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q(a(2)))+(S
tehfest((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+(Stehfest((td(j)td(a(3))),rd(i),8)*(q(a(4))-q(a(3))))+...
(Stehfest((td(j)td(a(4))),rd(i),8)*(q(a(5))-q(a(4))))+(pdsth(j,i)*(q(j)-q(a(5)))));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest2((td(j)-td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q(a(4))-q(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q(a(5))-q(a(4))))+(pdsths(j,i)*(q(j)-q(a(5)))));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(2)))+(
Stehfest(td(j),(4000/3),8)*q(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q(a(3))-q(a(2))))+...
(Stehfest((td(j)td(a(2))),(4000/3),8)*(q(a(3))-q(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q(a(4))-q(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q(a(4))-q(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q(a(5))-q(a(4))))+(Stehfest((td(j)td(a(4))),(4000/3),8)*(q(a(5))-q(a(4))))+(pdsths(j,i)*(q(j)-q(a(5))))+...
(Stehfest((td(j)td(a(5))),(4000/3),8)*(q(j)-q(a(5)))));
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q2(a(2)))+
(Stehfest((td(j)-td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+(Stehfest((td(j)td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(pdsth(j,i)*(q2(j)-q2(a(5)))));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest2((td(j)-td(a(2))),rd(i),8)*(q2(a(3))q2(a(2))))+(Stehfest2((td(j)-td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(pdsths(j,i)*(q2(j)-q2(a(5)))));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest(td(j),(4000/3),8)*q2(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest((td(j)td(a(2))),(4000/3),8)*(q2(a(3))-q2(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(Stehfest((td(j)td(a(4))),(4000/3),8)*(q2(a(5))-q2(a(4))))+(pdsths(j,i)*(q2(j)q2(a(5))))+...
(Stehfest((td(j)td(a(5))),(4000/3),8)*(q2(j)-q2(a(5)))));
else if j>=a(6)+1 && j<=a(7)
pdsth(j,i)=Stehfest((td(j)td(a(6))),rd(i),8);
pdsths(j,i)=Stehfest2((td(j)td(a(6))),rd(i),8);
Sayfa 14 / 18
dp12(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q2(a(2)))+
(Stehfest((td(j)-td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+(Stehfest((td(j)td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(Stehfest((td(j)td(a(5))),rd(i),8)*(q2(a(6))-q2(a(5))))+(pdsth(j,i)*(q2(j)-q2(a(5)))));
dp22(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest2((td(j)-td(a(2))),rd(i),8)*(q2(a(3))q2(a(2))))+(Stehfest2((td(j)-td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(Stehfest2((td(j)td(a(5))),rd(i),8)*(q2(a(6))-q2(a(5))))+(pdsths(j,i)*(q2(j)-q2(a(5)))));
dp3f(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q2(a(2)))
+(Stehfest(td(j),(4000/3),8)*q2(a(2)))+(Stehfest2((td(j)td(a(2))),rd(i),8)*(q2(a(3))-q2(a(2))))+...
(Stehfest((td(j)td(a(2))),(4000/3),8)*(q2(a(3))-q2(a(2))))+(Stehfest2((td(j)td(a(3))),rd(i),8)*(q2(a(4))-q2(a(3))))+(Stehfest((td(j)td(a(3))),(4000/3),8)*(q2(a(4))-q2(a(3))))+...
(Stehfest2((td(j)td(a(4))),rd(i),8)*(q2(a(5))-q2(a(4))))+(Stehfest((td(j)td(a(4))),(4000/3),8)*(q2(a(5))-q2(a(4))))+(Stehfest2((td(j)td(a(5))),rd(i),8)*(q2(a(6))-q2(a(5))))+...
(Stehfest((td(j)td(a(5))),(4000/3),8)*(q2(a(6))-q2(a(5))))+(pdsths(j,i)*(q2(j)q2(a(6))))+(Stehfest((td(j)-td(a(6))),(4000/3),8)*(q2(j)-q2(a(6)))));
dp1(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest(td(j),rd(i),8)*q(a(5)))+(S
tehfest((td(j)-td(a(6))),rd(i),8)*-q(a(5))));
dp2(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(5)))+(
Stehfest2((td(j)-td(a(6))),rd(i),8)*-q(a(5))));
dp3(j,i)=((141.2*Bo*viscosity)/(k*h))*((Stehfest2(td(j),rd(i),8)*q(a(5)))+(
Stehfest(td(j),(4000/3),8)*q(a(5)))+(Stehfest2((td(j)-td(a(6))),rd(i),8)*q(a(5)))+...
(Stehfest((td(j)td(a(6))),(4000/3),8)*-q(a(5))));
end
end
end
end
end
end
end
end
for i=1:rr
for j=1:tt
dp501(j,i)=((141.2*Bo*viscosity)/(k*h))*(Stehfest(td(j),rd(i),8)*qs);
dp502(j,i)=((141.2*Bo*viscosity)/(k*h))*(Stehfest2(td(j),rd(i),8)*qs);
dp503(j,i)=((141.2*Bo*viscosity)/(k*h))*(Stehfest2(td(j),rd(i),8)*qs+Stehfe
st(td(j),(4000/3),8)*qs);
end
end
Sayfa 15 / 18
Sayfa 16 / 18
for i=a(3):a(4)
ss=ss+1;
DP31(ss)=dp1(i)-dp1(a(3));
DP32(ss)=dp2(i)-dp2(a(3));
DP33(ss)=dp3(i)-dp3(a(3));
dte3(ss)=t(i)-t(a(3));
end
for ss=2:(a(4)-a(3))
DDP31(ss-1)=(DP31(ss+1)-DP31(ss-1))/(log(dte3(ss+1)/dte3(ss-1)));
DDP32(ss-1)=(DP32(ss+1)-DP32(ss-1))/(log(dte3(ss+1)/dte3(ss-1)));
DDP33(ss-1)=(DP33(ss+1)-DP33(ss-1))/(log(dte3(ss+1)/dte3(ss-1)));
end
dte(1)=[]; dte(end)=[]; dte3(1)=[]; dte3(end)=[]; DP1(1)=[]; DP1(end)=[];
DP2(1)=[]; DP2(end)=[]; DP3(1)=[]; DP3(end)=[]; DP31(1)=[]; DP31(end)=[];
DP32(1)=[]; DP32(end)=[]; DP33(1)=[]; DP33(end)=[]; DP501(1)=[];
DP501(end)=[]; DP502(1)=[]; DP502(end)=[]; DP503(1)=[]; DP503(end)=[];
dt(1)=[]; dt(end)=[];
figure=loglog(dte,DP1,dte,DDP1);
figure=loglog(dte,DP2,dte,DDP2);
figure=loglog(dte,DP3,dte,DDP3);
figure=loglog(dte3,DP31,dte3,DDP31);
figure=loglog(dte3,DP32,dte3,DDP32);
figure=loglog(dte3,DP33,dte3,DDP33);
figure=loglog(dt,DP501,dt,DDP501);
figure=loglog(dt,DP502,dt,DDP502);
figure=loglog(dt,DP503,dt,DDP503);
% Comparison of PDSTH (Stehfest Inversion Algorithm) and PDFWS (Finite
wellbore solution in time domain)
% for i=1:rr
%
for j=1:tt
%
pdfws(j,i)=(2/pi)*integral(@(u)
(((bessely(0,rd(i)*u).*besselj(1,u)besselj(0,rd(i)*u).*bessely(1,u))/(besselj(1,u).^2+bessely(1,u).^2))*((1exp(-td(j)*u.^2))/u.^2)),0,10^3,'ArrayValued',true);
%
pdsth(j,i)=Stehfest(td(j),rd(i),8);
%
end
% end
Stehfest2 Function.
function [InverseLT]=Stehfest2(t,rd,L)
a=L/2;
b=a+1;
fh=@pdlss;
for n=1:L
z=0.0;
for k=floor((n+1)/2):min(n,a)
z=z+((k^a)*factorial(2*k))/ ...
(factorial(a-k)*factorial(k)*factorial(k-1)* ...
factorial(n-k)*factorial(2*k-n));
end
v(n)=(-1)^(n+a)*z;
end
Sayfa 17 / 18
sum=0.0;
ln2ot=log(2.0)/t;
for n=1:L
p=n*ln2ot;
sum=sum+v(n)*fh(p,rd);
end
InverseLT=sum*ln2ot;
Stehfest Function
function [InverseLT]=Stehfest(t,rd,L)
a=L/2;
b=a+1;
fh=@pdls;
for n=1:L
z=0.0;
for k=floor((n+1)/2):min(n,a)
z=z+((k^a)*factorial(2*k))/ ...
(factorial(a-k)*factorial(k)*factorial(k-1)* ...
factorial(n-k)*factorial(2*k-n));
end
v(n)=(-1)^(n+a)*z;
end
sum=0.0;
ln2ot=log(2.0)/t;
for n=1:L
p=n*ln2ot;
sum=sum+v(n)*fh(p,rd);
end
InverseLT=sum*ln2ot;
pdls function
function f=pdls(s,rd)
f=(besselk(0,rd*sqrt(s))/((s^1.5)*besselk(1,sqrt(s))));
end
pdlss function
function f=pdlss(s,rd)
skin=2.5;
cd=1654.9;
%
f=1/(s*(s*cd+(1/(skin+(besselk(0,rd*sqrt(s))/(sqrt(s)*besselk(1,sqrt(s)))))
)));
f=(1/s)*((skin+s*(besselk(0,rd*sqrt(s))/((s^1.5)*besselk(1,sqrt(s)))))/(1+s
*cd*(skin+s*(besselk(0,rd*sqrt(s))/((s^1.5)*besselk(1,sqrt(s)))))));
end
Sayfa 18 / 18
mylog function
function y = mylog(d1, d2, n)
if nargin == 2
n = 50;
end
if d2 == pi || d2 == single(pi)
d2 = log10(d2);
end
y = 10.^ linspace(log10(d1), log10(d2), n);
end