In [1]:

```
# Given:-
Tc = 273.00 # temperature of cold region in kelvin
Th = 299.00 # temperature of hot region in kelvin
mdot = 0.08 # mass flow rate in kg/s
# Analysis
# At the inlet to the compressor, the refrigerant is a saturated vapor at 0C, so from Table A-10
h1 = 247.23 # in kj/kg
s1 = 0.9190 # in kj/kg.k
# The pressure at state 2s is the saturation pressure corresponding to 26C, or
p2 = 6.853 # in bars
# The refrigerant at state 2s is a superheated vapor with
h2s = 264.7 # in kj/kg
# State 3 is saturated liquid at 26C, so
h3 = 85.75 # in kj/kg
h4 = h3 # since The expansion through the valve is a throttling process
# Part(a)
Wcdot = mdot*(h2s-h1) # The compressor work input in KW
print '-> The compressor power, in kW, is: '
print round(Wcdot,2)
# Part(b)
Qindot = mdot*(h1-h4)*60/211 # refrigeration capacity in ton
print '-> The refrigeration capacity in tons is: '
print round(Qindot,2)
# Part(c)
beta = (h1-h4)/(h2s-h1)
print '-> The coefficient of performance is: '
print round(beta,2)
# Part(d)
betamax = Tc/(Th-Tc)
print '-> The coefficient of performance of a Carnot refrigeration cycle operating between warm and cold regions at 26 and 0C, respectively is: '
print betamax
```

In [2]:

```
# Given:-
mdot = 0.08 # mass flow rate in kg/s
# Analysis
# At the inlet to the compressor, the refrigerant is a saturated vapor at 10C, so from Table A-10,
h1 = 241.35 # in kj/kg
s1 = .9253 # in kj/kg.k
# Interpolating in Table A-12 gives
h2s = 272.39 # in kj/kg.k
# State 3 is a saturated liquid at 9 bar, so
h3 = 99.56 # in kj/kg
h4 = h3 # since The expansion through the valve is a throttling process
# Part(a)
Wcdot = mdot*(h2s-h1) # The compressor power input in KW
# Result
print '-> The compressor power in kw is: '
print round(Wcdot,2)
# Part(b)
Qindot = mdot*(h1-h4)*60/211 # refrigeration capacity in tons
# Result
print '-> The refrigeration capacity in tons is: '
print round(Qindot,2)
# Part(c)
beta = (h1-h4)/(h2s-h1)
# Result
print '-> The coefficient of performance is: '
print round(beta,2)
```

In [3]:

```
# Given:-
Tnot = 299 #in kelvin
etac = .8 #compressor efficiency of 80 percent
mdot = .08 #mass flow rate in kg/s
#analysis
#State 1 is the same as in Example 10.2, so
h1 = 241.35 #in kj/kg
s1 = .9253 #in kj/kg.k
#from example 10.2
h2s = 272.39 #in kj/kg
h2 =(h2s-h1)/etac + h1 #in kj/kg
#Interpolating in Table A-12,
s2 = .9497 #in kj/kg.k
h3 = 91.49 #in kj/kg
s3 = .3396
h4 = h3 #since The expansion through the valve is a throttling process
#from data table
hf4 = 36.97 #in kj/kg
hg4 = 241.36 #in kj/kg
sf4 = .1486 #in kj/kg.k
sg4 = .9253 #in kj/kg.k
x4 = (h4-hf4)/(hg4-hf4) #quality at state 4
s4 = sf4 + x4*(sg4-sf4) #specific entropy at state 4 in kj/kg.k
#part(a)
Wcdot = mdot*(h2-h1) #compressor power in kw
print 'The compressor power in kw is: ',round(Wcdot,2),'kW'
#part(b)
Qindot = mdot*(h1-h4)*60/211 #refrigeration capacity in ton
print 'The refrigeration capacity in ton is: ',round(Qindot,2),'ton'
#part(c)
beta = (h1-h4)/(h2-h1) #coefficient of performance
print 'The coefficient of performance is: ',round(beta,2)
#part(d)
Eddotc = mdot*Tnot*(s2-s1) #in kw
Eddotv = mdot*Tnot*(s4-s3) #in kw
print 'The rate of exergy destruction within the compressor is:',round(Eddotc,2),'kw.'
print 'The rate of exergy destruction within the valve is:',round(Eddotv,2),'kw'
```

In [4]:

```
# Given:-
p1 = 1.00 # in bar
T1 = 270.00 # in kelvin
AV = 1.4 # in m^3/s
r = 3.00 # compressor pressure ratio
T3 = 300.00 # turbine inlet temperature in kelvin
# Analysis
# From Table A-22,
h1 = 270.11 # in kj/kg
pr1 = 0.9590
# Interpolating in Table A-22,
h2s = 370.1 # in kj/kg
# From Table A-22,
h3 = 300.19 # in kj/kg
pr3 = 1.3860
# Interpolating in Table A-22, we obtain
h4s = 219.00 # in kj/kg
# Calculations
pr2 = r*pr1
pr4 = pr3/r
# Part(a)
R = 8.314 # universal gas constant, in SI units
M = 28.97 # molar mass of air in grams
# Results
mdot = (AV*p1)/((R/M)*T1)*10**2 # mass flow rate in kg/s
Wcycledot = mdot*((h2s-h1)-(h3-h4s))
print '-> The net power input in kw is: '
print round(Wcycledot,2)
# Part(b)
Qindot = mdot*(h1-h4s) # refrigeration capacity in kw
print '-> The refregeration capacity in kw is: '
print round(Qindot,2)
# Part(c)
beta = Qindot/Wcycledot # coefficient of performance
print 'The coefficient of performance is: '
print round(beta,2)
```

In [5]:

```
# Given:-
# Part(a)
wcdots = 99.99 # work per unit mass for the isentropic compression determined with data from the solution in Example 10.4 in kj/kg
mdot = 1.807 # mass flow rate in kg/s from 10.4
etac = 0.8 # isentropic efficiency of compressor
Wcdot = (mdot*wcdots)/etac # The power input to the compressor in kw
# Using data form the solution to Example 10.4 gives
wtdots =81.19 # in kj/kg
etat = 0.8 # isentropic efficiency of turbine
# Calculations
Wtdot = mdot*etat*wtdots # actual turbine work in kw
Wdotcycle = Wcdot-Wtdot # The net power input to the cycle in kw
# Result
print '-> The net power input in kw is: '
print round(Wdotcycle,2)
# Part(b)
h3 = 300.19 # in kj/kg
# From table A-22
h1 = 270.11 # in kj/kg
# Calculations
h4 = h3 -Wtdot/mdot
Qindot = mdot*(h1-h4) # refrigeration capacity in kw
# Result
print '-> The refrigeration capacity in kw is: '
print round(Qindot,2)
# Part(c)
beta = Qindot/Wdotcycle # coefficient of performance
# Result
print '-> The coefficient of performance is: '
print round(beta,2)
```