Chapter 5 : Conservation Principle of Energy

Example 5.1 Page No : 136

In [2]:
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
z2 = 0. 			#m
z1 = 8. 			#m
V2 = 5. 			#outlet velocity - m/s
V1 = 3. 			#inlet velocity - m/s
			
#calculations
Hs = (z2-z1) + (V2**2 -V1**2)/(2*g)
			
#results
print "Work done by fluid  =  %.3f J/N"%(Hs)
Work done by fluid  =  -7.185 J/N

Example 5.2 Page No : 137

In [1]:
import math 
			
#Initialization of variables
g = 9.81 			    #m/s**2
rho = 10.**3 			#kg/m**3
P1 = 80.*10**3 			#N/m**2
P2 = 12.*10**6 + 101300 			#N/m**2
Hq = -400.               			#J/N
			
#calculations
g1 = g*rho
Hs =  -Hq+ (P2-P1)/(g1)
			
#results
print "Energy added by pump  =  %d J/N"%(Hs)
print ("The answer given in textbook is wrong. Please verify using a calculator")
Energy added by pump  =  1625 J/N
The answer given in textbook is wrong. Please verify using a calculator

Example 5.3 Page No : 140

In [4]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
d1 = 15. 			#cm
d2 = 10. 			#cm
V1 = 2.4 			#m/s
P1 = 450.*10**3 			#N/m**2
rho2 = 900.      			#kg/m**3
			
#calculations
V2 = d1**2 /d2**2 *V1
P2 = g*rho2*(P1/(rho2*g) + V1**2 /(2*g) - V2**2 /(2*g))
Q = math.pi/4*(d2/100)**2 *V2
			
#results
print "Pressure at 2  =  %.2f kN/m**2"%(P2/1000)
print " Flow rate  =  %.4f m**3/s"%(Q)
#The answer given in textbook is wrong. Please verify it.
Pressure at 2  =  439.47 kN/m**2
 Flow rate  =  0.0424 m**3/s

Example 5.4 Page No : 140

In [5]:
import math 
			
#Initialization of variables
g = 9.81 	    		#m/s**2
rho = 10.**3 			#kg/m**3
z = 10.      			#m
			
#calculations
PE = g*rho*math.pi*z**2 /2
			
#results
print "Work obtained  =  %.2e J"%(PE)
Work obtained  =  1.54e+06 J

Example 5.6 Page No : 141

In [6]:
import math 
			
#Initialization of variables
g = 9.81     			#m/s**2
rho = 10**3 			#kg/m**3
d1 = 7.5 	    		#diameter - cm
d2 = 3. 			    #cm
P1 = 300+101.3 			#pressure - kPa
P2 = 25. 		    	#kPa
			
#calculations
V1 = math.sqrt(2*g/ ((d1/d2)**4 -1) *(P1*10**3 /(rho*g) -P2*10**3 /(rho*g)))
Q = math.pi/4 *(d1/100)**2 *V1
			
#results
print "Max discharge  =  %.4f m**3/s"%(Q)
#The answer given in textbook is wrong. Please use a calculator to verify
Max discharge  =  0.0196 m**3/s

Example 5.7 Page No : 145

In [8]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10**3 		#kg/m**3
z1 = 1.2 			#m
z2 = 4. 			#m
d = 5.   			#cm
			
#calculations
Va = math.sqrt(2*g*(z2-z1))
Q = math.pi/4 *(d/100)**2 *Va
Pc =  - z2*rho*g
P = 25*10**3 			#Pa
Zab = (101325 - P)/rho/g
			
#results
print "rate of discharge  =  %.4f m**3/s"%(Q)
print " Pressure at C  =  %.2f kPa"%(Pc/1000)
print " Max. permissible length  =  %.2f m"%(Zab)
rate of discharge  =  0.0146 m**3/s
 Pressure at C  =  -39.24 kPa
 Max. permissible length  =  7.75 m

Example 5.8 Page No : 146

In [4]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
Q = 0.09 			#m**3/s
d1 = 0.12 			#diameter - m
d2 = 0.2 			#diameter - m
P1 = 80. 			#pressure - kN/m**2
P2 = 120. 			#pressure - kN/m**2
			
#calculations
V1 = Q/(math.pi/4 *d1**2)
TE1  =  P1*10**3 /(rho*g) + V1**2 /(2*g)
V2 =  d1**2 /d2**2 *V1
TE2 =  P2*10**3 /(rho*g) + V2**2 /(2*g)
		
#results
if TE1>TE2 :
    print "Flow is from section 1 to section 2"
else:
    print "Flow is from section 2 to section 1"
Flow is from section 2 to section 1

Example 5.9 Page No : 147

In [10]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
Q = 0.012 			#m**3/s
z = 10. 			#m
d = 0.075 			#m
			
#calculations
Vb = Q/(math.pi/4 *d**2)
Hm = z+ Vb**2 /(2*g)
P = Hm*rho*g*Q
			
#results
print "Power required  =  %.3f kW"%(P/1000)
Power required  =  1.221 kW

Example 5.10 Page No : 150

In [11]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 860. 			#kg/m**3
P1 = 20. *10**3 	#Pa
P2 = 50.*10**3 		#Pa
z = 2.8 			#m
d1 = 0.1 			#m
			
#calculations
V1 = math.sqrt(2*g*(P2/(rho*g) -z - P1/(rho*g)))
Q = math.pi/4 *d1**2 *V1
			
#results
print "rate of flow  =  %.4f m**3/s"%(Q)
rate of flow  =  0.0302 m**3/s

Example 5.11 Page No : 156

In [13]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
Cv = 0.92           #coefficient of velocity
P = 210.*10**3 		#Pressure - Pa
d = 0.05 			#m
ret = 1.5 			#m/s**2
			
#calculations
H = P/(g*rho)
Va = Cv*(2*g*H)
h = Cv**2 *H
h2 =  Cv**2 *2*g*H/(2*(g+ret))
			
#results
print "The height to which the jet will rise is %.2f m"%(h)
print " In case height  =  %.2f m"%(h2)
The height to which the jet will rise is 18.12 m
 In case % height  =  15.72 m

Example 5.12 Page No : 157

In [1]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
h = 4. 			    #m
d = 0.03 			#m
Qa = 3.8/1000 		#m**3/s
x = 2.5 			#m
y = 0.41 			#m
			
#calculations
Qth  =  math.pi/4 *d**2 *math.sqrt(2*g*h)
Cd = Qa/Qth
Cv = math.sqrt(x**2 /(4*y*h))
Cc = Cd/Cv
			
#results
print "Cd  =  %.2f"%(Cd)
print " Cv  =  %.3f"%(Cv)
print " Cc =  %.2f"%(Cc)

# note : rounding off error.
Cd  =  0.61
 Cv  =  0.976
 Cc =  0.62

Example 5.13 Page No : 157

In [15]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
rho2 = 13.6*10**3 	#kg/m**3
d1 = 3.2 			#m
d2 = 0.6 			#m
			
#calculations
z1 = d1*rho/rho2
head =  d2+z1
V = math.sqrt(2*g*head)
			
#results
print "Efflux velocity  =  %.2f m/s"%(V)
#The answer is a bit different due to rounding off error.
Efflux velocity  =  4.05 m/s

Example 5.15 Page No : 159

In [16]:
import math 
from scipy.integrate import quad
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
Cd = 0.6
d = 0.04 			#m
h2 = 2.5 			#m
			
#calculations
def fun(h):
    return 1/(Cd*math.pi/4 *d**2 *math.sqrt(2*g)) *(4/math.sqrt(h) + math.sqrt(64-h**2))

t = quad(fun,0,h2)[0]
tmin = 31.1
			
#results
print "Time required  =  %.1f min"%(tmin)
Time required  =  31.1 min

Example 5.16 Page No : 160

In [12]:
import math 
from scipy.integrate import quad
from sympy import solve,Symbol

#Initialization of variables
g = 981. 			#cm/s**2
Cd = 0.6
Q = 1200.
d = 3. 			    #cm
l = 30. 			#cm
b = 30. 			#cm
dh = 5. 			#cm
h1 = 9. 			#cm
			
#calculations
def fun1(h):
    return  l*b/(Q - Cd*math.pi/4 *d**2 *math.sqrt(2*g*h))
#t = Symbol("t")
#ans = solve((Q - Cd*math.pi/4*d**2*math.sqrt(2*g*h)*d*t) - (30*30*dh))
#print ans
t = quad(fun1,h1,h1+dh)[0]
t = 126
			
#results
print "Time required  =  %d sec"%(t)
Time required  =  126 sec

Example 5.17 Page No : 165

In [13]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
pst = 25.2*10**3 	#pressure - Pa
h = 2.5 			#depth - m
			
#calculations
v = math.sqrt(2/rho *(pst - g*rho*h))
			
#results
print "velocity  =  %.2f m/s"%(v)
velocity  =  1.16 m/s

Example 5.18 Page No : 165

In [14]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 			#kg/m**3
vel = 800.*10**3 /3600
sm = 13.57
sl2 = 12.2          #specific weight of air
			
#calculations
sl = sl2/(g*rho)
y = vel**2 /(2*g*(sm/sl -1))
			
#results
print "length of manometer  =  %.f cm"%(y*100)
length of manometer  =  23 cm

Example 5.19 Page No : 166

In [22]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10**3 		#kg/m**3
h = 3.5 			#m
			
#calculations
v = math.sqrt(2*g*h)
			
#results
print "Speed necessary  =  %.1f m/s"%(v)
Speed necessary  =  8.3 m/s

Example 5.20 Page No : 173

In [23]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
sm = 13.6 
s = 1.
Q = 1.   			#m**3/s
d2 = 0.25 			#m
d1 = 0.5 			#m
nu = 1e-6
			
#calculations
RN = Q*d1/(math.pi/4 *d1**2 *nu)
Cv = 0.98
yd =  Q**2 *(1-d2**4 /d1**4)/(Cv**2 *math.pi/4 *d2**2 *2*g)
y = yd/(sm/s -1)
			
#results
print "Mercury manometer reading  =  %.2f cm"%(y*100)
Mercury manometer reading  =  8.04 cm

Example 5.21 Page No : 174

In [25]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
sm = 13.6
s = 1.
y = 0.12 			#m
Cv = 0.984
d1 = 0.05 			#m
d2 = 0.1 			#m
nu = 1e-6
			
#calculations
Q = Cv*math.pi/4 *d1**2 *math.sqrt(2*g) /math.sqrt(1- (d1/d2)**4) *math.sqrt(y*(sm/s -1))
V1 = Q/(math.pi/4 *d2**2)
R = V1*d1/nu
			
#results
print "Since reynolds number is in required value Flow rate  =  %.4f m**3/s"%(Q)
Since reynolds number is in required value Flow rate  =  0.0109 m**3/s

Example 5.22 Page No : 174

In [26]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
P1 = 150.*10**3 	#pressure - Pa
d0 = 3. 			#cm
d1 = 6. 			#diameter - cm
Cv = 0.98  
Cc = 0.62
			
#calculations
P1g = P1/(g*rho)
Ar =  (d0/d1)**4
A0 = math.pi/4 *(d0/100)**2
Q =  Cv*Cc*A0 *math.sqrt(2*g) /math.sqrt(1- Cc**2 *Ar) *math.sqrt(P1g)
			
#results
print "Discharge  =  %.2f lps"%(Q*10**3)
Discharge  =  7.53 lps

Example 5.23 Page No : 182

In [16]:
import math 
from numpy import *
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10**3 		#kg/m**3
Cd = 0.6
L = 3 			    #m
H = 0.4 			#m
V0 = array([0, 0.24, 0.275])
			
#calculations
Q =  Cd*2/3 *math.sqrt(2*g) *(L-0.2*H) *((H+ V0**2 /(2*g) )**(3./2) - (V0**2 / (2*g))**(3./2))
			
#results
H = max(Q)
print "Flow rate  =  %.2f m**3/s"%(H)
Flow rate  =  1.33 m**3/s

Example 5.24 Page No : 183

In [2]:
import math 
from sympy import Symbol, solve
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
d = 0.5 			#m
vel = 1. 			#m/s
depth = 1.2 		#m
Cd = 0.62
L = 1
			
#calculations
#H = Symbol("H")
#ans = solve(d*L/(Cd*2./3*L*H**(3./2)) - 1)
#print ans
H = (d*3./(2*Cd))**(2/3.)
hw = depth-H
	
#results
print "height of weir plate  =  %.2f m"%(hw)

# note : value of H is calculated wrongly. please check.
height of weir plate  =  0.06 m

Example 5.25 Page No : 184

In [26]:
import math 
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 			#kg/m**3
Q = 0.1*100**2 /(24.*3600) 			#m**3/s
Cd = 0.61
theta = 60. 			#degrees

#Calculations
Hd = Q/(Cd*8./15 *math.sqrt(2*g) *math.tan(math.radians(theta/2)))
H = Hd**(2./5)
			
#results
print "apex of weir must be set %.1f cm below the free surface"%(H*100)

#The answer in the textbook is wrong. Please verify it
apex of weir must be set 18.1 cm below the free surface

Example 5.26 Page No : 184

In [33]:
import math 
			
#Initialization of variables
Q1 = 0.93      #m**3/s 
Q2 = 0.4       #m**3/s
H1 = 0.7      #m
H2 = 0.5      #m
			
#calculations
n = math.log(Q1/Q2) /math.log(H1/H2)
			
#results
print "Shape n  =  %.1f . hence shape of weir is triangular"%(n)
Shape n  =  2.5 . hence shape of weir is triangular

Example 5.27 Page No : 185

In [27]:
import math 
			
#Initialization of variables
g = 981. 			#cm/s**2
H = 20. 			#cm
err = 3./100
			
#calculations
dH = err/2.5 *H
v0 = math.sqrt(2*g*dH)
			
#results
print "Required velocity  =  %.2f cm/s"%(v0)

#The answer is a bit different due to rounding off error
Required velocity  =  21.70 cm/s

Example 5.28 Page No : 185

In [28]:
import math 
from scipy.integrate import quad
			
#Initialization of variables
g = 9.81 			#m/s**2
rho = 10.**3 		#kg/m**3
Q = 12000. 			#m**2
f = 30.   			#h**2/3
t1 = 0.5  			#m
t2 = 1.2  			#m
			
#calculations
def  fun2(h):
    return Q/f *(1/h**(3./2))

t = quad(fun2,t1,t2)[0]
			
#results
print "Time   =  %d sec"%(t)

#The answer is different due to rounding off error
Time   =  401 sec