Challenge

Week 3 - Adiabatic Flame Temperature calculation

OBJECTIVE

FINDING ADIABATIC FLAME TEMPERATURE IN COMBUSTION WITH VARIABLE CONDITION

  1. Constant Volume Process

2.Constant Pressure Process

  1. CH4 with variable heat loss
  2. Di-carbon atoms alkanes, alkynes, and alkenes with 0.35 (35% heat loss)
  3. variable carbon atom in alkane

Introduction

General combustion Process

Combustion is a chemical process in which a substance reacts rapidly with oxygen and gives off heat. Simply Rapid Oxidation generation

Process

During combustion, new chemical substances are created from the fuel and the oxidizer. These substances are called exhaust. Most of the exhaust comes from chemical combinations of fuel and oxygen. When a hydrogen-carbon-based fuel (like gasoline) burns, the exhaust includes water (hydrogen + oxygen) and carbon dioxide (carbon + oxygen). But the exhaust can also include chemical combinations from the oxidizer alone. If the gasoline is burned in air. which contains 21% oxygen and 78% nitrogen, the exhaust can also include nitrous oxides (NOX, nitrogen + oxygen). The temperature of the exhaust is high because of the heat that is transferred to the exhaust during combustion. Because of the high temperatures, exhaust usually occurs as a gas, but there can be liquid or solid exhaust products as well. Soot, for example, is a form of solid exhaust that occurs in some combustion processes.

Hydrocarbon+oxidizer=combustion

Reactant=product

`C_xH_y+a(O_2+3.76N_2) rarr xCO+(y/2)*H_2O+3.76aN_2`

where `a=x+y/4`

here oxidizer is air which is `O_2=21%,N_2=79%,O_2=1 mol, N2=3.76mols`

our objective to get the maximum temperature in the combustion process at study for various condition

stoichiometric

Quantity of oxidizer to complete burning a quantity of fuel

`(A/F)_(stioc)=(m_(air)/m_(fuel))_(stio)=(4.76*a)/1 (MW)_(air)/(MW)_(fuel)`

Equivalent Ratio

Indicate fuel-oxidizer mixture

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

F=Fuel, A=air

Varies from learn `phi<1``rarr` stoichiometric `phi=1` `rarr` rich mixture `phi>1`

Adiabatic Flame temperature

In the combustion process, the final temperature attain at adiabatic condition is known as an adiabatic process

The adiabatic flame temperature depends on initial pressure, Temperature & Reaction component

Where the initial condition is atmosphere condition

Temperature (T=298.15 k), Pressure (P=101325 pascal)

From 1st law of thermodynamics

`Q=W+DeltaU`

  1. Constant Volume Process (Cp)Here from name indicate volume is constant (p=c) and there is variation volume which the air volume varies with indicate varies of Equalient ratio

W=0, so `Q=DeltaU`

`H_(reactant)-H_(Product)-v(P_(STD)-P_(FINAL))=0`

Thus in molar based it has been rewritten below

`H_(reactant)-H_(Product)-(T_(STD)*N_(reactant)-T_(AFT)*N_(AFT))*R=0`

for variable volume changes the combustion Process of methane CH4

Phi varies from 0.6 to 1.4 in between 19 variables are taken

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


Lean mixture phi>1 where the fuel is lesser than air
CH4+2/phi(O2+3.76N2)=CO2+2H2O+(2/phi-2)O2+7.52/phi*N2


Rich mixture phi<1 where fuel is more so CH4 is more
CH4+2/phi(O2+3.76N2)=(4/phi-3)CO2+2H2O+(4-4*phi)co+7.52/phi*N2

PYTHON CODE

"""
Adiabatic flame temperature of Methane at different equivalent ratio at constant pressure
Program by Jagaveerapandiyan
from the first law of thermodynamics dh=dU-p*dv
stoichiometric condition phi=1
CH4+2(O2+3.76N2)=CO2+2H2O+7.52N2
Lean mixture phi>1 where the air is more 
CH4+2/phi(O2+3.76N2)=CO2+2H2O+(2/phi-2)O2+7.52/phi*N2
Rich mixture phi<1 where fuel is more so CH is more
CH4+2/phi(O2+3.76N2)=(4/phi-3)CO2+2H2O+(4-4*phi)co+7.52/phi*N2

"""

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

# Newton Iterative method
def h(T,coeffs):
	""" #function to find enthalphy
	"""
	R=8.314 #J/mol-k
	# assign 6 co-efficient
	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
# lower co-efficient rangers <Tstd> Tmax(3500 k)	
ch4_coeffs_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00] #2nd 7 coeff
o2_coeffs_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00] #2nd 7 coeff
n2_coeffs_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02] #2nd 7 coeff


# higher co-efficient at Tmax(3500 k)	
n2_coeffs_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02] #1nd 7 coeff
co2_coeffs_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00] #1nd 7 coeff
h2o_coeffs_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00] #1nd 7 coeff
o2_coeffs_h=[3.28253784E+00,1.48308754E-03,-7.57966669E-07,2.09470555E-10,-2.16717794E-14,-1.08845772E+03,5.45323129E+00] #1nd 7 coeff
co_coeffs_h=[2.71518561E+00,2.06252743E-03,-9.98825771E-07,2.30053008E-10,-2.03647716E-14,-1.41518724E+04,7.81868772E+00] #1nd 7 coeff

# defining Temperature function h
def f(T,phi):

	Tstd=298.15 #k
	R=8.134 #J/mol.k

	# reactant 
	h_ch4_r=h(Tstd,ch4_coeffs_l)
	h_o2_r=h(Tstd,o2_coeffs_l)
	h_n2_r=h(Tstd,n2_coeffs_l)

	#enthalphy
	h_reactant=h_ch4_r+((2/phi)*h_o2_r)+((7.52/phi)*h_n2_r)

	# mix moles
	n_reactant=1+(2/phi)+(7.52/phi)

	if (phi==1):
		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_product=h_co2_p+(2*h_h2o_p)+(7.52*h_n2_p)

		n_product=1+2+7.52


	#Rich mixture

	if (phi>1):
		# product
		h_co2_p=h(T,co2_coeffs_h)
		h_h2o_p=h(T,h2o_coeffs_h)
		h_co_p=h(T,co_coeffs_h)
		h_n2_p=h(T,n2_coeffs_h)

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

		n_product=(4/phi-3)+2+(4-4/phi)+(7.52/phi)
		#learn mixture 
	else:
	
		# product
		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_product=h_co2_p+(2*h_h2o_p)+((2/phi-2)*h_o2_p)+((7.52/phi)*h_n2_p)
		n_product=1+2+(2/phi-2)+(7.52/phi)
	"""
	checking of moles
	n=n_product+n_reactant
	MW_reactant=n_reactant/n
	MW_product=n_product/n
	MW=MW_reactant+MW_product
	print(MW)
	"""
	return h_reactant-h_product-(R*(n_reactant*Tstd-n_product*T))

T_guess=1300 #K
phi=np.linspace(0.6,1.4,19)
ct=0
T_NI=[]
tol=1e-6
alpha=0.5
P_NI=[]	
# slope 
def fprime(T,phi):
	return (f(T+1e-6,phi)-f(T,phi))/1e-6

# finding T
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
		
	T_NI.append(T_guess)

""" 
#solving in cantera
"""
import cantera as ca

gas= ca.Solution ('gri30.xml')
T_cantera=[]
P_cantera=[]
for i in range (0,len(phi)):
	Tstd=298.15
	# total mole=fuel(CH4)+air(2o2+7.52*N2)
	TM=1+2*phi[i]+7.52*phi[i]
	# finding molar fraction for fuel
	mf=1/TM
	mo2=(2*phi[i])/TM
	mn2=(7.52*phi[i])/TM
	gas.TPX=Tstd,101325,{'CH4':mf,'O2':mo2,'N2':mn2}
	gas.equilibrate('UV','auto')
	T_cantera.append(gas.T)
	equilent_ratio=1/phi


# observation
Taf_c=max(T_cantera)
Taf=max(T_NI)
diff=Taf-Taf_c


# plotting Temperature
plt.plot(equilent_ratio,T_NI,color='r')
plt.plot(equilent_ratio,T_cantera,color='b')
plt.xlabel('Equilent Ratio')
plt.ylabel('Temperature (k)')
plt.legend(['Python','cantera'])
plt.title('Effect of Equalent Ratio on Adiabatic Flame Temperature')
plt.grid()
plt.savefig('AFT_CV_T')
plt.show()

# conclusion 
print('maximum Temperature during combustion in constant volume obtain at stoichiometric condition phi=1')
print('Newton iterative techic T=',Taf,'k')
print('cantera T=',Taf_c,'k')
print('Difference of Temperature T=', diff,'k')

Graph

Equivalent Ratio Vs Adiabatic Flame Temperature

Observation

maximum Temperature during combustion in constant volume obtain at stoichiometric condition phi=1
Newton iterative technic T= 2804.798354290193 k
Cantera T= 2601.244993903679 k
The difference of Temperature T= 203.55336038651376 k

2.Constant Pressure

`Q=DeltaH`

`H_(Product)-H(Reactant)=0`

Lower Heat Value (LHV)

none of the water to be condensed in product

Loss can be calculated simply by Loss of heat loss percentage product of LHV

`Loss=LHV*MW_(fuel)*% Heat loss`

`MW_(fuel)`= Molecular weight of fuel

a.CH4 with variable heat loss

Heat loss varies from 0 to 100% with 10% different

PYTHON CODE

"""
Adiabatic Flame temperature of methane
at stoichiometric condition at constant Pressure process with Variable Heat 

CH4+air(2o2+7.52n2)=co2+2H2O+7.52n2
program by Jagaveerapandiyan.S
"""
import math
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

# lower co-efficient rangers  Tmax(3500 k)	
ch4_coeffs_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00] #2nd 7 coeff

o2_coeffs_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00] #2nd 7 coeff

n2_coeffs_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02] #2nd 7 coeff

# higher co-efficient at Tmax(3500 k)	
n2_coeffs_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02] #1nd 7 coeff

co2_coeffs_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00] #1nd 7 coeff

h2o_coeffs_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00] #1nd 7 coeff

o2_coeffs_h=[3.28253784E+00,1.48308754E-03,-7.57966669E-07,2.09470555E-10,-2.16717794E-14,-1.08845772E+03,5.45323129E+00] #1nd 7 coeff

def f(T,H_loss):
	"""
	finding root problem T
	"""
	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_product=h_co2_p+ (2*h_h2o_p) + (7.52*h_n2_p)
	

	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_reactant=h_ch4_r+ (2*h_o2_r) + (7.52*h_n2_r)

	LHV=50016*16
	loss=H_loss*LHV

	
	H_guess=(h_product-h_reactant+loss)
	
	return H_guess
# finding derivative for T or error T_guess to T to 1
def fprime(T,H_loss):
	return (f(T+1e-6,H_loss)-f(T,H_loss))/1e-6

T_guess=1500
tol=1e-6
ct=0
it=[]
T=[]
H_loss=np.linspace(0,1,10)
alpha=0.2
# iterative technic for finding T 
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
		it.append(ct)
	T.append(T_guess)




plt.plot(H_loss,T,color='red')
plt.title('Effect of Heat loss on Adiabatic flame temperature')
plt.xlabel('Heat loss factor')
plt.ylabel('Flame Temperature')
plt.savefig('AFT_with_Heat loss')
plt.grid()
plt.show()

# conclusion
print("Heat loss Varies From no to total with difference of 10 percentage for CH4 at stoichiometric condition ")
print("Graph clearly shows there is linear loss in Temperature when heat loss is linear")
print(T)

Graph

Heat loss Vs Flame Temperature

Observation

Heat loss Varies From no to total with a difference of 10 percentage which shown above the graph for CH4 at the stoichiometric condition

Maximum Temperature without heat loss T=2325.598 k

there is clearly shown in the graph that there is linearly drop in Temperature

b. Di-carbon atoms alkanes, alkynes, and alkenes with 0.35 (35% heat loss)

here carbon atoms are constant & Hydrogen atoms are varies

alkanes(ethane)
C2H6+3.5O2+13.16N2=2CO2+3H2O+13.16N2

alkenes (ethene)
C2H4+3O2+11.28N2=2co2+2H2O+11.28N2

alkynes (acetylene)
C2H2+2.5O2+9.4N2=2Co2+H2O+9.4N2

PYTHON CODE

"""
AFT of Di-carbon atoms with 35% Heat loss for alkanes, alkynes, and alkenes at constant Pressure process
Program by Jagaveerapandiyan

alkanes(ethane)
C2H6+3.5O2+13.16N2=2CO2+3H2O+13.16N2

alkenes (ethene)
C2H4+3O2+11.28N2=2co2+2H2O+11.28N2

alkynes (acetylene)
C2H2+2.5O2+9.4N2=2Co2+H2O+9.4N2

"""
import math
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

# lower co-efficient rangers  Tmax(3500 k)
c2h6_coeffs_l=[4.29142492E+00,-5.50154270E-03,5.99438288E-05,-7.08466285E-08,2.68685771E-11,-1.15222055E+04,2.66682316E+00] #2nd 7 coeff

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

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

o2_coeffs_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00] #2nd 7 coeff

n2_coeffs_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02] #2nd 7 coeff

# higher co-efficient at Tmax(3500 k)
co2_coeffs_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00] #1nd 7 coeff

h2o_coeffs_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00] #1nd 7 coeff

n2_coeffs_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02] #1nd 7 coeff

# alkanes (ethane)
def f(T_c2h6):
	
	Tstd=298.15
	#reactant
	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_reactant=h_c2h6_r+(3.5*h_o2_r)+(13.16*h_n2_r)

	#Product
	h_co2_p=h(T_c2h6,co2_coeffs_h)
	h_h2o_p=h(T_c2h6,h2o_coeffs_h)
	h_n2_p=h(T_c2h6,n2_coeffs_h)

	h_product=(2*h_co2_p)+(3*h_h2o_p)+(13.16*h_n2_p)

	#loss
	H_loss=0.35
	LHV=47489*30 #j/mol
	loss=H_loss*LHV

	h_guess=h_product-h_reactant+loss
	return h_guess

def fprime(T_c2h6):
	return (f(T_c2h6+1e-6)-f(T_c2h6))/1e-6

T_c2h6=[]
T_c2h4=[]
T_c2h2=[]
Tguess=1500
ct=0
tol=1e-6
alpha=1

while (abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
T_c2h6=Tguess




# alkenes (ethene)
def f(T_c2h4):
	
	Tstd=298.15
	#reactant
	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_reactant=h_c2h4_r+(3*h_o2_r)+(11.28*h_n2_r)

	#Product
	h_co2_p=h(T_c2h4,co2_coeffs_h)
	h_h2o_p=h(T_c2h4,h2o_coeffs_h)
	h_n2_p=h(T_c2h4,n2_coeffs_h)

	h_product=(2*h_co2_p)+(2*h_h2o_p)+(11.28*h_n2_p)

	#loss
	H_loss=0.35
	LHV=47161*28 #j/mol
	loss=H_loss*LHV

	h_guess=h_product-h_reactant+loss
	return h_guess

def fprime(T_c2h4):
	return (f(T_c2h4+1e-6)-f(T_c2h4))/1e-6

while (abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
T_c2h4=Tguess



# alkynes (acetylene)
def f(T_c2h2):
	
	Tstd=298.15
	#reactant
	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_reactant=h_c2h2_r+(2.5*h_o2_r)+(9.4*h_n2_r)

	#Product
	h_co2_p=h(T_c2h2,co2_coeffs_h)
	h_h2o_p=h(T_c2h2,h2o_coeffs_h)
	h_n2_p=h(T_c2h2,n2_coeffs_h)

	h_product=(2*h_co2_p)+h_h2o_p+(9.4*h_n2_p)

	#loss
	H_loss=0.35
	LHV=48225*26 #j/mol
	loss=H_loss*LHV

	h_guess=h_product-h_reactant+loss
	return h_guess

def fprime(T_c2h2):
	return (f(T_c2h2+1e-6)-f(T_c2h2))/1e-6

while (abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
T_c2h2=Tguess

Taf1=T_c2h2-T_c2h6
Taf2=T_c2h2-T_c2h4
Taf=(T_c2h6,T_c2h4,T_c2h2)

fuel=('Alkanes','Alkenes','Alkynes')

plt.bar(fuel,Taf,color='violet')
plt.title('AFT with factor of 0.35 heatloss')
plt.xlabel('Different Hydrocarbon')
plt.ylabel('Adiabatic Flame Temperature')
plt.savefig('c2_AFT with heatloss')
plt.show()
print('from this study can conclude')
print('Alkynes give maximum flame Temperature=',T_c2h2,'k')
print('Different Temperature vary with Alkynes')
print('T_Alkanes=',Taf1,'k')
print('Alkenes=',Taf2,'k')
print('from the study concluded from various Hydrocarbon with bi-carbon atoms lower hydrogen atoms higher the Temperature obtain')

Graph

Effect of Different Hydrocarbon vs Temperature

Observation

Alkynes give maximum flame Temperature= 2067.63 K
Different Temperature varies with Alkynes
T_Alkanes= 351.74 k
Alkenes= 229.03 k
from the study concluded from various Hydrocarbon with bi-carbon atoms lower hydrogen atoms higher the Temperature obtain

C. variable carbon atom in alkane

Methane
CH4+2(O2+3.76*N2)=co2+2*H2O+7.56*N2
Ethane
C2H6+3.5(O2+3.76*N2)=2*co2+3*H2O+13.16*N2
Propane
C3H8+5(O2+3.76*N2)=3*co2+4*H2O+18.8*N2

PYTHON CODE

"""
Carbon atams varation from 1 to 3
alkane stiochiometric combustion at constant Pressure Process

Methane 
CH4+2(O2+3.76*N2)=co2+2*H2O+7.56*N2
Ethane combustion 
C2H6+3.5(O2+3.76*N2)=2*co2+3*H2O+13.16*N2
Propane 
C3H8+5(O2+3.76*N2)=3*co2+4*H2O+18.8*N2
"""
import math
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

# lower co-efficient rangers  Tmax(3500 k)	
ch4_coeffs_l=[5.14987613E+00,-1.36709788E-02,4.91800599E-05,-4.84743026E-08,1.66693956E-11,-1.02466476E+04,-4.64130376E+00] #2nd 7 coeff

c2h6_coeffs_l=[4.29142492E+00,-5.50154270E-03,5.99438288E-05,-7.08466285E-08,2.68685771E-11,-1.15222055E+04,2.66682316E+00] #2nd 7 coeff

c3h8_coeff_l=[0.93355381E+00,0.26424579E-01,0.61059727E-05,-0.21977499E-07,0.95149253E-11,-0.13958520E+05,0.19201691E+02] #2nd 7 coeff

o2_coeffs_l=[3.78245636E+00,-2.99673416E-03,9.84730201E-06,-9.68129509E-09,3.24372837E-12,-1.06394356E+03,3.65767573E+00] #2nd 7 coeff

n2_coeffs_l=[0.03298677E+02,0.14082404E-02,-0.03963222E-04,0.05641515E-07,-0.02444854E-10,-0.10208999E+04,0.03950372E+02] #2nd 7 coeff


# higher co-efficient at Tmax(3500 k)
co2_coeffs_h=[3.85746029E+00,4.41437026E-03,-2.21481404E-06,5.23490188E-10,-4.72084164E-14,-4.87591660E+04,2.27163806E+00] #1nd 7 coeff

h2o_coeffs_h=[3.03399249E+00,2.17691804E-03,-1.64072518E-07,-9.70419870E-11,1.68200992E-14,-3.00042971E+04,4.96677010E+00] #1nd 7 coeff

n2_coeffs_h=[0.02926640E+02,0.14879768E-02,-0.05684760E-05,0.10097038E-09,-0.06753351E-13,-0.09227977E+04,0.05980528E+02] #1nd 7 coeff


# Methane
def f(T_ch4):
	# reactant
	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_reactant=h_ch4_r+ (2*h_o2_r) + (7.52*h_n2_r)

	# product

	h_co2_p=h(T_ch4,co2_coeffs_h)
	h_h2o_p=h(T_ch4,h2o_coeffs_h)
	h_n2_p=h(T_ch4,n2_coeffs_h)

	h_product=h_co2_p+2*h_h2o_p+7.56*h_n2_p

	return h_product-h_reactant
	
def fprime(T_ch4):
	return (f(T_ch4+1e-6)-f(T_ch4))/1e-6

ct=0

Tguess=1500
Tat=[]
alpha=1
Tat_ch4=[]
Tat_c2h6=[]
Tat_c3h8=[]
tol=1e-6

while(abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
	
Tat_ch4=Tguess


# Ethane
def f(T_c2h6):
	# reactant
	T_std=298.15
	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_reactant=h_c2h6_r+(3.5*h_o2_r)+(13.16*h_n2_r)

	# product
	h_co2_p=h(T_c2h6,co2_coeffs_h)
	h_h2o_p=h(T_c2h6,h2o_coeffs_h)
	h_n2_r=h(T_c2h6,n2_coeffs_h)

	h_product=(2*h_co2_p)+(3*h_h2o_p)+(13.16*h_n2_r)

	return h_product-h_reactant

def fprime(T_c2h6):
	return (f(T_c2h6+1e-6)-f(T_c2h6))/1e-6

while(abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
	
Tat_c2h6=Tguess


# Propane
def f(T_c3h8):

	# reactant
	Tstd=298.15
	h_c3h8_r=h(Tstd,c3h8_coeff_l)
	h_o2_r=h(Tstd,o2_coeffs_l)
	h_n2_r=h(Tstd,n2_coeffs_l)
	
	h_reactant=h_c3h8_r + (5*h_o2_r) + (18.8*h_n2_r)

	# product
	h_co2_p=h(T_c3h8,co2_coeffs_h)
	h_h2o_p=h(T_c3h8,h2o_coeffs_h)
	h_n2_p=h(T_c3h8,n2_coeffs_h)

	h_product=(3*h_co2_p) + (4*h_h2o_p) + (18.8*h_n2_p)

	return h_product-h_reactant

def fprime(T_c3h8):
	return (f(T_c3h8+1e-6)-f(T_c3h8))/1e-6

while(abs(f(Tguess))) >tol:
	Tguess=Tguess-alpha*(f(Tguess)/fprime(Tguess))
	ct=ct+1
	

Tat_c3h8=Tguess


Tat=(Tat_ch4,Tat_c2h6,Tat_c3h8)
print(Tat)

fuel=('Methane','Ethane','Propane')

# difference of temperature calculation
Tft1=(Tat_c3h8-Tat_ch4)
Tft2=(Tat_c3h8-Tat_c2h6)
print("maximum AFT obtain for propane which is T=",Tat_c3h8)
print("Difference of Temperature from Propane")
print("T_Methane=",Tft1)
print("T_Ethane=",Tft2)


plt.bar(fuel,Tat,color='orange')
plt.title('Adiabatic Flame Temperature for Alkane')
plt.xlabel('Alkane Fuel')
plt.ylabel('Adiabatic Flame Temperature')
plt.savefig('Alkane_AFT')
plt.show()

print('simply concluded from above study when Carbon atoms increase Temperature of Flame increase')

Graph

Effect of Alkane fuel Vs Adiabatic Flame Temperature

Observation

propane obtain maximum Temperature T= 2392 k

T_Methane= 72.61 k
T_Ethane= 12.25 k
the above study when Carbon atoms increase Temperature of Flame increase

conclusion

In a study of CH4
The difference between constant pressure & constant volume
2804.798-2325.598 = 479.2 k

conclusion constant volume get a higher temperature at the stoichiometric condition

for vary in Hydrogen atoms with bi-carbon atoms

lesser hydrogen atoms give a maximum temperature in acetylene T=2067.63 K

from varying carbon & hydrogen atoms

Propane where carbon atom increase by a single atom with an increase in hydrogen atoms Temperature T= 2392 k

this is due to calorific value increases by an increase in carbon atoms which imply molecular weight of Carbon is 12 times greater than of Hydrogen

Reference

https://www.grc.nasa.gov/www/k-12/airplane/combst1.html

An introduction to combustion by Stephen R.Turn

https://chemistryvce.weebly.com/alkanes-alkenes-and-alkynes.html

http://combustion.berkeley.edu/gri-mech/version30/files30/thermo30.dat

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.