Chapter 6 : Fluid friction in steady on dimentional flow

Example 6.1 page no : 180

In [4]:
#calculate the drop in pressure per unit length in a pipe
import math

# Variables  
q=50.0                        #gal/min flow rate
d=3.068                       #in inner diameter

# Calculation  
a=(math.pi)*(3.068/12.0)**2/4.0            #ft^2
#1 ft^3 = 7.48 gal
#1 min = 60 sec
v_avg=q/a/60.0/7.48                        #ft/s
mew=50.0                                   #cP
#1 cP = 0.000672 lbm/ft/s
rho=62.3                                   #lbm/ft^3

# Result
R=(d/12)*v_avg*rho/(mew*0.000672)           #dimentionless reynold's no.
if (R<2000):
    print "Laminar flow"
else:
    print "Turbulent flow"

dx=3000.0                                #ft length of pipe
#1 gal = 231 in^3
#1 cP.ft^3 = 0.0000209 lbf.s
dp=(q/60)*(128/math.pi)*(mew/d**4)*dx*231*0.0000209/12         #lbf/in^2 or psi
#let D represent d/dx
Dp=(dp/dx)*100                          #psi/ft
print "The pressure gradient in the pipe is %f psi/100ft"%Dp
Laminar flow
The pressure gradient in the pipe is 0.770911 psi/100ft

Example 6.2 page no : 182

In [5]:
#calculate viscosity of fluid using a viscometer
import math

# Variables  
rho=1050.                         #Kg/m^3
g=9.81                            #m/s^2
dz=0.12                           #m change in height
d=0.001                           #m inner diameter of capillary of viscometer
q=10**(-8)                        #m^3/s
dx=0.1                            #m length of capillary

# Calculation  
mew=(rho*g*dz*(math.pi)*d**4)*1000/128./(q*dx)           #cP

# Result
print "The viscosity of the fluid is %f cP"%mew
The viscosity of the fluid is 30.337477 cP

Example 6.3 page no : 187

In [6]:
#Calculate the fanning friction factor

# Variables  
R=10**5.                          #dimentionless reynold's no.
ratio_ED=0.0002                   #dimentionless

# Calculation  
f=0.001375*(1+(20000*ratio_ED+10**6/R)**(1./3))            #dimentionless

# Result
print "The fanning friction factor is %f"%f
The fanning friction factor is 0.004689

Example 6.4 page no : 188

In [7]:
#Calculate the gauge pressure in the tank
import math

# Variables  
q=300.                             #gal/min flow rate
d=3.068                            #in inner diameter

# Calculation  
a=(math.pi)*(3.068/12.0)**2/4.0    #ft^2

#1 ft^3 = 7.48 gal
#1 min = 60 sec
v_avg=13.                          #q/a/60.0/7.48#ft/s
f=0.0091                           #dimentionless fanning friction factor
dx=3000.                           #ft
rho=62.3                           #lbm/ft^3
dp=4*f*(dx/(d/12.0))*rho*(v_avg**2/2.0)/32.2/144.0   #lbf/in^2 or psi

# Result
print "The gauge pressure in the tank is %d psi"%dp
The gauge pressure in the tank is 484 psi

Example 6.5 page no : 190

In [4]:
#Calculate volumetric flow rate of gasoline through a pipe
import math

# Variables  
d=0.1                            #m internal diameter of pipe
A=math.pi*d**2/4.0               #m^2
dx=100.0                         #m length of pipe
f=0.005                          #dimentionless fanning friction factor
dz=10.0                          #m difference in water level
g=9.81                           #m/s^2

# Calculation  
v=((2*g*dz/4/f)*(0.1/100))**0.5       #4.0/f)*d/dx)**0.5#m/s

# Result
print "The velocity of gasoline through pipe is %f m/s"%v
q=A*v#m^3/s
print "The volumteric flow arte od gasoline through the pipe is %f m^3/s"%q
The velocity of gasoline through pipe is 3.132092 m/s
The volumteric flow arte od gasoline through the pipe is 0.024599 m^3/s

Example 6.6 page no : 192

In [1]:
#Calculate pressure difference across the duct
import math

# Variables  
p=14.75                  #lbf/in^2
M=29.                    #lbm/lbmol
R=10.73                  #lbf.ft^3/(in^2.lbmol.R)
T=500.                   #R Rankine temperature scale
rho=p*M/(R*T)            #lbm/ft^3
q=500.                   #ft^3/min
d=1.                     #ft
A=(math.pi)*d**2/4       #ft^2
v=(q/60.0)/A             #ft/s
mew=0.017                #cP

#1cP = 0.000672 lbm/ft/s
R=d*v*rho/(mew*0.000672)               #dimentionless reynold's no.
f=0.00465                              #fanning friction factor
dx=800.                                #ft lenght of duct
#1 ft = 12 in
#1 lbf.s^2 = 32.2 lbm.ft

# Calculation  
dP=rho*(4*f*(dx/d)*(v**2/2))/32.2/144.                #lbf/in^2

# Result
print "The pressure drop across the duct is %f lbf/in^2"%dP
The pressure drop across the duct is 0.014402 lbf/in^2

Example 6.8 page no : 197

In [10]:
#Calculate the pump power required

# Variables  
q=200.                         #gal/min
rho=62.3                       #lbm/ft^3
#1 ft^3 = 7.48 gal

# Calculation  
m=(q/60)*rho/7.48              #lbm/s
dx=2000.                       #ft
dp=3.87                        #psi/100ft
F=(dp/100)*dx/rho*32.2*144     #ft
#1 hp = 550 lbf.ft/s
Po=F*m/550.                    #hp

# Result
print "The pump power required is %f hp"%Po
The pump power required is 290.786193 hp

Example 6.9 page no : 198

In [5]:
#Calculate the drop in pressure per unit length in a pipe

# Variables  
dp=0.1                 #psi
dx=800.                #ft

#let D represent d/dx
#1 psi = 6895 Pa
#1 m = 3.28 ft

# Calculation  
Dp=(dp/dx)*6895*3.28    #Pa/m

# Result
print "The drop in pressure per unit length in the pipe is %f Pa/m"%Dp
The drop in pressure per unit length in the pipe is 2.826950 Pa/m

Example 6.10 page no : 201

In [12]:
#Calculate the pressure difference created due to expansion and contraction

# Variables  
rho=62.3               #lbm/ft^3
K=1.5                  #dimentionless
v=13.                  #ft/s

#1 ft = 12 in
#1 lbf.s^2 = 32.2 lbm.ft

# Calculation  
dp=rho*K*(v**2/2)/32.2/144                #lbf/in^2

# Result
print "The pressure drop due to expansion and contraction is %f lbf/in^2"%dp
The pressure drop due to expansion and contraction is 1.703012 lbf/in^2

Example 6.11 page no : 203

In [5]:
#Calculate the pressure drop in the pipe due to fittings

# Variables  
dx=3000.0                 #ft actual length of pipe
dx1=281.                  #ft equivalent length of fittings
p=484.                    #psi

# Calculation  
dx_total=dx+dx1           #ft
dp_total=p*(dx_total/dx)  #psi
dp_vnf=dp_total-p         #psi pressure drop fue to valves and fittings

# Result
print "The pressure drop due to valves and fittings is %d psi"%dp_vnf
The pressure drop due to valves and fittings is 45 psi

Example 6.12 page no : 203

In [14]:
#Calculate pressure drop due to valves and fittings

# Variables  
K=27.56               #deimentionless
rho=62.3              #lbm/ft^3
v=13.                 #ft/s

# Calculation  
#1 ft = 12 in
#1 lbf.s^2 = 32.2 lbm.ft
dp=rho*K*(v**2/2)/32.2/144.            #psi

# Result
print "THe pressure drop due to valves and fittings is %d psi"%dp
THe pressure drop due to valves and fittings is 31 psi

Example 6.13 page no : 207

In [16]:
#Calculate the gasoline leakage rate through a seal
import math

# Variables  
p=100.0                #lbf/in^2
l=1.                   #in length od seal in direction of leak
mew=0.6                #cP
d=0.25                 #in diameter of valve stem
t=0.0001               #in thickness of valva stem

# Calculation  
#1 cP = 0.0000209 lbf.s/ft^2
#1 ft = 12 in
q=(p/l)*(1/12.0/mew)*(math.pi)*d*t**3/0.0000209*144*3600.     #in^3/hr

# Result
print "The volumetric leakage rate of gasoline is %f in^3/hr"%q
rho=0.026              #lbm/in^3
m=q*rho                #lbm/hr
print "The mass leakage rate of gasoline is %f lbm/hr"%m
The volumetric leakage rate of gasoline is 0.270568 in^3/hr
The mass leakage rate of gasoline is 0.007035 lbm/hr