# Chapter11-power and refrigeration cycles¶

## Example1-pg 273¶

In [2]:
import math
#calculate enthalpy and effieceny and carnot efficency
##initialisation of variables
h1= 251.4 ##kJ/kg
v= 0.001017 ##m^3/kg
p2= 2000. ##Mpa
p1= 20. ##Mpa
h2= 253.4
h3= 3247.6 ##kJ/kg
h4= 2349.3 ##kJ/kg
Tc= 60.06 ##C
Th= 400. ##C
##CALCULATIONS
h2= h1+v*(2-p1)
q12= 0.
w12= h1-h2
q23= h3-h2
w23= 0.
q34= 0.
w34= h3-h4
q41= h1-h4
qnet= q12+q23+q34+q41
wnet= w12+w23+w34
n= wnet/q23
ncarnot= 1-((273.15+Tc)/(273.15+Th))
##RESULTS
print'%s %.1f %s'%('enthalpy=',h2,'kJ/kg')
print'%s %.3f %s'%('efficiency=',n,'')
print'%s %.3f %s'%('carnot efficiency=',ncarnot,'')

enthalpy= 251.4 kJ/kg
efficiency= 0.300
carnot efficiency= 0.505


## Example2-pg275¶

In [3]:
import math
#calculate work and heat and effiecency and steam mass flow rate
##initialisation of variables
h3= 3247.4 ##kJ/kg
h4= 2439.1 ##kJ/kg
h1= 251.4 ##kJ/kg
h2= 253.9 ##kJ/kg
P= 100000 ##kW
##CALCULATIONS
wnet= h3-h4+h1-h2
qh= h3-h2
qc= h1-h4
n= wnet/qh
m= P/wnet
##RESULTS
print'%s %.f %s'%('work=',wnet,'kJ/kg')
print'%s %.1f %s'% ('heat=',qh,'kJ/kg')
print'%s %.1f %s'%('heat=',qc,'kJ/kg')
print'%s %.4f %s'%('efficiency=',n,'')
print'%s %.2f %s'%('steam mass flow rate=',m,'kg/s')

work= 806 kJ/kg
heat= 2993.5 kJ/kg
heat= -2187.7 kJ/kg
efficiency= 0.2692
steam mass flow rate= 124.10 kg/s


## Example3-pg 279¶

In [4]:
import math
#calculate qualitys and efficiency and mass flow rate and diameter
##initialisation of variables
h11= 2786.2 ##kJ/kg
h12= 340.5 ##kJ/kg
h7= 327.9 ##kJ/kg
h6= 169.0 ##kJ/kg
h10= 756.7 ##kJ/kg
h9= 480.9 ##kJkg
h14= 2818 ##kJ.kg
h15= 762.8 ##kJ/kg
h8= 462.7 ##kJ/kg
h13= 2974.5 ##kJ/kg
h5= 168.8 ##kJ/kg
P= 150. ##kW
v1= 0.02293 ##m^3/kg
v= 40. ##m/s
h1= 3448.6 ##kJ/kg
h3= 3478.5 ##kJ/kg
h2= 2818 ##kJ/kg
h4= 2527.1 ##kJ/kg
##CALCULATIONS
y1= (h10-h9)/(h14-h15)
y2= ((h8-h7)-y1*(h15-h7))/(h13-h7)
y3= (h7-h6)*(1-y1-y2)/(h11-h12)
qin= h1-h10+(1-y1)*(h3-h2)
qout= (h5-h4)*(1-y1-y2)+y3*(h4-h12)
wnet= qin+qout
n= wnet*100/qin
m1= P*1000/wnet
A1= m1*v1/v
D= math.sqrt(4*A1/math.pi)
##RESULTS
print'%s %.4f %s'%(' quality=',y1,'')
print'%s %.4f %s'%('quality=',y2,'')
print'%s %.4f %s'%('quality=',y3,'')
print'%s %.2f %s'%('efficiency=',n,'percent')
print'%s %.2f %s'%('mass flow rate=',m1,'kg/s')
print'%s %.3f %s'%(' diameter=',D,'m')

 quality= 0.1342
quality= 0.0289
quality= 0.0544
efficiency= 43.17 percent
mass flow rate= 106.46 kg/s
diameter= 0.279 m


## Example4-pg 284¶

In [5]:
import math
#calculate effieciency and power and temperature at the exist
##initialisation of variables
T= 300. ##K
P= 100. ##kPa
r= 4.
T1= 1200. ##K
m= 5. ##kg/s
k= 1.4
R= 8.314 ##jmol K
M= 29. ##gms
##CALCULATIONS
T2= T*math.pow(r,(k-1)/k)
T4= T1/math.pow(r,(k-1)/k)
n= 1-(T/T2)
wnet= (k*R/((k-1)*M))*(T1-T4+T-T2)
P= m*wnet
e= math.sqrt((T2-T)/(T1-T4))
T5= T+((T2-T)/e)
T6= T1+e*(T4-T1)
##RESULTS
print'%s %.4f %s'%('efficiency=',n,'')
print'%s %.f %s'%('power=',P,'kW')
print'%s %.4f %s'%('efficiency=',e,'')
print'%s %.1f %s'%('temperature at the exit=',T6,'K')

efficiency= 0.3270
power= 1238 kW
efficiency= 0.6095
temperature at the exit= 960.8 K


## Example5-pg286¶

In [1]:
import math
##initialisation of variables
v= 810. ##km/h
v1= 40. ##m/sec
cp= 1003. ##J/k mol
T0= 300. ##K
ec= 0.88
k= 1.4
T3= 1473.15 ##K
p3= 600. ##kPa
p0= 26.4 ##kPa
e= 0.9
m= 90. ##kg
cp1= 1.003 ##J/mol K
##CALCULATIONS
v0= v*1000/3600.
T1= T0+((v0**2-v1**2)/(2*cp))
T1s= T0+ec*(T0-T1)
p1= 36.79 #kPa
p2= 600 #kPa
T2s= T1*(p2/p1)**((k-1)/k)
T2= T1+((T2s-T1)/ec)
T21= T1+(T2s-T1)/ec
T4= T3+T0-T21
T4s= T3+(T4-T3)/ec
p4= p3*(T4s/T3)
T5s= p4+(p0-p4)*e
W34= m*cp1*(T3-T4)
v5= math.sqrt(v1**2+2*cp*(T4-T5s))
F= m*(v5-v0)
##RESULTS
print'%s %.2f %s'% ('T5=',T4s,'K ')
print'%s %.f %s'% ('Work=',W34,'kW ')
print'%s %.1f %s'% ('nozzle velocity=',v5,'m/s')
print'%s %.f %s'% ('thrust force=',F,'N')

##ANSWERS GIVEN IN THE TEXTBOOK ARE WRONG

##RESULTS

T5= 934.14 K
Work= 42818 kW
nozzle velocity= 1371.6 m/s
thrust force= 103193 N


## Ex6-289¶

In [2]:
##initialisation of variables
T1= 300. ##K
p2= 400. ##kPa
p1= 100. ##kPa
p4= 100. ##kPa
p3= 400. ##kPa
T3= 1200. ##K
e= 0.85
ee= 0.9
m= 8 ##kg
cp= 1.0035
k= 1.4
##CALCULATIONS
T2s= T1*(p2/p1)**((k-1.)/k)
T4s= T3*(p4/p3)**((k-1.)/k)
T2= T1+((T2s-T1)/e)
T4= T3+ee*(T4s-T3)
P= m*cp*(T3-T4-T2+T1)
n= (T3-T4+T1-T2)/(T3-T4)
n1= (T3-T4+T1-T2)/(T3-T2)
##RESULTS
print'%s %.2f %s'% (' T4= ',T4,' K ')
print'%s %.2f %s'% ('  T2= ',T2,' K ')
print'%s %.2f %s'% ('  T4= ',P,' kW ')
print'%s %.2f %s'% ('  net efficiency= ',n,'  ')
print'%s %.2f %s'% ('  net efficiency=',n1,'  ')

 T4=  846.79  K
T2=  471.53  K
T4=  1458.58  kW
net efficiency=  0.51
net efficiency= 0.25


## Example7-pg297¶

In [2]:
import math
#calculate COP and power and COP at given enthalpy
##initialisation of variables
h1= 182.07 ##kJ/kg
h4= 76.26 ##kJ/kg
h2= 217.97 ##kJ/kg
Q= math.pow(10,6) ##kJ/h
Tc= -5 ##C
Th= 32 ##C
##CALCULATIONS
COP= (h1-h4)/(h2-h1)
W= Q/(COP*3600)
COPcarnot= (273.15+Tc)/(Th-Tc)
##RESULTS
print'%s %.3f %s'% ('COP= ',COP,'')
print'%s %.3f %s'% ('power=',W,'KW')
print'%s %.3f %s'% ('COP=',COPcarnot,'')

COP=  2.947
power= 94.247 KW
COP= 7.247


## Ex8-pg298¶

In [3]:
##initialisation of variables
h1= 238.431 ##kJ/kg
h4= 109.777 ##kJ/kg
Qc= 6 ##kW
h2= 295.835 ##kJ/kg
n= 0.88
Tin= 33 ##C
Tout= 20 ##C
cp= 4.186 ##J/mol K
##CALCULATIONS
qc= h1-h4
m= Qc/qc
w= h2-h1
W= m*w/n
COP= Qc/W
qh= h2-h4
mcw= m*qh/(cp*(Tin-Tout))
##RESULTS
print'%s %.2f %s'% (' compressor power= ',W,' kW ')
print'%s %.2f %s'% ('  COP= ',COP,'  ')
print'%s %.2f %s'% ('  cooling water flow= ',mcw,'kg/s ')

 compressor power=  3.04  kW
COP=  1.97
cooling water flow=  0.16 kg/s


## Example9-pg301¶

In [4]:
import math
#calculate COPs and WORK at given variable
##initialisation of variables
h1= 183.12 ##kJ/kg
h4= 75.588 ##kJ/kg
h2= 218.697 ##kJ/kg
nm=0.94
Qc= 6 ##kW
h4a= 45.343 ##kJ/kg
h2a= 257.283 ##kJ/kg
h1a= 213.427 ##kJ/kg
##CALCULATIONS
COP= (h1-h4)*nm/(h2-h1)
W= Qc/COP
COP1= (h1-h4a)*nm/(h2a-h1a)
W1= Qc/COP1
##RESULTS
print'%s %.3f %s'% ('COP=',COP,'')
print'%s %.3f %s'% ('COP=',COP1,'')
print'%s %.3f %s'% ('Work=',W,'kW')
print'%s %.3f %s'% ('Work=',W1,'kW')

COP= 2.841
COP= 2.953
Work= 2.112 kW
Work= 2.032 kW


## Ex10-pg302¶

In [4]:
##initialisation of variables
h1= 238.431 ##kJ/kg
h4a= 73.881 ##kJ/kg
Qc= 6 ##kW
h2a= 343.787 ##kJ/kg
n= 0.88
Tin= 33 ##C
Tout= 20 ##C
cp= 4.186 ##J/mol K
h1a= 274.327 ##kJ/kg
h3= 109.777 ##kJ/kg
##CALCULATIONS
qc= h1-h4a
m= Qc/qc
w= h2a-h1a
W= m*w/n
COP= Qc/W
qh= h2a-h3
mcw= m*qh/(cp*(Tin-Tout))
##RESULTS
print'%s %.2f %s'% (' compressor power= ',W,' kW ')
print'%s %.2f %s'% ('  COP= ',COP,'')
print'%s %.2f %s'% ('  cooling water flow= ',mcw,' kg/s ')

 compressor power=  2.88  kW
COP=  2.08
cooling water flow=  0.16  kg/s


## Example11-pg304¶

In [6]:
#calculate COP and W
##initialisation of variables
h1= 1404.6 ##kJ/kg
h2s= 1748.9 ##kJ/kg
ec= 0.8
h4= 322.9 ##kJ/kg
h2= 1835 ##kJ/kg
Q= 100 ##kW
h21= 1649.2 ##kJ/kg
h22= 1515 ##kJ/kg
h23= 1678.8 ##kJ/kg
##CALCULATIONS
h2= h1+((h2s-h1)/ec)
COP= (h1-h4)/(h2-h1)
W= Q/COP
COP1= (h1-h4)/(h21-h1+h23-h22)
W1= Q/COP1
##RESULTS
print'%s %.3f %s'%  (' COP=',COP,'')
print'%s %.3f %s'% ('COP=',COP1,'')
print'%s %.1f %s'% ('W= ',W,'kW')
print'%s %.1f %s'% ('W=',W1,'kW')

 COP= 2.513
COP= 2.649
W=  39.8 kW
W= 37.8 kW