from __future__ import division
from math import pi
print "Example: 7.1 - Page: 256\n\n"
# Solution
# *****Data******#
d1 = 0.15## [inlet dia, m]
d2 = 0.20## [outlet dia, m]
U1 = 7## [inlet velocity, m/s]
#****************#
# From Fig. 7.2 (Pg 256)
# At the inlet:
A1 = (pi/4)*d1**2## [square m]
# At the outlet:
A2 = (pi/4)*d2**2## [square m]
Q = A1*U1## [cubic m/s]
print "Flow rate is %.4f m/s\n"%(Q)#
# Using Continuity Eqn.
# density1*U1*A1 = Density2*U2*A2
# For water: Density1 = Density2. Therefore:
U2 = A1*U1/A2#
print "Velocity of water at the outlet is %.3f m/s"%(U2)#
from __future__ import division
from math import pi
print "Example: 7.2 - Page: 257\n\n"
# Solution
#*****Data******#
d1 = 0.2## [m]
d2 = 0.15## [m]
d3 = 0.1## [m]
U1 = 3## [m/s]
U2 = 2.5## [m/s]
#**************#
# From Fig. 7.3 (Pg: 257)
# For pipe I:
A1 = (pi/4)*d1**2## [square m]
Q1 = A1*U1## [cubic m/s]
# For pipe II:
A2 = (pi/4)*d2**2## [square m]
Q2 = A2*U2## [cubic m/s]
# For pipe III:
A3 = (pi/4)*d3**2## [square m]
# From continuity Eqn.:
Q3 = Q1 - Q2## [cubic m/s]
U3 = Q3/A3## [m/s]
print "Discharge through the 10 cm pipe is %.4f cubic m/sec\n"%(Q1)#
print "Average velocity in the 15 cm pipe is %.2f m/s"%(U3)#
from __future__ import division
from math import pi
print "Example: 7.3 - Page: 262\n\n"
# Solution
#*****Data******#
d1 = 0.3## [m]
d2 = 0715##[m]
Q = 40/1000## [cubic m/s]
Z1 = 8## [m]
Z2 = 6## [m]
P1 = 5*10**5## [Pa]
density = 1000## [kg/cubic m]
g = 9.81## [m/square s]
#*************#
# From Fig. 7.3 (Pg: 262)
A1 = (pi/4)*d1**2## [square m]
A2 = (pi/4)*d2**2## [square m]
U1 = Q/A1## [m/s]
U2 = Q/A2## [m/s]
# Applying Bernoulli's equations at sections 1 & 2:
P2 = ((U1**2/(2*g) + Z1 + P1/(density*g)) - (U2**2/(2*g) + Z2))*(density*g)## [Pa]
print "Pressure at section 2 is %.2f bar"%(P2/10**5)#
from __future__ import division
from math import pi
print "Example: 7.4 - Page: 268\n\n"
# Solution
#*****Data******#
P1 = 100## [kPa]
T1 = 320## [K]
P2 = 600## [kPa]
T2 = 430## [K]
m_dot = 0.03## [kg/s]
Qout = 15## [kJ/kg]
#*************#
# The energy balance around the compressor:
# dE_System/dt = Ein - Eout
# Since it is a steady state process:
# dE_Sysytem/dt = 0
# Ein = Eout
# Win + m_dot*H1 = Qout + m_dot*H2
# Since, Qout = Qout/m
# Win = m_dot*(Qout + (H2 - H1))
# From enthalpy chart of air:
H1 = 320.20## [Enthalpy of air at 320 K, kJ/kg]
H2 = 431.43## [Enthalpy of air at 430 K, kJ/kg]
Win = m_dot*(Qout + (H2 - H1))## [kW]
print "Power Requirement of the compressor is %.2f kW"%(Win)#
from __future__ import division
from math import pi,log
print "Example: 7.5 - Page: 269\n\n"
# Solution
#*****Data******#
P1 = 100## [kPa]
T1 = 250## [K]
Q = 0.1## [cubic m/s]
P2 = 500## [kPa]
M = 44## [g/mol]
R = 8.314## [J/mol K]
#****************#
# Solution (a)
# Work done by reversible adiabatic compression, gama = 1.4#
gama = 1.4#
T2 = T1*(P2/P1)**((gama - 1)/gama)## [K]
Wad = (gama*R/(gama - 1))*(T1 - T2)## [J/mol]
Wad = Wad/M## [J/g]
print "Work done by reversible adiabatic compression when gama = 1.4 is %.2f J/g\n"%(Wad)#
# Solution (b)
# Work done by isothermal compression:
Wiso = - (R*T1)*log(P2/P1)## [J/mol]
Wiso = Wiso/M## [J/g]
print "Work done by isothermal compression is %.2f J/g\n"%(Wiso)#
# Solution (c)
# Work done in single stage compression, gama = 1.3:
gama = 1.3#
V1 = Q## [cubic m]
Wsingle_stage = (gama*P1*V1/(gama - 1))*(1-(P2/P1)**((gama - 1)/gama))## [kW]
print "Work done in single stage compression is %.2f kW"%(Wsingle_stage)#
from __future__ import division
from math import pi
print "Example: 7.7 - Page: 274\n\n"
# Solution
#*****Data******#
T_steam1 = 50## [OC]
T_steam2 = 30## [OC]
msteam_dot = 10## [kg/min]
T_water1 = 15## [OC]
T_water2 = 25## [OC]
#***************#
# Solution (a)
# From the Stem Table:
H1 = 2645.9## [kJ/kg, At 50 OC]
H2 = 768.2## [kJ/kg, At 30 OC]
H3 = 62.982## [kJ/kg, At 15 OC]
H4 = 104.83## [kJ/kg, At 25 OC]
# The mass & Energy balance of the above flow gives:
mwater_dot = msteam_dot*(H1 - H2)/(H4 - H3)## [kg/min]
print "The mass flow rate of water is %.2f kg/min\n"%(mwater_dot)#
# Solution (b)
Qdot = mwater_dot*(H4 - H3)## [kJ/min]
print "The rate of heat transfer is %.2f kJ/min"%(Qdot)#
from __future__ import division
from math import pi,sqrt
print "Example: 7.8 - Page: 279\n\n"
# Solution
#*****Data******#
P1 = 500## [kPa]
T1 = 623## [K]
mdot = 12## [kg/s]
P2 = 500## [kPa]
T2 = 523## [K]
Qdot = -120## [kW]
H1 = 3168## [kJ/kg]
H2 = 2976## [kJ/kg]
#************#
Q = Qdot/mdot## [kJ/kg]
# By energy balance:
# (deltaU**2/2) + g*deltaZ + deltaH = Q - Ws
# Considering negligible change in P.E., deltaZ = 0 & Ws = 0.
# (U2**2 - U1**2)/2 + deltaH = Q
deltaH = H2 - H1## [kJ/kg]
# Neglecting inlet velocity.
U2 = sqrt(2*(Q - deltaH)*1000)## [m/s]
print "Outlrt velocity is %.1f m/s\n"%(U2)#
from __future__ import division
from math import pi,sqrt
print "Example: 7.9 - Page: 279\n\n"
# Solution
#*****Data******#
Pin = 1000## [kPa]
Tin = 600## [K]
Uin = 50## [m/s]
gama = 1.4#
M = 17## [g/mol]
R = 8314## [kJ/mol K]
MachNumber = 2#
#***************#
# Solution (i)
# Using Eqn. (7.36):
Critical_Ratio = (2/(gama + 1))**(gama/(gama - 1))#
print "Critical Ratio is %.2f\n"%(Critical_Ratio)#
# Solution (ii)
PV_in = R*Tin/M## [square m]
Uthroat = sqrt(Uin**2 + (2*gama*PV_in/(gama - 1))*(1-(Critical_Ratio)**((gama - 1)/gama)))## [m/s]
Uout = MachNumber*Uthroat## [m/s]
print "The discharge velocity is %.2f m/s"%(Uout)#
from __future__ import division
from math import pi,sqrt
print "Example: 7.10 - Page: 280\n\n"
# Solution
#*****Data******#
P1 = 800## [kPa]
T1 = 773## [K]
H1 = 3480## [kJ/kg]
P2 = 100## [kPa]
T2 = 573## [K]
H2 = 3074## [kJ/kg]
#***************#
# Solution (a)
# Velocity of the fluid exiting the nozzle:
# U2 = sqrt(U1**2 + 2*(H1 - H2))
# Neglecting initial velocity:
U2 = sqrt(2*(H1 - H2)*1000)## [m/s]
print "(a) Final Velocity is %.2f m/s\n"%(U2)#
# Solution (b)
U1 = 40## [m/s]
U2 = sqrt((U1**2 + 2*(H1 - H2))*1000)## [m/s]
print "(b) Final Velocity is %.2f m/s\n"%(U2)#
from __future__ import division
from math import pi
print "Example: 7.11 - Page: 281\n\n"
# Solution
#*****Data******#
P1 = 100## [kPa]
T1 = 200## [OC]
U1 = 190## [m/s]
A1 = 2000/10**4## [square m]
U2 = 70## [m/s]
P2 = 200## [kPa]
Qdot = 100## [kW]
V1 = 2.172## [cubic m/kg]
H1 = 2875.3## [kJ/kg]
#***************#
# Solution (a)
mdot = U1*A1/V1## [kg/s]
print "Mass flow rate of the steam is %.2f kg/s\n"%(mdot)#
# Solution (b)
# Amount of heat transferred to the surrounding per unit steam:
Q = Qdot/mdot## [kJ/kg]
# The Enthalpy at the diffuser outlet can be estimated as:
H2 = Q + H1 + (U1**2 - U2**2)/2## [kJ/kg]
# From the steam table:
T2 = 393.38## [K]
V2 = 1.123## [cubic m/kg]
print "The temperature of the steam leaving the outlet is %.2f K\n"%(T2)#
# Solution (c)
A2 = V2*mdot/U2## [square m]
print "Area of diffuser outlet is %.2f square m\n"%(A2)#