Challenge

Week 3 - Adiabatic Flame Temperature calculation

ADIABATIC FLAME TEMPERATURE CALCULATION

AIM: To write a program in python to see the variation in the adiabatic flame temperature.

OBJECTIVE:

  • To plot the effect of Adiabatic flame temperature variation with Equivalence ratio (In constant volume-chamber)
  • To plot the Adiabatic flame temperature variation with Heat loss (In constant pressure-chamber)
  • To plot the comparison of Adiabatic flame temperature variation with respect to Alkane, Alkene, Alkyne
  • And to plot the Adiabatic flame temperature variation with respect to a number of Carbon atom chains

THEORY:

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. 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.

From the first law of thermodynamics for a closed reacting system we have,

where, and are the heat and work transferred from the system to the surroundings during the process respectively, and and are the internal energy of the reactants and products respectively. In the constant volume adiabatic flame temperature case, the volume of the system is held constant hence there is no work occurring,

and there is no heat transfer because the process is defined to be adiabatic: . As a result, the internal energy of the products is equal to the internal energy of the reactants: . Because this is a closed system, the mass of the products and reactants is constant and the first law can be written on a mass basis,

.
Enthalpy versus temperature diagram illustrating closed system calculation

In the constant pressure adiabatic flame temperature case, the pressure of the system is held constant which results in the following equation for the work,

Again there is no heat transfer occurring because the process is defined to be adiabatic: . From the first law, we find that,

Recalling the definition of enthalpy we recover: . Because this is a closed system, the mass of the products and reactants is constant and the first law can be written on a mass basis,

.

We see that the adiabatic flame temperature of the constant pressure process is lower than that of the constant volume process. This is because some of the energy released during combustion goes into changing the volume of the control system.

COMBUSTION REACTIONS FOR METHANE WITH EQUIVALENCE RATIO

The purpose of combustion is to consume fuel efficiently to produce heat. There are three components of combustion: fuel, oxygen, and heat. The most common fuel sources in a combustion process are fossil fuels; natural gas, oil, and coal. Fossil fuels are hydrocarbons; organic compounds containing carbon and hydrogen. To maximize the efficiency of combustion, it is vital to consume (or burn) all the fuel, which is known as complete combustion. The reaction for the methane is as follows

`CH_4+2(O_2+3.76N_2)rightarrowCO_2+2H_2O+7.52N_2`

The general reaction for any fuel is given by

`C_xH_y+(x+y/4)(O_2+3.76N_2)rightarrowxCO_2+y/2H_2O+(x+y/4)N2`

Now in order to estimate the effect of equivalence ratio on combustion of methane we consider the balanced reaction for lean and rich mixtures

Lean Mixture `phi<1`

`CH_+2/phi(O_2+3.76N_2)rightarrowCO_2+H_2O+(2/phi-2)O_2+7.52/phiN_2`

Rich Mixture `phi>1`

`CH_4+2/phi(O_2+3.76N_2)rightarrow(4/phi-3)CO_2+2H_2O+(4/phi-4)CO+7.52/phiN_2`

CODE IN PYTHON

Adiabatic flame temperature variation with Equivalence ratio

Writing a program in Python to plot the effect of equivalence ratio on the final adiabatic flame temperature. Comparing the results with Cantera. Assume that N2 is present.

The effect of Adiabatic Flame Temperature Vs The Equivalence Ratio [ϕ]:

"""
To calculate the effect of equivalance ratio on AFT
For the formula 
CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2
"""
import matplotlib.pyplot as plt
import math
import numpy as np
# to calculate enthalpy
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

# For low temprature coefficients
CH4_coeffs_l = [5.14987613E+00, -1.36709788E-02, 4.91800599E-05, -4.84743026E-08, 1.66693956E-11, -1.02466476E+04]
O2_coeffs_l  = [3.78245636E+00, -2.99673416E-03, 9.84730201E-06, -9.68129509E-09, 3.24372837E-12, -1.06394356E+03]
N2_coeffs_l  = [0.03298677E+02, 0.14082404E-02, -0.03963222E-04,  0.05641515E-07, -0.02444854E-10, -0.10208999E+04]

# For high temprature coefficients
N2_coeffs_h  = [0.02926640E+02, 0.14879768E-02, -0.05684760E-05, 0.10097038E-09, -0.06753351E-13, -0.09227977E+04 ]
CO2_coeffs_h = [3.85746029E+00, 4.41437026E-03, -2.21481404E-06, 5.23490188E-10, -4.72084164E-14, -4.87591660E+04]
H20_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]
O2_coeffs_h  = [3.28253784E+00, 1.48308754E-03, -7.57966669E-07, 2.09470555E-10, -2.16717794E-14, -1.08845772E+03]
CO_coeffs_h  = [2.71518561E+00, 2.06252743E-03, -9.98825771E-07, 2.30053008E-10, -2.03647716E-14, -1.41518724E+04]

# Root Finding

def f(T,phi):
	if(phi<=1):
		h_CO2_p = h(T,CO2_coeffs_h)
		h_N2_p  = h(T,N2_coeffs_h)
		h_H2O_p = h(T,H20_coeffs_h)
		h_O2_p  = h(T,O2_coeffs_h)

		h_products = h_CO2_p+(7.52/phi)*h_N2_p+2*h_H2O_p+(2/phi - 2)*h_O2_p
		n_products = 1 + 2 + 3.76*(2/phi) + (2/phi - 2)
	elif(phi>1):
		h_CO2_p = h(T,CO2_coeffs_h)
		h_N2_p  = h(T,N2_coeffs_h)
		h_H2O_p = h(T,H20_coeffs_h)
		h_CO_p  = h(T,CO_coeffs_h)

		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)

	print(h_products)

	T_std = 298.15

	h_CH4_r = h(T_std,CH4_coeffs_l)
	h_O2_r  = h(T_std,O2_coeffs_l)
	h_N2_r  = h(T_std,N2_coeffs_l)

	h_reactants = h_CH4_r+(2/phi)*h_O2_r+(7.52/phi)*h_N2_r
	n_reactants = 1 + (2/phi) + 3.76*(2/phi)

	print(h_reactants)

	return  (h_products-h_reactants-R*(n_products*T-n_reactants*T_std))

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

R = 8.314
T_guess = 1500
tol = 1e-3
ct = 0
alpha = 0.2
phi = np.linspace(0.1,1.5,20)

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]))
		ct=ct+1
	#print(T_guess,phi[i])
	plt.plot(phi[i],T_guess,'o',color ='blue')
print(T_guess)
plt.xlabel('Equivalence Ratio')	
plt.ylabel('Adiabatic Flame Temperature')
plt.show()	

RESULTS:

The range of equivalence ratios is 0.1 to 1.5 and we can observe their effect on the adiabatic flame temperature. The maximum flame temperature achieved for this combustion is 2818.07 Kelvin.

Cantera Program:

Cantera is a chemical kinetics library of Python. In Cantera, gas.TPX function is used to initialize the temperature, pressure, and the mass fractions of the species, gas.set_equivalence_ratio is used to initialize the equivalence ratios for the necessary species. Finally, the gas. equilibrate function solves the reaction and determines the flame temperature. In Cantera, gas.TPX function is used to initialize the temperature, pressure, and the mass fractions of the species, gas.set_equivalence_ratio are used to initialize the equivalence ratios for the necessary species. Finally, the gas. equilibrate function solves the reaction and determines the flame temperature.

import matplotlib.pyplot as plt
import cantera as ct
gas = ct.Solution('gri30.xml')
phi = 0.1
for i in range(0,15):
	gas.TPX = 298,101325,{'CH4':1,'O2':2/phi,'N2':7.52/phi}
	gas.set_equivalence_ratio(phi,'CH4','O2:1, N2:3.76')
	gas.equilibrate('UV','auto')
	print(phi, gas.T)
	plt.plot(phi,gas.T,'o',color='red')
	phi = phi+0.1
plt.xlabel('Equivalence ratio')
plt.ylabel('Adiabatic Flame Temperature')
plt.show()

In Cantera, the maximum flame temperature achieved is 2614.22 Kelvin. The reason the temperature is lesser than the previous one is that there are a lot of species forming after the combustion and a lot of energy is used to form them.

Adiabatic flame temperature variation with Heat loss

Considering a constant pressure reactor with heat loss. The reactor is initially set at STP conditions. The heat loss should be input in your program and must be a fraction of the "maximum possible heat loss". You will control heat loss using a variable called H_loss. For example, H_loss = 0.5 would mean a heat loss that is equal to 50% of the maximum possible heat loss.

The fuel type can be a general hydrocarbon of the form CxHy. Phi and lambda = 1.0. Find the AFT of CH4 with H_loss = 0.35

The code for the stoichiometric combustion of methane happens at constant pressure

"""
To calculate the effect of Heat Loss on AFT 
For the Formula
CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2
"""
import matplotlib.pyplot as plt
import numpy as np
R = 8.314

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

# For low temprature coefficients
CH4_coeffs_l = [5.14987613E+00, -1.36709788E-02, 4.91800599E-05, -4.84743026E-08, 1.66693956E-11, -1.02466476E+04]
O2_coeffs_l  = [3.78245636E+00, -2.99673416E-03, 9.84730201E-06, -9.68129509E-09, 3.24372837E-12, -1.06394356E+03]
N2_coeffs_l  = [0.03298677E+02, 0.14082404E-02, -0.03963222E-04,  0.05641515E-07, -0.02444854E-10, -0.10208999E+04]

# For high temprature coefficients
N2_coeffs_h  = [0.02926640E+02, 0.14879768E-02, -0.05684760E-05, 0.10097038E-09, -0.06753351E-13, -0.09227977E+04 ]
CO2_coeffs_h = [3.85746029E+00, 4.41437026E-03, -2.21481404E-06, 5.23490188E-10, -4.72084164E-14, -4.87591660E+04]
H20_coeffs_h = [3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04]

def f(T,H_loss):
	# R in J/mol.k
	R = 8.314 
	T_std = 298.15
	LHV = 800950 

	h_CH4_r = h(T_std,CH4_coeffs_l)
	h_O2_r  = h(T_std,O2_coeffs_l)
	h_N2_r  = h(T_std,N2_coeffs_l)

	h_CO2_p = h(T,CO2_coeffs_h)
	h_N2_p  = h(T,N2_coeffs_h)
	h_H2O_p = h(T,H20_coeffs_h)

	h_reactants = h_CH4_r + 2*h_O2_r + 7.52*h_N2_r
	h_products  = h_CO2_p + 2*h_H2O_p +7.52*h_N2_p

	loss = H_loss*LHV

	return h_products - h_reactants + loss

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

T_guess = 1500
tol = 1e-4
ct = 0
alpha = 1.2
H_loss = np.linspace(0,1,20)


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] ))
		ct = ct+1
	print(H_loss[i], T_guess)
	plt.plot( H_loss[i] ,T_guess, 'o', color='green')
print(ct)
print(T_guess)
plt.xlabel('Heat Loss factor')
plt.ylabel('Flame Temperature(K)')
plt.title('Effect of Heat loss on the Flame Temperature')
plt.show() 

From the result, we can conclude that heat loss increases and AFT decrease linearly.

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

For Alk-ane, -ene and -yne variants of 2 Carbon atom chain and plot a trend. The provided therm.dat might not contain data for other alkanes, alkynes, and alkenes (in that case use Cantera). Assume no heat loss.

Reactions:

Alkane (ETHANE)
C2H6 + 3.5O2 +3.5 *3.76 N2 = 2CO2 + 3H2O + 3.5 *3.76 N2 + 0.35* LHV

Alkene (ETHENE)
C2H4 + 3O2 + 3 *3.76 N2 = 2CO2 + 2H2O + 3 *3.76 N2 + 0.35* LHV

Alkyne (ETHYNE)
C2H2 + 2.5O2 + 2.5 *3.76 N2 = 2CO2 + H2O + 3 *3.76 N2 + 0.35* LHV

Code to compare the AFT of alkane alkene and alkyene

"""
 To calculate  and compare the AFT of Alkane, Alkene, Alkyne for 2 carbon atoms respectively

 For Formula

Alkane (ETHANE)
C2H6 + 3.5O2 +3.5 *3.76 N2 = 2CO2 + 3H2O + 3.5 *3.76 N2 + 0.35* LHV  

Alkene (ETHENE)
C2H4 + 3O2 + 3 *3.76 N2 = 2CO2 + 2H2O + 3 *3.76 N2 + 0.35* LHV  

Alkyne (ETHYNE)
C2H2 + 2.5O2 + 2.5 *3.76 N2  = 2CO2 + H2O + 3 *3.76 N2 + 0.35* LHV
"""
import matplotlib.pyplot as plt
import numpy as np
import math

def h(T,coeffs):

	R = 8.314 

	a1=coeffs[0]
	a2=coeffs[1]
	a3=coeffs[2]
	a4=coeffs[3]
	a5=coeffs[4]
	a6=coeffs[5]
	a7=coeffs[6]


	return (a1 + (a2*T/2) + (a3*pow(T,2)/3) + (a4*pow(T,3)/4) + (a5*pow(T,4)/5) + (a6/T))*R*T

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

# For high temprature 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]


# One : Alkane

def f_alkane(T):
	R = 8.314
	T_std = 298.15
	LHV = 1428275 #J/mole

	h_c2h6_r = h(T_std,c2h6_coeffs_l)
	h_o2_r   = h(T_std,o2_coeffs_l)
	h_n2_r   = h(T_std,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_c2h6_r + 3.5*h_o2_r + (3.5*3.76*h_n2_r)
	H_products  = 2*h_co2_p+ 3*h_h2o_p + (3.5*3.76*h_n2_p)

	return H_products - H_reactants + (0.35*LHV)

def fprime_alkane(T):
	return (f_alkane(T+1e-6) - f_alkane(T))/1e-6	

# TWO : Alkene

def f_alkene(T):

	R = 8.314
	T_std = 298.15
	LHV = 1323474 #J/mole

	h_c2h4_r = h(T_std,c2h4_coeffs_l)
	h_o2_r   = h(T_std,o2_coeffs_l)
	h_n2_r   = h(T_std,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_c2h4_r + 3*h_o2_r + (3*3.76*h_n2_r)
	H_products  = 2*h_co2_p+ 2*h_h2o_p + (3*3.76*h_n2_p)

	return H_products - H_reactants + (0.35*LHV)

def fprime_alkene(T):
	return (f_alkene(T+1e-6) - f_alkene(T))/1e-6

# THREE : Alkyne

def f_alkyne(T):

	R = 8.314
	T_std = 298.15
	LHV = 1258020 #J/mole

	h_c2h2_r = h(T_std,c2h2_coeffs_l)
	h_o2_r   = h(T_std,o2_coeffs_l)
	h_n2_r   = h(T_std,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_c2h2_r + 2.5*h_o2_r + (2.5*3.76*h_n2_r)
	H_products  = 2*h_co2_p+ h_h2o_p + (3*3.76*h_n2_p)

	return H_products - H_reactants + (0.35*LHV)

def fprime_alkyne(T):
	return (f_alkyne(T+ 1e-6) - f_alkyne(T))/1e-6

T_alkane_guess = 1500
T_alkene_guess = 1500
T_alkyne_guess = 1500

tol = 1e-4
alpha = 0.8
ct = 0

T_aft = []

#alkane

while(abs(f_alkane(T_alkane_guess)) > tol):
	T_alkane_guess = T_alkane_guess - alpha*(f_alkane(T_alkane_guess) / fprime_alkane(T_alkane_guess))

T_aft.append(T_alkane_guess)	

#alkene

while(abs(f_alkene(T_alkene_guess)) > tol):
	T_alkene_guess = T_alkene_guess - alpha*(f_alkene(T_alkene_guess) / fprime_alkene(T_alkene_guess))

T_aft.append(T_alkene_guess)

#alkyne

while(abs(f_alkyne(T_alkyne_guess)) > tol):
	T_alkyne_guess = T_alkyne_guess - alpha*(f_alkyne(T_alkyne_guess) / fprime_alkyne(T_alkyne_guess))

T_aft.append(T_alkyne_guess)

fuel=['Ethane','Ethene','Ethyne']
print(T_aft)
plt.bar(fuel,T_aft)
plt.xlabel('Type of Hydrocarbon')
plt.ylabel(' Flame Temperature(K)')
plt.title('Estimation of FT for 35 Percent of Heat Loss')
plt.show()

From the above figure, we can conclude that the AFT obtained for the C2H2, C2H4, and C2H6 are 1875 K, 1848 K, and 1721 K respectively. It shows that the AFT is decreasing for the respective species. It is decreasing because energy is needed to break the bonds for them.

Adiabatic flame temperature variation with respect to a number of Carbon atom chains.

For a general alkane, plot the effect of the number of carbon atoms (from 1 to 3) on the final temperature. Assume no heat loss.

Reactions:

Methane
CH4 + 2O2 +2 *3.76 N2 = CO2 + 2H2O + 2 *3.76 N2

Ethane
C2H6 + 3.5O2 +3.5*3.76 N2 = 2CO2 + 3H2O + 3.5 *3.76 N2

Propane
C3H8 + 5O2 + 5*3.76 N2 = 3CO2 + 4H2O + 5*3.76 N2

Code for Methane, Ethene, Ethyne and plot its value against temperature.

"""
 Variation in AFT with change in number of Carbon Atom

 For Formula

 Methane
CH4 + 2O2 +2 *3.76 N2 = CO2 + 2H2O + 2 *3.76 N2 

Ethane
C2H6 + 3.5O2 +3.5*3.76 N2 = 2CO2 + 3H2O + 3.5 *3.76 N2 

Propane
C3H8 + 5O2 + 5*3.76 N2 = 3CO2 + 4H2O + 5*3.76 N2 

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

R = 8.314 

def h(T,co_effs):

	a1 = co_effs[0]
	a2 = co_effs[1]
	a3 = co_effs[2]
	a4 = co_effs[3]
	a5 = co_effs[4]
	a6 = co_effs[5]
	a7 = co_effs[6]

	return (a1 + (a2*T/2) + (a3*pow(T,2)/3) + (a4*pow(T,3)/4) + (a5*pow(T,4)/5) + (a6/T))*R*T

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

# For high temprature 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]

# For Methane

def f_methane(T):

	R = 8.314
	T_std = 298.15
	LHV = 1428275 #J/mole

	h_ch4_r = h(T_std,ch4_coeffs_l)
	h_o2_r  = h(T_std,o2_coeffs_l)
	h_n2_r  = h(T_std,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 + 7.52*h_n2_r
	H_products  = h_co2_p+ 2*h_h2o_p + 7.52*h_n2_p

	return H_products - H_reactants

def fprime_methane(T):
	return (f_methane(T+1e-6)-f_methane(T))/1e-6

# For Ethane

def f_ethane(T):

	R = 8.314
	T_std = 298.15
	LHV = 1428275 #J/mole

	h_c2h6_r = h(T_std,c2h6_coeffs_l)
	h_o2_r   = h(T_std,o2_coeffs_l)
	h_n2_r   = h(T_std,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_c2h6_r + 3.5*h_o2_r + (3.5*3.76*h_n2_r)
	H_products  = 2*h_co2_p+ 3*h_h2o_p + (3.5*3.76*h_n2_p)

	return H_products - H_reactants

def fprime_ethane(T):
	return (f_ethane(T+1e-6)-f_ethane(T))/1e-6	

# For Propane

def f_propane(T):

	R = 8.314
	Tstd = 298.15
	LHV = 1428275 #J/mole

	h_c3h8_r = h(Tstd,c3h8_coeffs_l)
	h_o2_r   = h(Tstd,o2_coeffs_l)
	h_n2_r   = h(Tstd,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_c3h8_r + 5*h_o2_r + (5*3.76*h_n2_r)
	H_products  = 3*h_co2_p+ 4*h_h2o_p + (5*3.76*h_n2_p)

	return H_products - H_reactants

def fprime_propane(T):
	return (f_propane(T+1e-6)-f_propane(T))/1e-6

T_methane_guess = 1500
T_ethane_guess = 1500
T_propane_guess = 1500

tol = 1e-4
alpha = 0.8
ct = 0

T_aft = []

# methane

while(abs(f_methane(T_methane_guess)) > tol):
	T_methane_guess = T_methane_guess - alpha*(f_methane(T_methane_guess) / fprime_methane(T_methane_guess))

T_aft.append(T_methane_guess)	

# ethane

while(abs(f_ethane(T_ethane_guess)) > tol):
	T_ethane_guess = T_ethane_guess - alpha*(f_ethane(T_ethane_guess) / fprime_ethane(T_ethane_guess))

T_aft.append(T_ethane_guess)

# propane

while(abs(f_propane(T_propane_guess)) > tol):
	T_propane_guess = T_propane_guess - alpha*(f_propane(T_propane_guess) / fprime_propane(T_propane_guess))

T_aft.append(T_propane_guess)	
	
fuel=['Methane','Ethane','Propane']
print(T_aft)
plt.bar(fuel,T_aft)
plt.xlabel('Type of Hydrocarbon')
plt.ylabel(' Flame Temperature(K)')
plt.title('Effect of alkane carbon atoms on the AFT ')
plt.show()


From the figure, we can conclude that propane has a higher AFT than the other two, because it consists of higher hydrogen atoms, and the energy required to break them is large, which in turn releases larger energy after breaking that bond. Also as the carbon atoms increase fuel mass also increases which in turn releases a higher amount of energy after burning.

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.