Chapter 4 : Fuels and combustion

Ex: 4.1 Pg: 211

In [20]:
from __future__ import division
#Input data
C=84##The mass of carbon present in the fuel in %
H=10##The mass of hydrogen present in the fuel in %
S=3.2##The mass of sulphur present in the fuel in %
O=1.6##The mass of oxygen present in the fuel in %
I=1.2##The mass of incombustible in the fuel in %
X=15.72##The flue gas of combined CO2 and SO2 by volume in %
Og=1##The flue gas of O2 by volume in %
Y=100##Let us consider the fuel oil in kg
C1=12##Molecular weight of Carbon 
H1=2##Molecular weight of hydrogen
S1=32##Molecular weight of sulphur
O1=32##Molecular weight of oxygen
Co2=44##Molecular weight of carbondioxide
So2=64##Molecular weight of sulphurdioxide
N1=28##Molecular weight of nitrogen 
H2O=18##Molecular weight of water

#Calculations
b=C/C1##Equating coefficients of the carbon from equation
g=H/H1##Equating coefficients of the hydrogen from equation
d=S/S1##Equating coefficients of the sulphur from the equation
e=(b+d)/(X/Og)##By volumetric analysis
x=b+d+e+(g/2)-(O/O1)##Moles of oxygen are supplied for combustion
f=3.76*x##Equating coefficients of the nitrogen from equation
Mo=x*O1##Mass of oxygen supplied in kg
Ma=Mo/0.232##Mass of air supplied for 100 kg of fuel in kg
Wa=Ma/100##Mass of air supplied for 1 kg fuel in kg
Wrh=((11.5*C)+(34.5*((H)-(O/8))+(4.3*S)))/100##Theoretical air required per kg of fuel in kg
E=((Wa-Wrh)/Wrh)*100##Percentage of excess air in %
D=(b*Co2)+(d*So2)+(e*O1)+(f*N1)##Mass of dry flue gas formed for 100 kg fuel in kg
dfg=D/100##Mass of dry flue gas formed per kg of fuel in kg
Mw=(g*H2O)/100##Mass of water vapour formed per kg of fuel

#Output
print "(a) Mass of air supplied WA = %3.2f kg \n (b)Percentage excess air supplied = %3.2f percentage \n (c)mass of dry flue gas formed = %3.2f kg \n (d) Mass of water vapour formed = %3.2f kg"%(Wa,E,dfg,Mw)
(a) Mass of air supplied WA = 13.80 kg 
 (b)Percentage excess air supplied = 4.68 percentage 
 (c)mass of dry flue gas formed = 13.82 kg 
 (d) Mass of water vapour formed = 0.90 kg

Ex: 4.2 Pg 212

In [21]:
#Input data
CO2=11.5##Percentage of carbondioxide present in combustion in %
O2=2.7##Percentage of oxygen present in the combustion in %
CO=0.7##Percentage of carbonmonoxide present in the combuston in %

#Calculations 
a=85.1/3.76##Equating moles for nitrogen from the equation 
x=(CO2+CO)/3##Equating moles for carbon from the equation 
b=(a-CO2-(CO/2)-O2)*2##Equating moles for oxygen from the equation 
y=a/x##Moles of oxygen supplied for one mole of propane gas
z=5##Theoretically 5 moles of oxygen are required for reacting
E=((y-z)/z)*100##The excess of air supplied in %

#Output
print "The percentage excess air used is = %3.1f percentage"%(E)
The percentage excess air used is = 11.3 percentage

Ex: 4.3 Pg: 213

In [22]:
#Input data
CO2=12.1##The amount of carbondioxide released from the combustion in %
O2=3.8##The amount of oxygen released from the combustion in %
CO=0.9##The amount of carbonmonoxide released from the combustion in %
MO=32##Molecular weight of Oxygen

#Calculations
a=83.2/3.76##Equating moles for nitrogen from the equation 
b=(2*a)-(2*CO2)-(2*O2)-CO##Equating moles for oxygen from the equation
x=CO2+CO##Equating moles for carbon from the equation
y=2*b##Equating moles for hydrogen from the equation
z=18.75##Moles of Oxygen from the stoichiometric equation 
z1=a##Moles of Oxygen from the combustion equation 
E=((z1-z)/z)*100##Percentage of excess air in%
A=(a*MO)/0.232##Actual air supplied per mole of C13H23
Mc=179##Molecular weight of C13H23
Af=A/Mc##Air fuel ratio during the test

#Output
print " (a) The air fuel ratio during the test = %3.2f \n (b) The excess or deficiency of air used = %3.0f Percentage of excess air used"%(Af,E)
 (a) The air fuel ratio during the test = 17.05 
 (b) The excess or deficiency of air used =  18 Percentage of excess air used

Ex: 4.4 Pg: 214

In [23]:
from __future__ import division
#Input data
C=61##The mass of carbon present in the coal according to coal analysis on mass basis in %
H=4##The mass of hydrogen present in the coal according to coal analysis on mass basis in %
O=3##The mass of oxygen present in the coal according to coal analysis on mass basis in %
N=2##The mass of nitrogen present in the coal according to coal analysis on mass basis in %
S=1##The mass of sulphur present in the coal according to coal analysis on mass basis in %
M=4##The mass of moisture present in the coal according to coal analysis on mass basis in %
A=25##The mass of ash present in the coal according to coal analysis on mass basis in %
HHV=24.3##The high heating value of the coal i.e energy released by complete combustion of 1 kg fuel in MJ/kg
CO2=12##The amount of carbondioxide by volume according to dry flue gas analysis in %
CO=1.5##The amount of carbonmonoxide by volume according to dry flue gas analysis in %
O2=7##The amount of oxygen by volume according to dry flue gas analysis in %
N2=79.5##The amount of nitrogen by volume according to dry flue gas analysis in %
Te=170##Exhaust gas temperature in degree centigrade
L=0.03##Energy loss other than dry exhaust loss and incomplete combustion is 3% of HHV
R=150##Steam generation rate in t/h
Po=100##Steam condition at boiler outlet in bar
To=500##Steam condition at boiler outlet in degree centigrade
Ti=160##Feed water inlet temperature in degree centigrade
HCO2=33083##Heat of reaction in kJ/kg carbon
HCO=9500##Heat of reaction in kJ/kg carbon
cp=1.05##Heat capacity of dry flue gas (dfg) in kJ/kgK
Ta=30##The ambient temperature of air in degree centigrade
Mc=44##Molecular weight of Carbondioxide
Mco=28##Molecular weight of carbonmonoxide
Mo=32##Molecular weight of oxygen
Mn=28##Molecular weight of nitrogen
Mx=12##Molecular weight of carbon
h1=3373.7##Enthalpy at 100 bar and 500 degree centigrade in kJ/kg
hf=675.55##Enthalpy at 160 degree centigrade in kJ/kg
hg=2724.7##Enthalpy at 100 bar in kJ/kg

#Calculations
Mdfg=(((C/100)*((Mc*(CO2/100))+(Mco*(CO/100))+(Mo*(N2/100))))/(Mx*((CO2/100)+(CO/100))))##Mass of dry flue gas produced per kg of fuel in kg
Ed=Mdfg*cp*(Te-Ta)##Energy loss due to dry exhaust gas in kJ/kg fuel
#Since Mdfg is 11.73kg through sciab calculation, there is a variation in Ed value and Ei value
Ei=((Mdfg)*(HCO2-HCO)*(Mx/Mco))*((Mco*(CO/100))/((Mc*(CO2/100))+(Mco*(CO/100))+(Mo*(O2/100))+(Mco*(N2/100))))##Energy loss due to incomplete combustion in kJ/kg fuel
El=L*HHV##Energy loss other than dry exhaust loss and incomplete combustion loss in MJ/kg fuel
TEl=(Ed/1000)+(Ei/1000)+El##Total energy loss in MJ/kg fuel
Be=((HHV-TEl)/(HHV))*100##Boiler efficiency in %
Wf=(((R*1000)*(h1-hf))/((Be/100)*HHV*1000))/3600##The fuel burning rate in kg/s
Wth=(11.5*(C/100))+(34.5*((H/100)-(O/800)))+(4.3*(S/100))##Thearetical air required per kg of fuel in kg
WA=(((3.04*(N2/100)*(C/100)))/((CO2/100)+(CO/100)))-((N/100)*(1/0.768))##Actual air supplied per kg of fuel in kg
per=((WA-Wth)/Wth)*100##Percentage excess air used in %
pea=((h1-hg)/(h1-hf))*100##Percentage of energy absorbed in the superheater

#Output
print " (a)The amount of dry flue gas produced per kg fuel = %3.2f kg \n (b)The dry exhaust loss = %3.1f kJ/kg fuel and incomplete combustion loss per kg fuel = %3.2f kJ/kg fuel \n (c)The boiler efficiency = %3.2f percentage \n (d) THe fuel burning rate = %3.3f kg/s \n (e)The percentage of excess air used = %3.2f percentage \n (f) The percentage of energy absorbed in the superheater = %3.2f percentage"%(Mdfg,Ed,Ei,Be,Wf,per,pea)
 (a)The amount of dry flue gas produced per kg fuel = 11.73 kg 
 (b)The dry exhaust loss = 1723.7 kJ/kg fuel and incomplete combustion loss per kg fuel = 1648.15 kJ/kg fuel 
 (c)The boiler efficiency = 83.12 percentage 
 (d) THe fuel burning rate = 5.566 kg/s 
 (e)The percentage of excess air used = 31.12 percentage 
 (f) The percentage of energy absorbed in the superheater = 24.05 percentage

Ex: 4.5 Pg: 216

In [24]:
#Input data
C=83.7##The amount of carbon present in the fuel oil according to ultimate analysis of a fuel oil in %
H=12.7##The amount of hydrogen present in the fuel oil according to ultimate analysis of a fuel oil in %
O=1.2##The amount of oxygen present in the fuel oil according to ultimate analysis of a fuel oil in %
N=1.7##The amount of nitrogen present in the fuel oil according to ultimate analysis of a fuel oil in %
S=0.7##The amount of sulphur present in the fuel oil according to ultimate analysis of a fuel oil in %
td=27##The dry bulb temperature of combustion air in degree centigrade
tw=21##The wet bulb temperature of combustion air in degree centigrade
E=0.3##Excess air and assuming complete combustion in %
t=200##Temperature to find total volume of combustion products in degree centigrade
p=1.013##Pressure to find total volume of combustion procucts in bar

#Calculations
Wth=(11.5*(C/100))+(34.5*((H/100)-(O/100)*(1/8)))+(4.3*(S/100))##Theoretical air required per kg of fuel in kg
WA=(1+E)*Wth##Actual air required per kg of fuel in kg/kg fuel
sh=0.0132##Specific humidity at DBT and WBT in kg moisture/kg dry air
W=WA*sh##Water vapour entering with air per kg fuel in kg vap/kg fuel
Tw=(9*(H/100))+WA##Total water vapour formed per kg fuel in kg
CO2=(44/12)*(C/100)##mass of carbondioxide gas per kg of fuel
O2=0.232*E*Wth##Mass of oxygen gas per kg of fuel
N2=0.768*(1+E)*Wth+(N/100)##Mass of nitrogen gas per kg of fuel
SO2=(64/32)*(S/100)##Mass of nitrogen gas per kg of fuel
H2O=1.383##Mass of water per kg of fuel
M=(CO2/44)+(O2/32)+(N2/28)+(SO2/64)+(H2O/18)##Moles of combustion gases formed per kg fuel
VG=M*22.4*((273+t)/273)*(1.013/1.013)##Volume of flue gases at 200 degree centigrade and 1.013 bar per kg fuel
CO21=((CO2/44)/((CO2/44)+(O2/32)+(N2/28)))*100##Composition of dry flue gas CO2 by volume
O21=((O2/32)/((CO2/44)+(O2/32)+(N2/28)))*100##Composition of dry flue gas O2 by volume
N21=((N2/28)/((CO2/44)+(O2/32)+(N2/28)))*100##Composition of dry flue gas N2 by volume

#Output
print " (a)The total volume of combustion products at 200 degee centigrade and 1.013 bar = %3.2f m**3 \n (b)The dry flue gas analysis based on carbondioxide,oxygen and nitrogen is \n Carbondioxide = %3.2f percent \n Oxygen = %3.2f percent \n Nitrogen = %3.2f percent"%(VG,CO21,O21,N21)
 (a)The total volume of combustion products at 200 degee centigrade and 1.013 bar = 26.26 m**3 
 (b)The dry flue gas analysis based on carbondioxide,oxygen and nitrogen is 
 Carbondioxide = 11.64 percent 
 Oxygen = 5.07 percent 
 Nitrogen = 83.29 percent

Ex: 4.6 Pg: 217

In [25]:
#Input data
C2H6=22.6##The amount of gas present in the fuel gas according to volumetric analysis of fuel gas by volume in %
CH4=73.6##The amount of gas present in the fuel gas according to volumetric analysis of fuel gas by volume in %
CO2=2.4##The amount of gas present in the fuel gas according to volumetric analysis of fuel gas by volume in %
N2=1.4##The amount of gas present in the fuel gas according to volumetric analysis of fuel gas by volume in %
E=0.25##Assuming combustion air to be dry and in excess
t=260##The temperature for the total gas volume for complete combustion in degree centigrade
p=1.013##The pressure for the total gas volume for complete combustion in bar
Mch=30##Molecular weight of C2H6
Mc=16##Molecular weight of CH4
Mco=44##Molecular weight of CO2
Mn=28##Molecular weight of N2
Mo=32##Molecular weight of O2
Mh=18##Molecular weight of H2O

#Calculations
x=100##Assuming 100 moles of fuel gas 
Mf=((C2H6/100)*Mch)+((CH4/100)*Mc)+((N2/100)*Mn)+((CO2/100)*Mco)##Molecular weight of fuel gas
Ma=((226.3*(Mo+(3.76*Mn))*(1+E)))/28.96##Moles of air supplied
Mc=1440##Moles of combustion gas from the equation 
Mr=x+Ma+Mc##Total reaction molecules
Mwc=((121.2*Mco)+(215*Mh)+(56.6*Mo)+(1065.4*Mn))/Mc##Molecular weight of combustion gas in kg/kgmol
Mt=Mc/(x*20)##Total number of moles of combustion gas per kg fuel gas
VG=Mt*22.4*((273+t)/273)##Volume of combustion products per kg fuel gas
CO21=(121.2/(121.2+56.6+1065.4))*100##Gas analysis of CO2 by volume
O21=(56.6/1243.2)*100##Gas analysis of O2 by volume
N2=(1065.4/1243.2)*100##Gas analysis of N2 by volume

#Output
print " (a)The molecular weight of the combustion products M = %3.2f kg/kg mol \n (b) The total gas volume for complete combustion at 260 degree centigrade and 1.013 bar is %3.2f m**3/kg fuel \n (c)The dry flue gas analysis on \n carbondioxide = %3.1f percent \n oxygen = %3.1f percent \n nitrogen = %3.1f percent "%(Mwc,VG,CO21,O21,N2)
 (a)The molecular weight of the combustion products M = 28.36 kg/kg mol 
 (b) The total gas volume for complete combustion at 260 degree centigrade and 1.013 bar is 31.49 m**3/kg fuel 
 (c)The dry flue gas analysis on 
 carbondioxide = 9.7 percent 
 oxygen = 4.6 percent 
 nitrogen = 85.7 percent 

Ex: 4.7 Pg: 218

In [26]:
from __future__ import division
#Input data
CO21=9.7##Carbondioxide gas analysis before the air preheater 
CO22=9.2##Carbondioxide gas analysis after the air preheater
O21=4.0##Oxygen gas analysis before the air preheater
O22=4.9##Oxygen gas analysis after the air preheater
N21=86.3##Nitrogen gas analysis before the air preheater
N22=85.9##Nitrogen gas analysis after the air preheater
C=72.0##The coal used shows the carbon percentage by mass in %

#Calculations
W1=((3.04)*(N21/100)*(C/100))/((CO21/100))##Before air preheater in kg air/kg fuel
W2=((3.04)*(N22/100)*(C/100))/((CO22/100))##After air preheater in kg air/kg fuel
A=W2-W1##Air leakage in kg air/kg fuel

#Output
print "The air leakage into the air preheater per kg of coal fired is %3.0f kg air/kg fuel"%(A)
The air leakage into the air preheater per kg of coal fired is   1 kg air/kg fuel

Ex: 4.8 Pg: 218

In [27]:
from __future__ import division
#Input data
n=6##Total lancashire boilers in a textile factory
Ws=6##Each boiler supplying steam in t/h
p=16##Pressure at which steam is supplied in bar
t=250##Temperature at which steam is supplied in degree centigrade
CV=43960##Calorific value of the fuel oil in kJ/kg
no=75##Overall efficiency of the boiler in %
a=16##The amount of air required for efficient burning of the fuel inkg
H=20##Drought of water gauge required at the base of chimney in mm
tf=320##The flue gases leave the boiler in degree centigrade
ts=300##The average temperature of the gases in the stack in degree centigrade
ta=30##The atmospheric temperature in degree centigrade
R=0.287##Real Gas constant in kJ/kgK
h1=2919.2##enthalpy at the entrance of the boiler in kJ/kgK
hf=125.8##Enthalpy at the feed in kJ/kgK
pi=3.1412##Mathematical constant
g=9.81##gravitational fore constant in m/s**2
P=1.013##Atmospheric pressure in bar

#Calculations
H1=((H*R*(273+ta)*(273+ts)))/(P*100*((273+ts)-(273+ta)))##The draught produced in m
Wf=(((Ws*1000)*6*(h1-hf))/((no/100)*CV))/3600##Air fuel ratio in kg/s
Wa=a*Wf##Actual air fuel ratio in kg/s
Wfg=17*Wf##Air fuel ratio in kg/s
D=(((Wfg*R*(273+ts)*(4/pi)))/((101.3)*(2*g*H1)**(1/2)))**(1/2)##Diameter at its base in m

#Output
print "(a)The height of the stack H = %3.2f m \n (b)The diameter at its base D = %3.2f m "%(H1,D)
(a)The height of the stack H = 36.44 m 
 (b)The diameter at its base D = 1.06 m 

Ex: 4.9 Pg: 219

In [28]:
from __future__ import division
#Input data
Wf=10##Coal rate in t/h
C=78##The mass of carbon present in the coal according to coal analysis on mass basis in %
H=3##The mass of hydrogen present in the coal according to coal analysis on mass basis in %
O=3##The mass of oxygen present in the coal according to coal analysis on mass basis in %
S=1##The mass of sulphur present in the coal according to coal analysis on mass basis in %
M=7##The mass of moisture present in the coal according to coal analysis on mass basis in %
A=8##The mass of ash present in the coal according to coal analysis on mass basis in %
E=0.3##Excess air in percentage
p=180##Plenum chamber pressure in mm water gauge
nm=0.6##Mechanical efficiency of the fan
ta=30##Room temperature in degree centigrade
R=0.287##Real gas constant
P=101.325##Atmospheric pressure in kPa
g=9.812##gravitational force constant m/s**2

#Calculations
Wth=(11.5*(C/100))+(34.5*((H/100)-(O/(8*100))))+(4.3*(S/100))##Theoretical air required per kg fuel in kg air/kg fuel
WA=Wth*(1+0.3)##Actual air required per kg fuel in kg air/kg fuel
Va=(R*(273+ta))/P##Volume flow rate of air in m**3/kg
FD=((WA*Wf*1000*Va*p*g)/(3600*nm))/1000##FD fan motor capacity in kW

#Output
print "The required motor capacity needed for the FD fan is %3.2f kW "%(FD)
The required motor capacity needed for the FD fan is 90.49 kW 

Ex: 4.10 Pg: 220

In [29]:
#Input data
tg=180##The gas temperature in degree centigrade
p=250##The draught produced by the ID fan in mm
nf=0.52##The efficiency of the fan
Va=0.858##Volume flow rate of air in m**3/kg
g=9.812##gravitational force constant in m/s**2
Wf=10##Coal rate in t/h
Wa=12.9##Actual air required per kg fuel in kg air/kg fuel
ta=30##Room temperature in degree centigrade

#Calculations
Wfg=((Wf+(Wa*10))*1000)/3600##Fuel gas required in kg/s
Vfg=(Va*(tg+273))/(ta+273)##Volume flow rate of fuel gas in m**3/kg
ID=((Wfg*Vfg*p*g)/(nf))/1000##ID fan motor capacity in kW

#Output
print "The motor capacity of the ID fan is %3.2f kW "%(ID)
The motor capacity of the ID fan is 233.64 kW 

Ex: 4.11 Pg: 220

In [30]:
#Input data
CO2=13.2##The volume of carbondioxide present in the partial analysis of dry flue gas in %
O2=3.2##The volume of oxygen present in the partial analysis of dry flue gas in %
C=88##The mass of carbon present in the coal according to coal analysis on mass basis in %
H=4.4##The mass of hydrogen present in the coal according to coal analysis on mass basis in %
A=7.6##The mass of ash present in the coal according to coal analysis on mass basis in %
M=0##Moisture present in the fuel was nil
Mc=12##Molecular weight of the carbon 
Mh=2##Molecular weight of the hydrogen
Mo=32##Molecular weight of the oxygen
Mho=18##Molecular weight of water
p=101.325##Atmospheric pressure in kPa

#Calculations
c=C/Mc##Equating coefficients of the carbon from the equation 
g=H/Mh##Equating coefficients of the hydrogen from the equation 
x=(CO2/100)/(O2/100)##From dry fuel gas analysis (dfg) 
d=(((CO2/100)*(47.5))-7.333)/(((CO2/100)*(3.032))-1)##Coefficient of the carbonmonoxide in the equations product side
b=c-d##Coefficient of the carbondioxide in the equation product side
a=10.21-(0.742*d)##Coefficient of the oxygen in the reactant side of the equation 
e=b/x##Coefficient of the oxygen in the product side of the equation 
f=3.76*a##Equating coefficients of the nitrogen from the equation 
ma=(a*Mo)/0.232##Mass of air supplied for 100 kg coal in kg
ma1=ma/100##Mass of air supplied per kg coal in kg
T=b+d+e+f##Total number of moles of dry flue gas (dfg)
CO21=(b/T)*100##Carbondioxide by volume in percentage
O21=(e/T)*100##Oxygen by volume in percentage
CO1=(d/T)*100##Carbonmonoxide by volume in percentage
N21=(f/T)*100##Nitrogen by volume in percentage
Mwv=(g*Mho)/100##Mass of watervapour formed per kg coal in kg
Mf=(g)/(b+d+e+f+g)##Mole fraction of water vapour in flue gas
P=Mf*p##Partial pressure of water vapour in kPa
D=32.9##Dew point temperature from steam tables in degree centigrade

#Output
print "(a)The complete volumetric composition of the dry flue gas is \n Carbondioxide by volume = %3.2f percentage \n Oxygen by volume = %3.2f percentage \n Carbonmonoxide by volume = %3.2f percentage \n Nitrogen by volume = %3.2f percentage \n (b) The actual amount of air supplied per kg coal = %3.2f kg \n (c) Mass of water vapour formed per kg coal = %3.2f kg \n (d) The dew point temperature of the flue gas = %3.2f degree centigrade "%(CO21,O21,CO1,N21,ma1,Mwv,D)
(a)The complete volumetric composition of the dry flue gas is 
 Carbondioxide by volume = 13.20 percentage 
 Oxygen by volume = 3.20 percentage 
 Carbonmonoxide by volume = 4.21 percentage 
 Nitrogen by volume = 79.39 percentage 
 (b) The actual amount of air supplied per kg coal = 12.27 kg 
 (c) Mass of water vapour formed per kg coal = 0.40 kg 
 (d) The dew point temperature of the flue gas = 32.90 degree centigrade 

Ex: 4.12 Pg: 222

In [31]:
#Input data
H=200##Height of the stack in m
D=4##Diameter of the stack in m
m=1000##Mass flow rate of gas in kg/s
Ts=100##Stack exit gas temperature in degree centigrade
Ta=5##Ambient air temperature in degree centigrade
Vw=50##Wind velocity in Km/h
Cp=1.005##Specific heat of the gas in kJ/kgK
pi=3.142##Mathematical constant the value of pi

#Calculations
Vw1=(50*1000)/(60*60)##Wind velocity in m/s
Qe=m*Cp*(Ts-Ta)##Heat emission from plume in kW
Qe1=Qe/1000##Heat emission from the plume in MW
p=(101.325)/(0.287*373)##Density of the gas in kg/m**3
A=(pi*D**2)/4##Area of the stack in m**2
Vs=m/(p*A)##Stack gas exict velocity in m/s
H1=((2.62*(Qe1**(1/2))*1000)/Vw1)-((0.029*Vs*D)/Vw1)##The height of the gas plume in m

#Output
print "The height of the gas plume is H = %3.1f m "%(H1)
The height of the gas plume is H = 1842.5 m 

Ex: 4.13 Pg: 222

In [33]:
from __future__ import division
#Input data
CV=20##Calorific value of the fuel in MJ/kg
C=65##The amount of carbon present in the fuel according to gravimetric analysis in %
H=25##The amount of hydrogen present in the fuel according to gravimetric analysis in %
O=10##The amount of oxygen present in the fuel according to gravimetric analysis in %
p1=1##Pressure at the inlet of the compressor in bar
t1=27##Temperature at the inlet of the compressor in degree centigrade
p2=4##The pressure which compressor compresses it isentropically in bar
Re=78##The regenerator effectiveness in %
CO2=6##The amount of carbondioxide according to the analysis of dry exhaust gas in %
CO=1.5##The amount of carbonmonoxide according to the analysis of dry exhaust gas in %
Cp=1.005##Specific heat capacity of the air in kJ/kgK
i=1.44##Isentropic index for the air
Cp1=1.15##Specific heat capacity of the air in kJ/kgK
i1=1.33##Isentropic index for the combustion products
Mc=12##Molecular weight of the carbon 
Mh=2##Molecular weight of the hydrogen
Mo=32##Molecular weight of the oxygen
Mho=18##Molecular weight of water
T0=288##Datum temperature in K (Assumed)

#Calculations
h=(C/100)/(Mc)##Equating coefficients of the carbon from the equation 
e=(H/100)/Mh##Equating coefficients of the hydrogen from the equation 
y=(CO/100)/(CO2/100)##From dry exhaust gas analysis for solving
a=h/(1+y)##The coefficient of the carbondioxide in the product side of the equation 
b=h-a##The coefficient of the carbonmonoxide in the product side of the equation 
z=b/(CO/100)##The sum of coefficients of the product side of the equation 
x=z-(b/2)+(e/2)##Mol of air supplied in kmol
wa=x*28.96##Air supplied in kg/kg fuel
wf=1##Assuming 1 kg of fuel supplied
T2=(t1+273)*(p2/p1)**((i-1)/i)##Temperature at the outlet of the compressor in K
T3=(((wa*Cp*(T2-T0))+(wf*CV*1000))/((wa+wf)*(Cp1)))+T0##Maximum temperature of the cycle in K
T4=T3/((4)**((i1-1)/i1))##Temperature at point of the cycle in K
T5=((Re/100)*(T4-T2))+T2##Temperature at point of the cycle in K
Wc=wa*Cp*(T2-(t1+273))##Work done by the compressor in kW
Wt=23.54*Cp1*(T3-T4)##Work done by the turbine in kW
Q1=23.54*Cp1*(T3-T5)##Total work done by the system in kW
nc=(Wt-Wc)/Q1##Efficiency of the cycle 
nc1=nc*100##Efficiency of the cycle in %
spc=3600/(Wt-Wc)##Specific fuel consumption in kg/kWh

#Output 
print " (a) The maximum temperature of the cycle T3 = %3.0f K \n (b)Thermal efficiency of the plant = %3.3f or %3.2f percentage\n (c) Specific fuel consumption = %3.3f kg/kWh "%(T3,nc,nc1,spc)
 (a) The maximum temperature of the cycle T3 = 1168 K 
 (b)Thermal efficiency of the plant = 0.492 or 49.23 percentage
 (c) Specific fuel consumption = 0.641 kg/kWh