#Initialization of variables
Ta=500 #R
Tr=540 #R
#calculations
cop=Ta/(Tr-Ta)
hp=4.71/cop
print "From steam tables,"
ha=48.02
hb=46.6
hc=824.1
hd=886.9
Wc=-(hd-hc)
We=-(hb-ha)
#results
print "Coefficient of performance = %.1f "%(cop)
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp)
print "\n Work of compression = %.1f Btu/lbm"%(Wc)
print "\n Work of expansion = %.2f Btu/lbm"%(We)
#Initialization of variables
x=0.8
he=26.28 #Btu/lbm
hb=26.28 #Btu/lbm
pe=98.76 #psia
pc=51.68 #psia
hc=82.71 #Btu/lbm
hf=86.80+0.95
#calculations
dwisen=-(hf-hc)
dwact=dwisen/x
hd=hc-dwact
cop=(hc-hb)/(hd-hc)
#results
print "Coefficient of performance = %.2f"%(cop)
#Initialization of variables
hc=613.3#btu/lbm
hb=138.9#btu/lbm
ha=138.9#btu/lbm
hd=713.4 #btu/lbm
ta=464.7 #R
t0=545.7 #R
v=8.150 #ft**3/lbm
#calculations
Qa=hc-hb
Qr=ha-hd
Wcd=Qa+Qr
cop=abs(Qa/Wcd)
hp=abs(4.71/cop)
carnot=abs(ta/(t0-ta))
rel=abs(cop/carnot)
mass=200/Qa
C=mass*v
#results
print "Work done = %.1f Btu/lbm"%(Wcd)
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp)
print "\n Coefficient of performance actual = %.2f "%(cop)
print "\n Ideal cop = %.3f"%(carnot)
print "\n relative efficiency = %.3f"%(rel)
print "\n Mass flow rate = %.3f lbm/min ton"%(mass)
print "\n Compressor capacity = %.2f cfm/ton"%(C)
#Initialization of variables
pc=0.6982 #psia
pe=0.1217 #psia
m=200 #gal/min
qual=0.98
h1=23.07 #Btu/lbm
h2=8.05 #Btu/lbm
hw=1071.3
#calculations
rp=pc/pe
m2=m/0.01602 *0.1388 #Conversion of units
m2=1670
dh=15.02
Qa=m2*(h1-h2)
h3=h2 + qual*hw
m3=Qa/(h3-h1)
v=0.016+ qual*2444
C=m3*v
#results
print "Pressure ratio = %.2f"%(rp)
print "\n Heat = %d Btu/min"%(Qa)
print "\n Water make up required = %.2f lbm/min"%(m3)
print "\n Volume of vapor entering ejector = %d cfm"%(C)
print "The answers are a bit different due to rounding off error in textbook"
#Initialization of variables
print "From fig B-4,"
print "Appropraite notation from textbook has been used"
print "All are enthalpy values at different stages"
hc=73.5 #Btu/lbm
hb=26.28 #Btu/lbm
hd=91.58 #Btu/lbm
hc2=190.7 #Btu/lbm
hd2=244.3 #Btu/lbm
hb2=44.4 #Btu/lbm
m1=1 #lbm
m2=0.461 #lbm
hc1=73.5 #Btu/lbm
hd1=83.35 #Btu/lbm
hc2=190.7 #Btu/lbm
hd2=244.3 #Btu/lbm
hb1=12.55 #Btu/lbm
hc22=197.58 #Btu/lbm
hd22=224 #Btu/lbm
#Calculations
w1=hc-hd
qa1=hc-hb
cop1=abs(qa1/(w1))
hp1=4.71/cop1
w2=hc2-hd2
qa2=hc2-hb2
cop2=abs(qa2/(w2))
hp2=4.71/cop2
qa3=m1*(hc1-hb1)
w3=m1*(hc1-hd1) + m2*(hc22-hd22)
cop3=abs(qa3/w3)
hp3=4.71/cop3
#results
print "part a"
print "Work done = %.2f Btu/lbm"%(w1)
print "\n Heat = %.2f Btu/lbm"%(qa1)
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp1)
print "\n Coefficient of performance actual = %.2f "%(cop1)
print "case 2"
print "\n Work done = %.1f Btu/lbm"%(w2)
print "\n Heat = %.2f Btu/lbm"%(qa2)
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp2)
print "\n Coefficient of performance actual = %.2f "%(cop2)
print "part b"
print "\n Work done = %.1f Btu/lbm"%(w3)
print "\n Heat = %.2f Btu/lbm"%(qa3)
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp3)
print "\n Coefficient of performance actual = %.2f "%(cop3)
#Initialization of variables
print "From fig B-4,"
print "Appropraite notation from textbook has been used"
print "All are enthalpy values at different stages"
ha=44.36 #Btu/lbm
hc=18.04 #Btu/lbm
hj=197.58 #Btu/lbm
hh=213.5 #Btu/lbm
hd=hc #Btu/lbm
he=190.66 #Btu/lbm
hk=241.25 #Btu/lbm
#calculations
m=(hc-ha)/(ha-hj)
hi=(m*hj+hh)/(1+m)
Qa=he-hd
W=he-hh + (1+m)*(hi-hk)
cop=abs(Qa/W)
hp=4.71/cop
#results
print "\n horsepower required per ton of refrigeration = %.3f hp/ton refrigeration"%(hp)
print "\n Coefficient of performance actual = %.2f "%(cop)