Chapter 9:Gas Power Cycles

example 9.1;pg no: 334

In [1]:
#cal of mean effective pressure
#intiation of all variables
# Chapter 9
import math
print"Example 9.1, Page:334  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 1")
Cp=1;#specific heat at constant pressure in KJ/kg K
Cv=0.71;#specific heat at constant volume in KJ/kg K
P1=98;#pressure at begining of compression in KPa
T1=(60+273.15);#temperature at begining of compression in K
Q23=150;#heat supplied in KJ/kg
r=6;#compression ratio
R=0.287;#gas constant in KJ/kg K
print("SI engine operate on otto cycle.consider working fluid to be perfect gas.")
print("here,y=Cp/Cv")
y=Cp/Cv
y=1.4;#approx.
print("Cp-Cv=R in KJ/kg K")
R=Cp-Cv
print("compression ratio,r=V1/V2=(0.15+V2)/V2")
print("so V2=0.15/(r-1) in m^3")
V2=0.15/(r-1)
print("so V2=0.03 m^3")
print("total cylinder volume=V1=r*V2  m^3")
V1=r*V2
print("from perfect gas law,P*V=m*R*T")
print("so m=P1*V1/(R*T1) in kg")
m=P1*V1/(R*T1)
m=0.183;#approx.
print("from state 1 to 2 by P*V^y=P2*V2^y")
print("so P2=P1*(V1/V2)^y in KPa")
P2=P1*(V1/V2)**y
print("also,P1*V1/T1=P2*V2/T2")
print("so T2=P2*V2*T1/(P1*V1)in K")
T2=P2*V2*T1/(P1*V1)
print("from heat addition process 2-3")
print("Q23=m*CV*(T3-T2)")
print("T3=T2+(Q23/(m*Cv))in K")
T3=T2+(Q23/(m*Cv))
print("also from,P3*V3/T3=P2*V2/T2")
print("P3=P2*V2*T3/(V3*T2) in KPa")
V3=V2;#constant volume process
P3=P2*V2*T3/(V3*T2) 
print("for adiabatic expansion 3-4,")
print("P3*V3^y=P4*V4^y")
print("and V4=V1")
V4=V1;
print("hence,P4=P3*V3^y/V1^y in KPa")
P4=P3*V3**y/V1**y
print("and from P3*V3/T3=P4*V4/T4")
print("T4=P4*V4*T3/(P3*V3) in K")
T4=P4*V4*T3/(P3*V3)
print("entropy change from 2-3 and 4-1 are same,and can be given as,")
print("S3-S2=S4-S1=m*Cv*log(T4/T1)")
print("so entropy change,deltaS_32=deltaS_41 in KJ/K")
deltaS_32=m*Cv*math.log(T4/T1)
deltaS_41=deltaS_32;
print("heat rejected,Q41=m*Cv*(T4-T1) in KJ")
Q41=m*Cv*(T4-T1)
W=Q23-Q41
print("net work(W) in KJ="),round(W,2)
n=W/Q23
print("efficiency(n)="),round(W/Q23,2)
print("in percentage"),round(n*100,2)
mep=W/0.15
print("mean effective pressure(mep)=work/volume change in KPa="),round(W/0.15,2)
print("so mep=511.67 KPa")
Example 9.1, Page:334  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 1
SI engine operate on otto cycle.consider working fluid to be perfect gas.
here,y=Cp/Cv
Cp-Cv=R in KJ/kg K
compression ratio,r=V1/V2=(0.15+V2)/V2
so V2=0.15/(r-1) in m^3
so V2=0.03 m^3
total cylinder volume=V1=r*V2  m^3
from perfect gas law,P*V=m*R*T
so m=P1*V1/(R*T1) in kg
from state 1 to 2 by P*V^y=P2*V2^y
so P2=P1*(V1/V2)^y in KPa
also,P1*V1/T1=P2*V2/T2
so T2=P2*V2*T1/(P1*V1)in K
from heat addition process 2-3
Q23=m*CV*(T3-T2)
T3=T2+(Q23/(m*Cv))in K
also from,P3*V3/T3=P2*V2/T2
P3=P2*V2*T3/(V3*T2) in KPa
for adiabatic expansion 3-4,
P3*V3^y=P4*V4^y
and V4=V1
hence,P4=P3*V3^y/V1^y in KPa
and from P3*V3/T3=P4*V4/T4
T4=P4*V4*T3/(P3*V3) in K
entropy change from 2-3 and 4-1 are same,and can be given as,
S3-S2=S4-S1=m*Cv*log(T4/T1)
so entropy change,deltaS_32=deltaS_41 in KJ/K
heat rejected,Q41=m*Cv*(T4-T1) in KJ
net work(W) in KJ= 76.75
efficiency(n)= 0.51
in percentage 51.16
mean effective pressure(mep)=work/volume change in KPa= 511.64
so mep=511.67 KPa

example 9.2;pg no: 336

In [2]:
#cal of compression ratio,air standard efficiency,fuel consumption,bhp/hr
#intiation of all variables
# Chapter 9
print"Example 9.2, Page:336  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 2")
Pa=138;#pressure during compression at 1/8 of stroke in KPa
Pb=1.38*10**3;#pressure during compression at 7/8 of stroke in KPa
n_ite=0.5;#indicated thermal efficiency
n_mech=0.8;#mechanical efficiency
C=41800;#calorific value in KJ/kg
y=1.4;#expansion constant
print("as given")
print("Va=V2+(7/8)*(V1-V2)")
print("Vb=V2+(1/8)*(V1-V2)")
print("and also")
print("Pa*Va^y=Pb*Vb^y")
print("so (Va/Vb)=(Pb/Pa)^(1/y)")
(Pb/Pa)**(1/y)
print("also substituting for Va and Vb")
print("(V2+(7/8)*(V1-V2))/(V2+(1/8)*(V1-V2))=5.18")
r=1+(4.18*8/1.82)
print("so V1/V2=r=1+(4.18*8/1.82)"),round(r,2)
print("it gives r=19.37 or V1/V2=19.37,compression ratio=19.37")
print("as given;cut off occurs at(V1-V2)/15 volume")
print("V3=V2+(V1-V2)/15")
print("cut off ratio,rho=V3/V2")
rho=1+(r-1)/15
n_airstandard=1-(1/(r**(y-1)*y))*((rho**y-1)/(rho-1))
print("air standard efficiency for diesel cycle(n_airstandard)="),round(n_airstandard,2)
print("in percentage"),round(n_airstandard*100,2)
n_airstandard=0.6325;
n_overall=n_airstandard*n_ite*n_mech
print("overall efficiency(n_overall)=n_airstandard*n_ite*n_mech"),round(n_overall,3)
print("in percentage"),round(n_overall*100,2)
n_overall=0.253;
75*60*60/(n_overall*C*100)
print("fuel consumption,bhp/hr in kg="),round(75*60*60/(n_overall*C*100),2)
print("so compression ratio=19.37")
print("air standard efficiency=63.25%")
print("fuel consumption,bhp/hr=0.255 kg")
Example 9.2, Page:336  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 2
as given
Va=V2+(7/8)*(V1-V2)
Vb=V2+(1/8)*(V1-V2)
and also
Pa*Va^y=Pb*Vb^y
so (Va/Vb)=(Pb/Pa)^(1/y)
also substituting for Va and Vb
(V2+(7/8)*(V1-V2))/(V2+(1/8)*(V1-V2))=5.18
so V1/V2=r=1+(4.18*8/1.82) 19.37
it gives r=19.37 or V1/V2=19.37,compression ratio=19.37
as given;cut off occurs at(V1-V2)/15 volume
V3=V2+(V1-V2)/15
cut off ratio,rho=V3/V2
air standard efficiency for diesel cycle(n_airstandard)= 0.63
in percentage 63.23
overall efficiency(n_overall)=n_airstandard*n_ite*n_mech 0.253
in percentage 25.3
fuel consumption,bhp/hr in kg= 0.26
so compression ratio=19.37
air standard efficiency=63.25%
fuel consumption,bhp/hr=0.255 kg

example 9.3;pg no: 338

In [3]:
#cal of comparing efficiency of two cycles
#intiation of all variables
# Chapter 9
print"Example 9.3, Page:338  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 3")
T1=(100+273.15);#temperature at beginning of compresssion in K
P1=103;#pressure at beginning of compresssion in KPa
Cp=1.003;#specific heat at constant pressure in KJ/kg K
Cv=0.71;#specific heat at constant volume in KJ/kg K
Q23=1700;#heat added during combustion in KJ/kg
P3=5000;#maximum pressure in cylinder in KPa
print("1-2-3-4=cycle a")
print("1-2_a-3_a-4_a-5=cycle b")
print("here Cp/Cv=y")
y=Cp/Cv
y=1.4;#approx.
print("and R=0.293 KJ/kg K")
R=0.293;
print("let us consider 1 kg of air for perfect gas,")
m=1;#mass of air in kg
print("P*V=m*R*T")
print("so V1=m*R*T1/P1 in m^3")
V1=m*R*T1/P1
print("at state 3,")
print("P3*V3=m*R*T3")
print("so T3/V2=P3/(m*R)")
P3/(m*R)
print("so T3=17064.8*V2............eq1")
print("for cycle a and also for cycle b")
print("T3_a=17064.8*V2_a.............eq2")
print("a> for otto cycle,")
print("Q23=Cv*(T3-T2)")
print("so T3-T2=Q23/Cv")
Q23/Cv
print("and T2=T3-2394.36.............eq3")
print("from gas law,P2*V2/T2=P3*V3/T3")
print("here V2=V3 and using eq 3,we get")
print("so P2/(T3-2394.36)=5000/T3")
print("substituting T3 as function of V2")
print("P2/(17064.8*V2-2394.36)=5000/(17064.8*V2)")
print("P2=5000*(17064.8*V2-2394.36)/(17064.8*V2)")
print("also P1*V1^y=P2*V2^y")
print("or 103*(1.06)^1.4=(5000*(17064.8*V2-2394.36)/(17064.8*V2))*V2^1.4")
print("upon solving it yields")
print("381.4*V2=17064.8*V2^2.4-2394.36*V2^1.4")
print("or V2^1.4-0.140*V2^0.4-.022=0")
print("by hit and trial it yields,V2=0.18 ")
V2=0.18;
print("thus compression ratio,r=V1/V2")
r=V1/V2
print("otto cycle efficiency,n_otto=1-(1/r)^(y-1)")
n_otto=1-(1/r)**(y-1)
print("in percentage")
n_otto=n_otto*100
print("b> for mixed or dual cycle")
print("Cp*(T4_a-T3_a)=Cv*(T3_a-T2_a)=1700/2=850")
print("or T3_a-T2_a=850/Cv")
850/Cv
print("or T2_a=T3_a-1197.2 .............eq4 ")
print("also P2_a*V2_a/T2_a=P3_a*V3_a/T3_a")
print("P2_a*V2_a/(T3_a-1197.2)=5000*V2_a/T3_a")
print("or P2_a/(T3_a-1197.2)=5000/T3_a")
print("also we had seen earlier that T3_a=17064.8*V2_a")
print("so P2_a/(17064.8*V2_a-1197.2)=5000/(17064.8*V2_a)")
print("so P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a).....................eq5")
print("or for adiabatic process,1-2_a")
print("P1*V1^y=P2*V2^y")
print("so 1.3*(1.06)^1.4=V2_a^1.4*(5000-(359.78/V2_a))")
print("or V2_a^1.4-0.07*V2_a^0.4-0.022=0")
print("by hit and trial ")
print("V2_a=0.122 m^3")
V2_a=0.122;
print("therefore upon substituting V2_a,")
print("by eq 5,P2_a in KPa")
P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a)
print("by eq 2,T3_a in K")
T3_a=17064.8*V2_a
print("by eq 4,T2_a in K")
T2_a=T3_a-1197.2
print("from constant pressure heat addition")
print("Cp*(T4_a-T3_a)=850")
print("so T4_a=T3_a+(850/Cp) in K")
T4_a=T3_a+(850/Cp)
print("also P4_a*V4_a/T4_a= P3_a*V3_a/T3_a")
print("so V4_a=P3_a*V3_a*T4_a/(T3_a*P4_a) in m^3 ")
print("here P3_a=P4_a and V2_a=V3_a")
V4_a=V2_a*T4_a/(T3_a)
print("using adiabatic formulations V4_a=0.172 m^3")
print("(V5/V4_a)^(y-1)=(T4_a/T5),here V5=V1")
V5=V1;
print("so T5=T4_a/(V5/V4_a)^(y-1) in K")
T5=T4_a/(V5/V4_a)**(y-1)
print("heat rejected in process 5-1,Q51=Cv*(T5-T1) in KJ")
Q51=Cv*(T5-T1)
n_mixed=(Q23-Q51)/Q23
print("efficiency of mixed cycle(n_mixed)="),round(n_mixed,2)
print("in percentage"),round(n_mixed*100,2)
("NOTE=>In this question temperature difference (T3-T2) for part a> in book is calculated wrong i.e 2328.77,which is corrected above and comes to be 2394.36,however it doesnt effect the efficiency of any part of this question.")
Example 9.3, Page:338  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 3
1-2-3-4=cycle a
1-2_a-3_a-4_a-5=cycle b
here Cp/Cv=y
and R=0.293 KJ/kg K
let us consider 1 kg of air for perfect gas,
P*V=m*R*T
so V1=m*R*T1/P1 in m^3
at state 3,
P3*V3=m*R*T3
so T3/V2=P3/(m*R)
so T3=17064.8*V2............eq1
for cycle a and also for cycle b
T3_a=17064.8*V2_a.............eq2
a> for otto cycle,
Q23=Cv*(T3-T2)
so T3-T2=Q23/Cv
and T2=T3-2394.36.............eq3
from gas law,P2*V2/T2=P3*V3/T3
here V2=V3 and using eq 3,we get
so P2/(T3-2394.36)=5000/T3
substituting T3 as function of V2
P2/(17064.8*V2-2394.36)=5000/(17064.8*V2)
P2=5000*(17064.8*V2-2394.36)/(17064.8*V2)
also P1*V1^y=P2*V2^y
or 103*(1.06)^1.4=(5000*(17064.8*V2-2394.36)/(17064.8*V2))*V2^1.4
upon solving it yields
381.4*V2=17064.8*V2^2.4-2394.36*V2^1.4
or V2^1.4-0.140*V2^0.4-.022=0
by hit and trial it yields,V2=0.18 
thus compression ratio,r=V1/V2
otto cycle efficiency,n_otto=1-(1/r)^(y-1)
in percentage
b> for mixed or dual cycle
Cp*(T4_a-T3_a)=Cv*(T3_a-T2_a)=1700/2=850
or T3_a-T2_a=850/Cv
or T2_a=T3_a-1197.2 .............eq4 
also P2_a*V2_a/T2_a=P3_a*V3_a/T3_a
P2_a*V2_a/(T3_a-1197.2)=5000*V2_a/T3_a
or P2_a/(T3_a-1197.2)=5000/T3_a
also we had seen earlier that T3_a=17064.8*V2_a
so P2_a/(17064.8*V2_a-1197.2)=5000/(17064.8*V2_a)
so P2_a=5000*(17064.8*V2_a-1197.2)/(17064.8*V2_a).....................eq5
or for adiabatic process,1-2_a
P1*V1^y=P2*V2^y
so 1.3*(1.06)^1.4=V2_a^1.4*(5000-(359.78/V2_a))
or V2_a^1.4-0.07*V2_a^0.4-0.022=0
by hit and trial 
V2_a=0.122 m^3
therefore upon substituting V2_a,
by eq 5,P2_a in KPa
by eq 2,T3_a in K
by eq 4,T2_a in K
from constant pressure heat addition
Cp*(T4_a-T3_a)=850
so T4_a=T3_a+(850/Cp) in K
also P4_a*V4_a/T4_a= P3_a*V3_a/T3_a
so V4_a=P3_a*V3_a*T4_a/(T3_a*P4_a) in m^3 
here P3_a=P4_a and V2_a=V3_a
using adiabatic formulations V4_a=0.172 m^3
(V5/V4_a)^(y-1)=(T4_a/T5),here V5=V1
so T5=T4_a/(V5/V4_a)^(y-1) in K
heat rejected in process 5-1,Q51=Cv*(T5-T1) in KJ
efficiency of mixed cycle(n_mixed)= 0.57
in percentage 56.55
Out[3]:
'NOTE=>In this question temperature difference (T3-T2) for part a> in book is calculated wrong i.e 2328.77,which is corrected above and comes to be 2394.36,however it doesnt effect the efficiency of any part of this question.'

example 9.4;pg no: 341

In [4]:
#cal of thermal efficiency,turbine and compressor work
#intiation of all variables
# Chapter 9
print"Example 9.4, Page:341  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 4")
T3=1200;#maximum temperature in K
T1=300;#minimum temperature in K
y=1.4;#expansion constant
Cp=1.005;#specific heat at constant pressure in KJ/kg K
print("optimum pressure ratio for maximum work output,")
print("rp=(T_max/T_min)^((y)/(2*(y-1)))")
T_max=T3;
T_min=T1;
rp=(T_max/T_min)**((y)/(2*(y-1)))
print("so p2/p1=11.3,For process 1-2, T2/T1=(p2/p1)^(y/(y-1))")
print("so T2=T1*(p2/p1)^((y-1)/y)in K")
T2=T1*(rp)**((y-1)/y)
print("For process 3-4,")
print("T3/T4=(p3/p4)^((y-1)/y)=(p2/p1)^((y-1)/y)")
print("so T4=T3/(rp)^((y-1)/y)in K")
T4=T3/(rp)**((y-1)/y)
print("heat supplied,Q23=Cp*(T3-T2)in KJ/kg")
Q23=Cp*(T3-T2)
Wc=Cp*(T2-T1)
print("compressor work,Wc in KJ/kg="),round(Wc,2)
Wt=Cp*(T3-T4)
print("turbine work,Wt in KJ/kg="),round(Wt,2)
(Wt-Wc)/Q23
print("thermal efficiency=net work/heat supplied="),round((Wt-Wc)/Q23,2)
print("so compressor work=301.5 KJ/kg,turbine work=603 KJ/kg,thermal efficiency=50%")
Example 9.4, Page:341  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 4
optimum pressure ratio for maximum work output,
rp=(T_max/T_min)^((y)/(2*(y-1)))
so p2/p1=11.3,For process 1-2, T2/T1=(p2/p1)^(y/(y-1))
so T2=T1*(p2/p1)^((y-1)/y)in K
For process 3-4,
T3/T4=(p3/p4)^((y-1)/y)=(p2/p1)^((y-1)/y)
so T4=T3/(rp)^((y-1)/y)in K
heat supplied,Q23=Cp*(T3-T2)in KJ/kg
compressor work,Wc in KJ/kg= 301.5
turbine work,Wt in KJ/kg= 603.0
thermal efficiency=net work/heat supplied= 0.5
so compressor work=301.5 KJ/kg,turbine work=603 KJ/kg,thermal efficiency=50%

example 9.5;pg no: 342

In [5]:
#cal of thermal efficiency,turbine and compressor work
#intiation of all variables
# Chapter 9
print"Example 9.5, Page:342  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 5")
P1=1*10**5;#initial pressure in Pa
P4=P1;#constant pressure process
T1=300;#initial temperature in K
P2=6.2*10**5;#pressure after compression in Pa
P3=P2;#constant pressure process
k=0.017;#fuel to air ratio
n_compr=0.88;#compressor efficiency
q=44186;#heating value of fuel in KJ/kg
n_turb=0.9;#turbine internal efficiency
Cp_comb=1.147;#specific heat of combustion at constant pressure in KJ/kg K
Cp_air=1.005;#specific heat of air at constant pressure in KJ/kg K
y=1.4;#expansion constant
n=1.33;#expansion constant for polytropic constant
print("gas turbine cycle is shown by 1-2-3-4 on T-S diagram,")
print("for process 1-2 being isentropic,")
print("T2/T1=(P2/P1)^((y-1)/y)")
print("so T2=T1*(P2/P1)^((y-1)/y) in K")
T2=T1*(P2/P1)**((y-1)/y)
print("considering compressor efficiency,n_compr=(T2-T1)/(T2_a-T1)")
print("so T2_a=T1+((T2-T1)/n_compr)in K")
T2_a=T1+((T2-T1)/n_compr)
print("during process 2-3 due to combustion of unit mass of compressed the energy balance shall be as under,")
print("heat added=mf*q")
print("=((ma+mf)*Cp_comb*T3)-(ma*Cp_air*T2)")
print("or (mf/ma)*q=((1+(mf/ma))*Cp_comb*T3)-(Cp_air*T2_a)")
print("so T3=((mf/ma)*q+(Cp_air*T2_a))/((1+(mf/ma))*Cp_comb)in K")
T3=((k)*q+(Cp_air*T2_a))/((1+(k))*Cp_comb)
print("for expansion 3-4 being")
print("T4/T3=(P4/P3)^((n-1)/n)")
print("so T4=T3*(P4/P3)^((n-1)/n) in K")
T4=T3*(P4/P3)**((n-1)/n)
print("actaul temperature at turbine inlet considering internal efficiency of turbine,")
print("n_turb=(T3-T4_a)/(T3-T4)")
print("so T4_a=T3-(n_turb*(T3-T4)) in K")
T4_a=T3-(n_turb*(T3-T4))
Wc=Cp_air*(T2_a-T1)
print("compressor work,per kg of air compressed(Wc) in KJ/kg of air="),round(Wc,2)
print("so compressor work=234.42 KJ/kg of air")
Wt=Cp_comb*(T3-T4_a)
print("turbine work,per kg of air compressed(Wt) in KJ/kg of air="),round(Wt,2)
print("so turbine work=414.71 KJ/kg of air")
W_net=Wt-Wc
print("net work(W_net) in KJ/kg of air="),round(W_net,2)
Q=k*q
print("heat supplied(Q) in KJ/kg of air="),round(Q,2)
n=W_net/Q
print("thermal efficiency(n)="),round(n,2)
print("in percentage"),round(n*100,2)
print("so thermal efficiency=24%")
Example 9.5, Page:342  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 5
gas turbine cycle is shown by 1-2-3-4 on T-S diagram,
for process 1-2 being isentropic,
T2/T1=(P2/P1)^((y-1)/y)
so T2=T1*(P2/P1)^((y-1)/y) in K
considering compressor efficiency,n_compr=(T2-T1)/(T2_a-T1)
so T2_a=T1+((T2-T1)/n_compr)in K
during process 2-3 due to combustion of unit mass of compressed the energy balance shall be as under,
heat added=mf*q
=((ma+mf)*Cp_comb*T3)-(ma*Cp_air*T2)
or (mf/ma)*q=((1+(mf/ma))*Cp_comb*T3)-(Cp_air*T2_a)
so T3=((mf/ma)*q+(Cp_air*T2_a))/((1+(mf/ma))*Cp_comb)in K
for expansion 3-4 being
T4/T3=(P4/P3)^((n-1)/n)
so T4=T3*(P4/P3)^((n-1)/n) in K
actaul temperature at turbine inlet considering internal efficiency of turbine,
n_turb=(T3-T4_a)/(T3-T4)
so T4_a=T3-(n_turb*(T3-T4)) in K
compressor work,per kg of air compressed(Wc) in KJ/kg of air= 234.42
so compressor work=234.42 KJ/kg of air
turbine work,per kg of air compressed(Wt) in KJ/kg of air= 414.71
so turbine work=414.71 KJ/kg of air
net work(W_net) in KJ/kg of air= 180.29
heat supplied(Q) in KJ/kg of air= 751.16
thermal efficiency(n)= 0.24
in percentage 24.0
so thermal efficiency=24%

example 9.6;pg no: 343

In [6]:
#cal of overall optimum pressure ratio
#intiation of all variables
# Chapter 9
print"Example 9.6, Page:343  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 6")
T1=300;#minimum temperature in brayton cycle in K
T5=1200;#maximum temperature in brayton cycle in K
n_isen_c=0.85;#isentropic efficiency of compressor
n_isen_t=0.9;#isentropic efficiency of turbine
y=1.4;#expansion constant
print("NOTE=>In this question formula for overall pressure ratio is derived,which cannot be done using scilab,so using this formula we proceed further.")
rp=(T1/(T5*n_isen_c*n_isen_t))**((2*y)/(3*(1-y)))
print("overall pressure ratio(rp)="),round(rp,2)
print("so overall optimum pressure ratio=13.6")
Example 9.6, Page:343  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 6
NOTE=>In this question formula for overall pressure ratio is derived,which cannot be done using scilab,so using this formula we proceed further.
overall pressure ratio(rp)= 13.59
so overall optimum pressure ratio=13.6

example 9.7;pg no: 346

In [7]:
#cal of state of air at exit of compressor,polytropic efficiency,efficiency of each sate,power
#intiation of all variables
# Chapter 9
import math
print"Example 9.7, Page:346  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 7")
T1=313.;#air entering temperature in K
P1=1*10**5;#air entering pressure in Pa
m=50.;#flow rate through compressor in kg/s
R=0.287;#gas constant in KJ/kg K
print("i> theoretically state of air at exit can be determined by the given stage pressure ratio of 1.35.Let pressure at inlet to first stage P1 and subsequent intermediate pressure be P2,P3,P4,P5,P6,P7,P8 and exit pressure being P9.")
print("therefore,P2/P1=P3/P2=P4/P3=P5/P4=P6/P5=P7/P6=P8/P7=P9/P8=r=1.35")
r=1.35;#compression ratio
k=(1.35)**8
print("or P9/P1=k=(1.35)^8"),round(k,2)
k=11.03;#approx.
print("or theoretically,the temperature at exit of compressor can be predicted considering isentropic compression of air(y=1.4)")
y=1.4;#expansion constant 
print("T9/T1=(P9/P1)^((y-1)/y)")
T9=T1*(k)**((y-1)/y)
print("so T9 in K="),round(T9,2)
print("considering overall efficiency of compression 82% the actual temperature at compressor exit can be obtained")
print("(T9-T1)/(T9_actual-T1)=0.82")
T9_actual=T1+((T9-T1)/0.82)
print("so T9_actual=T1+((T9-T1)/0.82) in K"),round(T9_actual,2)
print("let the actual index of compression be n, then")
print("(T9_actual/T1)=(P9/P1)^((n-1)/n)")
print("so n=log(P9/P1)/(log(P9/P1)-log(T9-actual/T1))")
n=math.log(k)/(math.log(k)-math.log(T9_actual/T1))
print("so state of air at exit of compressor,pressure=11.03 bar and temperature=689.18 K")
print("ii> let polytropic efficiency be n_polytropic for compressor then,")
print("(n-1)/n=((y-1)/y)*(1/n_polytropic)")
n_polytropic=((y-1)/y)/((n-1)/n)
print("so n_polytropic="),round(n_polytropic,2)
print("in percentage"),round(n_polytropic*100,2)
print("so ploytropic efficiency=86.88%")
print("iii> stage efficiency can be estimated for any stage.say first stage.")
print("ideal state at exit of compressor stage=T2/T1=(P2/P1)^((y-1)/y)")
print("so T2=T1*(P2/P1)^((y-1)/y) in K")
T2=T1*(r)**((y-1)/y)
print("actual temperature at exit of first stage can be estimated using polytropic index 1.49.")
print("T2_actual/T1=(P2/P1)^((n-1)/n)")
print("so T2_actual=T1*(P2/P1)^((n-1)/n) in K")
T2_actual=T1*(r)**((n-1)/n)
ns_1=(T2-T1)/(T2_actual-T1)
print("stage efficiency for first stage,ns_1="),round(ns_1,2)
print("in percentage"),round(ns_1*100,2)
print("actual temperature at exit of second stage,")
print("T3_actual/T2_actual=(P3/P2)^((n-1)/n)")
print("so T3_actual=T2_actual*(P3/P2)^((n-1)/n) in K")
T3_actual=T2_actual*(r)**((n-1)/n)
print("ideal temperature at exit of second stage")
print("T3/T2_actual=(P3/P2)^((n-1)/n)")
print("so T3=T2_actual*(P3/P2)^((y-1)/y) in K")
T3=T2_actual*(r)**((y-1)/y)
ns_2=(T3-T2_actual)/(T3_actual-T2_actual)
print("stage efficiency for second stage,ns_2="),round(ns_2,2)
print("in percentage"),round(ns_2*100,2)
print("actual rtemperature at exit of third stage,")
print("T4_actual/T3_actual=(P4/P3)^((n-1)/n)")
T4_actual=T3_actual*(r)**((n-1)/n)
print("so T4_actual in K="),round(T4_actual,2)
print("ideal temperature at exit of third stage,")
print("T4/T3_actual=(P4/P3)^((n-1)/n)")
T4=T3_actual*(r)**((y-1)/y)
print("so T4 in K="),round(T4,2)
ns_3=(T4-T3_actual)/(T4_actual-T3_actual)
print("stage efficiency for third stage,ns_3="),round(ns_3,2)
ns_3=ns_3*100
print("in percentage="),round(ns_3*100,2)
print("so stage efficiency=86.4%")
print("iv> from steady flow energy equation,")
print("Wc=dw=dh and dh=du+p*dv+v*dp")
print("dh=dq+v*dp")
print("dq=0 in adiabatic process")
print("dh=v*dp")
print("Wc=v*dp")
print("here for polytropic compression ")
print("P*V^1.49=constant i.e n=1.49")
n=1.49;
Wc=(n/(n-1))*m*R*T1*(((k)**((n-1)/n))-1)
print("Wc in KJ/s="),round(Wc,2)
Wc_actual=Wc*0.9
print("due to overall efficiency being 90% the actual compressor work(Wc_actual) in KJ/s="),round(Wc*0.9,2)
print("so power required to drive compressor =14777.89 KJ/s")
Example 9.7, Page:346  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 7
i> theoretically state of air at exit can be determined by the given stage pressure ratio of 1.35.Let pressure at inlet to first stage P1 and subsequent intermediate pressure be P2,P3,P4,P5,P6,P7,P8 and exit pressure being P9.
therefore,P2/P1=P3/P2=P4/P3=P5/P4=P6/P5=P7/P6=P8/P7=P9/P8=r=1.35
or P9/P1=k=(1.35)^8 11.03
or theoretically,the temperature at exit of compressor can be predicted considering isentropic compression of air(y=1.4)
T9/T1=(P9/P1)^((y-1)/y)
so T9 in K= 621.47
considering overall efficiency of compression 82% the actual temperature at compressor exit can be obtained
(T9-T1)/(T9_actual-T1)=0.82
so T9_actual=T1+((T9-T1)/0.82) in K 689.19
let the actual index of compression be n, then
(T9_actual/T1)=(P9/P1)^((n-1)/n)
so n=log(P9/P1)/(log(P9/P1)-log(T9-actual/T1))
so state of air at exit of compressor,pressure=11.03 bar and temperature=689.18 K
ii> let polytropic efficiency be n_polytropic for compressor then,
(n-1)/n=((y-1)/y)*(1/n_polytropic)
so n_polytropic= 0.87
in percentage 86.9
so ploytropic efficiency=86.88%
iii> stage efficiency can be estimated for any stage.say first stage.
ideal state at exit of compressor stage=T2/T1=(P2/P1)^((y-1)/y)
so T2=T1*(P2/P1)^((y-1)/y) in K
actual temperature at exit of first stage can be estimated using polytropic index 1.49.
T2_actual/T1=(P2/P1)^((n-1)/n)
so T2_actual=T1*(P2/P1)^((n-1)/n) in K
stage efficiency for first stage,ns_1= 0.86
in percentage 86.33
actual temperature at exit of second stage,
T3_actual/T2_actual=(P3/P2)^((n-1)/n)
so T3_actual=T2_actual*(P3/P2)^((n-1)/n) in K
ideal temperature at exit of second stage
T3/T2_actual=(P3/P2)^((n-1)/n)
so T3=T2_actual*(P3/P2)^((y-1)/y) in K
stage efficiency for second stage,ns_2= 0.86
in percentage 86.33
actual rtemperature at exit of third stage,
T4_actual/T3_actual=(P4/P3)^((n-1)/n)
so T4_actual in K= 420.83
ideal temperature at exit of third stage,
T4/T3_actual=(P4/P3)^((n-1)/n)
so T4 in K= 415.42
stage efficiency for third stage,ns_3= 0.86
in percentage= 8632.9
so stage efficiency=86.4%
iv> from steady flow energy equation,
Wc=dw=dh and dh=du+p*dv+v*dp
dh=dq+v*dp
dq=0 in adiabatic process
dh=v*dp
Wc=v*dp
here for polytropic compression 
P*V^1.49=constant i.e n=1.49
Wc in KJ/s= 16419.87
due to overall efficiency being 90% the actual compressor work(Wc_actual) in KJ/s= 14777.89
so power required to drive compressor =14777.89 KJ/s

example 9.8;pg no: 349

In [8]:
#intiation of all variables
# Chapter 9
print"Example 9.8, Page:349  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 8")
print("In question no.8,expression for air standard cycle efficiency is derived which cannot be solve using python software.")
Example 9.8, Page:349  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 8
In question no.8,expression for air standard cycle efficiency is derived which cannot be solve using python software.

example 9.9;pg no: 350

In [9]:
#cal of cycle efficiency,work ratio,specific work output
#intiation of all variables
# Chapter 9
print"Example 9.9, Page:350  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 9")
y=1.4;#expansion constant
n_poly_c=0.85;#ploytropic efficiency of compressor
n_poly_T=0.90;#ploytropic efficiency of Turbine
r=8.;#compression ratio
T1=(27.+273.);#temperature of air in compressor in K
T3=1100.;#temperature of air leaving combustion chamber in K
epsilon=0.8;#effectiveness of heat exchanger
Cp=1.0032;#specific heat at constant pressure in KJ/kg K
print("using polytropic efficiency the index of compression and expansion can be obtained as under,")
print("let compression index be nc,")
print("(nc-1)/nc=(y-1)/(y*n_poly_c)")
print("so nc=1/(1-((y-1)/(y*n_poly_c)))")
nc=1/(1-((y-1)/(y*n_poly_c)))
print("let expansion index be nt,")
print("(nt-1)/nt=(n_poly_T*(y-1))/y")
print("so nt=1/(1-((n_poly_T*(y-1))/y))")
nt=1/(1-((n_poly_T*(y-1))/y))
print("For process 1-2")
print("T2/T1=(p2/p1)^((nc-1)/nc)")
print("so T2=T1*(p2/p1)^((nc-1)/nc)in K")
T2=T1*(r)**((nc-1)/nc)
print("also T4/T3=(p4/p3)^((nt-1)/nt)")
print("so T4=T3*(p4/p3)^((nt-1)/nt)in K")
T4=T3*(1/r)**((nt-1)/nt)
print("using heat exchanger effectivenesss,") 
print("epsilon=(T5-T2)/(T4-T2)")
print("so T5=T2+(epsilon*(T4-T2))in K")
T5=T2+(epsilon*(T4-T2))
print("heat added in combustion chamber,q_add=Cp*(T3-T5)in KJ/kg")
q_add=Cp*(T3-T5)
print("compressor work,Wc=Cp*(T2-T1)in ")
Wc=Cp*(T2-T1)
print("turbine work,Wt=Cp*(T3-T4)in KJ/kg")
Wt=Cp*(T3-T4)
(Wt-Wc)/q_add
print("cycle efficiency="),round((Wt-Wc)/q_add,2)
print("in percentage"),round((Wt-Wc)*100/q_add,2)
(Wt-Wc)/Wt
print("work ratio="),round((Wt-Wc)/Wt,2)
print("specific work output in KJ/kg="),round(Wt-Wc,2)
print("so cycle efficiency=32.79%,work ratio=0.334,specific work output=152.56 KJ/kg")
Example 9.9, Page:350  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 9
using polytropic efficiency the index of compression and expansion can be obtained as under,
let compression index be nc,
(nc-1)/nc=(y-1)/(y*n_poly_c)
so nc=1/(1-((y-1)/(y*n_poly_c)))
let expansion index be nt,
(nt-1)/nt=(n_poly_T*(y-1))/y
so nt=1/(1-((n_poly_T*(y-1))/y))
For process 1-2
T2/T1=(p2/p1)^((nc-1)/nc)
so T2=T1*(p2/p1)^((nc-1)/nc)in K
also T4/T3=(p4/p3)^((nt-1)/nt)
so T4=T3*(p4/p3)^((nt-1)/nt)in K
using heat exchanger effectivenesss,
epsilon=(T5-T2)/(T4-T2)
so T5=T2+(epsilon*(T4-T2))in K
heat added in combustion chamber,q_add=Cp*(T3-T5)in KJ/kg
compressor work,Wc=Cp*(T2-T1)in 
turbine work,Wt=Cp*(T3-T4)in KJ/kg
cycle efficiency= 0.33
in percentage 32.79
work ratio= 0.33
specific work output in KJ/kg= 152.56
so cycle efficiency=32.79%,work ratio=0.334,specific work output=152.56 KJ/kg

example 9.10;pg no: 351

In [10]:
#cal of isentropic efficiency of turbine
#intiation of all variables
# Chapter 9
print"Example 9.10, Page:351  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 10")
T1=(27+273);#temperature of air in compressor in K
p1=1*10**5;#pressure of air in compressor in Pa
p2=5*10**5;#pressure of air after compression in Pa
p3=p2-0.2*10**5;#pressure drop in Pa
p4=1*10**5;#pressure to which expansion occur in turbine in Pa
nc=0.85;#isentropic efficiency
T3=1000;#temperature of air in combustion chamber in K
n=0.2;#thermal efficiency of plant
y=1.4;#expansion constant
Cp=1.0032;#specific heat at constant pressure in KJ/kg K
print("for process 1-2_a")
print("T2_a/T1=(p2_a/p1)^((y-1)/y)")
print("so T2_a=T1*(p2_a/p1)^((y-1)/y) in K")
T2_a=T1*(p2/p1)**((y-1)/y)
print("nc=(T2_a-T1)/(T2-T1)")
print("so T2=T1+((T2_a-T1)/nc) in K")
T2=T1+((T2_a-T1)/nc)
print("for process 3-4_a,")
print("T4_a/T3=(p4/p3)^((y-1)/y)")
print("so T4_a=T3*(p4/p3)^((y-1)/y)in K")
T4_a=T3*(p4/p3)**((y-1)/y)
print("Compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg")
Wc=Cp*(T2-T1)
print("Turbine work per kg,Wt=Cp*(T3-T4)in KJ/kg")
print("net output,W_net=Wt-Wc={Wc-(Cp*(T3-T4))} in KJ/kg")
print("heat added,q_add=Cp*(T3-T2) in KJ/kg")
q_add=Cp*(T3-T2)
print("thermal efficiency,n=W_net/q_add")
print("n={Wc-(Cp*(T3-T4))}/q_add")
print("so T4=T3-((Wc-(n*q_add))/Cp)in K")
T4=T3-((Wc-(n*q_add))/Cp)
nt=(T3-T4)/(T3-T4_a)
print("therefore,isentropic efficiency of turbine,nt=(T3-T4)/(T3-T4_a)"),round((T3-T4)/(T3-T4_a),3)
print("in percentage"),round(nt*100,2)
print("so turbine isentropic efficiency=29.69%")
Example 9.10, Page:351  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 10
for process 1-2_a
T2_a/T1=(p2_a/p1)^((y-1)/y)
so T2_a=T1*(p2_a/p1)^((y-1)/y) in K
nc=(T2_a-T1)/(T2-T1)
so T2=T1+((T2_a-T1)/nc) in K
for process 3-4_a,
T4_a/T3=(p4/p3)^((y-1)/y)
so T4_a=T3*(p4/p3)^((y-1)/y)in K
Compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg
Turbine work per kg,Wt=Cp*(T3-T4)in KJ/kg
net output,W_net=Wt-Wc={Wc-(Cp*(T3-T4))} in KJ/kg
heat added,q_add=Cp*(T3-T2) in KJ/kg
thermal efficiency,n=W_net/q_add
n={Wc-(Cp*(T3-T4))}/q_add
so T4=T3-((Wc-(n*q_add))/Cp)in K
therefore,isentropic efficiency of turbine,nt=(T3-T4)/(T3-T4_a) 0.297
in percentage 29.7
so turbine isentropic efficiency=29.69%

example 9.11;pg no: 352

In [11]:
#cal of thermal efficiency,net output,A/F ratio
#intiation of all variables
# Chapter 9
import math
print"Example 9.11, Page:352  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 11")
P1=1.*10**5;#initial pressure in Pa
T1=(27.+273.);#initial temperature in K
T3=T1;
r=10.;#pressure ratio
T5=1000.;#maximum temperature in cycle in K
P6=3.*10**5;#first stage expansion pressure in Pa
T7=995.;#first stage reheated temperature in K
C=42000.;#calorific value of fuel in KJ/kg
Cp=1.0032;#specific heat at constant pressure in KJ/kg K
m=30.;#air flow rate in kg/s
nc=0.85;#isentropic efficiency of compression
ne=0.9;#isentropic efficiency of expansion
y=1.4;#expansion constant
print("for perfect intercooling the pressure ratio of each compression stage(k)")
print("k=sqrt(r)")
k=math.sqrt(r)
k=3.16;#approx.
print("for process 1-2_a,T2_a/T1=(P2/P1)^((y-1)/y)")
print("so T2_a=T1*(k)^((y-1)/y)in K")
T2_a=T1*(k)**((y-1)/y)
print("considering isentropic efficiency of compression,")
print("nc=(T2_a-T1)/(T2-T1)")
print("so T2=T1+((T2_a-T1)/nc)in K")
T2=T1+((T2_a-T1)/nc)
print("for process 3-4,")
print("T4_a/T3=(P4/P3)^((y-1)/y)")
print("so T4_a=T3*(P4/P3)^((y-1)/y) in K")
T4_a=T3*(k)**((y-1)/y)
print("again due to compression efficiency,nc=(T4_a-T3)/(T4-T3)")
print("so T4=T3+((T4_a-T3)/nc)in K")
T4=T3+((T4_a-T3)/nc)
print("total compressor work,Wc=2*Cp*(T4-T3) in KJ/kg")
Wc=2*Cp*(T4-T3)
print("for expansion process 5-6_a,")
print("T6_a/T5=(P6/P5)^((y-1)/y)")
print("so T6_a=T5*(P6/P5)^((y-1)/y) in K")
P5=10.*10**5;#pressure in Pa
T6_a=T5*(P6/P5)**((y-1)/y)
print("considering expansion efficiency,ne=(T5-T6)/(T5-T6_a)")
print("T6=T5-(ne*(T5-T6_a)) in K")
T6=T5-(ne*(T5-T6_a))
print("for expansion in 7-8_a")
print("T8_a/T7=(P8/P7)^((y-1)/y)")
print("so T8_a=T7*(P8/P7)^((y-1)/y) in K")
P8=P1;#constant pressure process
P7=P6;#constant pressure process
T8_a=T7*(P8/P7)**((y-1)/y)
print("considering expansion efficiency,ne=(T7-T8)/(T7-T8_a)")
print("so T8=T7-(ne*(T7-T8_a))in K")
T8=T7-(ne*(T7-T8_a))
print("expansion work output per kg of air(Wt)=Cp*(T5-T6)+Cp*(T7-T8) in KJ/kg")
Wt=Cp*(T5-T6)+Cp*(T7-T8)
print("heat added per kg air(q_add)=Cp*(T5-T4)+Cp*(T7-T6) in KJ/kg")
q_add=Cp*(T5-T4)+Cp*(T7-T6)
mf=q_add/C
print("fuel required per kg of air,mf=q_add/C"),round(q_add/C,2)
print("air-fuel ratio=1/mf"),round(1/mf,2)
W=Wt-Wc
print("net output(W) in KJ/kg="),round(Wt-Wc,2)
print("output for air flowing at 30 kg/s,=W*m in KW"),round(W*m,2)
W/q_add
print("thermal efficiency="),round(W/q_add,2)
print("in percentage"),round(W*100/q_add,2)
print("so thermal efficiency=27.87%,net output=6876.05 KW,A/F ratio=51.07")
print("NOTE=>In this question,expansion work is calculated wrong in book,so it is corrected above and answers vary accordingly.")
Example 9.11, Page:352  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 11
for perfect intercooling the pressure ratio of each compression stage(k)
k=sqrt(r)
for process 1-2_a,T2_a/T1=(P2/P1)^((y-1)/y)
so T2_a=T1*(k)^((y-1)/y)in K
considering isentropic efficiency of compression,
nc=(T2_a-T1)/(T2-T1)
so T2=T1+((T2_a-T1)/nc)in K
for process 3-4,
T4_a/T3=(P4/P3)^((y-1)/y)
so T4_a=T3*(P4/P3)^((y-1)/y) in K
again due to compression efficiency,nc=(T4_a-T3)/(T4-T3)
so T4=T3+((T4_a-T3)/nc)in K
total compressor work,Wc=2*Cp*(T4-T3) in KJ/kg
for expansion process 5-6_a,
T6_a/T5=(P6/P5)^((y-1)/y)
so T6_a=T5*(P6/P5)^((y-1)/y) in K
considering expansion efficiency,ne=(T5-T6)/(T5-T6_a)
T6=T5-(ne*(T5-T6_a)) in K
for expansion in 7-8_a
T8_a/T7=(P8/P7)^((y-1)/y)
so T8_a=T7*(P8/P7)^((y-1)/y) in K
considering expansion efficiency,ne=(T7-T8)/(T7-T8_a)
so T8=T7-(ne*(T7-T8_a))in K
expansion work output per kg of air(Wt)=Cp*(T5-T6)+Cp*(T7-T8) in KJ/kg
heat added per kg air(q_add)=Cp*(T5-T4)+Cp*(T7-T6) in KJ/kg
fuel required per kg of air,mf=q_add/C 0.02
air-fuel ratio=1/mf 51.08
net output(W) in KJ/kg= 229.2
output for air flowing at 30 kg/s,=W*m in KW 6876.05
thermal efficiency= 0.28
in percentage 27.88
so thermal efficiency=27.87%,net output=6876.05 KW,A/F ratio=51.07
NOTE=>In this question,expansion work is calculated wrong in book,so it is corrected above and answers vary accordingly.

example 9.12;pg no: 354

In [12]:
#cal of fuel-air ratio in two combustion chambers,total turbine work,cycle thermal efficiency
#intiation of all variables
# Chapter 9
print"Example 9.12, Page:354  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 12")
P1=1.*10**5;#initial pressure in Pa
P9=P1;
T1=300.;#initial temperature in K
P2=4.*10**5;#pressure of air in intercooler in Pa
P3=P2;
T3=290.;#temperature of air in intercooler in K
T6=1300.;#temperature of combustion chamber in K
P4=8.*10**5;#pressure of air after compression in Pa
P6=P4;
T8=1300.;#temperature after reheating in K
P8=4.*10**5;#pressure after expansion in Pa
P7=P8;
C=42000.;#heating value of fuel in KJ/kg
y=1.4;#expansion constant
ne=0.8;#effectiveness of regenerator
Cp=1.0032;#specific heat at constant pressure in KJ/kg K
print("for process 1-2,")
print("T2/T1=(P2/P1)^((y-1)/y)")
print("so T2=T1*(P2/P1)^((y-1)/y) in K")
T2=T1*(P2/P1)**((y-1)/y)
print("for process 3-4,")
print("T4/T3=(P4/P3)^((y-1)/y)")
print("so T4=T3*(P4/P3)^((y-1)/y) in K")
T4=T3*(P4/P3)**((y-1)/y)
print("for process 6-7,")
print("T7/T6=(P7/P6)^((y-1)/y)")
print("so T7=T6*(P7/P6)^((y-1)/y) in K")
T7=T6*(P7/P6)**((y-1)/y)
print("for process 8-9,")
print("T9/T8=(P9/P8)^((y-1)/y)")
print("T9=T8*(P9/P8)^((y-1)/y) in K")
T9=T8*(P9/P8)**((y-1)/y)
print("in regenerator,effectiveness=(T5-T4)/(T9-T4)")
print("T5=T4+(ne*(T9-T4))in K")
T5=T4+(ne*(T9-T4))
print("compressor  work per kg air,Wc=Cp*(T2-T1)+Cp*(T4-T3) in KJ/kg")
Wc=Cp*(T2-T1)+Cp*(T4-T3)
Wt=Cp*(T6-T7)+Cp*(T8-T9)
print("turbine work per kg air,Wt in KJ/kg="),round(Wt,2)
q_add=Cp*(T6-T5)+Cp*(T8-T7)
print("heat added per kg air,q_add in KJ/kg="),round(q_add,2)
q_add/C
print("total fuel required per kg of air="),round(q_add/C,2)
W_net=Wt-Wc
print("net work,W_net in KJ/kg="),round(W_net,2)
n=W_net/q_add
print("cycle thermal efficiency,n="),round(n,2)
print("in percentage"),round(n*100,2)
print("fuel required per kg air in combustion chamber 1,Cp*(T8-T7)/C="),round(Cp*(T8-T7)/C,4)
print("fuel required per kg air in combustion chamber2,Cp*(T6-T5)/C="),round(Cp*(T6-T5)/C,4)
print("so fuel-air ratio in two combustion chambers=0.0126,0.0056")
print("total turbine work=660.85 KJ/kg")
print("cycle thermal efficiency=58.9%")
print("NOTE=>In this question,fuel required per kg air in combustion chamber 1 and 2 are calculated wrong in book,so it is corrected above and answers vary accordingly. ")
Example 9.12, Page:354  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 12
for process 1-2,
T2/T1=(P2/P1)^((y-1)/y)
so T2=T1*(P2/P1)^((y-1)/y) in K
for process 3-4,
T4/T3=(P4/P3)^((y-1)/y)
so T4=T3*(P4/P3)^((y-1)/y) in K
for process 6-7,
T7/T6=(P7/P6)^((y-1)/y)
so T7=T6*(P7/P6)^((y-1)/y) in K
for process 8-9,
T9/T8=(P9/P8)^((y-1)/y)
T9=T8*(P9/P8)^((y-1)/y) in K
in regenerator,effectiveness=(T5-T4)/(T9-T4)
T5=T4+(ne*(T9-T4))in K
compressor  work per kg air,Wc=Cp*(T2-T1)+Cp*(T4-T3) in KJ/kg
turbine work per kg air,Wt in KJ/kg= 660.84
heat added per kg air,q_add in KJ/kg= 765.43
total fuel required per kg of air= 0.02
net work,W_net in KJ/kg= 450.85
cycle thermal efficiency,n= 0.59
in percentage 58.9
fuel required per kg air in combustion chamber 1,Cp*(T8-T7)/C= 0.0056
fuel required per kg air in combustion chamber2,Cp*(T6-T5)/C= 0.0126
so fuel-air ratio in two combustion chambers=0.0126,0.0056
total turbine work=660.85 KJ/kg
cycle thermal efficiency=58.9%
NOTE=>In this question,fuel required per kg air in combustion chamber 1 and 2 are calculated wrong in book,so it is corrected above and answers vary accordingly. 

example 9.13;pg no: 356

In [13]:
#cal of brake output,stroke volume
#intiation of all variables
# Chapter 9
import math
print"Example 9.13, Page:356  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 13")
T2=700.;#highest temperature of stirling engine in K
T1=300.;#lowest temperature of stirling engine in K
r=3.;#compression ratio
q_add=30.;#heat addition in KJ/s
epsilon=0.9;#regenerator efficiency
P=1*10**5;#pressure at begining of compression in Pa
n=100.;#number of cycle per minute
Cv=0.72;#specific heat at constant volume in KJ/kg K
R=29.27;#gas constant in KJ/kg K
print("work done per kg of air,W=R*(T2-T1)*log(r) in KJ/kg")
W=R*(T2-T1)*math.log(r)
print("heat added per kg of air,q=R*T2*log(r)+(1-epsilon)*Cv*(T2-T1) in KJ/kg")
q=R*T2*math.log(r)+(1-epsilon)*Cv*(T2-T1)
print("for 30 KJ/s heat supplied,the mass of air/s(m)=q_add/q in kg/s")
m=q_add/q
print("mass of air per cycle=m/n in kg/cycle")
m/n
print("brake output in KW="),round(W*m,2)
m=1.33*10**-4;#mass of air per cycle in kg/cycle
T=T1;
V=m*R*T*1000/P
print("stroke volume,V in m^3="),round(V,4)
print("brake output=17.11 KW")
print("stroke volume=0.0116 m^3")
Example 9.13, Page:356  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 13
work done per kg of air,W=R*(T2-T1)*log(r) in KJ/kg
heat added per kg of air,q=R*T2*log(r)+(1-epsilon)*Cv*(T2-T1) in KJ/kg
for 30 KJ/s heat supplied,the mass of air/s(m)=q_add/q in kg/s
mass of air per cycle=m/n in kg/cycle
brake output in KW= 17.12
stroke volume,V in m^3= 0.0117
brake output=17.11 KW
stroke volume=0.0116 m^3

example 9.14;pg no: 357

In [14]:
#cal of compression ratio,air standard efficiency,fuel consumption,bhp/hr
#intiation of all variables
# Chapter 9
print"Example 9.14, Page:357  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 14")
print("In question no.14,various expression is derived which cannot be solved using python software.")
Example 9.14, Page:357  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 14
In question no.14,various expression is derived which cannot be solved using python software.

example 9.15;pg no: 361

In [15]:
#cal of overall efficiency,steam per kg of air
#intiation of all variables
# Chapter 9
print"Example 9.15, Page:361  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 15")
r=10.;#pressure ratio
Cp=1.0032;#specific heat of air in KJ/kg K
y=1.4;#expansion constant
T3=1400.;#inlet temperature of gas turbine in K
T1=(17.+273.);#ambient temperature in K
P1=1.*10**5;#ambient pressure in Pa
Pc=15.;#condensor pressure in KPa
Pg=6.*1000;#pressure of steam in generator in KPa
T5=420.;#temperature of exhaust from gas turbine in K
print("In gas turbine cycle,T2/T1=(P2/P1)^((y-1)/y)")
print("so T2=T1*(P2/P1)^((y-1)/y)in K")
T2=T1*(r)**((y-1)/y)
print("T4/T3=(P4/P3)^((y-1)/y)")
print("so T4=T3*(P4/P3)^((y-1)/y) in K")
T4=T3*(1/r)**((y-1)/y)
print("compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg")
Wc=Cp*(T2-T1)
print("turbine work per kg,Wt=Cp*(T3-T4) in KJ/kg ")
Wt=Cp*(T3-T4)
print("heat added in combustion chamber per kg,q_add=Cp*(T3-T2) in KJ/kg ")
q_add=Cp*(T3-T2)
print("net gas turbine output,W_net_GT=Wt-Wc in KJ/kg air")
W_net_GT=Wt-Wc
print("heat recovered in HRSG for steam generation per kg of air")
print("q_HRGC=Cp*(T4-T5)in KJ/kg")
q_HRGC=Cp*(T4-T5)
print("at inlet to steam in turbine,")
print("from steam table,ha=3177.2 KJ/kg,sa=6.5408 KJ/kg K")
ha=3177.2;
sa=6.5408;
print("for expansion in steam turbine,sa=sb")
sb=sa;
print("let dryness fraction at state b be x")
print("also from steam table,at 15KPa, sf=0.7549 KJ/kg K,sfg=7.2536 KJ/kg K,hf=225.94 KJ/kg,hfg=2373.1 KJ/kg")
sf=0.7549;
sfg=7.2536;
hf=225.94;
hfg=2373.1;
print("sb=sf+x*sfg")
print("so x=(sb-sf)/sfg ")
x=(sb-sf)/sfg
print("so hb=hf+x*hfg in KJ/kg K")
hb=hf+x*hfg
print("at exit of condenser,hc=hf ,vc=0.001014 m^3/kg from steam table")
hc=hf;
vc=0.001014;
print("at exit of feed pump,hd=hd-hc")
print("hd=vc*(Pg-Pc)*100 in KJ/kg")
hd=vc*(Pg-Pc)*100
print("heat added per kg of steam =ha-hd in KJ/kg")
ha-hd
print("mass of steam generated per kg of air in kg steam per kg air="),round(q_HRGC/(ha-hd),3)
W_net_ST=(ha-hb)-(hd-hc)
print("net steam turbine cycle output,W_net_ST in KJ/kg="),round(W_net_ST,2)
W_net_ST=W_net_ST*0.119 
print("steam cycle output per kg of air(W_net_ST) in KJ/kg air="),round(W_net_ST,2)
(W_net_GT+W_net_ST)
print("total combined cycle output in KJ/kg air= "),round((W_net_GT+W_net_ST),2)
n_cc=(W_net_GT+W_net_ST)/q_add
print("combined cycle efficiency,n_cc=(W_net_GT+W_net_ST)/q_add"),round(n_cc,2)
print("in percentage"),round(n_cc*100,2)
n_GT=W_net_GT/q_add
print("In absence of steam cycle,gas turbine cycle efficiency,n_GT="),round(n_GT,2)
print("in percentage"),round(n_GT*100,2)
print("thus ,efficiency is seen to increase in combined cycle upto 57.77% as compared to gas turbine offering 48.21% efficiency.")
print("overall efficiency=57.77%")
print("steam per kg of air=0.119 kg steam per/kg air")
Example 9.15, Page:361  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 15
In gas turbine cycle,T2/T1=(P2/P1)^((y-1)/y)
so T2=T1*(P2/P1)^((y-1)/y)in K
T4/T3=(P4/P3)^((y-1)/y)
so T4=T3*(P4/P3)^((y-1)/y) in K
compressor work per kg,Wc=Cp*(T2-T1) in KJ/kg
turbine work per kg,Wt=Cp*(T3-T4) in KJ/kg 
heat added in combustion chamber per kg,q_add=Cp*(T3-T2) in KJ/kg 
net gas turbine output,W_net_GT=Wt-Wc in KJ/kg air
heat recovered in HRSG for steam generation per kg of air
q_HRGC=Cp*(T4-T5)in KJ/kg
at inlet to steam in turbine,
from steam table,ha=3177.2 KJ/kg,sa=6.5408 KJ/kg K
for expansion in steam turbine,sa=sb
let dryness fraction at state b be x
also from steam table,at 15KPa, sf=0.7549 KJ/kg K,sfg=7.2536 KJ/kg K,hf=225.94 KJ/kg,hfg=2373.1 KJ/kg
sb=sf+x*sfg
so x=(sb-sf)/sfg 
so hb=hf+x*hfg in KJ/kg K
at exit of condenser,hc=hf ,vc=0.001014 m^3/kg from steam table
at exit of feed pump,hd=hd-hc
hd=vc*(Pg-Pc)*100 in KJ/kg
heat added per kg of steam =ha-hd in KJ/kg
mass of steam generated per kg of air in kg steam per kg air= 0.119
net steam turbine cycle output,W_net_ST in KJ/kg= 677.4
steam cycle output per kg of air(W_net_ST) in KJ/kg air= 80.61
total combined cycle output in KJ/kg air=  486.88
combined cycle efficiency,n_cc=(W_net_GT+W_net_ST)/q_add 0.58
in percentage 57.77
In absence of steam cycle,gas turbine cycle efficiency,n_GT= 0.48
in percentage 48.21
thus ,efficiency is seen to increase in combined cycle upto 57.77% as compared to gas turbine offering 48.21% efficiency.
overall efficiency=57.77%
steam per kg of air=0.119 kg steam per/kg air

example 9.16;pg no: 363

In [16]:
#cal of air standard thermal efficiency
#intiation of all variables
# Chapter 9
print"Example 9.16, Page:363  \n \n"
print("Engineering Thermodynamics by Onkar Singh Chapter 9 Example 16")
T1=(27+273);#temperature at begining of compression in K
k=70;#ration of maximum to minimum pressures
r=15;#compression ratio
y=1.4;#expansion constant
print("here P4/P1=P3/P1=70............eq1")
print("compression ratio,V1/V2=V1/V3=15.............eq2")
print("heat added at constant volume= heat added at constant pressure")
print("Q23=Q34")
print("m*Cv*(T3-T2)=m*Cp*(T4-T3)")
print("(T3-T2)=y*(T4-T3)")
print("for process 1-2;")
print("T2/T1=(P2/P1)^((y-1)/y)")
print("T2/T1=(V1/V2)^(y-1)")
print("so T2=T1*(V1/V2)^(y-1) in K")
T2=T1*(r)**(y-1)
print("and (P2/P1)=(V1/V2)^y")
print("so P2=P1*(V1/V2)^y in Pa...........eq3")
print("for process 2-3,")
print("P2/P3=T2/T3")
print("so T3=T2*P3/P2")
print("using eq 1 and 3,we get")
print("T3=T2*k/r^y in K")
T3=T2*k/r**y 
print("using equal heat additions for processes 2-3 and 3-4,")
print("(T3-T2)=y*(T4-T3)")
print("so T4=T3+((T3-T2)/y) in K")
T4=T3+((T3-T2)/y)
print("for process 3-4,")
print("V3/V4=T3/T4")
print("(V3/V1)*(V1/V4)=T3/T4")
print("so (V1/V4)=(T3/T4)*r")
(T3/T4)*r
print("so V1/V4=11.88 and V5/V4=11.88")
print("for process 4-5,")
print("P4/P5=(V5/V4)^y,or T4/T5=(V5/V4)^(y-1)")
print("so T5=T4/((V5/V4)^(y-1))")
T5=T4/(11.88)**(y-1)
print("air standard thermal efficiency(n)=1-(heat rejected/heat added)")
print("n=1-(m*Cv*(T5-T1)/(m*Cp*(T4-T3)+m*Cv*(T3-T2)))")
n=1-((T5-T1)/(y*(T4-T3)+(T3-T2)))
print("n="),round(n,2)
print("air standard thermal efficiency=0.6529")
print("in percentage"),round(n*100,2)
print("so air standard thermal efficiency=65.29%")
print("Actual thermal efficiency may be different from theoretical efficiency due to following reasons")
print("a> Air standard cycle analysis considers air as the working fluid while in actual cycle it is not air throughtout the cycle.Actual working fluid which are combustion products do not behave as perfect gas.")
print("b> Heat addition does not occur isochorically in actual process.Also combustion is accompanied by inefficiency such as incomplete combustion,dissociation of combustion products,etc.")
print("c> Specific heat variation occurs in actual processes where as in air standard cycle analysis specific heat variation neglected.Also during adiabatic process theoretically no heat loss occur while actually these processes are accompanied by heat losses.")
Example 9.16, Page:363  
 

Engineering Thermodynamics by Onkar Singh Chapter 9 Example 16
here P4/P1=P3/P1=70............eq1
compression ratio,V1/V2=V1/V3=15.............eq2
heat added at constant volume= heat added at constant pressure
Q23=Q34
m*Cv*(T3-T2)=m*Cp*(T4-T3)
(T3-T2)=y*(T4-T3)
for process 1-2;
T2/T1=(P2/P1)^((y-1)/y)
T2/T1=(V1/V2)^(y-1)
so T2=T1*(V1/V2)^(y-1) in K
and (P2/P1)=(V1/V2)^y
so P2=P1*(V1/V2)^y in Pa...........eq3
for process 2-3,
P2/P3=T2/T3
so T3=T2*P3/P2
using eq 1 and 3,we get
T3=T2*k/r^y in K
using equal heat additions for processes 2-3 and 3-4,
(T3-T2)=y*(T4-T3)
so T4=T3+((T3-T2)/y) in K
for process 3-4,
V3/V4=T3/T4
(V3/V1)*(V1/V4)=T3/T4
so (V1/V4)=(T3/T4)*r
so V1/V4=11.88 and V5/V4=11.88
for process 4-5,
P4/P5=(V5/V4)^y,or T4/T5=(V5/V4)^(y-1)
so T5=T4/((V5/V4)^(y-1))
air standard thermal efficiency(n)=1-(heat rejected/heat added)
n=1-(m*Cv*(T5-T1)/(m*Cp*(T4-T3)+m*Cv*(T3-T2)))
n= 0.65
air standard thermal efficiency=0.6529
in percentage 65.29
so air standard thermal efficiency=65.29%
Actual thermal efficiency may be different from theoretical efficiency due to following reasons
a> Air standard cycle analysis considers air as the working fluid while in actual cycle it is not air throughtout the cycle.Actual working fluid which are combustion products do not behave as perfect gas.
b> Heat addition does not occur isochorically in actual process.Also combustion is accompanied by inefficiency such as incomplete combustion,dissociation of combustion products,etc.
c> Specific heat variation occurs in actual processes where as in air standard cycle analysis specific heat variation neglected.Also during adiabatic process theoretically no heat loss occur while actually these processes are accompanied by heat losses.