Week 3 - Adiabatic Flame Temperature calculation
Aim: To Simulate and Calculate the Adiabatic Flame temperature
Given Condition:
Case 1: Effect of equivalence ratio on AFT
Case 2: Constant pressure reactor with heat loss
Case 3: Comparing general Alkane equation with heat loss zero
Case 4: Comparing Species using Cantera
ADIABATIC FLAME TEMPERATURE:
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.
1)If a fuel air mixture burns adiabatically at constant pressure the absolute enthalpy of the reactant at the initial state (T = 298 K, P = 1 atm) equal the absolute enthalpy of the product at the final state (T = Tad, P = 1 atm)
2)The constant volume adiabatic flame temperature is the temperature that results from a complete combustion process that occurs without any work, heat transfer or changes in kinetic or potential energy. Its temperature is higher than the constant pressure process because no energy is utilized to change the volume of the system (i.e., generate work)
Since, in constant volume it temperature is higher than the constant pressure process because no energy is utilized to change the volume of the system.
Process:
Case 1: Effect of equivalence ratio on AFT:
- Assume that Methane is contained in a constant volume chamber and assume N2 is present.
- Equivalence ratio is defined as the ratio of the actual fuel/air ratio to the stoichiometric fuel/air ratio.
- If the equivalence ratio is equal to one, the combustion is stoichiometric.
- If it is ϕϕ < 1, it combustion is clean with excess air and if it ϕϕ > 1 the combustion is rich with incomplete combustion.
Chemical Reaction:
Stoichiometric reaction,
CxHy+a(O2+3.76N2) →aCO2+y2H2O+3.76⋅aN2
Equivalence ratio mixture, consider Methane
CH4+(2/ϕ) (O2+3.76N2) →xCO2+y2H2O+OtherProduct
For Lean Mixture, (ϕ<1)
CH4+(2/ϕ) (O2+3.76N2) →CO2+2H2O+(7.52/ϕ) N2+((2/ϕ) −2) O2]
For Rich Mixture, (ϕ>1)
CH4+(2/ϕ) (O2+3.76N2) →((4/ϕ) −3) CO2+2H2O+(7.52/ϕ) N2+(4−(4/ϕ)) CO
Constant Volume Process
(hpdt−hreact) −R(npdtT−nreactTstd)
Python code:
"""
adiabtic falme temperature calculation at different equivalance ratio-Effect of equivalance ratio on AFT
"""
import matplotlib.pyplot as plt
import math
import numpy as np
R = 8.314
def h(T,coeff):
a1=coeff[0]
a2=coeff[1]
a3=coeff[2]
a4=coeff[3]
a5=coeff[4]
a6=coeff[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 Heat Transfer Coefficient
CH4_coeff_l= [5.14987613E+00, -1.36709788E-02, 4.91800599E-05, -4.84743026E-08, 1.66693956E-11, -1.02466476E+04, -4.64130376E+00]
O2_coeff_l= [3.78245636E+00, -2.99673416E-03, 9.84730201E-06, -9.68129509E-09, 3.24372837E-12, -1.06394356E+03, 3.65767573E+00]
N2_coeff_l=[0.03298677E+02, 0.14082404E-02, -0.03963222E-04, 0.05641515E-07, -0.02444854E-10, -0.10208999E+04, 0.03950372E+02]
# High Temperature Heat Transfer Coefficient
CO2_coeff_h=[3.85746029E+00, 4.41437026E-03, -2.21481404E-06, 5.23490188E-10, -4.72084164E-14, -4.87591660E+04, 2.27163806E+00]
H2O_coeff_h=[3.03399249E+00, 2.17691804E-03, -1.64072518E-07, -9.70419870E-11, 1.68200992E-14, -3.00042971E+04, 4.96677010E+00]
N2_coeff_h=[0.02926640E+02, 0.14879768E-02, -0.05684760E-05, 0.10097038E-09, -0.06753351E-13, -0.09227977E+04, 0.05980528E+02]
CO_coeff_h=[2.71518561E+00, 2.06252743E-03,-9.98825771E-07, 2.30053008E-10,-2.03647716E-14, -1.41518724E+04, 7.81868772E+00]
O2_coeff_h=[ 3.28253784E+00, 1.48308754E-03, -7.57966669E-07, 2.09470555E-10, -2.16717794E-14, -1.08845772E+03, 5.45323129E+00]
def f(T,phi): # Enthalpy
if (phi<=1): # Lean Mixture
h_CO2_p=h(T,CO2_coeff_h)
h_H2O_p=h(T,H2O_coeff_h)
h_O2_p=h(T,O2_coeff_h)
h_N2_p=h(T,N2_coeff_h)
h_product= h_CO2_p + 2*h_H2O_p + (2/phi-2)*h_O2_p + (7.52/phi)*h_N2_p
n_product= 1 + 2 + (2/phi-2) + (7.52/phi)
elif (phi>1): # Rich Mixture
h_CO2_p=h(T,CO2_coeff_h)
h_H2O_p=h(T,H2O_coeff_h)
h_CO_p=h(T,CO_coeff_h)
h_N2_p=h(T,N2_coeff_h)
h_product= (4/phi-3)*h_CO2_p + 2*h_H2O_p + (4-4/phi)*h_CO_p + (7.52/phi)*h_N2_p
n_product= (4/phi-3) + 2 + (4-4/phi) +(7.52/phi)
print(h_product)
T_std = 298.15 # Reactants
h_CH4_r=h(T_std,CH4_coeff_l)
h_O2_r=h(T_std,O2_coeff_l)
h_N2_r=h(T_std,N2_coeff_l)
h_reactant=h_CH4_r + (2/phi)*(h_O2_r + (3.76*h_N2_r))
n_reactant=1 + (2/phi) + 3.76*(2/phi)
print(h_reactant)
return(h_product - h_reactant) - R*(n_product*T-n_reactant*T_std)
def fprime(T,phi):
return(f(T+1e-6,phi)-f(T,phi))/1e-6
# Newton Rhapson Method
T_guess=1500
tol=1e-4
alpha=0.8
phi=np.linspace(0.1,1.5,20)
temp = []
for i in range (0,len(phi)):
while(abs(f(T_guess,phi[i]))>tol):
T_guess=T_guess-alpha*(f(T_guess,phi[i])/fprime(T_guess,phi[i]))
temp.append(T_guess)
plt.plot(phi,temp)
plt.xlabel('Equivalance Ratio')
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of Equivalance ratio using AFT')
plt.grid('on')
plt.show()
Result:
As the above graph represented Temperature obtained the range Equivalent Ratio. We have seen as the Equivalent Ratio increases The Temperature Increases still Equivalent Valve reached to one. There will get a Higher temperature of 2377.13 K, after the Equivalent Ratio increase greater than one the temperature was decreasing. This is called a Lean Mixture.
cantera Code:
#Calculate Adiabatic Flame Temperature usine cantra
import cantera as ct
import matplotlib.pyplot as plt
#Define gas object
gas=ct.Solution('gri30.xml')
phi=[0.5,0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4]
for i in range(0,10):
gas.TPX=298.15,101325,{'Ch4':1,'O2':2/phi[i],'N2':7.52/phi[i]}
gas.set_equivalence_ratio(phi[i],'CH4:1','O2:1, N2:3.76')
gas.equilibrate('HP','auto')
print(gas.T,phi[i])
plt.plot(phi[i],gas.T,'*',color='blue')
plt.xlabel('Equivalent ratio')
plt.ylabel('Temperature')
plt.title('Adiabatic Flame Temperature Using cantera')
plt.show()
result:
The above graph represents the Adiabatic Flame Temperature Using Cantera. This Method obtained a final temperature of 2224 K. As compared to the python program had a lower temperature because the products we defined in Cantera CH4 and O2 but in python program formed more species after combustion, which will give more temperature.
Case 2: Constant pressure reactor with heat loss
import matplotlib.pyplot as plt
import math
def h(T,coeff):
R=8.314
a1=coeff[0]
a2=coeff[1]
a3=coeff[2]
a4=coeff[3]
a5=coeff[4]
a6=coeff[5]
#Enthlpy
return (a1+ a2/2*T+ a3/3*pow(T,2)+ a4/4*pow(T,3)+ a5/5*pow(T,4)+ a6/T)*R*T
''' High Temperature Coefficient T>1000'''
coeff_co2_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
coeff_h2o_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
coeff_n2_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05, 0.10097038E-09,-0.06753351E-13, -0.09227977E+04, 0.05980528E+02]
coeff_o2_h=[3.28253784E+00, 1.48308754E-03, -7.57966669E-07, 2.09470555E-10, -2.16717794E-14, -1.08845772E+03, 5.45323129E+00]
coeff_co_h=[2.71518561E+00, 2.06252743E-03, -9.98825771E-07, 2.30053008E-10, -2.03647716E-14, -1.41518724E+04, 7.81868772E+00]
'''Low temperature Coefficient T<1000'''
coeff_ch4_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00]
coeff_n2_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
coeff_o2_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
coeff_c2h2_l=[8.08681094E-01, 2.33615629E-02, -3.55171815E-05, 2.80152437E-08, -8.50072974E-12, 2.64289807E+04, 1.39397051E+01]
coeff_c2h4_l=[3.95920148E+00, -7.57052247E-03, 5.70990292E-05, -6.91588753E-08, 2.69884373E-11, 5.08977593E+03, 4.09733096E+00]
coeff_c2h6_l=[4.29142492E+00, -5.50154270E-03, 5.99438288E-05, -7.08466285E-08, 2.68685771E-11, -1.15222055E+04, 2.66682316E+00]
def f(T,n):
#Enthalpy of Products
co2_p = h(T,coeff_co2_h)
h2o_p = h(T,coeff_h2o_h)
n2_p = h(T,coeff_n2_h)
#Alkane C2H6
if (n==1):
x=2
y=6
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#Alkene C2H4
if (n==2):
x=2
y=4
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#Alkyne C2H2
if (n==3):
x=2
y=2
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#Enthaply Reactants
Tstd = 298.15
R = 8.314 #J/mol-K
H_loss=0.35
ch4_r = h(Tstd,coeff_ch4_l)
o2_r = h(Tstd,coeff_o2_l)
n2_r = h(Tstd,coeff_n2_l)
c2h2_r=h(Tstd,coeff_c2h2_l)
c2h4_r=h(Tstd,coeff_c2h4_l)
c2h6_r=h(Tstd,coeff_c2h6_l)
#Alkane C2H6
if (n==1):
x=2
y=6
LHV=1435*pow(10,3)
H_reactants=c2h6_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
#Alkene C2H4
if (n==2):
x=2
y=4
LHV=1480*pow(10,3)
H_reactants=c2h4_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
#Alkyne C2H2
if (n==3):
x=2
y=2
LHV=1250*pow(10,3)
H_reactants=c2h2_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
return (H_products - H_reactants + H_loss * LHV)
def fprime(T,n):
return ((f(T+1e-6,n) - f(T,n))/(1e-6))
T_guss=[1500,1500,1500]
n=[1,2,3]
tol=1e-3
alpha=0.2
itr=0
for i in range(0,3):
while (abs(f(T_guss[i],n[i]))>tol):
T_guss[i]=T_guss[i]-alpha*(f(T_guss[i],n[i])/fprime(T_guss[i],n[i]))
itr+=1
print(T_guss)
Species=['Alkane','Alkene','Alkyne']
if (i==0):
plt.plot(Species[0],T_guss[i],'*',color='red')
plt.text(Species[0],1950,'alkane',color='red')
if (i==1):
plt.plot(Species[1],T_guss[i],'*',color='blue')
plt.text(Species[0],1910,'alkene',color='blue')
if (i==2):
plt.plot(Species[2],T_guss[2],'*',color='green')
plt.text(Species[0],1870,'alkyne',color='green')
print(itr)
plt.title('Adiabatic Flame Temperature')
plt.xlabel('Species')
plt.ylabel('Temperature')
plt.show()
Result:
As we have seen above the graph, we got, the temperatures of different species, where Alkyne gets a higher temperature than the other two species. Newton Rapson Method used. the main case in the process calculates
H_produts-H_Reactants+LHV*H_loss
Case 3: Comparing general Alkane equation with heat loss zero
# adiabatic flame temperature
#CH4 + 2(O2 + 3.76N2) = Co2 + 2H2O + 7.52N2
import matplotlib.pyplot as plt
import math
def h(T,coeff):
#Define real gas constant
R=8.314
#Assign values to variables
a1=coeff[0]
a2=coeff[1]
a3=coeff[2]
a4=coeff[3]
a5=coeff[4]
a6=coeff[5]
#Enthlpy calculated
return (a1+ a2/2*T+ a3/3*pow(T,2)+ a4/4*pow(T,3)+ a5/5*pow(T,4)+ a6/T)*R*T
#Coefficient of Species
''' High Temperature T>1000'''
coeff_co2_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00]
coeff_h2o_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00]
coeff_n2_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05, 0.10097038E-09,-0.06753351E-13, -0.09227977E+04, 0.05980528E+02]
coeff_o2_h=[3.28253784E+00, 1.48308754E-03, -7.57966669E-07, 2.09470555E-10, -2.16717794E-14, -1.08845772E+03, 5.45323129E+00]
coeff_co_h=[2.71518561E+00, 2.06252743E-03, -9.98825771E-07, 2.30053008E-10, -2.03647716E-14, -1.41518724E+04, 7.81868772E+00]
'''Low temperature T<1000'''
coeff_ch4_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00]
coeff_n2_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02]
coeff_o2_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00]
coeff_c3h8_l=[0.93355381E+00, 0.26424579E-01, 0.61059727E-05, -0.21977499E-07, 0.95149253E-11, -0.13958520E+05, 0.19201691E+02]
coeff_c2h4_l=[3.95920148E+00, -7.57052247E-03, 5.70990292E-05, -6.91588753E-08, 2.69884373E-11, 5.08977593E+03, 4.09733096E+00]
coeff_c2h6_l=[4.29142492E+00, -5.50154270E-03, 5.99438288E-05, -7.08466285E-08, 2.68685771E-11, -1.15222055E+04, 2.66682316E+00]
def f(T,n):
# Enthalphy of Products
co2_p = h(T,coeff_co2_h)
h2o_p = h(T,coeff_h2o_h)
n2_p = h(T,coeff_n2_h)
# Alkane = CnH2n+2
#CH4
if (n==1):
x=1
y=4
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#C2H6
if (n==2):
x=2
y=6
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#C3H8
if (n==3):
x=3
y=8
H_products=x*co2_p+y/2*h2o_p+3.76*(x+y/4)*n2_p
#Enthalpy of Reactants
Tstd = 298.15
R = 8.314 #J/mol-K
H_loss=0
ch4_r = h(Tstd,coeff_ch4_l)
o2_r = h(Tstd,coeff_o2_l)
n2_r = h(Tstd,coeff_n2_l)
c3h8_r=h(Tstd,coeff_c3h8_l)
c2h6_r=h(Tstd,coeff_c2h6_l)
#CH4
if (n==1):
x=1
y=4
LHV=1435*pow(10,3)
H_reactants=ch4_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
#C2H6
if (n==2):
x=2
y=6
LHV=1480*pow(10,3)
H_reactants=c2h6_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
#C3H8
if (n==3):
x=3
y=8
LHV=1250*pow(10,3)
H_reactants=c3h8_r+(x+y/4)*o2_r+3.72*(x+y/4)*n2_r
return (H_products - H_reactants + H_loss * LHV)
def fprime(T,n):
return ((f(T+1e-6,n) - f(T,n))/(1e-6))
T_guss=[1500,1500,1500]
n=[1,2,3]
tol=1e-3
alpha=0.2
itr=0
for i in range(0,3):
while (abs(f(T_guss[i],n[i]))>tol):
T_guss[i]=T_guss[i]-alpha*(f(T_guss[i],n[i])/fprime(T_guss[i],n[i]))
itr+=1
print(T_guss)
Species=['CH4','C2H6','C3H8']
if (i==0):
plt.plot(Species[i],T_guss[i],'*',color='red')
plt.text(Species[1],2370,'CH4 Temperature= 2325 K',color='red')
if (i==1):
plt.plot(Species[i],T_guss[i],'*',color='blue')
plt.text(Species[1],2365,'C2H6 Temperature= 2379 K',color='blue')
if (i==2):
plt.plot(Species[i],T_guss[i],'*',color='green')
plt.text(Species[1],2360,'C3H8 Temperature= 2392.09 K',color='green')
print(itr)
plt.title('Adiabatic Flame Temperature')
plt.xlabel('Species')
plt.ylabel('Temperature')
plt.show()
We were calculated the Adiabatic Flame Temperature of General Alkane (Cn+H2n+2) with Different Carbon atoms(1-3).this method got higher temperatures as compared to the pressure constant process because here zero heat loss
Case 4: Comparing Species using Cantera
#Define different species using Cantara
import cantera as ct
import matplotlib.pyplot as plt
gas=ct.Solution('gri30.xml')
species=['CH4', 'C2H6', 'C3H8']
phi = 1
temp = []
for specie in species:
gas.TP = 298,101325
gas.set_equivalence_ratio(phi, specie,'O2:2, N2:3.76')
gas.equilibrate ('UP','auto')
temp.append(gas.T)
print(phi, gas.T, specie)
plt.plot(species,temp,'*',color='red')
plt.xlabel('Number of carbon atoms')
plt.ylabel('Adiabatic Flame Temperature')
plt.show()
result:
Conculsion:
- At a constant volume process, The Adiabatic Flame Temperature Increases while increasing the Equivalent Ratio until Stochimetric Condition, after Stochimetric Condition Temperature will decreases.
- Comparing temperature between Python and Cantera, The temperature is lower than python because while the generall calculates more species formed after combustion than the temperature was increased, but Cantera got low temperatures.
- For comparing the temperatures of constant pressure and constant volume, where constant pressure got lower temperature then constant volume because the final temperature will get without any work, heat transfer or kinetic energy at constant volume.