Week 3 - Adiabatic Flame Temperature calculation
AIM:
To calculate adiabatic flame temperature,
- Adiabatic flame temperature variation with Equivalence ratio (In constant volume-chamber)
- Adiabatic flame temperature variation with Heat loss (In constant pressure-chamber)
- Adiabatic flame temperature variation with respect to Alkane, Alkene, Alkyne
- Adiabatic flame temperature variation with respect to a number of Carbon atom chains
THEORY:
ADIABATIC FLAME TEMPERATURE:
The adiabatic flame temperature is defined as the temperature attained when all of the chemical reaction heat released heats combustion products.
In the study of combustion, there are two types of adiabatic flame temperature depending on how the process is completed: the constant volume and constant pressure, both of which describe temperature that combustion products theoretically can reach if no energy is lost to the outside environment.
THE CONCEPT OF AIR-FUEL MIXTURE:
STOICHIOMETRIC COMBUSTION:
The air-fuel ratio for complete combustion is called stoichiometric air fuel ratio.
LEAN COMBUSTION:
If the amount of air is more than fuel for complete combustion. This is called lean combustion.
RICH MIXTURE:
If the amount of fuel is more than air for complete combustion. This is called rich combustion.
EQUIVALENCE RATIO:
The fuel-air equivalence ratio (phi) of a system is defined as the ratio of the fuel to oxidizer ratio to the stoichiometric fuel to oxidiser ratio.
`phi = ((m_(fuel)/(m_air))_(actual))/((m_(fuel)/(m_(air )))_(stio))`
Phi < 1, lean combustion
Phi = 1, stoichiometric combustion.
Phi > 1, rich combustion.
GENERAL EQUATION FOR ANY HYDROCARBON COMBUSTION:
CxHy + [x + (y/4)](O2 + 3.76N2) => xCO2 + (y/2)H2O + 3.76[x+(y/4)]N2
CHEMICAL REACTION FOR COMBUSTION OF METHANE:
STOICHIOMETRIC COMBUSTION:
CH4 + 2(O2 + 3.76N2) = CO2 + 2H2O + 7.52N2
LEAN COMBUSTION;
CH4 + (2/phi)(O2 + 3.76N2) = CO2 + 2H2O + (2/phi-2)O2 + (7.52/phi)N2
RICH COMBUSTION:
CH4 + (2/phi)(O2 + 3.76N2) = (4/phi-3)CO2 + 2H2O + (4-4/phi)CO + (7.52/phi)N2
CASE 1: EFFECT OF EQUIVALENCE RATIO ON AFT FOR COMBUSTION OF METHANE UNDER CONSTANT VOLUME COMBUSTION PROCESS:
For a constant volume process internal energy is equated for reactants and products to get AFT,
U_r – U_p = 0
So using newton Raphson method the final temperature is obtained.
(Hproducts-n_products*R*T) – (Hreactants-n_reactants*R*Tstd)
CODING APPROACH:
USING NR METHOD:
- Enthalpy of reactants and products were calculated from the nasa polynomial.
H = ((a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T)
The coefficients are obtained from Berkeley website.
- For the constant volume process internal energy is equated to get AFT.
- Using the newton Raphson method the final temperature is obtained.
- The equivalence ratio was varied from 0.1 to 2.
CODE USING CANTERA:
- The solution class of cantera is used.
- The gas object is created from solution class.
- The gas species were obtained from gri30.xml.
- The equilibrate solver was used with constant volume and internal energy to obtain AFT.
CODE:
"""
ADIABATIC FLAME TEMPERATURE
CH4 + 2(O2 + 3.76N2) = CO2 + 2H2O + 7.52N2 #STOICHOMETRIC MIXTURE
CH4 + (2/phi)(O2 + 3.76N2) = CO2 + 2H2O + (2/phi-2)O2 + (7.52/phi)N2 #LEAN MIXTURE
CH4 + (2/phi)(O2 + 3.76N2) = (4/phi-3)CO2 + 2H2O + (4-4/phi)CO + (7.52/phi)N2 #RICH MIXTURE
"""
import matplotlib.pyplot as plt
import math
import numpy as np
def h(T,co_effs):
"""
function to evaluate enthalpy
"""
R = 8.314 #j/mol-k
a1 = co_effs[0]
a2 = co_effs[1]
a3 = co_effs[2]
a4 = co_effs[3]
a5 = co_effs[4]
a6 = co_effs[5]
return (a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T
#low temperature coefficients
ch4_coeffs_l = [5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00]
o2_coeffs_l = [3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
n2_coeffs_l = [0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
#high temperature coefficients
o2_coeffs_h = [3.28253784E+00,1.48308754E-03,-7.57966669E-07,2.09470555E-10,-2.16717794E-14,-1.08845772E+03,5.45323129E+00]
n2_coeffs_h = [0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02]
co2_coeffs_h = [3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
h2o_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
co_coeffs_h = [2.71518561E+00,2.06252743E-03,-9.98825771E-07,2.30053008E-10,-2.03647716E-14,-1.41518724E+04,7.81868772E+00]
def f(T):
"""
function that represents the root finding problem
"""
h_co2_p = h(T,co2_coeffs_h)
h_n2_p = h(T,n2_coeffs_h)
h_h2o_p = h(T,h2o_coeffs_h)
h_o2_p = h(T,o2_coeffs_h)
h_co_p = h(T,co_coeffs_h)
R = 8.314
#lean mixture
if phi < 1:
H_products = h_co2_p + 2*h_h2o_p + (7.52/phi)*h_n2_p + ((2/phi)-2)*h_o2_p
n_products = 1 + (7.52/phi) + 2 + ((2/phi)-2)
if phi == 1:
H_products = h_co2_p + 2*h_h2o_p + 7.52*h_n2_p
n_products = 1 + 7.52 + 2
#rich mixture
if phi > 1:
H_products = ((4/phi)-3)*h_co2_p + 2*h_h2o_p + (7.52/phi)*h_n2_p + (4-(4/phi))*h_co_p
n_products = ((4/phi)-3) + (7.52/phi) + 2 + (4-(4/phi))
Tstd = 298.15
h_ch4_r = h(Tstd,ch4_coeffs_l)
h_o2_r = h(Tstd,o2_coeffs_l)
h_n2_r = h(Tstd,n2_coeffs_l)
H_reactants = h_ch4_r + (2/phi)*(h_o2_r + (3.76*h_n2_r))
n_reactants = 1 + (2/phi) + 3.76*(2/phi)
return (H_products - n_products*R*T) - (H_reactants - n_reactants*R*Tstd)
def fprime(T):
return (f(T+1e-6) - f(T))/1e-6
#Newton raphson method
T_guess = 1500
tol = 1e-03
alpha = 0.2
X = np.arange(0.1,2,0.05)
T_ad = []
for phi in X:
while(abs(f(T_guess)) > tol):
T_guess = T_guess - alpha*((f(T_guess)/fprime(T_guess)))
T_ad.append(T_guess)
plt.plot(X,T_ad,color='red',label="using newton raphson")
plt.grid('on')
#program using cantera
import cantera as ct
T_adc = []
for phi in np.arange(0.1,2,0.05):
gas = ct.Solution('gri30.xml')
gas.TPX = 298.15,101325,{'CH4':1,'O2':2/phi,'N2':7.52/phi}
gas.equilibrate('UV','auto')
T_adc.append(gas.T)
#plotting
plt.plot(X,T_adc,color='blue',label="using cantera")
plt.xlabel('Equivalence Ratio')
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of Equivalence Ratio on AFT of methane')
plt.legend()
plt.show()
RESULT:

From the graph we can see that at stoichiometric condition (phi =1) the AFT is high and as we move away from stoichiometric condition the AFT starts decreasing because at stoichiometric condition all the fuel gets burned and produces more energy.
We can see that cantera result shows lower AFT than newton Raphson method because cantera uses all the products of the combustion so more energy is used to produce those products.
Hence lower AFT is obtained through cantera which is actual solution.
CASE 2: FLAME TEMPERATURE VS HEAT LOSS
For a constant pressure process enthalpy is equated for reactants and products to get AFT,
H_r – H_p + Heat_loss = 0
the ,aximum possible heat loss is the lower heat value(LHV)
Heat_loss = Heat_loss factor * (LHV)
CODING APPROACH:
USING NR METHOD:
- Enthalpy of reactants and products were calculated from the nasa polynomial.
H = ((a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T)
The coefficients are obtained from Berkeley website.
- For the constant pressure process enthalpy is equated to get AFT.
- Using the newton Raphson method the final temperature is obtained.
- The heat loss was varied from 0 to 1.
CODE:
"""
ADIABATIC FLAME TEMPERATURE
CH4 + 2(O2 + 3.76N2) = CO2 + 2H2O + 7.52N2 #STOICHOMETRIC MIXTURE
"""
import matplotlib.pyplot as plt
import math
import numpy as np
def h(T,co_effs):
"""
function to evaluate enthalpy
"""
R = 8.314 #j/mol-k
a1 = co_effs[0]
a2 = co_effs[1]
a3 = co_effs[2]
a4 = co_effs[3]
a5 = co_effs[4]
a6 = co_effs[5]
return (a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T
#low temperature coefficients
ch4_coeffs_l = [5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00]
o2_coeffs_l = [3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
n2_coeffs_l = [0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
#high temperature coefficients
o2_coeffs_h = [3.28253784E+00,1.48308754E-03,-7.57966669E-07,2.09470555E-10,-2.16717794E-14,-1.08845772E+03,5.45323129E+00]
n2_coeffs_h = [0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02]
co2_coeffs_h = [3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
h2o_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
co_coeffs_h = [2.71518561E+00,2.06252743E-03,-9.98825771E-07,2.30053008E-10,-2.03647716E-14,-1.41518724E+04,7.81868772E+00]
#standard temperature
Tstd = 298.15
#computing the maximum possible heat loss
LHV = h(Tstd,ch4_coeffs_l) + 2*h(Tstd,o2_coeffs_l) - h(Tstd,co2_coeffs_h) - 2*h(Tstd,h2o_coeffs_h)
def f(T,Heat_loss):
"""
function that represents the root finding problem
"""
h_co2_p = h(T,co2_coeffs_h)
h_n2_p = h(T,n2_coeffs_h)
h_h2o_p = h(T,h2o_coeffs_h)
H_products = h_co2_p + 2*h_h2o_p + 7.52*h_n2_p
h_ch4_r = h(Tstd,ch4_coeffs_l)
h_o2_r = h(Tstd,o2_coeffs_l)
h_n2_r = h(Tstd,n2_coeffs_l)
H_reactants = h_ch4_r + 2*(h_o2_r + 3.76*h_n2_r)
return (H_products - H_reactants + (Heat_loss*LHV))
def fprime(T,Heat_loss):
return (f(T+1e-6,Heat_loss) - f(T,Heat_loss))/1e-6
#Newton raphson method
T_guess = 1500
tol = 1e-3
alpha = 0.2
Heat_loss = np.linspace(0,1,10)
temp = []
for i in range(0,len(Heat_loss)):
while(abs(f(T_guess,Heat_loss[i])) > tol):
T_guess = T_guess - alpha*((f(T_guess,Heat_loss[i])/fprime(T_guess,Heat_loss[i])))
temp.append(T_guess)
#plotting
plt.plot(Heat_loss,temp,color='red')
plt.plot(Heat_loss[3],temp[3],'o',color='black',label='H_loss = 0.35')
plt.grid('on')
plt.legend()
plt.xlabel('Heat Loss Factor')
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of Heat Loss Factor on AFT')
plt.show()
RESULT:

From the graph we can infer that as the heat loss increases the AFT keeps decreasing because less energy is contained in the chamber as it decreases the temperature.
CASE 3 : AFT FOR HYDROCARBONS C=2
The same approach is carried out and tested for alkane, alkyne and alkene for 2 carbon atom chain. The hydrocarbons are ethane, ethene and ethyne.
CODE:
"""
Adiabatic flame temperature variation with respect to Alkane, Alkene and Alkyne
type of hydrocarbon (c=2)
general hydrocarbon: CxHy + [x + (y/4)](O2 + 3.76N2) => xCO2 + (y/2)H2O + 3.76[x+(y/4)]N2
ETHANE : C2H6 + 3.5(O2 +3.76N2) => 2CO2 + 3H2O + 13.16N2
ETHENE : C2H4 + 3(O2 + 3.76N2) => 2CO2 + 2H2O + 11.28N2
ETHYNE : C2H2 + 2.5(O2 +3.76N2) => 2CO2 + H2O + 9.4N2
"""
import matplotlib.pyplot as plt
import cantera as ct
def h(T,co_effs):
"""
function to evaluate enthalpy
"""
R = 8.314 #j/mol-k
a1 = co_effs[0]
a2 = co_effs[1]
a3 = co_effs[2]
a4 = co_effs[3]
a5 = co_effs[4]
a6 = co_effs[5]
return (a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T
#low temperature coefficients
c2h6_coeffs_l = [4.29142492E+00,-5.50154270E-03,5.99438288E-05,-7.08466285E-08,2.68685771E-11,-1.15222055E+04,2.66682316E+00]
c2h4_coeffs_l = [3.95920148E+00,-7.57052247E-03,5.70990292E-05,-6.91588753E-08,2.69884373E-11,5.08977593E+03,4.09733096E+00]
c2h2_coeffs_l = [8.08681094E-01,2.33615629E-02,-3.55171815E-05,2.80152437E-08,-8.50072974E-12,2.64289807E+04,1.39397051E+01]
o2_coeffs_l = [3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
n2_coeffs_l = [0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
#high temperature coefficients
n2_coeffs_h = [0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02]
co2_coeffs_h = [3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
h2o_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
#standard temperature
Tstd = 298.15
def f(T,ntype):
"""
function that represents the root finding problem
"""
h_co2_p = h(T,co2_coeffs_h)
h_n2_p = h(T,n2_coeffs_h)
h_h2o_p = h(T,h2o_coeffs_h)
h_c2h4_r = h(Tstd,c2h4_coeffs_l)
h_c2h6_r = h(Tstd,c2h6_coeffs_l)
h_c2h2_r = h(Tstd,c2h2_coeffs_l)
h_o2_r = h(Tstd,o2_coeffs_l)
h_n2_r = h(Tstd,n2_coeffs_l)
if ntype == 1:
x = 2
y = 6
h_fuel = h_c2h6_r
elif ntype == 2:
x = 2
y = 4
h_fuel = h_c2h4_r
elif ntype == 3:
x = 2
y = 2
h_fuel = h_c2h2_r
H_products = x*h_co2_p + (y/2)*h_h2o_p + 3.76*(x + y/4)*h_n2_p
H_reactants = h_fuel + (x + y/4)*h_o2_r + 3.76*(x + y/4)*h_n2_r
return (H_products - H_reactants)
def fprime(T,ntype):
return (f(T+1e-6,ntype) - f(T,ntype))/(1e-6)
#Newton raphson method
T_guess = 1500
tol = 1e-3
alpha = 0.2
ntype = [1,2,3]
temp = []
for i in range(0,len(ntype)):
while(abs(f(T_guess,ntype[i])) > tol):
T_guess = T_guess - alpha*((f(T_guess,ntype[i])/fprime(T_guess,ntype[i])))
temp.append(T_guess)
#plotting
plt.figure(1)
plt.bar(['Ethane($C_2H_6$)','Ethene($C_2H_4$)','Ethyne($C_2H_2$)'],temp)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of AFT with respect to alkane,alkene,alkyne')
plt.show()
"""
cantera solution
"""
gas = ct.Solution('gri30.xml')
t = []
for i in range(0,len(ntype)):
if ntype[i] == 1:
x = 2
y = 6
fuel = 'C2H6'
elif ntype[i] == 2:
x = 2
y = 4
fuel = 'C2H4'
elif ntype[i] == 3:
x = 2
y = 2
fuel = 'C2H2'
n_tot = 1 + (x+y/4) + 3.76*(x+y/4)
n_fuel = 1/n_tot
n_o2 = (x+y/4)/n_tot
n_n2 = (3.76*(x+y/4))/n_tot
gas.TPX = 298.15,101325,{fuel:n_fuel,'O2':n_o2,'N2':n_n2}
gas.equilibrate('HP','auto')
t.append(gas.T)
#plotting
plt.figure(2)
plt.bar(['Ethane($C_2H_6$)','Ethene($C_2H_4$)','Ethyne($C_2H_2$)'],t)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of AFT with respect to alkane,alkene,alkyne (cantera)')
plt.show()
RESULT:


From the bar graph we can obtain that the highest final temperature is obtained for ethyne and lowest for ethane. As the high amount of energy is obtained in case of ethyne which is due to triple C bond which requires more energy to break.
CASE 4 : AFT FOR SERIES OF ALKANES
The carbon atoms are varied from 1 to 3 for the alkane group. The hydrocarbons are methane, ethane and propane.
CODE:
"""
Adiabatic flame temperature variation with respect to Alkane, Alkene and Alkyne
type of hydrocarbon (c=2)
general hydrocarbon: CxHy + [x + (y/4)](O2 + 3.76N2) => xCO2 + (y/2)H2O + 3.76[x+(y/4)]N2
METHANE: CH4 + 2(O2 + 3.76N2) = CO2 + 2H2O + 7.52N2
ETHANE : C2H6 + 3.5(O2 +3.76N2) => 2CO2 + 3H2O + 13.16N2
PROPANE : C3H8 + 5*(O2 +3.76N2) => 3CO2 + 4H2O + 18.8N2
"""
import matplotlib.pyplot as plt
import cantera as ct
def h(T,co_effs):
"""
function to evaluate enthalpy
"""
R = 8.314 #j/mol-k
a1 = co_effs[0]
a2 = co_effs[1]
a3 = co_effs[2]
a4 = co_effs[3]
a5 = co_effs[4]
a6 = co_effs[5]
return (a1 + a2*T/2 + a3*pow(T,2)/3 + a4*pow(T,3)/4 + a5*pow(T,4)/5 + a6/T)*R*T
#low temperature coefficients
c2h6_coeffs_l = [4.29142492E+00,-5.50154270E-03,5.99438288E-05,-7.08466285E-08,2.68685771E-11,-1.15222055E+04,2.66682316E+00]
ch4_coeffs_l = [5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00]
c3h8_coeffs_l = [0.93355381E+00,0.26424579E-01,0.61059727E-05,-0.21977499E-07,0.95149253E-11,-0.13958520E+05,0.19201691E+02]
o2_coeffs_l = [3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
n2_coeffs_l = [0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
#high temperature coefficients
n2_coeffs_h = [0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02]
co2_coeffs_h = [3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
h2o_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
#standard temperature
Tstd = 298.15
def f(T,ntype):
"""
function that represents the root finding problem
"""
h_co2_p = h(T,co2_coeffs_h)
h_n2_p = h(T,n2_coeffs_h)
h_h2o_p = h(T,h2o_coeffs_h)
h_ch4_r = h(Tstd,ch4_coeffs_l)
h_c2h6_r = h(Tstd,c2h6_coeffs_l)
h_c3h8_r = h(Tstd,c3h8_coeffs_l)
h_o2_r = h(Tstd,o2_coeffs_l)
h_n2_r = h(Tstd,n2_coeffs_l)
if ntype == 1:
x = 1
y = 4
h_fuel = h_ch4_r
elif ntype == 2:
x = 2
y = 6
h_fuel = h_c2h6_r
elif ntype == 3:
x = 3
y = 8
h_fuel = h_c3h8_r
H_products = x*h_co2_p + (y/2)*h_h2o_p + 3.76*(x + y/4)*h_n2_p
H_reactants = h_fuel + (x + y/4)*h_o2_r + 3.76*(x + y/4)*h_n2_r
return (H_products - H_reactants)
def fprime(T,ntype):
return (f(T+1e-6,ntype) - f(T,ntype))/(1e-6)
#Newton raphson method
T_guess = 1500
tol = 1e-3
alpha = 0.2
ntype = [1,2,3]
temp = []
for i in range(0,len(ntype)):
while(abs(f(T_guess,ntype[i])) > tol):
T_guess = T_guess - alpha*((f(T_guess,ntype[i])/fprime(T_guess,ntype[i])))
temp.append(T_guess)
#plotting
plt.figure(1)
plt.bar(['Methane($CH_4$)','Ethane($C_2H_6$)','Propane($C_3H_8$)'],temp)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of AFT with respect to no carbon atom chain')
plt.show()
"""
cantera solution
"""
gas = ct.Solution('gri30.xml')
t = []
for i in range(0,len(ntype)):
if ntype[i] == 1:
x = 1
y = 4
fuel = 'CH4'
elif ntype[i] == 2:
x = 2
y = 6
fuel = 'C2H6'
elif ntype[i] == 3:
x = 3
y = 8
fuel = 'C3H8'
n_tot = 1 + (x+y/4) + 3.76*(x+y/4)
n_fuel = 1/n_tot
n_o2 = (x+y/4)/n_tot
n_n2 = (3.76*(x+y/4))/n_tot
gas.TPX = 298.15,101325,{fuel:n_fuel,'O2':n_o2,'N2':n_n2}
gas.equilibrate('HP','auto')
t.append(gas.T)
#plotting
plt.figure(2)
plt.bar(['Methane($CH_4$)','Ethane($C_2H_6$)','Propane($C_3H_8$)'],t)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of AFT with respect to no of carbon atom chain (cantera)')
plt.show()
RESULT:


From the graph we can conclude that propane has highest AFT whereas the methane has lower AFT.
The AFT increases with increases in no of carbon atom and hydrogen atom for alkane group of hydro carbons.