Professional Documents
Culture Documents
P=input('Presi [psia]:
');
T=input('Temperatura [F]:
');
Qg=input('Gasto de gas [MMscfd]:
');
Qo=input('Gasto de aceite [bpd]:
');
Qw=input('Gasto de agua [bwpd]:
');
QL=input('Gasto de Liquido[bpd]:
');
DenRg=input('Densidad relativa del gas [adi]: ');
DenRw=input('Densdiad relativa del agua [adi]: ');
API=input('Densidad del aceite [API]:
');
TR=T+460;
x=ho+hw;
dm=dmo;
%Calculo de parmetros
Z=CalZ(DenRg,T,P); %Z
Do=Densidad_aceite(API,P,T,DenRg); %Do
Dg=Densidad_gas(DenRg,P,T,Z); %Dg
Visg=Viscosidad_gas(DenRg,T,Dg);
CD=CD_Vt_Re(Do,Dg,dm,Visg); %CD
Vt=Vt_CD_Re(Do,Dg,dm,Visg); %Vt
Viso=Viscosidad_aceite(API,DenRg,T,Qg,Qo,P);
Visw=Viscosidad_agua(T);
fprintf( Gas
Gas
Gas
Liquido
ho
Eleccin Eleccin \n');
Liquido
Liquido
Ao Ag Vg
fprintf((in) (ft) (in) (ft^2) (ft^2) (ft^2) (ft^2) (ft^2) (ft/s) (ft)
(ft) (ft) (ft) \n');
for D=14:2:40
Dft=D/12;
dL=(D/2)-(hL*D);
At=(pi*(Dft^2))/4;
R=0.5*D; %(in)
Rft=R/12; %(ft)
tros=tro*60;
trws=trw*60;
Qofts=(Qo*5.615)/86400;
Qwfts=(Qw*5.615)/86400;
LeffL=(tros*Qofts)+(trws*Qwfts)/AL;
LssL=(4/3)*(D/D)*LeffL;
hoL=D*ho;
REL=12*(LssL/D);
if ((REL >= 3) && (REL <= 5))
a=1;
else
a=0;
end
if ((REg >= 3) && (REg <= 5))
b=1;
else
b=0;
end
pause
disp('Desea calcular Rearrastre?')
disp('1) Si')
disp('2) No')
K=input('Elige una opcion: ');
switch K
case 1
Ten=Tension(API,T,P);
Viso=Viscosidad_aceite(API,DenRg,T,Qg,Qo,P);
Rr=Rearrastre(x,Qg,Qo,Z,T,P,Do,Dg,Viso,Ten)
case 2
disp('Hasta Luego o_o')
end
function Rr=Rearrastre(x,Qg,Qo,Z,T,P,Do,Dg,Viso,Ten)
g=32.2;
Denw=62.4;
Visolbft=Viso/1488.1639; %[lb*s/ft]
TR=T+460; %[R]
alfa=((1/pi)*(acos(1-2*x)))-((2/pi)*(1-2*x)*((x-(x^2))^0.5));
fprintf(' D
D
AL
Vt(max) Rearrastre \n');
fprintf(' (in)
(ft) (ft^2)
\n');
PL
DH
VG
VL
(ft)
(ft)
(ft/s)
(ft/s)
for D=14:2:40
Ref
Nmu
delD=(Denw-Do);
a=(Ten/(g*delD))^0.5;
Nmu=Visolbft./((Do.*Ten.*a).^0.5);
end
end
if VG <= Vtmax
Rr=1;
else
Rr=0;
end
fprintf(' %5.2f %5.2f %5.2f %5.2f %5.2f
%5.2f
%5.2f
%5.6f %5.6f %5.1f \n',D,Df,AL,PL,DH,VG,VL,Ref,Nmu,Vtmax,Rr)
end
%Para que exista no Rearrastre VG < Vtmax
%5.2f
a=(Dg/(Do-Dg));
d_2g=((5040*T*Qg*Z)/P)*((a*(CD/dmL))^0.5);
format short
dg=d_2g^0.5
%Diametro minimo para que una gota de aceite viaje a travez
%de la fase agua
DenRo=141.5/(131.5+API);
DelDenR=DenRw-DenRo;
d_2o=(6690*Qo*Viso)/(DelDenR*(dmw^2));
format short
do=d_2o^0.5
%Diametro minimo para que una gota de aceite viaje atraves
%de la fase agua
d_2w=(6690*Qw*Visw)/(DelDenR*(dmo^2));
format short
dw=d_2w^0.5
d=max([dg do dw]);
fprintf(' D
fprintf(' (in)
ho+hw
Lss
(ft)
RE
Opcin
\n');
\n');
for D=d:12:100
ho_hw=((tro*Qo)+(trw*Qw))/(0.12*(D^2));
if D<=36
Lss=(ho_hw+76)/12;
else
Lss=(ho_hw+D+40)/12;
end
RE=(12*Lss)/D;
if ((RE >= 1.5) && (RE <= 3))
a=1;
else
a=0;
end
fprintf(' %5.2f
%5.2f
\n',D,ho_hw,Lss,RE,a)