10.5. Exercise 5 Solutions#

Section 7.6.3 Exercise 5

#7.6.3 Exercise 1
#Air enters a 1-m2 pipe at 100 kPa and 20°C with a velocity of 180 m/s. Determine the volumetric flow rate, in m3/s, at the inlet and the mass flow rate, in kg/s, at the exit.


A = 1 # m2
Pi = 100 # Pa
Ti = 20 + Kc
vel_i = 180 # m/s
R = 0.287 # kPa*m^3/kgK

# Find: volumetric flow rate at inlet, mass flow rate at exit 
vdot = vel_i*A 

# PV = mRT > P*v = RT > rho = P/RT

rho = Pi/R/Ti

# kg/m^3 * m^3/s = kg/s

mdot_i = rho*vdot
mdot_e = mdot_i
print(f"The volume flow rate at inlet is {round(vdot,1)} m3/s, and the mass flow rate at exit is {round(mdot_e,1)} kg/s")
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [1], in <cell line: 7>()
      5 A = 1 # m2
      6 Pi = 100 # Pa
----> 7 Ti = 20 + Kc
      8 vel_i = 180 # m/s
      9 R = 0.287 # kPa*m^3/kgK

NameError: name 'Kc' is not defined
#7.6.3 Exercise 2
# Air enters a nozzle steadily at 2.21 kg/m3 and 40 m/s and leaves at 0.762 kg/m3 and 180 m/s. 
#If the inlet area of the nozzle is 90 cm2, determine (a) the mass flow rate through the nozzle, and (b) the exit area of the nozzle.

rho_i = 2.21 # kg/m3 
vel_i = 40 # m/s
rho_e = 0.762 #kg/m3
vel_e = 180 # m/s 
A_i = 90/100e2 # m2

# Find: a) mass flow rate through the nozzle, b) exit area
# a)
vdot_i = vel_i*A_i
mdot = rho_i*vdot_i
# b)
A_e = mdot/rho_e/vel_e

print(f"The mass flow rate through the nozzle is {mdot} kg/s and the exit area is {round(A_e,4)} m2")
The mass flow rate through the nozzle is 0.7956 kg/s and the exit area is 0.0058 m2
#7.6.3 Exercise 3
# Water is heated in an insulated, constant-diameter tube by a 7-kW electric resistance heater. If the water enters the heater steadily at 20°C and leaves at 75°C, determine the mass flow rate of water.

import cantera as ct
Kc = 273.15

Wdot = -7 # kJ/s 
T_i = 20 + Kc # K
T_e = 75 + Kc # K

# Wdot = mdot*cp*deltaT
P = 100e3 # assume specific heat independent of pressure and only dependent on temperature
state1 = ct.Water()
state1.TP = T_i, P
cp1 = state1.cp
state1.TP = T_e, P
cp2 = state1.cp
cpavg = (cp1 + cp2)/2/1000
mdot = Wdot/(cpavg*(T_i - T_e))
print(f"The mass flow rate using specific heats is {round(mdot,2)} kg/s")

# Wdot = mdot*(h_i-h_e)
P = 100e3 # assume enthalpy independent of pressure and only dependent on temperature
state1 = ct.Water()
state1.TP = T_i, P
hi = state1.HP[0]/1000
state1.TP = T_e, P
he = state1.HP[0]/1000
mdot = Wdot/(hi-he)
print(f"The mass flow rate is {round(mdot,3)} kg/s")
The mass flow rate using specific heats is 0.03 kg/s
The mass flow rate is 0.03 kg/s
#7.6.3 Exercise 4
# Saturated liquid water is heated in a steady-flow steam boiler at a constant pressure of 2 MPa at a rate of 4 kg/s to an outlet temperature of 250°C. Determine the rate of heat transfer in the boiler.

import cantera as ct
Kc = 273.15

Pi = 2e6 # Pa
xi = 0
Pe = Pi
mdot = 4 # kg/s
Te = 250 + Kc

state1 = ct.Water()
state1.PQ = Pi, xi
hi = state1.HP[0]

state2 = ct.Water()
state2.TP = Te, Pe
he = state2.HP[0]

deltah = he - hi

Qdot = mdot*deltah
print(f"The rate of heat transfer is {round(Qdot*10**-6,2)} MJ/s (MW)")
The rate of heat transfer is 7.97 MJ/s (MW)
#7.6.3 Exercise 5
# Steam enters an adiabatic turbine at 8 MPa and 500°C at a rate of 3 kg/s and leaves at 20 kPa. If the power output of the turbine is 2.5 MW, determine the temperature of the steam at the turbine exit. Neglect kinetic energy changes.

import cantera as ct
Kc = 273.15

Pi = 8e6 # Pa
Ti = 500 + Kc # K
mdot = 3 # kg/s
Pe = 20e3 # Pa
Wdot = 2.5e6 # J/s

# Find: Te
# Wdot = mdot*deltah
inlet = ct.Water()
inlet.TP = Ti, Pi
hi = inlet.HP[0]
he = (mdot*hi - Wdot)/mdot
exit = ct.Water()
exit.HP = he, Pe
Te = exit.TV[0] - Kc
print(f"The exit temperature is {round(Te,2)} deg C")
The exit temperature is 60.11 deg C
#7.6.3 Exercise 6
# An adiabatic air compressor compresses 10 L/s of air at 120 kPa and 20°C to 1000 kPa and 300°C. Determine (a) the work required by the compressor, in kJ/kg, and (b) the power required to drive the air compressor, in kW.

import cantera as ct
Kc = 273.15

vdoti = 10/1000 # m3/s
Pi = 120e3 # Pa
Ti = 20 + Kc # K
Pe = 1000e3 # Pa
Te = 300 + Kc # K
R = 0.287

# w = he - hi
inlet = ct.Solution('gri30.yaml')
inlet.X = 'N2:0.79 O2: 0.21'
inlet.TP = Ti,Pi

exit = ct.Solution('gri30.yaml')
exit.X = 'N2:0.79 O2: 0.21'
exit.TP = Te, Pe

hi = inlet.HP[0]
he = exit.HP[0]
w = (he - hi)/1000
print(f"The work required is {round(w,1)} kJ")

# have vdot, need mdot > use ideal gas law 
# PVdot = mdotRT
mdot = Pi*vdoti/R/Ti

Wdot = mdot*w/1000
print(f'The power required to drive the compressor is {round(Wdot,1)} kJ')
The work required is 287.9 kJ
The power required to drive the compressor is 4.1 kJ
#7.6.3 Exercise 7
# A portion of the steam passing through a steam turbine is sometimes removed for the purposes of feedwater heating. Consider an adiabatic steam turbine with 12.5 MPa and 550°C steam entering at a rate of 20 kg/s. Steam is bled from this turbine at 1000 kPa and 200°C with a mass flow rate of 1 kg/s. The remaining steam leaves the turbine at 100 kPa and 100°C. Determine the power produced by this turbine.

import cantera as ct
Kc = 273.15

Pi = 12.5e6 # Pa
Ti = 550 + Kc # K
mdoti = 20 # kg/s 
mdotb = 1 # kg/s
mdote = mdoti - mdotb # kg/s (mdote = mdoti - the mdot that is bled)
Pb = 1000e3 # Pa
Tb = 200 + Kc # K
Pe = 100e3  # Pa
Te = 100 + Kc # K

inlet = ct.Water()
exit = ct.Water()
bled = ct.Water()

inlet.TP = Ti,Pi
exit.TP = Te, Pe
bled.TP = Tb, Pb

hi = inlet.HP[0]
he = exit.HP[0]
hb = bled.HP[0]

Wdot = mdoti*hi - mdotb*hb - mdote*he
Wdot = Wdot/1000
print(f"The power produced by the turbine is {round(Wdot,1)} kW")
The power produced by the turbine is 15826.9 kW
#7.6.3 Exercise 8
# A well-insulated valve is used to throttle steam from 8 MPa and 350°C to 2 MPa. Determine the final temperature of the steam.

import cantera as ct
Kc = 273.15

Pi = 8e6 # Pa
Ti = 350 + Kc # K
Pe = 2e6 # Pa

# throttle > he = hi 

inlet = ct.Water()
inlet.TP = Ti,Pi
hi = inlet.HP[0]
hi = hi/1000
exit = ct.Water()
he = hi*1000
exit.HP = he, Pe
Te = exit.TP[0] - Kc
print(f"The exit temperature is {round(Te,1)} deg C")
The exit temperature is 284.6 deg C
#7.6.3 Exercise 9
# Refrigerant-134a at 1 MPa and 90°C is to be cooled to 1 MPa and 30°C in a condenser by air. The air enters at 100 kPa and 27°C with a volume flow rate of 600 m3/min and leaves at 95 kPa and 60°C. Determine the mass flow rate of the refrigerant.

import cantera as ct
Kc = 273.15

Pir = 1e6 # Pa
Tir = 90 + Kc # K
Per = Pir
Ter = 30 + Kc # K

Pia = 100e3 # Pa
Tia = 27 + Kc # K
vdotair = 600 # m3/s
Pea = 95e3 # Pa
Tea = 60 + Kc # K

# get enthalpy of inlet/exit for both refr and air
refri = ct.Hfc134a()
refri.TP = Tir, Pir
refrex = ct.Hfc134a()
refrex.TP = Ter, Per
h_ri = refri.HP[0]*1000
h_re = refrex.HP[0]*1000

airi = ct.Solution('gri30.yaml')
airi.X = 'N2:0.79 O2: 0.21'
airi.TP = Tia,Pia

aire = ct.Solution('gri30.yaml')
aire.X = 'N2:0.79 O2: 0.21'
aire.TP = Tea, Pea

h_ai = airi.HP[0]*1000
h_ae = aire.HP[0]*1000

# have vdot, need mdot > use ideal gas law 
# PVdot = mdotRT
mdotair = Pia*vdotair/R/Tia

# Edotin = Edotout >  mdotair*(h_ai - h_ae) = mdotr*(h_ri - h_re)
mdotr = mdotair*(h_ae - h_ai)/(h_ri - h_re)
mdotr = mdotr/1000
print(f"The mass flow rate is therefore {round(mdotr,2)} kg/min")
The mass flow rate is therefore 100.65 kg/min
#7.6.3 Exercise 10
# Steam is to be condensed in the condenser of a steam power plant at a temperature of
#50°C with cooling water from a nearby lake, which enters the tubes of the condenser at
#18°C at a rate of 101 kg/s and leaves at 27°C. Determine the rate of condensation of the
#steam in the condenser.

import cantera as ct
Kc = 273.15

Ti = 18 + Kc
Te = 27 + Kc
Tc = 50 + Kc
mdot = 101 # kg/s

# Qdot = mdot_steam*latent heat of vaporization (hfg) @ Tc - this is the enthalpy change when a substance goes from saturated liquid to saturated vapor

state1 = ct.Water()
state2 = ct.Water()
state1.TP = Ti, 100e3
state2.TP = Te, 100e3
cpavg = (state1.cv/1000 + state2.cv/1000)/2

Qdot = mdot*cpavg*(Te - Ti)

# now find hfg = hg - hf
state1 = ct.Water()
state1.TQ = Tc, 0
hf = state1.HP[0]
state1.TQ = Tc, 1
hg = state1.HP[0]
hfg = (hg - hf)/1000

mdot_steam = Qdot/hfg
print(f"The rate of condensation of the steam in the condensor is {round(mdot_steam,1)} kg/s")
The rate of condensation of the steam in the condensor is 1.6 kg/s
#7.6.3 Exercise 11
# Two streams of water are mixed in an insulated container to form a third stream leaving the container. The first stream has a flow rate of 30 kg/s and a temperature of 90°C. The flow rate of the second stream is 200 kg/s, and its temperature is 50°C. What is the temperature of the third stream?

import cantera as ct
Kc = 273.15

mdot1 = 30   # kg/s
T1 = 90 + Kc # K
mdot2 = 200 #kg/s 
T2 = 50 + Kc # K
mdot3 = mdot1 + mdot2 
# mdot1*h1 + mdot2*h2 = mdot3*h3

# Find h1 and h2 
channel1 = ct.Water()
channel1.TQ = T1, 0
channel2 = ct.Water()
channel2.TQ = T2, 0
h1 = channel1.HP[0]
h2 = channel2.HP[0]
h3 = (mdot1*h1 + mdot2*h2)/(mdot3)

P = 100e3
channel3 = ct.Water()
channel3.HP = h3, P
T = channel3.TP[0]
print(f'The temperature is about {round(T-Kc,2)} deg C')
The temperature is about 55.21 deg C
#7.6.3 Exercise 12
# The turbocharger of an internal combustion engine consists of a turbine and a compressor. Hot exhaust gases flow through the turbine to produce work, and the work output from the turbine is used as the work input to the compressor. 
# The pressure of ambient air is increased as it flows through the compressor before it enters the engine cylinders. Thus, the purpose of a turbocharger is to increase the pressure of air so that more air gets into the cylinder. 
# Consequently, more fuel can be burned and more power can be produced by the engine. In a turbocharger, exhaust gases enter the turbine at 400°C and 120 kPa at a rate of 0.02 kg/s and leave at 350°C. 
#Air enters the compressor at 50°C and 100 kPa and leaves at 130 kPa at a rate of 0.018 kg/s. The compressor increases the air pressure with a side effect: It also increases the air temperature, which increases the possibility that a gasoline engine will experience an engine knock. 
#To avoid this, an aftercooler is placed after the compressor to cool the warm air with cold ambient air before it enters the engine cylinders. It is estimated that the aftercooler must decrease the air temperature below 80°C if knock is to be avoided. 
#The cold ambient air enters the aftercooler at 30°C and leaves at 40°C. Disregarding any frictional losses in the turbine and the compressor and treating the exhaust gases as air, determine:
# a) the temperature of the air at the compressor outlet and
# b) the minimum volume flow rate of ambient air required to avoid knock.

import cantera as ct
Kc = 273.15

# turbocharger
Ti_t = 400 + Kc
Pi_t = 120e3
mdoti_t = 0.02 # kg/s
Te_t = 350 + Kc
# compressor 
Ti_c = 50 + Kc
Pi_c = 100e3
Pe_c = 130e3
mdot_c = 0.018 #kg/s 
# aftercooler 
Ti_a = 30 + Kc
Te_a = 40 + Kc
Te_a_ka = 80 + Kc

inlet = ct.Solution('gri30.yaml')
inlet.X = 'N2:0.79 O2: 0.21'
inlet.TP = Ti_t,Pi_t
cpi = inlet.cp/1000
exit = ct.Solution('gri30.yaml')
exit.X = 'N2:0.79 O2: 0.21'
exit.TP = Te_t,Pi_t
cpe = exit.cp/1000
cpavg= (cpi+cpe)/2

# WdotT = WdotC
WdotT = mdoti_t*cpavg*(Ti_t - Te_t)  
WdotC = WdotT

# assuming eta = 1, WdotT = WdotC (work of turbine = work of compressor)
# WdotC = mdota*cpa*(Tae - Tai)
air = ct.Solution('gri30.yaml')
air.X = 'N2:0.79 O2: 0.21'
air.TP = Ti_c, 100e3
cpa = air.cp/1000
Tae = (WdotC + mdot_c*cpa*Ti_c)/mdot_c/cpa

print(f"The temperature of the air at the compressor outlet is {round(Tae - Kc, 1)} deg C")

air = ct.Solution('gri30.yaml')
air.X = 'N2:0.79 O2: 0.21'
air.TP = Ti_a, 100e3
cp_ca = air.cp/1000
P = 100 #kPa
mdot = mdot_c*cpa*(Tae-Te_a_ka)/(cp_ca*(Te_a - Ti_a))
R = 0.287 # kJ/kgK
v = R*Ti_a/P
Vdot = v*mdot*1000
print(f"The minimum volume flow rate of ambient air required to avoid knock is {round(Vdot,2)} m3/s")
The temperature of the air at the compressor outlet is 108.6 deg C
The minimum volume flow rate of ambient air required to avoid knock is 44.9 m3/s
#7.6.3 Exercise 13
# A 2 m3 rigid insulated tank initially containing saturated water vapor at 1 MPa is connected through a valve to a supply line that carries steam at 400°C. Now the valve is opened, and steam is allowed to flow slowly into the tank until the pressure in the tank rises to 2 MPa. At this instant the tank temperature is measured to be 300 °C. Determine the mass of the steam that has entered and the pressure of the steam in the supply line.

import cantera as ct
Kc = 273.15

# Given: 
V_tank = 2 # m3
P1 = 1e6
x1 = 1
P2 = 2e6
T2 = 300 + Kc # K

# Find: mass of steam that entered, pressure of steam in the supply line 
# Q = mass*change in specific internal energy
# m_entered = m_final - m_initial 

state1 = ct.Water()
state1.PQ = P1, x1
v1 = state1.TV[1]
u1 = state1.UV[0] #J
m_tanki = V_tank/v1 # the mass of H20 that's originally in the tank 

state2 = ct.Water()
state2.TP = T2, P2
v2 = state2.TV[1]
u2 = state2.UV[0] #J 
m_tankf = V_tank/v2
m_entered = m_tankf - m_tanki

# Pressure of the steam in the supply line 
T_line = 400 + Kc # K

hsteam = (m_tankf*u2 - m_tanki*u1)/m_entered
line = ct.Water()
line.TH = T_line, hsteam
P_line = line.TP[1]/10**6
x = line.TQ[1]
print(f"The mass of steam that enters the tank is {round(m_entered,1)} kg and the pressure of the steam in the line is {round(P_line,1)} MPa")
The mass of steam that enters the tank is 5.7 kg and the pressure of the steam in the line is 2255.0 MPa
#7.6.3 Exercise 14
# A 2 m3 rigid tank initially contains air at 100 kPa and 22°C. The tank is connected to a supply line through a valve. Air is flowing in the supply line at 600 kPa and 22°C. The valve is opened, and air is allowed to enter the tank until the pressure in the tank reaches the line pressure, at which point the valve is closed. A thermometer placed in the tank indicates that the air temperature at the final state is 77°C. Determine (a) the mass of air that has entered the tank and (b) the amount of heat transfer.

import cantera as ct
Kc = 273.15

V_tank = 2 # m3
P1 = 100 # kPa
T1 = 22 + Kc # K
Pline = 600 # kPa
Tline = 22 + Kc # K 
P2 = Pline 
T2 = 77 + Kc # K
R = 0.287 # kPam3/kgK

# air, so we have to use ideal gas law 
# initial mass
m1 = P1*V_tank/R/T1
m2 = P2*V_tank/R/T2
mt = m2 - m1
print(f"The mass of air that has entered the tank is {round(mt,1)} kg")

state1 = ct.Solution('gri30.yaml')
state1.X = 'N2:0.79 O2: 0.21'
state1.TP = T1, P1
u1 = state1.u/1000 #kJ

state2 = ct.Solution('gri30.yaml')
state2.X = 'N2:0.79 O2: 0.21'
state2.TP = T2, P2
u2 = state2.u/1000 #kJ

line = ct.Solution('gri30.yaml')
line.X = 'N2:0.79 O2: 0.21'
line.TP = Tline, Pline
ht = line.h/1000 #kJ

# find the amount of heat transfer
Qin = -mt*ht + m2*u2 - m1*u1
print(f"The heat transfer is {round(Qin,1)} kJ")
The mass of air that has entered the tank is 9.6 kg
The heat transfer is -339.1 kJ