# Variables
m = 2.
M = 28.
M2 = 32.
PN = 300. #psia
Pt = 400. #psia
# Calculations
nN = m/M
PO = Pt-PN
nO = nN*PO/PN
mO = M2*nO
# Results
print "Mass of oxygen added = %.3f lbm"%(mO)
# Variables
n = 0.0714
R = 1545.
T = 560. #R
P = 400. #psia
VN = n*R*T/(P*144)
VO = (0.0238)*R*T/(P*144)
V = VN+VO
# Results
print "Total volume = %.3f ft**3"%(V)
# Variables
import math
m1 = 5.
m2 = 2.
cp1 = 0.248
cp2 = 0.203
T11 = 300. #F
T12 = 100. #F
P = 10. #psia
Pi = 20. #psia
Pf = 15. #psia
# Calculations
T2 = (m1*cp1*T11 + m2*cp2*T12)/(m1*cp1+m2*cp2)
n1 = m1/28.
n2 = m2/44.
n = n1+n2
P1 = P*n1/n
P2 = P*n2/n
dS = m2*(cp2*math.log((T2+460)/(T12+460)) - 35.1/778 *math.log(P2/Pi)) +m2*(cp2*math.log((T2+460)/(T12+460)) - 55.2/778 *math.log(P1/Pf))
# Results
print "change in enthalpy = %.2f B/R"%(dS)
# Variables
Pg = 2.8886 #psia
P = 25. #psia
phi = 0.5
# Calculations
pv = phi*Pg
pa = P-pv
w = 0.622*pv/pa
x = (w)/(1+w)
# Results
print "Mass fraction of water vapor in the mixture = %.4f lbm vapor/ lvm mixture"%(x)
# Variables
pgw = 0.5069 #psia
p = 14.696 #psia
Td = 100. #F
Tw = 80. #F
# Calculations
pv = pgw- (p-pgw)*(Td-Tw)/(2800-Tw)
pg = 0.9492 #psia
phi = pv/pg
# Results
print "relative humidity of air stream = %.1f percent"%(phi*100)
# Variables
w1 = 0.0176 #lbm
w2 = 0.0093 #lbm
T2d = 73. #F
T2 = 55. #F
# Calculations
hv1 = 1061+0.445*100
hv2 = 1061+0.445*55
hf = 23.06
q1 = 20.
q2 = 4.88
# Results
print "Heat removed in cooling section = %d Btu/lbm "%(q1)
print "Heat added in heating section = %.2f Btu/lbm "%(q2)
# Variables
Tdb = 115. #F
ph = 0.05
Twb = 67. #F
# Results
print ("From steam tables, Twb = 67 F")
# Variables
w1 = 206.
w2 = 55.
ma1 = 2.
ma2 = 3.
# Calculations
w3 = (ma1*w1 + ma2*w2)/(ma1+ma2)
Tdb3 = 82. #F
TWb3 = 74.55 #F
phi3 = 70. #percent
# Results
print "relative humidity = %d percent"%(phi3)
print " Dry bulb temperature = %d F"%(Tdb3)
print " Wet bulb temperature = %.2f F"%(TWb3)