from __future__ import division
import math
# Initialization of Variable
P1 = 7 #bar
T1 = 200 #deg C
m1dot = 40 #kg/s
P2 = 7 #bar
T2 = 40 #degC
A2 = 25 #cm2
P3 = 7 #bar
vdot = 0.06 #m3/s
#calculations:
#from Table T-3, specific vol
v3 = 1.108E-3 #m3/kg
m3dot = vdot/v3
m2dot = m3dot - m1dot
#from table T-2,
v2 = 1.0078E-3 #m3/kg
V2 = m2dot*v2*10000/A2
#Results
print "mass flow rate at inlet 2 is", round(m2dot,2),"kg/s and at exit is",round(m3dot,2),"kg/s"
print "velocity at inlet 2 is", round(V2,1),"m/s"
from __future__ import division
import math
%pylab inline
# Initialization of Variable
midot = 30 #lb/s
A = 3 #ft2
p = 62.4 #lb/ft2
#calculations:
#creating empty lists for plotting
L = []
t = []
for h in range(1200):
t.append((h-1)/10)
k=(h-1)/10
L.append(3.33*(1 - math.e**(-9*k/(p*A))))
#Results
# plots
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.plot(t,L)
xlabel('Time, s')
ylabel('Height, ft')
title('Liquid Height vs Time')
show()
from __future__ import division
import math
# Initialization of Variable
P1 = 40 #bar
T1 = 400 #degC
V1 = 10 #m/s
P2 = 15 #bar
V2 = 665 #m/s
mdot = 2 #kg/s
#calculations:
#specific potential energy at 1 is
h1 = 3213.6 #kJ/kg
#at 2
h2 = h1 + (V1**2 - V2**2)/2
#From Table T-4
v2 = 0.1627 #m3/kg
#exit area:
A2 = mdot*v2/V2
#Results
print "Exit Area is", round(A2,6),"m2"
from __future__ import division
import math
# Initialization of Variable
mdot = 4600 #kg/h
Wdot = 1000 #kW
P1 = 60 #bar
T1 = 400 #degC
V1 = 40 #m/s
P2 = 0.1 #bar
x2 = 0.9
V2 = 50 #m/s
#calculations:
#from table T-4, specific enthalpy
h1 = 3177.2 #kJ/kg
#From table T-3,
hf2 = 191.83 #kJ/kg
hg2 = 2584.63 #kJ/kg
h2 = hf2 + x2*(hg2-hf2)
#rate of heat transfer
Qdot = Wdot + mdot*(h2 - h1 + (V2**2 - V1**2)/2000)/3600
#Results
print "rate of heat transfer is", round(Qdot,1),"kW"
#answer wrong in book
from __future__ import division
import math
# Initialization of Variable
P1 = 1 #bar
T1 = 290 #K
V1 = 6 #m/s
A1 = 0.1 #m2
P2 = 7 #bar
T2 = 450 #K
V2 = 2 #m/s
Qdot = -180 #kJ/min
R = 8314/28.97 #J/kg-K
#calculations:
#specific volume at 1
v1 = R*T1/P1
#mass flow rate
mdot = A1*V1*1E5/v1
#from table T-9
h1 = 290.16 #kJ/kg
h2 = 451.8 #kJ/kg
#power required by the compressor
Wdot = Qdot/60 + mdot*((h1-h2) + (V1**2 - V2**2)/2000)
#Results
print "power required by the compressor is", round(Wdot,1),"kW"
from __future__ import division
import math
# Initialization of Variable
T1 = 20 #degC
P1 = 1 #atm
Vdot = 0.1 #lt/s
D1 = 2.5 #cm
T2 = 23 #degC
V2 = 50 #m/s
z1 = 0 #m
z2 = 5 #m
x2 = 0.1
c = 4.18 #kJ/kg-K
g = 9.81 #m/s2
#cqlculations:
#from Table T-2, Specific volume at 1
v = 1.0018E-3 #m3/kg
#mass flow rate
mdot = Vdot*1E-3/v
#inlet Area
A1 = math.pi*(D1**2)/4
#inlet velocity
V1 = Vdot/A1
# power
Wdot = (mdot/(1 - x2))*(c*(T1-T2) + (V1**2 - V2**2)/2000 + g*(z1 - z2)/1000)
#Results
print "power input is", round(Wdot,2),"kW"
from __future__ import division
import math
# Initialization of Variable
P1 = 0.1 #bar
x1 = 0.95
P2 = 0.1 #bar
T2 = 45 #deg C
T3 = 20 #degC
T4 = 35 #degC
#calculations:
#assumption
Wdot = 0
#from table T-3,
hf1 = 191.83 #kJ/kg
hf2 = 188.45 #kJ/kg
hg1 = 2584.7 #kJ/kg
h4_3 = 62.7 #kJ/kg
#specific enthalpy
h1 = hf1 + x1*(hg1-hf1)
h2 = hf2
#ratio of mdots
m3dot_m1dot = (h1 - h2)/h4_3
#rate of energy transfer from the condensing steam to the cooling water
Qdotm = h2 - h1
#Results
print "a) ratio of the mass flow rate of the cooling water to the mass flow rate of the condensing stream is", round(m3dot_m1dot,1)
print "b) rate of energy transfer from the condensing steam to the cooling water is",round(Qdotm,1),"kJ/kg"
from __future__ import division
import math
# Initialization of Variable
T1 = 20 #degC
P1 = 1 #bar
V1 = 1.3 #m/s
T2 = 32 #degC
Pc = -80 #W
Pf = -18 #W
Cp = 1.005 #kJ/kg-K
R = 8314/28.97 #J/kg-K
#calculations:
#assumptions
Qdot = 0
Wdot = Pc + Pf
#inlet Area
A1 = (1/V1)*(-1*Wdot/(Cp*(T2 - T1)*1000))*R*(T1+273)/101325
D1 = ((4*A1/math.pi)**0.5)*100
#Results
print "smallest fan inlet diameter is", round(D1,0),"cm"
from __future__ import division
import math
# Initialization of Variable
P1 = 300 #lbf/in2
P2 = 14.7 #lbf/in2
T2 = 250 #degF
#calculations:
#From TAble T-3E
hf1 = 394.1 #Btu/lb
hg1 = 1203.9 #Btu/lb
#from Table T-4E
h2 = 1168.8 #Btu/lb
#Quality factor
x1 = (h2-hf1)/(hg1-hf1)
#Results
print "quality in the line is", round(x1*100,1),"%"
from __future__ import division
import math
# Initialization of Variable
AV1 = 2E5 #ft3/min
T1 = 400 #degF
P1 = 1 #atm
T2 = 260 #degF
P2 = 1 #atm
P3 = 40 #lbf/in2
T3 = 102 #degF
m3dot = 275 #lb/min
P5 = 1 #lbf/in2
x5 = 0.93
cost = 0.08 #$/W
t = 8000 #hrs
R = 1545/28.97 #ft.lbf/lb-degR
#calculations:
#in Rankine
T1r = (((T1-32)*5/9)+273)*1.8
#mass flow rate at 1
m1dot = AV1*(P1*14.7)*144/(R*T1r)
#from Table T-9E
h1 = 206.46 #Btu/lb
h2 = 172.39 #Btu/lb
#From Table T-2E
h3 = 70 #Btu/lb
#From Table T-3E
hf5 = 69.74 #Btu/lb
hg5 = 1105.74 #Btu/lb
#enthapy at 5
h5 = hf5 + x5*(hg5-hf5)
#Power
Wdot = m1dot*(h1-h2) + m3dot*(h3 - h5)
#for temp T4
h4 = h3 + (m1dot/m3dot)*(h1-h2)
#from Table T-4E
P4 = 40 #lbf/in2
T4 = 354 #degF
#total cost
AnnVal = (Wdot*60/3413)*t*cost
#From TAble T-3E
hf1 = 394.1 #Btu/lb
hg1 = 1203.9 #Btu/lb
#from Table T-4E
h2 = 1168.8 #Btu/lb
#Quality factor
x1 = (h2-hf1)/(hg1-hf1)
#Results
print "a) power developed by the turbine is", round(Wdot,0),"Btu/min"
print "b) Turbine Inlet temperature is", T4,"degF"
print "c) Annual Value of power developed is", round(AnnVal,0),"$/year"
#Answer wrong in book