drill bit optimization code

6
7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\tribology\dr...\code11.m 1 of 6 % Drill Bit Optimization Algorithm Version 1.0 % close all clear clc %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Developed by Ankit Kukreja ([email protected]) % on June 26th, 2012 % % Step 1: Calculation of % a) Pressure gradient in pipe % b) Pressure gradient in annulus % c) Pressure loss at drill bit % Step 2: Drill Bit Optimization %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% Step 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % d=2.25; % Pipe ID (inch) d1=4; % Pipe OD (inch) d2=6.25; % Casing ID (inch) rho=9; % Fluid density (ppg) L= 10000; % Depth of well (ft) theta600=60.8; % Fann dial reading at 600 rpm theta300=37.4; % Fann dial reading at 300 rpm Cd=0.9697; % Discharge coefficient at nozzle Nsize=12; % Current nozzle size Nno=3; % Number of Nozzles currently in use qmin = 125; % Minimum flow rate (gpm) % Pump parameters Ppmax=3000; % Maximum achievable pump pressure PHP=1250; % Pump rating (Horsepower) e=0.91; % Pump efficiency % Enter the choice of criterion to choose % 1 - Maximum Jet impact force % 2 - Maximum drill bit hydraulic horsepower % 3 - Maximum jet velocity choice=2; % % Step 1 calculations % Flow behaviour parameter, n (dimensionless) n=3.32*log10(theta600/theta300) % Flow behaviour parameter, K (lbf/100 ft^2) K=510*theta300/(511^n) % Effective area through nozzle Aeff=(pi/4)*Nno*((Nsize/32)^2) % Maximum possible flow (gpm) qmax=1714*PHP*e/Ppmax % Selection of two flow rates q1=qmax/3 % Flow rate 1 (gpm) q2=2*qmax/3 % Flow rate 2 (gpm) % q1=350; % Flow rate 1 (gpm) % q2=550; % Flow rate 2 (gpm)

Upload: ankit-kukreja

Post on 14-Apr-2017

208 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 1 of 6

% Drill Bit Optimization Algorithm Version 1.0%close allclear clc%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Developed by Ankit Kukreja (ankit.kukreja.89@gmai l.com)% on June 26th, 2012%% Step 1: Calculation of % a) Pressure gradient in pipe% b) Pressure gradient in annulus% c) Pressure loss at drill bit% Step 2: Drill Bit Optimization%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Step 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%d=2.25; % Pipe ID (inch)d1=4; % Pipe OD (inch)d2=6.25; % Casing ID (inch)rho=9; % Fluid density (ppg)L= 10000; % Depth of well (ft)theta600=60.8; % Fann dial reading at 600 rpmtheta300=37.4; % Fann dial reading at 300 rpmCd=0.9697; % Discharge coefficient at nozzleNsize=12; % Current nozzle sizeNno=3; % Number of Nozzles currently in useqmin = 125; % Minimum flow rate (gpm)% Pump parametersPpmax=3000; % Maximum achievable pump pressurePHP=1250; % Pump rating (Horsepower)e=0.91; % Pump efficiency % Enter the choice of criterion to choose% 1 - Maximum Jet impact force% 2 - Maximum drill bit hydraulic horsepower% 3 - Maximum jet velocitychoice=2;% % Step 1 calculations% Flow behaviour parameter, n (dimensionless)n=3.32*log10(theta600/theta300)% Flow behaviour parameter, K (lbf/100 ft^2)K=510*theta300/(511^n)% Effective area through nozzleAeff=(pi/4)*Nno*((Nsize/32)^2)% Maximum possible flow (gpm)qmax=1714*PHP*e/Ppmax% Selection of two flow ratesq1=qmax/3 % Flow rate 1 (gpm)q2=2*qmax/3 % Flow rate 2 (gpm)% q1=350; % Flow rate 1 (gpm)% q2=550; % Flow rate 2 (gpm)

Page 2: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 2 of 6

%%% Calculation of pump pressure corresponding to flo w rate q1 % Average velocity of pipe, vbar_pipe (ft/sec)vbar_pipe1=q1/(2.448*(d^2))% Average velocity of annulus, vbar_ann (ft/sec)vbar_ann1=q1/(2.448*((d2^2)-(d1^2)));% Turbulence criteria of pipe, NRe_pipeNRe_pipe1=(89100*rho*(vbar_pipe1^(2-n))/K)*((0.0416 *d/(3+(1/n)))^n);% Turbulence criteria of annulus, NRe_annNRe_ann1=(109000*rho*(vbar_ann1^(2-n))/K)*((0.0208* (d2-d1)/(2+(1/n)))^n);% Define critical Reynold number, ReCif n<=1 && n>=0.5 ReC1=2000;else if n<0.5 && n>=0.2 log_ReC1=((0.5-n)*(log10(2.1))/0.3)+log10(2 000); ReC1=10^(log_ReC1); endendif NRe_pipe1<ReC1% If flow is laminar, frictional pressure loss grad ient of pipeLam_Pgrad_pipe1=K*(vbar_pipe1^n)*(((3+(1/n))/0.0416 )^n)/(144000*(d^(1+n)))% Pump pressure, PpdeltaPp1 = L*Lam_Pgrad_pipe1endif NRe_ann1<ReC1% If flow is laminar, frictional pressure loss grad ient of annulusLam_Pgrad_ann1=K*(vbar_ann1^n)*(((2+(1/n))/0.0208)^ n)/(144000*((d2-d1) ... ^(1+n)))end% Calculation of friction factor of pipe, f_pipef_pipe1 = fsolve(@(f_pipe1)(sqrt(1/f_pipe1))-((4/(n ^0.75))*log10 ... (NRe_pipe1*(f_pipe1^(1-(n/2)))))+(0.395/(n^1.2) ),1)% Calculation of friction factor of annulus, f_annf_ann1 = fsolve(@(f_ann1)(sqrt(1/f_ann1))-((4/(n^0. 75))*log10 ... (NRe_ann1*(f_ann1^(1-(n/2)))))+(0.395/(n^1.2)), 1)if NRe_pipe1>=ReC1% If flow is turbulent, frictional pressure loss gr adient of pipeTur_Pgrad_pipe1=(f_pipe1*rho*(vbar_pipe1^2))/(25.8* d)% Pump pressure, PpdeltaPp1 = L*Tur_Pgrad_pipe1endif NRe_ann1>=ReC1% If flow is turbulent, frictional pressure loss gr adient of annulusTur_Pgrad_ann1=(f_ann1*rho*(vbar_ann1^2))/(21.1*(d2 -d1))end% Pressure loss at bit, deltaPbdeltaPb1=8.311*(10^(-5))*rho*(q1^2)/((Cd^2)*(Aeff^2 ))%%%% Calculation of pump pressure corresponding to flo w rate q2 % Average velocity of pipe, vbar_pipe (ft/sec)vbar_pipe2=q2/(2.448*(d^2))

Page 3: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 3 of 6

% Average velocity of annulus, vbar_ann (ft/sec)vbar_ann2=q2/(2.448*((d2^2)-(d1^2)))% Turbulence criteria of pipe, NRe_pipeNRe_pipe2=(89100*rho*(vbar_pipe2^(2-n))/K)*((0.0416 *d/(3+(1/n)))^n)% Turbulence criteria of annulus, NRe_annNRe_ann2=(109000*rho*(vbar_ann2^(2-n))/K)*((0.0208* (d2-d1)/(2+(1/n)))^n)% Define critical Reynold number, ReCif n<=1 && n>=0.5 ReC2=2000;else if n<0.5 && n>=0.2 log_ReC2=((0.5-n)*(log10(2.1))/0.3)+log10(2 000); ReC2=10^(log_ReC2); endendif NRe_pipe2<ReC2% If flow is laminar, frictional pressure loss grad ient of pipeLam_Pgrad_pipe2=K*(vbar_pipe2^n)*(((3+(1/n))/0.0416 )^n)/(144000*(d^(1+n)))% Pump pressure, PpdeltaPp2 = L*Lam_Pgrad_pipe2endif NRe_ann2<ReC2% If flow is laminar, frictional pressure loss grad ient of annulusLam_Pgrad_ann2=K*(vbar_ann2^n)*(((2+(1/n))/0.0208)^ n)/(144000* ... ((d2-d1)^(1+n)))end% Calculation of friction factor of pipe, f_pipef_pipe2 = fsolve(@(f_pipe2)(sqrt(1/f_pipe2))-((4/(n ^0.75))* ... log10(NRe_pipe2*(f_pipe2^(1-(n/2)))))+(0.395/(n ^1.2)),1)% Calculation of friction factor of annulus, f_annf_ann2 = fsolve(@(f_ann2)(sqrt(1/f_ann2))-((4/(n^0. 75))* ... log10(NRe_ann2*(f_ann2^(1-(n/2)))))+(0.395/(n^1 .2)),1)if NRe_pipe2>=ReC2% If flow is turbulent, frictional pressure loss gr adient of pipeTur_Pgrad_pipe2=(f_pipe2*rho*(vbar_pipe2^2))/(25.8* d)% Pump pressure, PpdeltaPp2 = L*Tur_Pgrad_pipe2endif NRe_ann2>=ReC2% If flow is turbulent, frictional pressure loss gr adient of annulusTur_Pgrad_ann2=(f_ann2*rho*(vbar_ann2^2))/(21.1*(d2 -d1))end% Pressure loss at bit, deltaPbdeltaPb2=8.311*(10^(-5))*rho*(q2^2)/((Cd^2)*(Aeff^2 ))%%%% Parasitic pressure lossdeltaPd1=deltaPp1-deltaPb1 % Corresponding to flow rate q1deltaPd2=deltaPp2-deltaPb2 % Corresponding to flow rate q2% Slope of analysis plotm=(log10(deltaPd2/deltaPd1))/(log10(q2/q1)) %%%%%%%%%%%%%%%%% Path of optimum hydraulics %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%if choice==1 % For max jet impact force

Page 4: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 4 of 6

deltaPd_choice=(2/(m+2))*Ppmaxendif choice==2 % For max bit hydraulic horsepower deltaPd_choice=(1/(m+1))*Ppmaxendif choice==3 % For max jet velocity deltaPd_choice=100end% Path definitionfor qline=50:0.1:qmax deltaPdline=10^(log10(deltaPd1)+m*log10(qline/q 1)); plot(log10(qline),log10(deltaPdline)) hold on if deltaPdline<=deltaPd_choice plot(log10(qmax),log10(deltaPdline), 'r' ) hold on end if deltaPdline>=deltaPd_choice plot(log10(qmin),log10(deltaPdline), 'r' ) hold on end if qline<=qmax && qline>=qmin plot(log10(qline),log10(deltaPd_choice), 'r' ) hold on end plot(log10(qmin+1),log10(deltaPdline), 'g' ) hold on for i=log10(100):0.1:log10(deltaPd_choice) if log10(deltaPdline)<=log10(i+1) && log10(deltaPdlin e) ... >=log10(i-1) && log10(qline)<=log10 (qmax+1) && ... log10(qline)>=log10(qmax-1) deltaPdopt=i; qopt=qline; end end if log10(deltaPdline)<=log10(deltaPd_choice+1) && ... log10(deltaPdline)>=log10(deltaPd_choic e-1) && ... log10(qline)<log10(qmax) && log10(qline )>log10(qmin) deltaPdopt=deltaPd_choice; qopt=qline; end for k=log10(deltaPd_choice+1):0.1:log10(Ppmax) if log10(deltaPdline)<=k+1 && log10(deltaPdline)>=k-1 && ... log10(qline)<=log10(qmin+1) && log1 0(qline)>=log10(qmin-1) deltaPdopt=k; qopt=qline; end endendxlabel( 'Flow Rate (gpm)' )ylabel( 'Parasitic Pressure Loss(psi)' )grid ontitle( 'Well dynamics (in blue) and optimum hydraulic path (in red and green)' )

Page 5: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 5 of 6

%%% Calculation of pump pressure corresponding to flo w rate qopt % % Average velocity of pipe(surge taken into accou nt), vbar_pipe (ft/sec)% vbar_fluidpipeopt=qopt/(2.448*(d^2));% vp=1;% vabaro=vp*((3*(d^4)-(4*(d1^2)*((d2-d1)^2))))/((-6 *(d^4))-(4*((d2-d1)^2)*((d2^2)-(d1^2))));% vbar_pipeopt=vbar_fluidpipeopt+(vp/2)-vabaro;% % Average velocity of annulus(surge taken into ac count), vbar_ann (ft/sec)% vbar_fluidannopt=qopt/(2.448*((d2^2)-(d1^2)));% vbar_annopt=vbar_fluidannopt-(vp/4)+vabaro; % Average velocity of pipe, vbar_pipe (ft/sec)vbar_pipeopt=qopt/(2.448*(d^2)); % Average velocity of annulus, vbar_ann (ft/sec)vbar_annopt=qopt/(2.448*((d2^2)-(d1^2))); % Turbulence criteria of pipe, NRe_pipeNRe_pipeopt=(89100*rho*(vbar_pipeopt^(2-n))/K)*((0. 0416*d/(3+(1/n)))^n)% Turbulence criteria of annulus, NRe_annNRe_annopt=(109000*rho*(vbar_annopt^(2-n))/K)*((0.0 208*(d2-d1) ... /(2+(1/n)))^n)% Define critical Reynold number, ReCif n<=1 && n>=0.5 ReCopt=2000;else if n<0.5 && n>=0.2 log_ReCopt=((0.5-n)*(log10(2.1))/0.3)+log10 (2000); ReCopt=10^(log_ReCopt); endendif NRe_pipeopt<ReCopt% If flow is laminar, frictional pressure loss grad ient of pipeLam_Pgrad_pipeopt=K*(vbar_pipeopt^n)*(((3+(1/n))/0. 0416)^n) ... /(144000*(d^(1+n)))% Pump pressure, PpdeltaPpopt = L*Lam_Pgrad_pipeoptendif NRe_annopt<ReCopt% If flow is laminar, frictional pressure loss grad ient of annulusLam_Pgrad_annopt=K*(vbar_annopt^n)*(((2+(1/n))/0.02 08)^n)/ ... (144000*((d2-d1)^(1+n)))end% Calculation of friction factor of pipe, f_pipef_pipeopt = fsolve(@(f_pipeopt)(sqrt(1/f_pipeopt))- ((4/(n^0.75))* ... log10(NRe_pipeopt*(f_pipeopt^(1-(n/2)))))+(0.39 5/(n^1.2)),1)% Calculation of friction factor of annulus, f_annf_annopt = fsolve(@(f_annopt)(sqrt(1/f_annopt))-((4 /(n^0.75))* ... log10(NRe_annopt*(f_annopt^(1-(n/2)))))+(0.395/ (n^1.2)),1)if NRe_pipeopt>=ReCopt% If flow is turbulent, frictional pressure loss gr adient of pipe

Page 6: Drill bit optimization code

7/7/12 6:56 PM C:\Users\kukrejankit\Desktop\Courses\t ribology\dr...\code11.m 6 of 6

Tur_Pgrad_pipeopt=(f_pipeopt*rho*(vbar_pipeopt^2))/ (25.8*d)% Pump pressure, PpdeltaPpopt = L*Tur_Pgrad_pipeoptendif NRe_annopt>=ReCopt% If flow is turbulent, frictional pressure loss gr adient of annulusTur_Pgrad_annopt=(f_annopt*rho*(vbar_annopt^2))/(21 .1*(d2-d1))end% Optimum bit pressure lossdeltaPbopt=deltaPpopt-deltaPdopt% Proper total nozzle areaAeffopt=sqrt(8.311*(10^-5)*rho*(qopt^2)/((Cd^2)*del taPbopt))% End of code