# Chapter 2:Flow of Fluids —Energy and Momentum Relationships¶

## Example no:2.1,Page no:36¶

In [24]:
#Variable declaration
#(a) PV = 1 * RT, where
R=8314.0
P=60.0*10**6
T=320.0
Tc=191.0
Pc=4.64*10**6

#Calculation
V1=8314.0*T/P
#(b) In van der Waals equation (2.32), the constants may be taken as:
a=27*R**2*Tc**2.0/(64.0*Pc)
b=R*Tc/(8.0*Pc)
#Thus using equation 2.32:
import sympy
x=Symbol('x')
p=sympy.solve((60*10**6*x**2+a)*(x-0.0427)-(8314*320*x**2))
#(c) Tr=T/Tc  ,Pr=P/Pc
Tr=T/Tc
Pr=P/Pc
#Thus from Figure 2.1,
Z=1.33
#V = ZnRT/P (from equation 2.31)
V3=Z*R*T/P

#Result
print"(a) Volume of vessel (ideal gas law) =",round(V1,4),"m**3"
print"(b) Volume of vessel(van der waals eq.) =",round(p[0],3),"m**3"
print"(c) Volume of vessel(generalised compressibility-factor chart) =",round(V3,4),"m**3"

(a) Volume of vessel (ideal gas law) = 0.0443 m**3
(b) Volume of vessel(van der waals eq.) = 0.066 m**3
(c) Volume of vessel(generalised compressibility-factor chart) = 0.059 m**3


## Example no:2.3,Page no:43¶

In [31]:
#Variable declaration
#Mass rate of discharge of water, G = rho*u*A
rho=1000.0  #Density of Water
d=25.0*10**-3  #Diameter of nozzle
u=25.0  #Velocity of water at nozzle

#Calculation
import math
G=rho*u*math.pi/4*d**2
#Momentum of fluid per second = Gu
F=G*25

#Result
print"\n Reaction force = Rate of change of momentum =",round(F),"N"

 Reaction force = Rate of change of momentum = 307.0 N


## Example no:2.4,Page no:43¶

In [32]:
#Variable declaration
#Momentum per second of approaching liquid in Y-direction = rho*u**2*A
rho=1000.0  #Density of water
d=50.0*10**-3  #Diameter of pipe
u=5.0  #Velocity of water in pipe

#Calculation
import math
M=rho*u**2*math.pi/4*d**2
Rf=M*(math.cos(math.pi/4)+math.sin(math.pi/4))

#Result
print"\n The resultant force in direction of arm of bracket =",round(Rf,1),"N"

 The resultant force in direction of arm of bracket = 69.4 N


## Example no:2.5,Page no:48¶

In [33]:
#Variable declaration
#From equation 2.68:
# 0.5*((u2)**2-(u1)**2)=g*(z1-z2)+((P1-P2)/rho)
#Suffix 1 to denote conditions in the pipe and suffix 2 to denote conditions in the jet
#Symbols have their usual meaning
u1=0.0
z1=0.0
z2=0.0
P1=250.0*10**3
P2=0.0
rho=1000.0 #Density of water
g=9.81

#Calculation
import sympy
x=Symbol('x')
u2=solve((0.5*(x)**2)-((P1-P2)/rho))
print"Velocity of the jet, u2 =",round(u2[1],1),"m/s"

Velocity of the jet, u2 = 22.4 m/s


## Example no:2.6,Page no:54¶

In [34]:
#Variable declaration
id=0.5  #internal diameter of pipe
rs=50  #revolution speed
rho=1000  #density of water

#Calculation
omega=2*math.pi*rs
#The wall pressure is given by equation 2.82 as:
wall_pressure=rho*(omega)**2/2*((id/2)**2-ir**2)

#Result
print"\n The wall pressure is %.2e"%wall_pressure,"N/m**2"

 The wall pressure is 1.97e+06 N/m**2