#initialisation of variables
cc=12000 #btu/h
pi=1565 #/watts
ra=7 #btu/h/w
#CALCULATIONS
EER=cc/pi
p1=cc/ra
#RESULTS
print 'EER is %0.2f '%(EER)
print '\npower consumption of first unit is %0.2f Watts'%(p1)
#initialisation of variables
t1=278 #temparature in k
t2=300 #temparature in k
hf2=21 #kj/kg
hfg2=2489.7 #kj/kg
h3=113.1 #under 300 k in kj/kg
x2=0.8
p=3.154 #power
#CALCULATIONS
cop=t1/(t2-t1)
h2=hf2+(x2*hfg2)
re=h2-h3
pr=p/cop
#RESULTS
print 'cop is %0.2f '%(cop)
print '\npower required is %0.4f kw/ton of refrigeration'%(pr)
print '\nrefrigeration effect is %0.1f kJ/kg'%(re)
#initialisation of variables
t1=253 #temp in k
t3=313 #temp in k
cp=1.005 #kj/kg
r=4 #bar
g=1.4
#CALCULATIONS
t2=(t1*(r)**((g-1)/g))
t4=(t3/(r)**((g-1)/g))
re=cp*(t1-t4)
wi=cp*((t2-t3)-(t1-t4))
cop=re/wi
ma=(3.5164*10)/re
p=ma*wi
#RESULTS
print 'cop is %0.2f '%(cop)
print '\nmass of refrigeration is %0.3f kg/s'%(ma)
print '\npower required to drive the unit is %0.1f kW'%(p)
#initialisation of variables
t1=261 #temp in k
t3=310 #temp in k
cp=1.005 #kj/kg
r=5
#CALCULATIONS
t2=(t1*(r)**((g-1)/g))
t4=(t3/(r)**((g-1)/g))
re=cp*(t1-t4)
ma=(3.5164*3600)/re
woc=cp*(t2-t1)
woe=cp*(t3-t4)
nw=woc-woe
cop1=re/nw
cop2=t1/(t3-t1)
reff=cop1/cop2
#RESULTS
print 'temparature at states 2 and 4 are %0.1f k and %0.1f k'%(t2,t4)
print '\nmass of air per hour is %0.2f kg/h'%(ma)
print '\nnet work required is %0.2f kJ/kg'%(nw)
print '\ncoefficient of perfoemance is %0.3f '%(cop1)
print '\nrelative efficiency is %0.4f '%(reff)
#initialisation of variables
h1=176.48 #under -25 degrees temp in kj/kg
s1=0.7127 #under -25 degrees temp in kj/kgk
h2=215.17 #under 58 degrees temp in kj/kg
h3=79.71 #under 45 degrees temp in kj/kg
h4=79.71 #under 45 degrees temp in kj/kg
no=20 # number of tons
#CALCULATIONS
w=h2-h1
re=h1-h4
cop=re/w
ha=no*3.5164
cr=ha/re
pr=cr*w
#RESULTS
print 'the refrigeration effect is %0.2f kJ/kg'%(re)
print '\ncoefficient of performance is %0.2f '%(cop)
print '\npower required is %0.2f kw'%(pr)
print '\ncirculating rate of refrigerant is %0.3f kg/s'%(cr)
#initialisation of variables
h1=176.48 #under -25 degrees temp in kj/kg
h2=215.17 #kj/kg
h4=74.59 #kj/kg
#CALCULATIONS
re=h1-h4
w=h2-h1
cop=re/w
#RESULTS
print 'the refrigeration effect is %0.2f kj/kg'%(re)
print '\ncoefficient of performance is %0.2f '%(cop)
#initialisation of variables
h1=179.43 #under -25 degrees temp in kj/kg
h2=219.03 #kj/kg
h4=74.59 #kj/kg
#CALCULATIONS
re=h1-h4
w=h2-h1
cop=re/w
#RESULTS
print 'the refrigeration effect is %0.2f kJ/kg'%(re)
print '\ncoefficient of performance is %0.2f '%(cop)
#initialisation of variables
h2=1472.6 #kj/kg
s2=4.898 #kj/kgk
sf1=0.510 #kj/kgk
sfg1=5.504 #kj/kgk
hf1=126.2 #kj/kg
hfg1=1304.3 #kj/kg
h4=362.1 #under 38 degrees in kj/kg
h2=1472.6 #kj/kg
h3=362.1 #under 38 degrees in kj/kg
t1=261 #temp in k
t2=311 #temp in k
#CALCULATIONS
x1=(s2-sf1)/sfg1
h1=hf1+(x1*hfg1)
re=h1-h4
w=h2-h1
cop=re/w
hr=h2-h3
ca=(2*re*50)/(3600*3.5164)
pom=100*w/3600
ccop=t1/(t2-t1)
rff=cop/ccop
#RESULTS
print 'coefficient of performance is %0.2f '%(cop)
print '\nheat rejected in the condenser is %0.2f kJ/kg'%(hr)
print '\nrefrigerating effect is %0.1f kJ/kg'%(re)
print '\ncapacity of motor is %0.2f rons of refrigeration'%(ca)
print '\npower of motor is %0.2f kw'%(pom)
print '\nrefrigerating befficiency is %0.3f '%(rff)
#initialisation of variables
hf1=-7.53 #kj/kg
hfg1=245.8 #kj/kg
x1=0.6
sf1=-0.04187 #kj/kgk
t1=268 #temp in degrees
sf2=0.2513 #kj/kgk
hf2=81.25 #kj/kg
hfg2=121.5 #kj/kg
t2=298 #temp in k
h4=81.25 #under 20 degrees in kj/kg
h3=81.25 #under 20 degrees in kj/kg
sh=4.2 #kj/kgk
lt=335 #kj/kg
reff=0.5
sfg1= 1 #kj/kg
s2= 1 #kj/kg
#CALCULATIONS
h1=hf1+(x1*hfg1)
s1=sf1+(x1*sfg1)
x2=((s2-sf2)/hfg2)*t2
h2=hf2+(x2*hfg2)
re=h1-h4
are=re*reff
he=sh*10+lt
ma=(are*6*60)/he
#RESULTS
print 'refrigerating effect is %0.2f kJ/kg'%(re)
print '\nactual refrigerating effect is %0.2f kJ/kg'%(are)
print '\nheat to be extracted to produce 1kg of ice is %0.2f kJ/kg of ice'%(he)
print '\nmass of ice formed is %0.2f kg/day'%(ma)
#initialisation of variables
ph=13.89 #pressure in bar under 36 degrees temp
p1=1.447 #pressure in bar under -26 degrees temp
h1=1411.4 #kj/kg
s1=5.718 #kj/kgk
h2=1561.7 #kj/kg
h3= 150 #kj/kg
h4=185.8 #kj/kg
h5=1445.5 #kj/kg
s5=5.327 #kj/kgk
s5=5.327 #kj/kgk
h6=1607.6 #kj/kg
r=25
#CALCULATIONS
pi=(p1*ph)**0.5
m1=(3.5164*r)/(h1-h4)
mh=m1*(h2-h3)/(h5-h1)
poc=m1*(h2-h1)
pohc=mh*(h6-h5)
pr=poc+pohc
re=h1-h4
wi=(h2-h1)+(h6-h5)
cop=re/wi
#RESULTS
# ans in the book is wrong.
print 'power of lp compressor is %0.2f kW'%(poc)
print '\npower of hp compressor is %0.2f kW'%(pohc)
print '\ntotal power required is %0.2f kW'%(pr)
print '\nrefrigerating effect is %0.2f kJ/kg'%(re)
print '\ncoefficient of performance is %0.2f '%(cop)
#initialisation of variables
h1=1411.4 #kj/kg
s1=5.718 #kj/kgk
s2=5.718 #kj/kgk
h2=1755.7 #kj/kg
h4=352.3 #under 13.89 bar in kj/kg
h3=352.3 #under 13.89 bar in kj/kg
#CALCULATIONS
m=(3.5164*25)/(h1-h4)
poc=m*(h2-h1)
cop=(h1-h4)/(h2-h1)
#RESULTS
print 'mass flow rate of refrigerant is %0.3f kg/s'%(m)
print '\ncoefficient of performance is %0.2f '%(cop)
print '\npower of compressor is %0.2f kW'%(poc)
#initialisation of variables
h1=178.73 #under -20 degrees in kj/kg
h5=185.66 #under 5 degrees in kj/kg
h3=79.71 #under 10.84 degrees in kj/kg
h6=79.71 #under 10.84 degrees in kj/kg
h4=79.71 #under 10.84 degrees in kj/kg
h2=219.33 #kj/kg
#CALCULATIONS
m1=(7*211)/(h1-h4)
mh=(5*211)/(h5-h4)
h8=((m1*h1)+(mh*h5))/(m1+mh)
poc=(m1+mh)*(h2-h8)
cop=(12*211)/poc
#RESULTS
# ans in the book is wrong.
print 'power of compressor is %0.2f kJ/min'%(poc)
print '\nrefrigerant flow rate is %0.2f kg/min'%(mh)
print '\ncoefficient of performance is %0.2f '%(cop)
#initialisation of variables
h1=185.38 #under -5 degrees temp in kj/kg
s1=0.6991 #nder -5 degrees temp in kj/kgk
ps2=7.449 #under 30 degrees in bar
s2=0.6991 #under 30 degrees in bar
h2=203.9 #kj/kg
h3=64.59 #kj/kg
h4=64.59 #kj/kg
#CALCULATIONS
he=h2-h3
wi=h2-h1
cop1=he/wi
mf=84400/he
pr=(mf/3600)*(wi)
coe=pr*1
#RESULTS
print 'coefficient of performance is %0.3f '%(cop1)
print '\nmass flow rate of refrigerant is %0.2f kg/h'%(mf)
print '\npower required is %0.2f kw'%(pr)
print '\ncost of electricity is %0.2f rs'%(coe)
from __future__ import division
#initialisation of variables
TH = 120+273 # K
TL = 6+273 # K
Ta = 21+273 # K
eff = 14/100.0
#CALCULATIONS
cop1 = (TL/(Ta-TL))*(TH-Ta)/TH
cop2 = eff*cop1
#RESULTS
print '\nCOP of reversible cycle is %0.2f '%(cop1)
print '\nCOP of actual cycle is %0.2f '%(cop2)
#initialisation of variables
ps2=0.008129 #under 4 degree temp in bar
ps3=0.047534 #under32 degree temp in bar
v=0.75 #volume in m*m*m
vf=0.001
h1=50.4 #under 12 degree temp in kj/kg
h2=16.8 #kj/kg
hf3=16.8 #kj/kg
hfg3=2492.1 #kj/kg
x3=0.98
vg3=157.27 #under 4 degree temparature
#CALCULATIONS
pr=ps3/ps2
mfr=v/vf
re=mfr*(h1-h2)
h3=hf3+(x3*hfg3)
mf3=re/(h3-h1)
vv=mf3*x3*vg3
#RESULTS
print 'pressures in flash chamber are ps2=0.008129 and ps3=0.047534'
print '\npressure ratio is %0.2f '%(pr)
print '\nthe refrigeration effect is %0.2f kJ/kg'%(re)
print '\namount of makeup water is %0.3f kg/min'%(mf3)
print '\nvolume of water entering the ejector is %0.1f m*m*m/min'%(vv)
#initialisation of variables
h1=272.763 #under 300 k temp in kj/kg
s1=6.4125 #under 300 k temp in kj/kg
h2=230.347 #under 200 k temp in kj/kg1
s2=4.9216 #under 300 k temp in kj/kg
hf=-133.347 #kj/kg
t1=300 #temp in k
#CALCULATIONS
y=(h1-h2)/(h1-hf)
mw=(t1*(s2-s1))-(h2-h1)
x=mw/0.1044
#RESULTS
print 'fraction of oxygen condensed is %0.4f '%(y)
print '\nwork required is %0.2f '%(x) #answer is wrong in tb
#initialisation of variables
t1=300 #temp in k
sf=2.9409 #kj/kgk
s1=6.44125 #kj/kgk
hf=-133.347 #kj/kg
h1=272.763 #kj/kg
w=-4690.5
#CALCULATIONS
mw=(t1*(sf-s1)-(hf-h1))
fom=mw/w
#RESULTS
print 'minimum work is %0.2f kJ/kg of o2 liquefied'%(mw)
print '\nfigure of merit is %0.4f '%(fom)
#ans wrong in the book.