Appendix A

Example 1

In [13]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.1
'''  '''

#Variable Declaration: 


		#1-Inlet for compressor
		#2-Exit for compressor
		#T-Temperature at a state
		#P-Pressure at a state
T1 = 288.2		#K
P2 = 1000		#kPa
P1 = 100		#kPa
k = 1.4
T2 = T1*(P2/P1)**(1-1/k)		#K
Cp = 1.004		#Specific heat at constant pressure in kJ/kg
wc = Cp*(T2-T1)		#compressor work in kJ/kg
print ('Temperature T2  =  %.1f K',T2)
print (' Compressor work  =  %.1f kJ/kg ',wc)
		#3-Turbine Inlet
		#4-Turbine Exit
P4 = P1
P3 = P2
T3 = 1373.2		#K
T4 = T3*(P4/P3)**(1-1/k)		#K
wt = Cp*(T3-T4)
wnet = wt-wc
print (' Temperature T3  =  %.1f K',T3)
print (' Temperature T4  =  %.1f K',T4)
print (' Turbine work  =  %.1f kJ/kg',wt)
print (' Net work  =  %.1f kJ/kg',wt-wc)
		#2-Also high temperature heat exchanger Inlet
		#3-(-do-) Exit
qh = Cp*(T3-T2)		#Heat of source in kJ/kg
		#4-high temp heat exchanger inlet
		#1-(-do-) Exit
ql = Cp*(T4-T1)		#Heat of sink in kJ/kg
nth = wnet/qh
print (' Thermal Efficiency of cycle  =  %.1f percent',nth*100)
('Temperature T2  =  %.1f K', 556.4270854641527)
(' Compressor work  =  %.1f kJ/kg ', 269.2999938060093)
(' Temperature T3  =  %.1f K', 1373.2)
(' Temperature T4  =  %.1f K', 711.24546295203)
(' Turbine work  =  %.1f kJ/kg', 664.6023551961619)
(' Net work  =  %.1f kJ/kg', 395.30236139015256)
(' Thermal Efficiency of cycle  =  %.1f percent', 48.205253207687875)

Example 2

In [14]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.2
'''  '''

#Variable Declaration: 
		#Standard brayton cycle


		#Calculation mistake in book
		#1-Inlet for compressor
		#2-Exit for compressor
		#T-Temperature at a state
		#P-Pressure at a state
T1 = 288.2		#K
P2 = 1000		#kPa
P1 = 100		#kPa
k = 1.4
T2s = T1*(P2/P1)**(1-1/k)		#K
nc = .80		#Compressor Efficiency
T2 = T1+(T2s-T1)/0.80
Cp = 1.004		#Specific heat at constant pressure in kJ/kg
wc = Cp*(T2-T1)		#compressor work in kJ/kg
print ('Temperature T2  =  %.1f K',T2)
print (' Compressor work  =  %.1f kJ/kg ',wc)
		#3-Turbine Inlet
		#4-Turbine Exit
P4 = P1
P3 = P2
T3 = 1373.2		#K
T4s = T3*(P4/P3)**(1-1/k)		#K
nt = 0.85		#turbine Efficiency
T4 = T3-(T3-T4s)*0.85
wt = Cp*(T3-T4)
wnet = wt-wc
print (' Temperature T3  =  %.1f K',T3)
print (' Temperature T4  =  %.1f K',T4)
print (' Turbine work  =  %.1f kJ/kg',wt)
print (' Net work  =  %.1f kJ/kg',wt-wc)
		#2-Also high temperature heat exchanger Inlet
		#3-(-do-) Exit
qh = Cp*(T3-T2)		#Heat of source in kJ/kg
		#4-high temp heat exchanger inlet
		#1-(-do-) Exit
ql = Cp*(T4-T1)		#Heat of sink in kJ/kg
nth = wnet/qh
print (' Thermal Efficiency of cycle  =  %.1f percent',nth*100)
('Temperature T2  =  %.1f K', 623.4838568301909)
(' Compressor work  =  %.1f kJ/kg ', 336.6249922575117)
(' Temperature T3  =  %.1f K', 1373.2)
(' Temperature T4  =  %.1f K', 810.5386435092256)
(' Turbine work  =  %.1f kJ/kg', 564.9120019167375)
(' Net work  =  %.1f kJ/kg', 228.28700965922582)
(' Thermal Efficiency of cycle  =  %.1f percent', 30.32847854912508)

Example 3

In [15]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.3
'''  '''

#Variable Declaration: 


wnet = 395.2		#kJ/kg from example no 1
		#Tx = T4
Tx = 710.8		#K from example no 1
T3 = 1373.2		#K from example no 1
Cp = 1.004		#specific heat in kJ/kg 
qh = Cp*(T3-Tx)
nth = wnet/qh
print ('Thermal efficiency  =  %.1f percent',nth*100) 
('Thermal efficiency  =  %.1f percent', 59.42413919202417)

Example 4

In [18]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.4
'''  '''
from math import log
#Variable Declaration: 


R = 0.287		#gas constant 
T1 = 288.2		#compressor temperature K
T2 = 1373.2		#K turbine temperature K
		#Pe/Pi = c = 10, Pi/Pe = 1/c from example 12.1
c = 10
wc = -R*T1*log(c)
print ('Isothermal work in compressor  =  %.1f kJ/kg ',wc)
wt = -R*T2*log(1/c)
print (' Isothermal work in turbine  =  %.1f kJ/kg',wt) 
('Isothermal work in compressor  =  %.1f kJ/kg ', -190.4546418308537)
(' Isothermal work in turbine  =  %.1f kJ/kg', 907.4681268637344)

Example 5

In [20]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.5
'''  '''
from math import sqrt
#Variable Declaration: 


		#1-compressor inlet
		#2-Compressor exit
		#P-Pressure at given point
		#T-Temperature at given point
P1 = 100		#kPa
P2 = 1000		#kPa
T1 = 288.2		#K
T2 = 556.8		#K
wc = 269.5		#from ex 12.1 work done in compressor in kJ/kg
		#2-Burner inlet
		#3-Burner exit
P3 = 1000		#kPa
T3 = 1373.2		#K
		#wc = wt
Cp = 1.004		#specific enthalpy of heat at constant pressure in kJ/kg
k = 1.4
T4 = T3-wc/Cp
P4 = P3*(T4/T3)**(1-1/k)
		#from s4 = s5 and h4 = h5+v2/2 we get
T5 = 710.8		#K, from second law
v = sqrt(2*Cp*1000*(T4-T5))		#m/s
print ('Velocity of air leaving the nozel  =  %.0f m/s',v)
('Velocity of air leaving the nozel  =  %.0f m/s', 889.4375751001304)

Example 6

In [22]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.6
'''  '''

#Variable Declaration: 


		#1-compressor inlet
		#2-compressor exit
P1 = 100		#kPa
P2 = 500		#kPa
k = 1.4
rp = P2/P1
cop = (rp**(1-1/k)-1)**-1
print ('Coefficient of performance  =  %.3f ',cop)
		#3-Expander inlet
		#4-Expander exit
P3 = P2
P4 = P1
T3 = 288.23		#K, given and fixed
T4 = T3/(P3/P4)**(1-1/k)
T1 = 253.2		#K, given
Cp = 1.004		#Specific heat at cons pressure in kJ/kg
ql = Cp*(T1-T4)		#heat released in kJ/kg
P = 1		#power required in kW 
ms = P/ql		#kg/s
print (' Rate at which the air enter the compressor  =  %.3f kg/s ',ms) 
('Coefficient of performance  =  %.3f ', 1.712857850240205)
(' Rate at which the air enter the compressor  =  %.3f kg/s ', 0.013985866348928795)

Example 7

In [23]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.7
'''  '''

#Variable Declaration: 


		#1-compressor inlet
		#2-compressor exit
P1 = 100		#kPa
T1 = 288.2		#K
R = 0.287		#gas constant
v1 = R*T1/P1		#specific volume at inlet in m**3/kg
rv = 10		#compression ratio given
k = 1.4		#constant
T2 = T1*rv**(k-1)		#K
print 'Temperature at compressor exit, T2  =  %.1f K ',T2
P2 = P1*rv**k		#kPa
print ' Pressure at compressor exit, P2  =  %.3f MPa  ',P2/1000
v2 = v1/rv		#specific heat at exit in m**3/kg
		#23-heat addition process
		#q23 = Cv*(T3-T2) = 1800 kJ/kg given
q23 = 1800		#kJ/kg heat addition, given
Cv = 0.717		#specific heat at constant volume in kJ/kg
T3 = T2+q23/Cv		#K
print ' Initial Temperature during heat additon process, T3  =  %.0f K ',T3
P3 = P2*(T3/T2)		#kPa
print  ' Initial pressure during heat addition process, P3  =  %.3f MPa ',P3/1000
r = 10		#k = V4/V3 = P3/P4
T4 = T3*(1/r)**(k-1)
print '  Final temperature during heat addition process, T4  =  %.1f K ',T4
P4 = P3/r**k		#kPa
print ' Final pressure during heat addition process, P4  =  %.4f MPa ',P4/1000
nth = 1-1/r**k		#thermal efficiency
print ' Thermal efficiency  =  %.1f percent ',nth*100
q41 = Cv*(T1-T4)		#/heat for process 4-1 in kJ/kg
wnet = q23+q41
mep = wnet/(v1-v2)		#effective mean pressure n kPa
print ' Mean effective pressure  =  %.0f kPa ',mep
Temperature at compressor exit, T2  =  %.1f K  723.925669561
 Pressure at compressor exit, P2  =  %.3f MPa   2.51188643151
 Initial Temperature during heat additon process, T3  =  %.0f K  3234.38592061
 Initial pressure during heat addition process, P3  =  %.3f MPa  11.222713118
  Final temperature during heat addition process, T4  =  %.1f K  1287.63222733
 Final pressure during heat addition process, P4  =  %.4f MPa  0.446784256534
 Thermal efficiency  =  %.1f percent  96.0189282945
 Mean effective pressure  =  %.0f kPa  1455.36957602

Example 8

In [24]:
# -*- coding: utf8 -*-
from __future__ import division
#Example: 12.8
'''  '''

#Variable Declaration: 


		#1-compressor inlet
		#2-compressor exit
P1 = 100		#kPa
T1 = 288.2		#K
R = 0.287		#gas constant
v1 = R*T1/P1		#specific volume at inlet in m**3/kg
rv = 20		#compression ratio given
k = 1.4		#constant
T2 = T1*rv**(k-1)		#K
print 'Temperature at compressor exit, T2  =  %.1f K ',T2
P2 = P1*rv**k		#kPa
print ' Pressure at compressor exit, P2  =  %.3f MPa  ',P2/1000
v2 = v1/rv		#specific heat at exit in m**3/kg
		#23-heat addition process
		#q23 = Cv*(T3-T2) = 1800 kJ/kg given
q23 = 1800		#kJ/kg heat addition, given
Cv = .717
Cp = 1.004		#specific heat at constant pressure in kJ/kg
T3 = T2+q23/Cp		#K
print ' Initial Temperature during heat addition process, T3  =  %.0f K ',T3
r = T3/T2		#T3/T2 = V3/V2 = r
v3 = r*v2
T4 = T3/(v1/v3)**(k-1)
print ' Final temperature during heat addition process, T4  =  %.0f K ',T4
q41 = Cv*(T1-T4)		#/heat for process 4-1 in kJ/kg
wnet = q23+q41
mep = wnet/(v1-v2)		#effective mean pressure in kPa
qh = 1800		#heat transfer in kJ/kg
nth = wnet/qh		#thermal efficiency

print ' Thermal efficiency  =  %.1f percent ',nth*100
print ' Mean effective pressure  =  %.0f kPa ',mep
Temperature at compressor exit, T2  =  %.1f K  955.225647797
 Pressure at compressor exit, P2  =  %.3f MPa   6.62890803468
 Initial Temperature during heat addition process, T3  =  %.0f K  2748.05433306
 Final temperature during heat addition process, T4  =  %.0f K  1265.26371322
 Thermal efficiency  =  %.1f percent  61.0802954233
 Mean effective pressure  =  %.0f kPa  1399.18182622