Challenge

Week 3 - Adiabatic Flame Temperature calculation

Abstract: Adiabatic flame temperature for different cases was solved using Python and Cantera.

Introduction:

Adiabatic Flame Temperature:

If no heat is lost in the combustion process, then the temperature of the combustion product is called Adiabatic flame temperature.

Stoichiometric mixture:

It is the ideal ratio of air to fuel that burns all fuel with no excess air.

Equivalence ratio:

The equivalence ratio is the ratio of fuel mass to oxidizer mass divided by the same at stoichiometric mixture.

`phi=(F/A)/(F/A)_(stc)`

when `phi<1` - Lean mixture ie low proportion of fuel

`phi>1` - Rich mixture ie high proportion of fuel

Case 1: Adiabatic flame temperature variation with Equivalence ratio (In constant volume-chamber)

Here we consider methane as the fuel and we compute the adiabatic flame temperature for varying equivalence ratios under constant volume.

From the first law of thermodynamics for calculating constant volume adiabatic flame temperature we use the below relation i.e.

`U_(r)(T_(i),P_(i))=U_(pr)(T_(ad),P_f)`

By rearranging the above equation we can get

`H_(r)-H_(pr)-V(P_i-P_f)=0`

By applying ideal gas law we eliminate the PV terms:

`P_iV=sum_rN_iR_uT_i=N_rR_uT_i`

`P_fV=sum_(pr)N_fR_uT_(ad)=N_rR_uT_(ad)`

Thus we get

`(H_(pr)-H_r)-(N_(pr)-N_r)`

We used the above equation to get constant volume flame temperature using Python by using the Newton Raphson technique.

Program to find AFT of Methane for different equivalence ratios:

"""
AFT of Methane for different equivalence ratios

"""
import matplotlib.pyplot as plt
import math
import numpy

"""
Stoichiometric mixture: CH4 + 2(O2+3.72*N2)=CO2+2H2O+7.52N2
Lean Mixture: CH4+(2/phi)*(O2+3.72*N2)=CO2+2H2O+((2/phi)-2)O2+(7.52/phi)*N2
Rich Mixture: CH4+(2/phi)*(O2+3.72*N2)=((4/phi)-3)CO2+2H2O+(4-(4/phi))CO+(7.52/phi)*N2
"""
i = numpy.linspace(0.1,2.0,200)
phi=i

def h(T, co_effs):
	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

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 ]

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 ]

o2_coeffs_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):
	R=8.314
	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_co_p = h(T, co_coeffs_h)
	h_o2_p= h(T, o2_coeffs_h)
	if phi>1:
		H_products=((4/phi)-3)*h_co2_p+2*h_h2o_p+(4-(4/phi))*h_co_p+(7.52/phi)*h_n2_p
		N_products=(((4/phi)-3)+2+(4-(4/phi))+(7.52/phi))*R*T
	elif phi<1:
		H_products=h_co2_p+2*h_h2o_p+((2/phi)-2)*h_o2_p+(7.52/phi)*h_n2_p
		N_products=(1+2+((2/phi)-2)+(7.52/phi))*R*T
	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+(7.52/phi)*h_n2_r
	N_reactants = (1+(2/phi)+(7.52/phi))*R*Tstd
	return (H_products-H_reactants)-(N_products-N_reactants)

def fprime(T,phi):
	return (f(T+1e-6,phi)-f(T,phi))/1e-6
T_guess = 1500
tol = 1e-3
ct = 0
alpha = 0.2
temp=[]
for j in range(0,len(phi)):
	
	while(abs(f(T_guess,phi[j]))>tol):
		T_guess = T_guess -alpha*((f(T_guess,phi[j])/fprime(T_guess,phi[j])))
	temp.append(T_guess)


import cantera as ct
gas = ct.Solution('gri30.xml')
t_aft_ct = []
for i in range(0,len(phi)):
	n_tot=1+(2/phi[i])+(7.52/phi[i])
	n_ch4=1/n_tot
	n_o2=(2/phi[i])/n_tot
	n_n2=(7.52/phi[i])/n_tot
	gas.TPX=298.15, 101325, {'CH4':n_ch4,'O2':n_o2, 'N2':n_n2}
	gas.equilibrate('UV','auto')
	t_aft_ct.append(gas.T)

print(phi,t_aft_ct)

plt.plot(phi,temp,color='red',label='Python')
plt.plot(phi,t_aft_ct,color='blue',label='Cantera')
plt.legend()
plt.xlabel('Equivalence ratio(phi)')
plt.ylabel('Adiabatic Flame Temperature (K)')
plt.title('Adiabatic Flame Temperature Vs Equivalence ratio for CH4')
plt.grid('on')
plt.show()

Result:

The above plot is generated using python and Cantera. By observing the above plot at equivalence ratio: 1, Cantera gives temperature less than temperature value computed using python. This is because cantera includes more species in the product side.

Case 2: Adiabatic flame temperature variation with Heat loss (In constant pressure-chamber)

Here we use methane at stoichiometric mixture under constant pressure with heat loss. And we study the effect of adiabatic flame temperature with respect to heat loss from 0 to 100%.

The relation we use to calculate the heat loss is

`eta=Q/(mf*LHV)`

Where LHV is Lower Heating Value.

Program to compute constant pressure AFT with Heatloss:

"""
AFT of Methane along with heat loss
CH4+2(O2 +3.76N2)=CO2+2H20+7.52N2

"""
import matplotlib.pyplot as plt
import math
import numpy

def h(T, co_effs):
	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

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 ]

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 ]

Tstd = 298.15

LHV=h(Tstd,ch4_coeffs_l)+2*h(Tstd,o2_coeffs_l)+7.52*h(Tstd,n2_coeffs_l)-h(Tstd,co2_coeffs_h)-2*h(Tstd,h2o_coeffs_h)-7.52*h(Tstd,n2_coeffs_h)

def f(T,h_loss):
	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
	print(H_products)

	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*h_o2_r+7.52*h_n2_r
	print(H_reactants)
	return (H_products-H_reactants+(h_loss*LHV))

def fprime(T,h_loss):
	return (f(T+1e-6,h_loss)-f(T,h_loss))/1e-6

T_guess = 1500
tol = 1e-3
alpha = 0.2
h_loss=numpy.linspace(0,1,10)
temp=[]
for i in range(0,len(h_loss)):
	while(abs(f(T_guess,h_loss[i]))>tol):
		T_guess = T_guess -alpha*(f(T_guess,h_loss[i])/fprime(T_guess,h_loss[i]))
	temp.append(T_guess)
h_l=numpy.searchsorted(h_loss,0.25)
print('value is:',h_l)
t =temp[h_l]
print('value is:',t)
plt.plot(h_loss,temp,color='red')
plt.grid('on')
plt.xlabel('Heat Loss Factor')
plt.ylabel('Adiabatic Flame Temperature')
plt.title('Effect of Heat loss factor on AFT')
plt.show()

Result:

From the above plot, we can conclude that as heat loss increases Adiabatic Flame Temperature keeps on decreasing.

For heat loss factor of 0.35 we get a adiabatic flame temperature equals 1710K.

Case 3: Adiabatic flame temperature variation with respect to Alkane, Alkene, Alkyne

Here we compute the adiabatic flame temperature for Alkane, Alkene & Alkyne under stoichiometric condition.

And we compare its result.

Program to compute Adiabatic flame temperature of Alkane, Alkene & Alkyne.

"""
AFT of Alkane, Alkene & Alkyne

"""
import matplotlib.pyplot as plt
import math
import numpy

def h(T, co_effs):
	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

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]

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]

Tstd = 298.15
H1=h(Tstd,c2h6_coeffs_l)
H2=h(Tstd,c2h4_coeffs_l)
H3=h(Tstd,c2h2_coeffs_l)

H=[H1,H2,H3]

def f(T,H):
	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_r=h(Tstd,o2_coeffs_l)
	h_n2_r=h(Tstd,n2_coeffs_l)

	if H==H1:

		H_products=2*h_co2_p+3*h_h2o_p+13.6*h_n2_p

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

	elif H==H2:

		H_products=2*h_co2_p+2*h_h2o_p+11.1*h_n2_p

		H_reactants=H2+3*h_o2_r+(3*3.76)*h_n2_r

	elif H==H3:

		H_products=2*h_co2_p+h_h2o_p+9.4*h_n2_p

		H_reactants=H3+2.5*h_o2_r+(2.5*3.76)*h_n2_r

	return H_products-H_reactants

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

T_guess = 1500
tol = 1e-3
alpha = 0.2
temp=[]
for i in H:
	T_guess=1500
	R=8.314
	while(abs(f(T_guess,i))>tol):
		T_guess = T_guess -alpha*(f(T_guess,i)/fprime(T_guess,i))
	temp.append(T_guess)
plt.bar(['C2H6','C2H4','C2H2'],temp)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('AFT - Alkane, Alkene & Alkyne')
plt.show()

Result:

From the above bar chart we can see ethyne generates more energy when compared with ethane.

Case 4: Adiabatic flame temperature variation with respect to a number of Carbon atom chains

Here we take methane, ethane and propane to compute the result

"""
AFT of different carbon atom chain

"""
import matplotlib.pyplot as plt
import math
import numpy

def h(T, co_effs):
	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

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_l = [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]

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]

Tstd = 298.15
C1=h(Tstd,ch4_coeffs_l)
C2=h(Tstd,c2h6_coeffs_l)
C3=h(Tstd,c3h8_coeffs_l)

C=[C1,C2,C3]

def f(T,C):
	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_r=h(Tstd,o2_coeffs_l)
	h_n2_r=h(Tstd,n2_coeffs_l)

	if C==C1:
		x=1
		y=4
		a=x+(y/4)
		b=y/2

		H_products=x*h_co2_p+b*h_h2o_p+3.76*a*h_n2_p

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

	elif C==C2:
		x=2
		y=6
		a=x+(y/4)
		b=y/2

		H_products=x*h_co2_p+b*h_h2o_p+3.76*a*h_n2_p

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

	elif C==C3:
		x=3
		y=8
		a=x+(y/4)
		b=y/2

		H_products=x*h_co2_p+b*h_h2o_p+3.76*a*h_n2_p

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

	return H_products-H_reactants

def fprime(T,C):
	return (f(T+1e-6,C)-f(T,C))/1e-6

T_guess = 1500
tol = 1e-3
alpha = 0.2
temp=[]
for i in C:
	T_guess=1500
	R=8.314
	while(abs(f(T_guess,i))>tol):
		T_guess = T_guess -alpha*(f(T_guess,i)/fprime(T_guess,i))
	temp.append(T_guess)
plt.bar(['CH4','C2H6','C3H8'],temp)
plt.ylabel('Adiabatic Flame Temperature')
plt.title('AFT for different no. of carbon atom chains')
plt.show()

Result:

From the above plot we can conclude that as number of carbon chain increases Adiabatic flame temperature increases.

Conclusion:

1. Adiabatic flame temperature of Stoichiometric mixture is higher than the lean and rich mixture.

2. Cantera includes all the combustion products which gives a more accurate result.

3. Heat loss during combustion will impact Adiabatic flame temperature

4. Adiabatic flame temperature of Alyene is more compared to Alkene and Alkane due to more carbon bonds.

5. As the number of carbon chain increases the Adiabatic flame temperature increases.

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.