Challenge

Week 3 - Adiabatic Flame Temperature calculation

Adiabatic Flame Temperature is the maximum temperature reached during the combustion under adiabatic conditions. For a constant pressure process, It is calculated by equating the enthalpies of formation for products and reactants and thus solving the root equation . For constant volume process the internal energies are equated and root equation is solved .

  • Effect of equivalence ratio on AFT

Standard equation for methane combustion is as follows

For phi<1

CH4+ (2/phi)*(O2 + 3.76*N2) = CO2 + 2*H2O + (2/phi -2) *O2 + (7.52/phi)*N2

   For phi >1

CH4+ (2/phi)*(O2 + 3.76*N2) =( 4/phi -3) CO2 + 2*H2O + (4-4/phi) *CO + (7.52/phi)*N2

For constant volume reactor the root equation will be Internal Energy (U = H – nRT), which will be solved using Newton Raphson method to calculate the AFT. Python code for calculation is given below.

import matplotlib.pyplot as plt

import math

import numpy as np

import cantera as ct

R = 8.314 #J/mol-K

def h(T,coeffs):

               a1 = coeffs[0]

               a2 = coeffs[1]

               a3 = coeffs[2]

               a4 = coeffs[3]

               a5 = coeffs[4]

               a6 = coeffs[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

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]

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_l  = [0.03298677E+02, 0.14082404E-02,-0.03963222E-04, 0.05641515E-07,-0.02444854E-10,-0.10208999E+04, 0.03950372E+02]

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,phi):

               """

               Function to calculate the difference in the enthalpy between the Reactants and the Products

               """

               Tstp =298.15 #k

               R= 8.314 #Jol/ mol-k

               h_ch4_r = h(Tstp,ch4_coeffs_l)

               h_o2_r= h(Tstp,o2_coeffs_l)

               h_n2_r = h(Tstp,n2_coeffs_l)

               h_co2_p = h(T,co2_coeffs_h)

               h_h2o_p = h(T,h2o_coeffs_h)

               h_o2_p = h(T,o2_coeffs_h)

               h_n2_p = h(T,n2_coeffs_h)

               h_co_p = h(T,co_coeffs_h)

               if phi<=1:  # Lean mixture

                              H_reactants = h_ch4_r+ (2/phi)*(h_o2_r + 3.76*h_n2_r)

                              n_reactant = 1 + (2/phi) + 3.76*(2/phi)

                              H_products = h_co2_p + (7.52/phi)*h_n2_p + 2*h_h2o_p + (2/phi-2)*h_o2_p

                              n_product = 1 + 2 + (2/phi-2) + (7.52/phi)

               else:      # Rich Mixture (phi > 1)

                              H_reactants = h_ch4_r+ (2/phi)*(h_o2_r + 3.76*h_n2_r)

                              n_reactant = 1 + (2/phi) + 3.76*(2/phi)

                              H_products = (4/phi-3)*h_co2_p + (7.52/phi)*h_n2_p + 2*h_h2o_p + (4-4/phi)*h_co_p

                              n_product = (4/phi-3) + 2 + (4-4/phi) + (7.52/phi)

               return H_products - H_reactants - R*(n_product*T -n_reactant*Tstp)

def fprime(T, phi):

               return (f(T+ 1e-6, phi)- f(T,phi))/1e-6

T_guess=1500

tol = 1e-4

alpha = 0.2

phi= np.linspace(0.5,1.5,101)

T_AFT=[]

for i in range (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])))

               T_AFT.append(T_guess)

Equivalence_ratio = phi

T_AFT_cantera= []

gas = ct.Solution('gri30.xml')

for i in range (len(phi)):

               Total_mole = 1 + 2/phi[i] +7.52/phi[i]

               moles_CH4 = 1

               moles_O2 = 2/phi[i]

               moles_N2= 7.52/phi[i]

               gas.TPX= 298.15,101325,{'CH4':1 ,'O2':moles_O2,'N2':moles_N2}

               gas.equilibrate('UV','auto')

               T_AFT_cantera.append(gas.T)

print (T_AFT_cantera)

print (T_AFT)

plt.plot(Equivalence_ratio,T_AFT,color = 'green')

plt.plot(Equivalence_ratio,T_AFT_cantera,color = 'Red')

plt.xlabel('Equivalence Ratio')

plt.ylabel('Adiabatic Flame Temperature(K)')

plt.grid()

plt.title('Effect of Equivalence ratio on the AFT')

plt.legend(['Python', 'cantera'])

plt.show()

Results

Adiabatic Flame Temperature = 2817.83 K using Python

Adiabatic Flame Temperature = 2603.31 K using Cantera

Observation:

Higher AFT using Python as in cantera more species are involved in the combustion process, thus consuming more energy which led to lower AFT. Cantera considers this loss of energy and also works on Minimization of Gibbs energy principle.

  • Constant Pressure Reactor

In the constant pressure reactor, enthalpies are equated for root equation . In this case , heat loss factor is also considered as some percentage of  LHV of the fuel which is the maximum possible heat of the fuel , is lost to the surroundings.

The effect of the percentage of this heat loss is given as follows:

import matplotlib.pyplot as plt

import math

import numpy as np

import cantera as ct

R = 8.314 #J/mol-K

LHV = 50 #MJ/kg

m_fuel = 16.04 #gram

Q_heat = LHV*m_fuel*1000

H_loss = np.linspace(0,1,21)

def h(T,coeffs):

               a1 = coeffs[0]

               a2 = coeffs[1]

               a3 = coeffs[2]

               a4 = coeffs[3]

               a5 = coeffs[4]

               a6 = coeffs[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

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]

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_l  = [0.03298677E+02, 0.14082404E-02,-0.03963222E-04, 0.05641515E-07,-0.02444854E-10,-0.10208999E+04, 0.03950372E+02]

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,H_loss):

               """

               Function to calculate the difference in the enthalpy between the Reactants and the Products

               """

               Tstp =298.15 #k

               R= 8.314 #Jol/ mol-k

               h_ch4_r = h(Tstp,ch4_coeffs_l)

               h_o2_r= h(Tstp,o2_coeffs_l)

               h_n2_r = h(Tstp,n2_coeffs_l)

               h_co2_p = h(T,co2_coeffs_h)

               h_h2o_p = h(T,h2o_coeffs_h)

               h_n2_p = h(T,n2_coeffs_h)

               H_reactants = h_ch4_r+ (2)*(h_o2_r + 3.76*h_n2_r)

               H_products = h_co2_p + (7.52)*h_n2_p + 2*h_h2o_p

               return H_products - H_reactants + (H_loss*Q_heat)

def fprime(T, H_loss):

               return (f(T+ 1e-6, H_loss)- f(T,H_loss))/1e-6

tol = 1e-3

alpha = 0.9

T_AFT=[]

for i in H_loss:

               T_guess=1500

               while (abs(f(T_guess,i))>tol):

                              T_guess = T_guess - alpha*((f(T_guess,i)/fprime(T_guess, i)))

               T_AFT.append(T_guess)

print (T_AFT)

Temp = (T_AFT[7])

print (Temp)

plt.plot(H_loss,T_AFT,color = 'green')

plt.xlabel('H_loss')

plt.ylabel('Adiabatic Flame Temperature(K)')

plt.grid()

plt.title('Variation of AFT with heat loss')

plt.show()

Results

AFT for 0.35 Heat loss factor is 1678.83

  1. Effect of C-C bond on the AFT .

import matplotlib.pyplot as plt

import math

import numpy as np

import cantera as ct

R = 8.314 #J/mol-K

def h(T,coeffs):

               a1 = coeffs[0]

               a2 = coeffs[1]

               a3 = coeffs[2]

               a4 = coeffs[3]

               a5 = coeffs[4]

               a6 = coeffs[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

c2h2_coeffs_l = [8.08681094E-01, 2.33615629E-02,-3.55171815E-05,2.80152437E-08, -8.50072974E-12, 2.64289807E+04, 1.39397051E+01 ]

c2h4_coeffs_l = [3.95920148E+00, -7.57052247E-03, 5.70990292E-05, -6.91588753E-08, 2.69884373E-11, 5.08977593E+03, 4.09733096E+00]

c2h6_coeffs_1 = [4.29142492E+00, -5.50154270E-03, 5.99438288E-05, -7.08466285E-08, 2.68685771E-11, -1.15222055E+04, 2.66682316E+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]

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_l  = [0.03298677E+02, 0.14082404E-02,-0.03963222E-04, 0.05641515E-07,-0.02444854E-10,-0.10208999E+04, 0.03950372E+02]

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]

Tstp =298.15 #k

R= 8.314 #Jol/ mol-k

H1 = h(Tstp,c2h2_coeffs_l)

H2 = h(Tstp, c2h4_coeffs_l)

H3 = h (Tstp, c2h6_coeffs_1)

H = [H1,H2,H3]

H = np.array(H)

def f(T,H):

               """

               Function to calculate the difference in the enthalpy between the Reactants and the Products

               """

               h_o2_r= h(Tstp,o2_coeffs_l)

               h_n2_r = h(Tstp,n2_coeffs_l)

               h_co2_p = h(T,co2_coeffs_h)

               h_h2o_p = h(T,h2o_coeffs_h)

               h_n2_p = h(T,n2_coeffs_h)

               if H == H1:

                              x = 2

                              y = 2

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               elif H == H2:

                              x = 2

                              y = 4

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               elif H == H3:

                              x = 2

                              y = 6

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               return H_products - H_reactants

def fprime(T, H):

               return (f(T+ 1e-6, H)- f(T,H))/1e-6

tol = 1e-3

alpha = 0.9

T_AFT=[]

T_guess=1500

for i in H:

               while (abs(f(T_guess,i))>tol):

                              T_guess = T_guess - alpha*((f(T_guess,i)/fprime(T_guess, i)))

               T_AFT.append(T_guess)

gas = ct.Solution ('gri30.xml')

gas.TPX = 298.15,101325,{'C2H2':1, 'O2':2.5, 'N2':9.4}

gas.equilibrate('HP', 'auto')

T_c2h2_cantera = gas.T

gas.TPX = 298.15,101325,{'C2H4':1, 'O2':3, 'N2':11.28}

gas.equilibrate('HP', 'auto')

T_c2h4_cantera = gas.T

gas.TPX = 298.15,101325,{'C2H6':1, 'O2':3.5, 'N2':13.16}

gas.equilibrate('HP', 'auto')

T_c2h6_cantera = gas.T

temp = (T_c2h2_cantera, T_c2h4_cantera, T_c2h6_cantera)

temp = np.array(temp)

temperature = np.append(T_AFT, temp)

print (temperature)

plt.figure()

plt.bar(['C2H2_python', 'C2H4_python','C2H6_python'], T_AFT, color = 'red')

plt.bar(['T_c2h2_cantera', 'T_c2h4_cantera', 'T_c2h6_cantera'], temp, color = 'green')

plt.ylabel('Adiabatic Flame Temperature(K)')

plt.title('Variation of AFT with Fuel type')

plt.show()

Results

AFT for Ethane =  2784 K

AFT for Ethene = 2834 K

AFT for Ethyne = 2909 K

Observations

 There is increase in AFT with multiplicity of the bond  as multiple bond has higher strength and more energy will be released when they are broken down.

  • Effect of number of carbon atoms on AFT

import matplotlib.pyplot as plt

import math

import numpy as np

import cantera as ct

R = 8.314 #J/mol-K

def h(T,coeffs):

               a1 = coeffs[0]

               a2 = coeffs[1]

               a3 = coeffs[2]

               a4 = coeffs[3]

               a5 = coeffs[4]

               a6 = coeffs[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

ch4_coeffs_l = [5.14987613E+00, -1.36709788E-02,  4.91800599E-05, -4.84743026E-08, 1.66693956E-11, -1.02466476E+04, -4.64130376E+00]

c2h6_coeffs_1 = [4.29142492E+00, -5.50154270E-03, 5.99438288E-05, -7.08466285E-08, 2.68685771E-11, -1.15222055E+04, 2.66682316E+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]

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_l  = [0.03298677E+02, 0.14082404E-02,-0.03963222E-04, 0.05641515E-07,-0.02444854E-10,-0.10208999E+04, 0.03950372E+02]

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]

Tstp =298.15 #k

R= 8.314 #Jol/ mol-k

H1 = h(Tstp,ch4_coeffs_l)

H2 = h(Tstp, c2h6_coeffs_1)

H3 = h (Tstp, c3h8_coeffs_l)

H = [H1,H2,H3]

H = np.array(H)

def f(T,H):

               """

               Function to calculate the difference in the enthalpy between the Reactants and the Products

               """

               h_o2_r= h(Tstp,o2_coeffs_l)

               h_n2_r = h(Tstp,n2_coeffs_l)

               h_co2_p = h(T,co2_coeffs_h)

               h_h2o_p = h(T,h2o_coeffs_h)

               h_n2_p = h(T,n2_coeffs_h)

               if H == H1:

                              x = 1

                              y = 4

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               elif H == H2:

                              x = 2

                              y = 6

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               elif H == H3:

                              x = 3

                              y = 8

                              a = x + (y/4)

                              H_reactants = H1 + (a)*(h_o2_r + 3.76*h_n2_r)

                              H_products = x*h_co2_p + (3.76*a)*h_n2_p + (y/2)*h_h2o_p

               return H_products - H_reactants

def fprime(T, H):

               return (f(T+ 1e-6, H)- f(T,H))/1e-6

tol = 1e-3

alpha = 0.9

T_AFT=[]

T_guess=1500

for i in H:

               while (abs(f(T_guess,i))>tol):

                              T_guess = T_guess - alpha*((f(T_guess,i)/fprime(T_guess, i)))

               T_AFT.append(T_guess)

gas = ct.Solution ('gri30.xml')

gas.TPX = 298.15,101325,{'CH4':1, 'O2':2, 'N2':7.52}

gas.equilibrate('HP', 'auto')

T_ch4_cantera = gas.T

gas.TPX = 298.15,101325,{'C2H6':1, 'O2':3.5, 'N2':13.16}

gas.equilibrate('HP', 'auto')

T_c2h6_cantera = gas.T

gas.TPX = 298.15,101325,{'C3H8':1, 'O2':5, 'N2':18.8}

gas.equilibrate('HP', 'auto')

T_c3h8_cantera = gas.T

temp = (T_ch4_cantera, T_c2h6_cantera, T_c3h8_cantera)

temp = np.array(temp)

temperature = np.append(T_AFT, temp)

print (temperature)

plt.figure()

plt.bar(['CH4_python', 'C2H6_python','C3H8_python'], T_AFT, color = 'red')

plt.bar(['T_cH4_cantera', 'T_c2h6_cantera', 'T_c3h8_cantera'], temp, color = 'green')

plt.ylabel('Adiabatic Flame Temperature(K)')

plt.title('Variation of AFT with Carbon atoms')

plt.show()

Results

 

 

AFT for Methane = 2325 K

AFT for Ethane = 2391 K

AFT for Propne = 2418 K

 

 

Observation:

The AFT increase with increase in number of carbon atoms as with increase in carbon chain the heat of combustion also increases as more bonds are broken and thus increasing the AFT.

 

 

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.