Chapter 8,Pipe Friction and Turbulent Flow

Example 8.4,Page 199

In [1]:
#variable declaration
from math import pi
import math
rho =867.0; #kg /m^3
Q =12.0/3600; #m^3/ s
u =7.5*10**( -4) ; # Ns/m^2
L =200.0; # m
H =10.0; # m
g =9.81; # m/ s ^2
e=2.718;

#calculation
d=(H*2*g /(4*0.079*(4* rho *Q/pi/u)**( -0.25) *L *(4* Q/pi)**2) )**( -0.2105);
d=round(d,4);
Re =4* rho *Q/ pi /d/u;

#result
print" Internal diameter of the pipe line (m)=",round(d,5)
print"Re =",round(Re,2)
print("The value o f Reynolds number l i e s between 4000 and 10^5 , confirming the validity of using the Blasius equationfor smooth walled pipes")
 Internal diameter of the pipe line (m)= 0.0505
Re = 97152.8
The value o f Reynolds number l i e s between 4000 and 10^5 , confirming the validity of using the Blasius equationfor smooth walled pipes

Example 8.5,Page 202

In [2]:
#variable declaration
from math import pi
import math
m =40.0/60; # kg / s
rho =873; #kg /m^3
d =0.025; #m
u =8.8*10** -4; # Ns/m^2
dp =55.0*10**3; #N/m^2
L =18; #m
g =9.81; # m/ s ^2

#calculation
v2 =4*m/ rho / pi /d **2;
Re=rho*v2*d/u;
#using MOODY's Chart
f =0.0055;
H=dp/rho/g + v2 **2/2/ g + v2 **2/2/ g *(4* f*L/d +1.5) ;

#result
print "The minimum allowable height (m) =",round(H,3)
The minimum allowable height (m) = 8.684

Example 8.6,Page 204

In [3]:
#variable declaration
from math import pi
import math
Q =15.0/3600; # m^3/ s
d =0.05; #m
Rho =780.0;
u =1.7*10**( -3) ; #Ns/m^2
f =0.0065;
L =100; #m
g =9.8; #m^2/ s

#calculation
v =4* Q/ pi /d **2;
del_pf =2*f* Rho *v**2*L/d;
H_f =4* f*L*v **2/( d*2*g);
H_exit =v **2/2/ g;
H_entrance =v **2/4/ g;
H= H_f+ H_exit + H_entrance ;

#result
print "The pressure drop due to friction is (kN/m^2)",round(del_pf,2)
print " and the difference in levels is (m)",round(H,3)
The pressure drop due to friction is (kN/m^2) 91324.16
 and the difference in levels is (m) 12.292

Example 8.7,Page 206

In [16]:
#variable declaration
import math
f =0.005;
L =10; # m
d =0.025; # m
g =9.81; # m/ s ^2

#Calculations
# H L=4 f L/dv ^2/2/ g+0.5 v ^2/2/ g
# H L=8.5 v ^2/2/ g
# By Be r n o u l l i e q u a t i o n we g e t
#H=2.62+9.5 v2 ^2/2/ g
# Applying the Be r n o u l l i e q u a t i o n between the liquid surface and discharge point
# H L=33.5 v2 ^2/2/ g
#Solving above two we g e t
H =2.62+9.5* v2 **2/2/ g;
v2 =1.9; # m/ s
Q= pi*d **2/4* v2;

#result
print"Rate of flow (m^3/s)=",round(Q,5)
print"The minimum allowable height(m) =",round(H,3)
Rate of flow (m^3/s)= 0.0009321875
The minimum allowable height(m) = 4.36796126402

Example 8.8,Page 208

In [4]:
#variable declaration
import math
d_A =0.025; # m
v_A =1.21; # m/ s
d_B =0.05; # m
v_B =1.71; # m/ s

#calculation
Q_A = pi *d_A **2* v_A /4;
Q_B = pi *d_B **2* v_B /4;

#result
print "The rate of flow through parallel pipes A is ",round(Q_A,5)
print"The rate of flow through parallel pipes B is (m^3/s)=",round(Q_B,5);
The rate of flow through parallel pipes A is  0.00059
The rate of flow through parallel pipes B is (m^3/s)= 0.00336

Example 8.9,Page 210

In [5]:
#variable declaration
from math import pi
import math
d2 =0.06; # m
d1 =0.12; # m
k =0.44;
f =0.05;
L1 =500; # m
g =9.81; # m/ s ^2

#Calcualtion
# v1=d2 ^2/ d1 ^2 v2
# H f=4 f L1 /16/ d v2 ^2/2/ g
# H c=k v2 ^2/2/ g
# H f=4 f L2/d v2 ^2/2/ g
# H_exit=v2 ^2/2/ g
v2= math.sqrt (30*2* g /173.4);
Q= pi*d2 **2/4* v2;

#result
print"The rate of flow (m^3/s) =",round(Q,5)
The rate of flow (m^3/s) = 0.00521

Example 8.10,Page 212

In [6]:
#variable declaration
import math
m =12.0*10**3/3600; #kg / s
Rho =815; #kg /m^3
d =0.05; #m
e =0.02;
d1 =50; # m
d2 =0.038; # m
g =9.8; #m

#calculation
v =4* m/ Rho / pi /d**2;
f1 =1/(2* math.log (d1/e,10) +2.28) **2;
L_eq =d1 +2* d1*d;
H_50mm =4* f1* L_eq *v **2/( d *2* g);
v =4* m/( Rho * pi *d2 **2) ;
f2 =1/(2* math.log (38/ e,10) +2.28) **2;
L_eq =d1 +2* d1*d2;
H_38mm =4* f2* L_eq *v **2/( d2 *2* g);
Hr =0.2* v **2/(2* g);
H_L = H_50mm + H_38mm +Hr;
del_p_f =Rho*g* H_L ;

#result
print "The total pressure drop due to friction through the pipe system is (N/m^2) =",round(del_p_f,3)
The total pressure drop due to friction through the pipe system is (N/m^2) = 479792.576

Example 8.11,Page 214

In [7]:
#variable declaration
import math
#H L=1.2 v ^2/2/ g
# H L=4 f  L eq /dV^2/2/ g
# L eq=60d
# H L=240 f v ^2/2/ g
# Combining the two e q u a t i o n s f o r head l o s s
# 1.2v^2/2/ g=240 f_v^2/2/ g

f =1.2/240;
print " Friction factor =",round(f,3)
 Friction factor = 0.005

Example 8.12,Page 216

In [8]:
#variable declaration
import math
# dp AB+dp BC=dp AD+dp DC
# dp AD=2 f  rho v ^2L/d
# dp AD=16600(3_Q) ^2
# Li k ewi s e
# dp AB=16600Q^2
# dp BC=16600(Q+0.5) ^2
# dp DC=16600(2.1_Q) ^2
#By s o l v i n g above 5 e qu a t i o ns , we g e t
Q =1.175; # litres per second

#Calculation
dp_AD =16600*(3 - Q) **2;
dp_AB =16600* Q**2;
dp_BC =16600*( Q +0.5) **2;
dp_DC =16600*(2.1 - Q) **2;

print"The rate of flow from B to C (l/s)=",round(Q+0.5,3)
print "dp_AD(kN/m^2 =",round(dp_AD/1000,3);
print"dp AB (kN/m^2)=",round(dp_AB/1000,3);
print"dp BC(kN/m^2) =",round(dp_BC/1000,3);
print"dp DC (kN/m^2)=",round(dp_DC/1000,3);
print"The lowest pressure is in the pipe coneecting C and D"
The rate of flow from B to C (l/s)= 1.675
dp_AD(kN/m^2 = 55.288
dp AB (kN/m^2)= 22.918
dp BC(kN/m^2) = 46.573
dp DC (kN/m^2)= 14.203
The lowest pressure is in the pipe coneecting C and D

Example 8.13,Page 221

In [39]:
#variable declaration
from math import pi
import math
from scipy import integrate
H2 =0.5; #m
H1 =2.0; #m
A =4.0; #m^2
f =0.005;
L =20.0; #m
d =0.025; #m
g =9.81; # m/ s ^2

#calculation
a= pi *d **2/4;
c=A*math.sqrt( 4*f*L/d  +2.5)/a/math.sqrt(2*g); # constant term of integration
def integrand(H,c):
    return -c*(H)**(-0.5)
#integrate function '-A*sqrt ( ( 4*f L/d ) +2.5) / a /( sqrt(2*g ) )* (H) ^(-1/2)
#f=lambda H:-4*1978.18*H**(-0.5);


t=integrate.quad(integrand,H1,H2,args=(c))
                 
#result
print "Time taken (s)=",round(t[0],2)
Time taken (s)= 11190.29

Example 8.14,Page 223

In [12]:
#variable decleration
from math import pi
d0 =0.15; # m
d1 =0.1; #m
Q =50.0/3600; # m^3/ s
f =0.0052;
Rho =972;


#calculation
a= pi /4*(( d0)**2 -( d1) **2) ;
P= pi *(( d0)+( d1));
d_eq =4*a/P;
v=Q/a;
del_p_f =2*f* Rho *v**2/ d_eq ;

#result
print" the pressure drop due to friction per metre lenfth of tube is found to be(Nm^2/m)",round(del_p_f,3)
 the pressure drop due to friction per metre lenfth of tube is found to be(Nm^2/m) 404.636

Example 8.15,Page 225

In [3]:
#variable decleration
from math import pi
from scipy import integrate
f =0.005;
Q =0.07; #m^3/ s
g =9.81; #m/ s ^2
L=3;

#calculation
u=0.3-0.0666*L;
def integrand(l,f,Q,g,u):
    return 32*f*Q**2/pi**2/g*(0.3-0.0666*l)**-5    

H_f=integrate.quad(integrand,0,3,args=(f,Q,g,u));
H_f=round(H_f[0],1)

#result
print" Fractional head loss(m) =",H_f
 Fractional head loss(m) = 0.3

Example 8.16,Page 228

In [14]:
from math import pi
import math
g =9.81; # m/ s ^2
H =4; # m
f =0.006;
L =50; # m
d =0.1; # m
e=2.718;


#calculation
v1= math.sqrt (2* g*H /(4* f*L/d + 13) );
v2=0.99*v1;
t=2/v1*math.log((v1+v2)/(v1-v2),e)

#result
print"Time taken (s)=",round(t,2)
Time taken (s)= 5.98
In [ ]: