Project

Adiabatic Flame Temperature calculation

Aim:

1. Calculate Adiabatic Flame temperature for Methane Combustion(constant volume chamber) for different equivalence ratio by writing a programme in python.

2. Compare the above results with Cantera.

3. Calculate the AFT for the constant pressure chamber with heat loss of 0.35 for alkane, alkene, and alkyne.

4. For general alkane plotting the effect of carbon atoms (1 to 3) on the AFT.

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.

Constant Volume AFT:

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

Effect of Equivalence ratio on Adiabatic Flame Temperature:

The combustion of Methane is chosen for the given problem. It is also assumed that N2 is present as an extra specie. The stoichiometric reaction is expressed as

CH4 + 2(O2 + 3.76N2) = CO2 + 2H20 + 7.52N2

The final objective in this case is to compare the trends between the python and the cantera results.

Reactions:

for phi=1 (stoichiometric mixture)
CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2

for phi<1 (lean mixture)
CH4+2/phi*(O2+3.76N2)=CO2+2H2O+(2/phi-2)*O2+(7.52/phi)*N2

for phi>1 (Rich mixture)
Ch4+2/phi*(O2+3.76*N2)=(4/phi-3)*CO2+2H2O+(4-4/phi)*CO+(7.52/phi)*N2

By using python as the platform, a simple program was written to find the Adiabatic Flame Temperature. In this case, the internal energy equilibrium is done which is the core solution. After that, the problem was solved using the Newton – Raphson Method and the Equivalence ratios and the calculated flame temperature was plotted.

\"\"\"
Calculate effect of equivalence ratio on AFT

CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2
\"\"\"
import matplotlib.pyplot as plt
import math
import numpy as np
R=8.314
def h(T,coeffs):
	\"\"\"
	Function to evaluate Enthalpy

	\"\"\"
	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

#low temperature 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]

#high temperature 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]

def f(T,phi):
	\"\"\"
	Function that represents the root finding problem
	\"\"\"

	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)

	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) + 3.76*(2/phi)

	print(h_reactants)

	return  (h_products-h_reactants-R*(n_products*T-n_reactants*Tstd))
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
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. The reason it is used for this particular problem is because the general combustion reaction has many species as products and calculating for each and every one of them is difficult. As Cantera uses many chemical and stoichiometric methods, the calculation becomes easy and effective.

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.

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,\'*\',color=\'red\')
	phi=phi+0.1
plt.xlabel(\'Equivalence ratio\')
plt.ylabel(\'Adiabatic Flame Temperature\')
plt.show()

Results:

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

A.Constant Pressure Reactor with Heat Loss:

In this case, a constant pressure system is given. In the case of a constant pressure, the enthalpies are calculated for the adiabatic flame temperature. The same process is followed after that using the Newton – Raphson method. The core solution for this case is Enthalpy of products – Enthalpy of Reactants + Lower Heating Value * Maximum possible Heat loss.

The Heat_loss is taken as a fraction of the \"maximum possible heat loss\" and is used to control the heat loss in the reaction.

CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2 + heat_loss * LHV

where, LHV is lower heating value (maximum possible heat loss)

\"\"\"
CODE TO CALCULATE THE EFFECT OF HEAT LOSS ON AFT OF CH4

CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2
\"\"\"
import matplotlib.pyplot as plt
import numpy as np

def h(T,coeffs):

	R = 8.314 #j/mol-k

	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


#low temperature 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]

#high temperature 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 = 8.314 # J/mol.k
	Tstd = 298.15
	LHV = 800950 

	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_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-3	
ct = 0
H_loss = np.linspace(0,1,10)		
alpha=1
T_ft = []

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
	T_ft.append(T_guess)

print(T_ft)


plt.plot(H_loss,T_ft)
plt.xlabel(\'Heat Loss factor\')
plt.ylabel(\'Flame Temperature(K)\')
plt.title(\'Effect of Heat loss on the Flame Temperature\')
plt.show()

Result:

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

B. Alkane, Alkene and Alkyne variants of the hydrocarbon with heat loss:

In this case, the -ane,-ene and -yne variants of the 2 chain carbon atom has been chosen and the trend of the flame temperature when the heat loss was 35% of the max heat loss was determined.

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

\"\"\"
THIS CODE IS TO CALCULATE THE AFT OF ALKANE, ALKENE, ALKYNE FOR 2 CARBON ATOM AND TO COMPARE WITH EACH OTHER

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 #j/mol-k

	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

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]
	
n2_coeffs_h  = [0.02926640E+02, 0.14879768E-02,-0.05684760E-05, 0.10097038E-09,-0.06753351E-13,-0.09227977E+04, 0.05980528E+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]
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]



\"\"\"
Alkane (ETHANE)
C2H6 + 3.5O2 +3.5 *3.76 N2 = 2CO2 + 3H2O + 3.5 *3.76 N2 + 0.35* LHV
\"\"\"  
def f_alkane(T):

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

	h_c2h6_r = h(Tstd,c2h6_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_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	

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

\"\"\" 
def f_alkene(T):

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

	h_c2h4_r = h(Tstd,c2h4_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_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



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

\"\"\"

def f_alkyne(T):

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

	h_c2h2_r = h(Tstd,c2h2_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_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-3
alpha = 1

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 a Heat Loss Factor of 0.35\')
plt.show()

Results:

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.

C.Comparison of general Alkane with H_loss = 0:

In this case, the AFT is compared with alkanes having varying number of carbon atoms with the addition of heat loss being 0.

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

\"\"\"
THIS CODE IS TO SEE THE VARIATION IN AFT WITH CHANGE IN NUMBER OF CARBON ATOM


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


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

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]
	
n2_coeffs_h  = [0.02926640E+02, 0.14879768E-02,-0.05684760E-05, 0.10097038E-09,-0.06753351E-13,-0.09227977E+04, 0.05980528E+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]
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]


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

def f_methane(T):

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

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


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

def f_ethane(T):

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

	h_c2h6_r = h(Tstd,c2h6_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_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	

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

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-3
alpha = 1

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()

Results:

From the figure we can conclude that, propane has the higher AFT than the othe two, because it consist of higher hydrogen atoms and energy required to break them is large , which in turn releases larger energy after breaking that bond. Also as the carbon atoms increases fuel mass also increases which in turn releases 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.