Week 3 - Adiabatic Flame Temperature calculation
AFFECT OF EQUIVALENCE OF AFT(ADIABATIC FLAME TEMPERATURE)
FOR constant volume:
internal energy on reactant side=internal energy of product side.
Finding h from nasa polynomial equation and solving,
Hence, ∑h_reactants-∑h_products-R(∑n_reactants*T_std-∑n_products*T) should be zero.
Equation of mixture in form of equivalence ratio (phi)
phi=(fuel/air)_given equation/(fuel/air)_stochiometric equation
phi=1 =stochiometric mixture
phi>1=rich mixture
phi<1=lean mixture
Stochiometric equation:(when phi=1)
ch4+(o2+3.76n2)=h2o+co2+n2
Rich mixture:
ch4+(2/phi)(o2+3.76n2)=(4/phi -3)co2+2h2o+(7.52/phi)n2+(4-4/phi)co
Lean mixture:
ch4+(2/phi)(o2+3.76n2)=co2+2h2o+(7.52/phi)n2+(2/phi-2)o2
Code:
#ch4+2o2+7.52n2=7.52n2+2h20+co2
import matplotlib.pyplot as plt
import math
import numpy as arange
from numpy import arange
for a in arange(0.1,2,0.1):
b=2
c=7.52
far_ub=a/b
far_b=0.5
phi=far_ub/far_b
def h(T, co_effs):
R=8.314
a_1=co_effs[0]
a_2=co_effs[1]
a_3=co_effs[2]
a_4=co_effs[3]
a_5=co_effs[4]
a_6=co_effs[5]
return (a_1+a_2*0.5*T+a_3*(1/3)*pow(T,2)+a_4*(1/4)*pow(T,3)+a_5*(1/5)*pow(T,4)+a_6*(1/T))*R*T #enthalpy in J/mol
#ch4+2o2+7.52n2=co2+2h2o+7.5n2
ch4_coeff_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04]
o2_coeff_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03]
n2_coeff_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04]
n2_coeff_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04]
co2_coeff_h=[ 3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04]
h2o_coeff_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]
ch4_coeff_h=[ 7.48514950E-02,1.33909467E-02,-5.73285809E-06,1.22292535E-09,-1.01815230E-13,-9.46834459E+03]
o2_coeff_h=[3.28253784E+00,1.48308754E-03,-7.57966669E-07,2.09470555E-10,-2.16717794E-14,-1.08845772E+03]
co_coeff_h=[ 2.71518561E+00, 2.06252743E-03,-9.98825771E-07, 2.30053008E-10,-2.03647716E-14,-1.41518724E+04]
def f(T):
T_std=298.15
R=8.314
h_ch4_r=h(T_std,ch4_coeff_l) #per mol basis i.e j/mol
h_o2_r=h(T_std,o2_coeff_l)
h_n2_r=h(T_std,n2_coeff_l)
h_reactants=h_ch4_r + (2/phi)*h_o2_r + (7.52/phi)*h_n2_r
h_n2_p=h(T,n2_coeff_h)
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_o2_p=h(T,o2_coeff_h)
if (phi>=1):
h_products=(7.52/phi)*h_n2_p + 2*h_h2o_p + (4/phi-3)*h_co2_p +(4-4/phi)*h_co_p
return (h_reactants-h_products)-R*(1+2/phi+7.52/phi)*T_std + R*(7.52/phi+2+4/phi-3+4-4/phi)*T
else:
h_products=(7.52/phi)*h_n2_p + 2*h_h2o_p + h_co2_p+ (2/phi-2)*h_o2_p
return (h_reactants-h_products)-R*(1+2/phi+7.52/phi)*T_std + R*(7.52/phi+2+1+2/phi-2)*T
def fprime(T):
return (f(T+1e-6) - f(T))/1e-6
T_guess=1500
tol=1e-3
alpha=0.2
ct=0
while (abs(f(T_guess)) > tol):
T_guess=T_guess - alpha*(f(T_guess)/fprime(T_guess))
ct=ct+1
print(T_guess)
plt.plot(phi,T_guess,'*',color='red')
plt.xlabel('equivalence ratio')
plt.ylabel('Adiabatic flame temperature')
plt.grid('on')
plt.show()
Graph:
OBSERVATION:Max temperature when equivalence ratio is 1,i.e 2817.8310188455657 K. When equivalence ratio is <1 or >1 , then number of products on the product side is more than when phi=1. so,temperature on both sides of phi =1 will be lower than temp at phi=1 because more products are forming and take the energy and because of that temperature lessens.The graph concludes that as phi increases till 1, then adiabatic flame temperature increases , achieves it max at phi=1, and decreases after that as phi increases greater than 1.
PERFORMING THE SAME PROBLEM WITH CANTERA:
Code:
import cantera as ct
import matplotlib.pyplot as plt
import numpy as arange
gas=ct.Solution('gri30.xml')
from numpy import arange
for a in arange(0.1,2,0.1):
b=2
far_g=a/b
far_s=0.5
phi=far_g/far_s
gas.TPX=298.15,101325,{'ch4':1,'o2':2/phi,'n2':7.52/phi}
gas.equilibrate('UV','auto')
print(gas.T)
plt.plot(a,gas.T,'*',color='blue')
plt.xlabel('equivalence ratio')
plt.ylabel('adiabatic flame temperature')
plt.grid('on')
plt.show()
Graph:
Observation:
The max temperature at phi=1 when the result is performed by cantera is 2600.5391665502075 K .
The temperature result that come from cantera are lesser than that from python(which is2817.8310188455657 K) , because in cantera the reaction that is perfomed , all possible products are formed on the product side , because more no. of products are formed , as they take up some energy, the temperature lessens .
CONSTANT PRESSURE REACTOR- AFT OF CH4 WHEN H_LOSS=0.35 (35% heat loss)
(h_reactants-h_products)/h_reactants-h_loss=0
phi=1
lamda=1
Code:
import matplotlib.pyplot as plt
import math
heat_loss_percentage=35
h_loss=heat_loss_percentage/100
def h(T, co_effs):
R=8.314
a_1=co_effs[0]
a_2=co_effs[1]
a_3=co_effs[2]
a_4=co_effs[3]
a_5=co_effs[4]
a_6=co_effs[5]
return (a_1+a_2*0.5*T+a_3*(1/3)*pow(T,2)+a_4*(1/4)*pow(T,3)+a_5*(1/5)*pow(T,4)+a_6*(1/T))*R*T #enthalpy in J/mol
#ch4+2o2+7.52n2=co2+2h2o+7.5n2
ch4_coeff_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04]
o2_coeff_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03]
n2_coeff_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04]
n2_coeff_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04]
co2_coeff_h=[ 3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04]
h2o_coeff_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]
def f(T):
T_std=298.15
h_ch4_r=h(T_std,ch4_coeff_l) #per mol basis i.e j/mol
h_o2_r=h(T_std,o2_coeff_l)
h_n2_r=h(T_std,n2_coeff_l)
h_reactants=h_ch4_r + 2*h_o2_r + 7.52*h_n2_r
h_n2_p=h(T,n2_coeff_h)
h_co2_p=h(T,co2_coeff_h)
h_h2o_p=h(T,h2o_coeff_h)
h_products=7.52*h_n2_p + h_co2_p + 2*h_h2o_p
return (h_products - h_reactants)/h_reactants -h_loss
def fprime(T):
return (f(T+1e-6) - f(T))/1e-6
T_guess=1500
tol=1e-3
alpha=0.2
ct=0
while (abs(f(T_guess)) > tol):
T_guess=T_guess - alpha*(f(T_guess)/fprime(T_guess))
plt.plot(ct,T_guess,'*',color='red')
ct=ct+1
print(ct)
print(T_guess)
plt.xlabel('no. of iterations')
plt.ylabel('Adiabatic flame temperaure')
plt.grid('on')
plt.show()
Graph:
Observation:Adiabatic flame temperature when heat loss is 35% of the total heat is 2266.4295912224147 K within 38 iterations.
PLOTTING THE TREND OF adiabatic flame temperature FOR C2H2, C2H4, C2H6
heat loss=0
Pressure is constant here and equation used is :
CxHy+z(o2+3.76n2)=3.76z(n2)+a(co2)+b(h2o)
x=a
b=y/2
z=a+b/2
c=3.76z
Code:
import matplotlib.pyplot as plt
import math
#finding AFT for ch4 when h_loss=0.35
heat_loss_percentage=35
h_loss=heat_loss_percentage/100
#ch4+202+7.52n2=7.52n2+2h2o+co2
for y in range(2,8,2):
#CxHy+(x+y/4)(o2+3.76n2)=xco2+(y/2)h2o+3.76(x+y/4)n2
def h(T, co_effs):
R=8.314
a_1=co_effs[0]
a_2=co_effs[1]
a_3=co_effs[2]
a_4=co_effs[3]
a_5=co_effs[4]
a_6=co_effs[5]
return (a_1+a_2*0.5*T+a_3*(1/3)*pow(T,2)+a_4*(1/4)*pow(T,3)+a_5*(1/5)*pow(T,4)+a_6*(1/T))*R*T #enthalpy in J/mol
#ch4+2o2+7.52n2=co2+2h2o+7.5n2
h2o_coeff_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]
c2h4_coeff_l=[2.03611116E+00,1.46454151E-02,-6.71077915E-06,1.47222923E-09,-1.25706061E-13,4.93988614E+03] #c2h4
c2h6_coeff_l=[1.07188150E+00,2.16852677E-02,-1.00256067E-05,2.21412001E-09,-1.90002890E-13,-1.14263932E+04]#c2h6
c2h2_coeff_l=[4.14756964E+00, 5.96166664E-03,-2.37294852E-06, 4.67412171E-10,-3.61235213E-14, 2.59359992E+04]
o2_coeff_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03]
n2_coeff_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04]
n2_coeff_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04]
co2_coeff_h=[ 3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04]
def f(T):
T_std=298.15
h_c2h2_r=h(T_std,c2h2_coeff_l) #per mol basis i.e j/mol
h_c2h4_r=h(T_std,c2h4_coeff_l)
h_c2h6_r=h(T_std,c2h6_coeff_l)
h_o2_r=h(T_std,o2_coeff_l)
h_n2_r=h(T_std,n2_coeff_l)
x=2
if y==2:
h_cxhy_r=h_c2h2_r
else:
if y==4:
h_cxhy_r=h_c2h4_r
else:
h_cxhy_r=h_c2h6_r
h_reactants=x*h_cxhy_r + (x+y/4)*(h_o2_r + 3.76*h_n2_r)
h_n2_p=h(T,n2_coeff_h)
h_co2_p=h(T,co2_coeff_h)
h_h2o_p=h(T,h2o_coeff_h)
h_products=(3.76*(x+y/4))*h_n2_p + (y/2)*h_h2o_p + x*h_co2_p
return ((h_reactants - h_products)/h_reactants) -h_loss
def fprime(T):
return (f(T+1e-6) - f(T))/1e-6
T_guess=1500
tol=1e-3
alpha=0.2
ct=0
while (abs(f(T_guess)) > tol):
T_guess=T_guess - alpha*(f(T_guess)/fprime(T_guess))
ct=ct+1
print(T_guess)
print(ct)
if y==2:
plt.plot('c2h2',T_guess,'*',color='red')
else:
if y==4:
plt.plot('c2h4',T_guess,'*',color='red')
else:
plt.plot('c2h6',T_guess,'*',color='red')
plt.xlabel('hydrocarbon')
plt.ylabel('Adiabatic flame temperature')
plt.grid('on')
plt.show()
Graph:
OBSERVATION:Adiabatic flame temperature increases in the following order, alkyne>alkene>alkane.
Alkene having the triple bond which is the strongest creates more energy and so the adiabatic flame temperature is the highest for alkyne followed by alkene and then alkane.
AFT for alkyne:3037.453605117971K Iterations taken:34
AFT for alkene:2585.823586250286K Iterations taken:40
AFT for alkane:2344.734015016909K Iterations taken:37
PLOTTING THE TREND OF AFT FOR ALKANE(CARBON VARYING FROM 1 TO 3)
Alkane considered : Ch4,c2h6,c3h8
Equations considered:
CxHy+z(o2+3.76n2)=3.76z(n2)+a(co2)+b(h2o)
Code:
import matplotlib.pyplot as plt
for x in range (1,4,1):
def h(T, co_effs):
R=8.314
a_1=co_effs[0]
a_2=co_effs[1]
a_3=co_effs[2]
a_4=co_effs[3]
a_5=co_effs[4]
a_6=co_effs[5]
return (a_1+a_2*0.5*T+a_3*(1/3)*pow(T,2)+a_4*(1/4)*pow(T,3)+a_5*(1/5)*pow(T,4)+a_6*(1/T))*R*T #enthalpy in J/mol
#ch4+2o2+7.52n2=co2+2h2o+7.5n2
h2o_coeff_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]
ch4_coeff_l=[ 5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08, 1.66693956E-11,-1.02466476E+04]
c2h6_coeff_l=[1.07188150E+00,2.16852677E-02,-1.00256067E-05,2.21412001E-09,-1.90002890E-13,-1.14263932E+04]#c2h6
c3h8_coeff_l=[0.93355381E+00,0.26424579E-01,0.61059727E-05,-0.21977499E-07,0.95149253E-11,-0.13958520E+05]
o2_coeff_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03]
n2_coeff_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04]
n2_coeff_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04]
co2_coeff_h=[ 3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04]
def f(T):
T_std=298.15
h_ch4_r=h(T_std,ch4_coeff_l) #per mol basis i.e j/mol
h_c2h6_r=h(T_std,c2h6_coeff_l)
h_c3h8_r=h(T_std,c3h8_coeff_l)
h_o2_r=h(T_std,o2_coeff_l)
h_n2_r=h(T_std,n2_coeff_l)
if x==1:
h_cxhy_r=h_ch4_r
else:
if x==2:
h_cxhy_r=h_c2h6_r
else:
h_cxhy_r=h_c3h8_r
h_reactants=x*h_cxhy_r + ((3*x+1)/2)*(h_o2_r + 3.76*h_n2_r)
h_n2_p=h(T,n2_coeff_h)
h_co2_p=h(T,co2_coeff_h)
h_h2o_p=h(T,h2o_coeff_h)
h_products=(3.76*(3*x+1)/2)*h_n2_p + (x+1)*h_h2o_p + x*h_co2_p
return (h_reactants - h_products)
def fprime(T):
return (f(T+1e-6) - f(T))/1e-6
T_guess=1500
tol=1e-3
alpha=0.2
ct=0
while (abs(f(T_guess)) > tol):
T_guess=T_guess - alpha*(f(T_guess)/fprime(T_guess))
ct=ct+1
print(T_guess)
print(ct)
if x==1:
plt.plot('ch4',T_guess,'*',color='red')
else:
if x==2:
plt.plot('c2h6',T_guess,'*',color='blue')
else:
plt.plot('c3h8',T_guess,'*',color='magenta')
plt.xlabel('type of hydrocarbon')
plt.ylabel('Adiabatic flame temperature')
plt.grid('on')
plt.show()
GRAPH:
OBSERVATION:AFT for CH4 is 2325.5981278663803K , no. of iterations taken is :89
AFT for C2H6 is 2266.9318633356484, no. of iterations taken is:91
AFT for c3h8 is 2200.247641652681K,no. of iterations taken is:92
The temperature value of AFT is highest for methane, as the no, of carbon atoms increase the moles on product side also increase which result in consuming energy ans as a result the AFT lessens as the chain of carbon atom increases. So, temperature for ch4> cch6>c3h8.