You are on page 1of 3

# program calculo_dp

implicit none
real(kind=8),dimension(4) :: qex
integer::i,n
real(kind=8)
::gamal,d,miu,L,dh,W,dha,Wa,e,Pp,gamala,da,miua,L
a,r,II

qex=(/6000.0,8000.0,10000.0,7250.0/) !bl/dia
n=4
!para linea superficial
gamal=1 ![-]
d=4.0
!in^2
miu=1.0
!Cp
L=10560
!pies
e=0.0006
W=0.9
dh=+20
!pies
Pp=3100 !Presion en la estacion de bombeo lb/pg^2
!para linea superficial
gamala=1.0 ![-]
da=2.441
!in^2
miua=0.8
!Cp
La=12001.44
!pies
r=0.0006
Wa=0.9
dha=-12000.0 !pies
!para linea superficial
II=3.521 !bl/dia/lb/pg^2
open (unit=12, file='3_4.txt', status='old')
write(12,*) "
"
write(12,*) "
EJERCICIO 3.4.1 DEL LIBRO DE TRANSPORTE DE H
CS POR DUCTOS
"
write(12,*) "
DEL INGENIERO FRANCISCO GARAICOCHEA PETR
IRENA
"
write(12,*) "
"
write(12,*) "
EJEMPLO DE APLICACION DE ANALISIS NO
DAL
"
write(12,*) "------------------------------------------------------------------------------"
write(12,*) " GASTO SUPUESTO
Pth
Pwfi
Pws
"
write(12,*) "
[bl/dia]
[lb/in^2]
[lb/in^2]
[
lb/in^2]
"
write(12,*) "------------------------------------------------------------------------------"

do i=1,n
call factor_f(qex(i),gamal,d,miu,e,L,La,dh,dha,W,Pp,gamala,miua,da,r
,Wa,II)
pause
end do

## stop "Calculo bien"

end program
!SUBROUTINA- - - - - - - - - - - - subroutine factor_f(q,gamal,d,miu,e,L,La,dh,dha,W,Pp,gamala,miua,da,r,Wa
,II)
implicit none
real(kind=8) ::Nre,q,gamal,d,miu,e,f,fs,fsa,fc,fca,es,ea,eas,L,dpf,dpt,d
pfa,dpta,dh,W,Ptha,Pwfia,Pp,fa
real(kind=8) ::Nrea,gamala,da,miua,r,dha,La,Wa,II,Pwsa
integer
::cont
es=1e-7
Nre=92.2*q*gamal/(d*miu)
write(*,710)Nre
710 format(" Nre=",f11.0)
Nrea=92.2*q*gamala/(da*miua)
write(*,810)Nrea
810 format(" Nrea=",f11.0)
write(*,720)q
720 format(" q=",f11.0)
fs=0.03
fsa=0.03
write(*,*)"---------------------------------------------------------------"
write(*,*)" ITER

FAC_FRIC

EA

FAC_FRICa

EAa

"
write(*,*)"---------------------------------------------------------------"
if(Nre<=2300) then
f=64/Nre
fa=64/Nrea
write(*,300)f
300 format (" Factor de friccion=",f10.6)
else
do
cont=cont+1
fc=(-2.0*log10((e/(3.715*d))+(2.514/((sqrt (fs))*NRe))))**(-2)
ea= abs (fs-fc)*100/fs
fs=fc
fca=(-2.0*log10((r/(3.715*da))+(2.514/((sqrt (fsa))*NRea))))**(-2)
eas= abs (fsa-fca)*100/fsa
fsa=fca
if(ea<es.and.eas<es)exit
write(*,10) cont,fs,ea,fsa,eas
10 format (i3,f11.4,f14.4,f14.4,f14.4)
end do

dpf=0.06056*fc*gamal*L*q**(2)/(5277*d**5)
dpt=0.433*gamal*(dh)+(0.06056*((fc*gamal*(q**2)*(L/5277))/((W**2)*(d**5
))))
dpfa=0.06056*fca*gamala*La*q**(2)/(5277*da**5)
dpta=0.433*gamal*(dha)+(0.06056*((fca*gamala*(q**2)*(La/5277))/((Wa**2)
*(da**5))))

Ptha=Pp-dpt
write(*,11) Ptha
11 format (" Pth [Lb/pg^2]=",f10.1)
Pwfia=Ptha-dpta
write(*,16) Pwfia
16 format (" Pwfi [Lb/pg^2]=",f10.1)
Pwsa=Pwfia-(q/II)
write(*,17) Pwsa
17 format (" Pws [Lb/pg^2]=",f10.1)
end if
write(*,*)"---------------------------------------------------------------"
write(12,1000) q, Ptha, Pwfia, Pwsa
1000 format(f14.2,f18.2,f18.2,f16.2)
write(12,*) "------------------------------------------------------------------------------"
return
stop
end subroutine