In [1]:

```
#pg 10.42
#calculate the Power rating of compressor-motor
#Input data
T1=273.;#The temperature of ice in K
T2=298.;#Temperature of water at room in K
COP=2.1;#Cop of the plant
ne=90.;#Overall electrochemical efficiency in percentage
w=15.;#Weight of ice produced per day in tonnes
cw=4.187;#Specific heat of water in kJ/kg degrees celcius
Li=335.;#Latent heat of ice in kJ/kg
mi=1.;#Mass of ice produced at 0 degrees celcius
#Calculations
m=(w*1000.)/(24*60);#Mass of ice produced in kg/min
h=(mi*cw*(T2-T1))+Li;#Heat extracted from 1kg of water at 25 degrees celcius to produce 1kg of ice at 0 degrees celcius in kJ/kg
Q=m*h;#Total heat extracted in kJ
W=Q/COP;#Work done by the compressor in kJ/kg
P=W/(60.*(ne/100));#Power of compressor in kW
#Output
print 'Power rating of the compressor-motor unit if the cop of the plant is 2.1 is (kW) = ',round(P,1)
```

In [2]:

```
#pg 10.43
#calculate the refrigeration capacity
#Input data
m=400.;#Mass of fruits supplied to a cold storage in kg
T1=293.;#Temperature at which fruits are stored in K
T2=268.;#Temperature of cold storage in K
t=8.;#The time untill which fruits are cooled in hours
hfg=105.;#Latent heat of freezing in kJ/kg
Cf=1.25;#Specific heat of fruit
TR=210.;#One tonne refrigeration in kJ/min
#Calculations
Q1=m*Cf*(T1-T2);#Sensible heat in kJ
Q2=m*hfg;#Latent heat of freezing in kJ
Q=Q1+Q2;#Heat removed from fruits in 8 hrs
Th=(Q1+Q2)/(t*60);#Total heat removed in one minute in kJ/kg
Rc=Th/TR;#Refrigerating capacity of the plant in TR
#Output
print 'The refrigeration capacity of the plant is (TR) = ',round(Rc,3)
```

In [3]:

```
#pg 10.44
#calculate the COP of machine in all cases
#Input data
T1=300.;#The maximum temperature at which carnot cycle operates in K
T2=250.;#The minimum temperature at which carnot cycle operates in K
#Calculations
COPr=T2/(T1-T2);#COP of the refrigerating machine
COPh=T1/(T1-T2)#COP of heat pump
n=((T1-T2)/T1)*100;#COP or efficiency of the heat engine in percentage
#Output data
print '(a)COP of the machine when it is operated as a refrigerating machine is ',COPr
print '(b)COP when it is operated as heat pump is ',COPh
print '(c)COP or efficiency of the Heat engine is (percent) = ',round(n,2)
```

In [4]:

```
#pg 10.45
#calculate the capacity of the plant and time taken
#Input data
m=20000.;#The storage capacity of fish in a storage plant in kg
T1=298.;#Supplied temperature of fish in K
T2=263.;#Temperature of cold storage in which fish are stored in K
T3=268.;#Freezing point of fish in K
Caf=2.95;#Specific heat of fish above freezing point in kJ/kg K
Cbf=1.25;#Specific heat of below freezing point in kJ/kg K
W=75.;#Work required by the plant in kW
TR=210.;#One tonne refrigeration in kJ/min
hfg=230.;#Latent heat of fish in kJ/kg
#Calculations
COPr=T2/(T1-T2);#COP of reversed carnot cycle
COPa=0.3*COPr;#Given that actual COP is 0.3 times of reversed COP
Hr=(COPa*W)*60;#Heat removed by the plant in kJ/min
C=Hr/TR;#Capacity of the plant in TR
Q1=m*Caf*(T1-T3);#Heat removed from the fish above freezing point in kJ
Q2=m*Cbf*(T3-T2);#Heat removed from fish below freezing point in kJ
Q3=m*hfg;#Total latent heat of the fish in kJ
Q=Q1+Q2+Q3;#Total heat removed by the plant in kJ
T=(Q/Hr)/60;#Time taken to achieve cooling in hrs
#Output data
print '(a)Capacity of the plant is (TR) = ',round(C,2)
print '(b)Time taken to achieve cooling is (hours) = ',round(T,2)
```

In [5]:

```
#pg 10.46
#calculate the Theoretical COP
#Input data
T2=298.;#Maximum temperature at which CO2 machine works in K
T1=268.;#Minimum temperature at which CO2 machine works in K
sf1=-0.042;#Liquid entropy at 268 K in kJ/kg K
hfg1=245.3;#Latent heat of gas at 268 K in kJ/kg
sf2=0.251;#Liquid entropy in kJ/kg K
hfg2=121.4;#Latent heat of gas at 298 K in kJ/kg
hf1=-7.54;#Liquid enthalpy at 268 K in kJ/kg
hf2=81.3;#Liquid enthalpy at 298 K in kJ/kg
hf3=81.3;#Enthalpy at point 3 in graph in kJ/kg
#Calculations
s2=sf2+(hfg2/T2);#Entropy at point 2 from the graph in kJ/kg K
x1=(s2-sf1)/(hfg1/T1);#Dryness fraction at point 1
h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg
h2=hf2+hfg2;#Enthalpy at point 2 in kJ/kg
COP=(h1-hf3)/(h2-h1);#Coefficient of performance for a CO2 machine working at given temperatures
#Output data
print 'Theoretical COP for a CO2 machine working at given temperatures = ',round(COP,2)
print 'The answer in textbook is wrong. Please check using a calculator'
```

In [7]:

```
#pg 10.48
#calculate the capacity of refrigerator
#Input data
T2=298.;#Maximum temperature at which ammonia refrigerating system works in K
T1=263.;#Minimum temperature at which ammonia refrigerating system works in K
mf=5.;#Fluid flow rate in kg/min
sf1=0.5443;#Liquid entropy at 298 K in kJ/kg K
sf2=1.1242;#Liquid entropy at 263 K in kJ/kg K
hfg1=1297.68;#Latent heat at 298 K in kJ/kg
hfg2=1166.94;#Latent heat at 263 K in kJ/kg
hf1=135.37;#Liquid enthalpy at point 1 in graph in kJ/kg
hf2=298.9;#Liquid enthalpy at point 2 in graph in kJ/kg
TR=210.;#One tonne refrigeration in TR
#Calculations
s2=sf2+(hfg2/T2);#Entropy at point 2 in kJ/kg
x1=(s2-sf1)/(hfg1/T1);#Dryness fraction at point 1
h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg
h=h1-hf2;#Heat extracted of refrigerating effect produced per kg of refrigerant in kJ/kg
ht=mf*h;#Total heat extracted at a fluid flow rate of 5 kg/min in kJ/min
C=ht/TR;#Capacity of refrigerating in TR
#Output
print 'The capacity of refrigerator is (TR) = ',round(C,0)
```

In [8]:

```
#pg 10.49
#calculate the theoretical COP
#Input data
T1=263.;#Minimum temperature at which ammonia refrigerating machine works in K
T2=303.;#Maximum temperature at which ammonia refrigerating machine works in K
x1=0.6;#Dryness fraction of ammonia during suction stroke
sf1=0.5443;#Liquid entropy at 263 K in kJ/kg K
hfg1=1297.68;#Latent heat at 263 K in kJ/kg
sf2=1.2037;#Liquid entropy at 303 K in kJ/kg K
hfg2=1145.8;#Latent heat at 303 K in kJ/kg
hf1=135.37;#Liquid enthalpy at 263 K in kJ/kg
hf2=323.08;#Liquid enthalpy at 303 K in kJ/kg
#Calculations
s1=sf1+((x1*hfg1)/T1);#Entropy at point 1 in kJ/kg K
x2=(s1-sf2)/(hfg2/T2);#Entropy at point 2 in kJ/kg K
h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg
h2=hf2+(x2*hfg2);#Enthalpy at point 2 in kJ/kg
COP=(h1-hf2)/(h2-h1);#Theoretical COP of ammonia refrigerating machine
#Output
print 'The theoretical COP of a ammonia refrigerating machine working between given temperatures = ',round(COP,2)
```

In [9]:

```
#pg 10.51
#calculate the amount of ice
#Input data
T1=263.;#Minimum temperature at which Vapour compression refrigerator using methyl chloride operates in K
T2=318.;#Maximum temperature at which Vapour compression refrigerator using methyl chloride operates in K
sf1=0.183;#Entropy of the liquid in kJ/kg K
hfg1=460.7;#Enthalpy of the liquid in kJ/kg
sf2=0.485;#Entropy of the liquid in kJ/kg K
hfg2=483.6;#Enthalpy of the liquid in kJ/kg
x2=0.95;#Dryness fraction at point 2
hf3=133.0;#Enthalpy of the liquid in kJ/kg
W=3600.;#Work to be spent corresponding to 1kW/hour
Cw=4.187;#Specific heat of water in kJ/kg degrees celcius
mi=1;#Mass of ice produced at 0 degrees celcius
Li=335.;#Latent heat of ice in kJ/kg
hf1=45.4;#Enthalpy of liquid at 263 K in kJ/kg
hf2=133.;#Enthalpy of liquid at 318 K in kJ/kg
#Calculations
s2=sf2+((x2*(hfg2-hf2))/T2);#Enthalpy at point 2 in kJ/kg
x1=(s2-sf1)/((hfg1-hf1)/T1);#Dryness fraction at point 1
h1=hf1+(x1*hfg1);#Enthalpy at point 1 in kJ/kg
h2=hf2+(x2*hfg2);#Enthalpy at point 2 in kJ/kg
COP=(h1-hf3)/(h2-h1);#Theoretical COP
COPa=0.6*COP;#Actual COP which is 60 percent of theoretical COP
H=W*COPa;#Heat extracted or refrigeration effect produced per kW hour in kJ
Hw=(mi*Cw*10)+Li;#Heat extracted from water at 10 degrees celcius for the formation of 1 kg of ice at 0 degrees celcius
I=H/Hw;#Amount of ice produced in kg/kW hr
#Output
print 'The amount of ice produced is (kg/kW hr) = ',round(I,2)
```