import math
#variable initialisation
D=2 #diameter in cm
v=0.0098 #viscosity of water
Re=2000 #Critical Reynolds number
rho=998 #density in kg/m^3
#solution
V=Re*v/10000/(D/100) #Calculating V
L=(math.pi/4)*((D/100)**2)*V
print "The required Largest Discharge",round(L*1000*60,3),"L/min"
f=64/Re
u=V*(math.sqrt(f/8)) #Boundary shear stress
tou=rho*(u**2)
print "tou=",round(tou,4),"Pa"
import math
#variable initialisation
f=0.02 #Friction factor
#Calculation
Ut=math.sqrt(f/8) #Shear velocity
print "U*=",Ut,"V"
Um=1.43*math.sqrt(f)+1 #Maximum velocity
print "Um=",round(Um,5),"V"
r0=1
y=r0-0.3*r0
#Let us take (u-V/U*) as U
a=round(math.log(0.7,10),4)
U=5.75*a+3.75
#But,U*=0.05V
#Let's take u/V as V #Ratio of local velcotiy to mean velocity
V=U*(Ut)
print "u/V=",round(V+1,5)
#variable initialization
f=0.035 #friction factor
Re=1E+5 #Reynolds number
d=10 #diameter in cm
Es=0.80 #roughness of pipe
#solution
ro=(d/2)/100 #Radius in m
delta=(65.6*ro)/(Re*math.sqrt(f))*1000 #Thickness of lamina sublayer
print "delta=",round(delta,3),"mm"
Es_delta=Es/delta
print "Es_delta=",round(Es_delta,2)
print "This value being less than 6.0 and greater than 0.25,the pipe flow is in transition regime"
import math
#variable initialisation
r0=0.10 #Constant value
epsillon=0.0002 #roughness magnitude in mm
v=1E-6 #velocity in m**2/s
D=0.2 #Diameter in mm
#Calculation
#Transition from the smooth pipe regime begins at,
Ref=17*(r0/epsillon)
Re=(2*(math.log(Ref,10))-0.8)*Ref #friction factor
V=(Re*v)/D
print "Velocity at the upper limit of smooth pipe regime is",round(V,1),"m/s"
#Fully rough turbulent flow begins at,
Ref=400*(r0/epsillon)
Re=(2*(math.log((r0/epsillon),10))+1.74)*Ref
V=(Re*v)/D
print "The flow will be at fully rough turbulent regime at V=",round(V,2),"m/s"
import math
#variable initialisation
r0=0.30 #constant value
v1=4.50 #velocity in m/s
v2=4.20 #velocity in m/s
D=60 #diameter in cm
#Calculation
D=D/100
u=(v1-v2)/(5.75*(math.log((r0/(0.20)),10)))#For smooth and rough pipe
V=(3.75*u)-v1 #mean velocity V related to um as,
Q=math.pi/4*(D**2)*V #Discharge
print "Q=",round(-Q,3),"m**3/s"
import math
#variable initialisation
rho=804 #Relative density in kg/m^3
mu=1.92E-3 #viscosity in Pa.s.
D=20 #Diameter in cm
v=3 #Velocity in m/s
r0=0.10 #Constant value
#Calculation
D=D/100#Converting into m
Re=rho*v*D/mu
#At the permissible height of roughness in the pipe the flow will be in smooth-turbulent regime.
f=0.0032+(0.221/(Re**0.237))
#Since the pipe will behave as smooth,at the limiting value
epsillon=r0/((Re*math.sqrt(f))/17)
print "Permissible height of surface roughness=",round(epsillon*1000,4),"mm"
import math
#variable initialisation
r0=0.05 #radius
epsillon=0.0002 #roughness magnitude in m
r1=0.075 #radius
D1=10 #Diameter in cm
D2=15 #Diameter in cm
#Calculation
f1=round(1/((2*(math.log((r0/epsillon),10)))+1.74)**2,4)
f2=round(1/((2*(math.log((r1/epsillon),10)))+1.74)**2,4)
#P1/P2 is taken as P
P=(f1/f2)*((D2/D1)**5) #Ratio of powers,
#Cost of pumping is proportional to power consumed.
print "cost of pumping in 10cm pipe/cost of pumping in 15 cm=",round(P,2)
import math
#variable initialisation
v=1.0E-6 #Velocity in m/s
epsillon_s=15E-3 #roughness in m
epsillon2_s=0.2E-3 #roughness in m
Q=4.0 #discharge in m
D1=1.5 #diameter in m
t=0.01 #thickness
g=9.81 #gravity
L=1000 #length
ga=9.79 #density
#Calculation
V1=round(Q/((math.pi/4)*(D1**2)),3)
Re1=round(V1*D1/v,3)
#From the emrpirical equivalent of colrebook equation,
f1=round((1/(1.14-(2*(math.log(((epsillon_s/D1)+(21.25/Re1**0.9)),10)))))**2,4)
#After the lining,
D2=D1-2*t #Diameter2 calculation
V2=round(Q/((math.pi/4)*(D2**2)),4)
Re2=round(V2*D2/v,3)
#From the emrpirical equivalent of colrebook equation,
f2=round((1/(1.14-(2*(math.log(((epsillon2_s/D2)+(21.25/Re2**0.9)),10)))))**2,4)
h_f1=round((f1*L*(V1**2))/(2*g*D1),3)
h_f2=round((f2*L*(V2**2))/(2*g*D2),6)
h_s=round(h_f1-h_f2,5) #Saving in head
Ps=ga*Q*h_s #Saving in power
print"answer in the book is wrong.It should be as,"
print "Ps=",round(Ps,1),"kW"
import math
#variable initialisation
D=0.25 #Diameter in m
v=1E-6 #velocity
epsillon_s=0.15E-3 #roughness
h_f=0.025 #hydraulic gradient
L=100 #length in m
g=9.81 #gravity
ga=9790 #density
#calculation
#Re*math.sqrrt(f) is taken as Ref
#Re(math.sqrt(f))=(((V*D)/v)*((2*g*h_f*D)/(V**2*L)))
Ref=(((D)**(3/2))/v)*((2*g*h_f)**(1/2))
#By colerbrook formula,
f1=round((1/(1.14-(2*(math.log(((epsillon_s/D)+(9.35/Ref)),10)))))**2,5)
Re=round(Ref/math.sqrt(f1),3)
V=round((Re*v)/D,4)
Q=(math.pi/4)*(D**2)*V #Discharge
print "Q=",round(Q*1000,1),"L/s"
h_f=h_f*100 #head lost in 100 m length of pipe
P=ga*Q*h_f
print "P=",round(P/1000,2),"kW"
import math
#variable initialisation
L=1500 #Length in m
Q=250 #discharge in L/s
g=9.81 #gravity
h_f=15 #head loss
epsillon_s=0.12E-3 #roughness
v=1E-6 #viscosity in m^2/s
#Calculation
Q=Q/1000
#hf=fLV^2/2gD=(8*L*(Q**2))/((math.pi**2)*g)
D=((8*L*(Q**2))/((math.pi**2)*g))/h_f
#Re=1/D)(4*Q)/(math.pi*v)
#trial and error procedure is adpoted,
#1 st trail,assume
f=0.025
D1=(D*f)**(1/5)
Re=((4*Q)/(math.pi*v))/D1
f=round((1/(1.14-(2*(math.log(((epsillon_s/D1)+(21.25/Re**0.9)),10)))))**2,4)
#trial and error procedure is adpoted,
#2 nd trail,assume
f=0.0159
D1=(D*f)**(1/5)
Re=((4*Q)/(math.pi*v))/D1
f=round((1/(1.14-(2*(math.log(((epsillon_s/D1)+(21.25/Re**0.9)),10)))))**2,4)
#This value is practically same as assumbed hence no further trails are required.
#In practicce,the next larger size would be used.
print "The required diameter D=",round(D1*100,1),"cm"
#variable initialisation
v=1E-6 #Viscosity in m^2/s
V=1 #Velcoity in m/s
L=100 #Length in m
h_f=10/100 #headloss
epsillon_s=0.45E-3 #roughness
g=9.81 #gravity
#Calculation
#Re=V*D/v
Re=(V)/v #Reynolds number
f=0.0055*(1+(2000*epsillon_s+1)**(1/3))
#h_f=f*L*V^2/2gD
f1=(2*g*h_f)/(L*V**2)
#Using trial and error methods,F is found to be 0.0133,
f=0.0133
D=f/f1
print "D=",round(D,3),"m"
#This value is practically same as assumbed hence no further trails are required.
#In practicce,the next larger size would be used.
import math
#variable initialisation
Rd=0.85 #relative density of oil
L=150 #length in m
h_f=67 #head loss in m
v=0.1 #viscosity in cm
Q=80 #Discharge in L/s
g=9.81 #gravity
#Calculation
Q=Q/1000#Converting into m
v=v/10000
#h_f=f*L*V**2/(2*g*D)
f=h_f*(math.pi**2)*g/(8*L*(Q**2))
#D=f/(844.66)**(1/5)
#Reynolds number,
Re=(4*Q)/(math.pi*v)
#Re=Re*(1/D)
#A trial and error procedure is used.
#1 st trial assume,
f1=0.02
D=(f1/f)**(1/5)
Re1=Re*(1/D)
#As Re<10^5,Blasius formula can be used.
#2nd trial,
f1=0.316/(Re1**(1/4))
D=round((f1/f)**(1/5)*100,1)
Re2=Re/D
#3 rs trial,
f1=0.316/(Re2**(1/4))
print "The required diameter is D=",round(D,2),"cm"
#This value is practically same as assumbed hence no further trails are required.
#In practicce,the next larger size would be used.
import math
#variable initialisation
rho=1.20 #relative density
l=0.4 #length in m
b=0.25 #breadth in m
V=20 #velcity in m/s
v=1.5E-5 #viscosity
epsillon_s=0.05E-3 #roughness
ga=9.81*1.2 #gravity
eta=0.60 #efficiency
L=200 #length in m
g=9.81 #gravity
#Calculation
area=l*b #Calculating area
perimeter=2*(l+b) #Calculating perimeter
Dh=4*(area/perimeter)
Reh=(V*Dh)/v
#By empirical equivalent of colrebook formula,
f=round((1/(1.14-(2*(math.log(((epsillon_s/Dh)+(21.25/Reh**0.9)),10)))))**2,4)
hf=(f*L*(V**2))/(2*g*Dh) #Head loss
print "hf=",round(hf,1),"m(of air column)"
del_p=int(rho*g*hf)/1000 #pressure loss
print "del_p=",round(del_p,3),"kPa"
Q=V*l*b
P=ga*Q*hf/eta #Power required at 60% efficiency
print "P=",round(P/1000,1),"kW"