Chapter 3 : Conservation Principle of Mass

Example 3.3 Page No : 100

In [1]:
import math 
			
#Initialization of variables
d1 = 60. 			#diameter of a section of pipe - cm
V1 = 45. 			#velocity of water - cm/s
d2 = 90. 			#diameter of enlarged section - cm
			
#calculations
V2 = V1*d1**2 /d2**2
Q = math.pi/4 *d1**2 *V1 *10**-6
			
#results
print "Velocity at point 2  =  %d cm/s"%(V2)
print " FLow rate  =  %.4f m**3/s"%(Q)
Velocity at point 2  =  20 cm/s
 FLow rate  =  0.1272 m**3/s

Example 3.4 Page No : 100

In [2]:
			
#Initialization of variables
dn1 = 4 			#spacing between streamlines - cm
v1 = 300. 			#velocity - cm/s
dn2 = 2.5 			#spacing - cm
			
#calculations
v2 = v1*dn1/dn2
			
#results
print "Velocity  =  %.1f m/s"%(v2/100)
Velocity  =  4.8 m/s