Week 7 - Auto ignition using Cantera
AIM: To simulate the case of autoignition of methane fuel for finding the ignition delay and to study the effect of temperature and pressure on ignition delay.
Theoritical Background:
Ignition dealy
Ignition delay (ID) is defined as the time period between the start of fuel injection to the start of combustion inside the combustion chamber. The longer ignition delay can be caused by a number of factors which includes lower intake air temperature, lower boost pressure due to turbocharger lag, lower combustion chamber wall temperature and more advanced dynamic injection timing.

Autoignition
It is the lowest temperature at which ignition take place. It temperature at or above which a material will spontaneously ignite (catch fire) without an external spark or flame. Autoignition occurs when a mixture of gases or vapors ignites spontaneously with no external ignition and after reaching a certain temperature, the autoignition temperature. The autoignition temperature is not an intrinsic property of the gases or vapors but is the lowest temperature in a system where the rate of heat evolved from the gases or vapors increases beyond the rate of heat loss to the surroundings, resulting in ignition. The autoignition temperature of a mixture of gases or vapors is affected by pressure, vessel shape and volume, surface activity, contaminants, flow rate, reaction rate, droplet and mist formation, gravity, and reactant concentration.
The Stichiometric combustion equation of Methane is given as below

Part 1:
Case 1:
Auto Ignition time of Methane with a constant temperature of 1250K and pressure varying from 1 to 5 atm.
import sys
import numpy as np
import cantera as ct
import matplotlib.pyplot as plt
def reac(T,P,t_end):
gas=ct.Solution('gri30.xml')
gas.TPX=T,P,{'CH4':1,'O2':2,'N2':7.52}
r=ct.IdealGasReactor(gas)
sim=ct.ReactorNet([r])
time = 0.0
T_aft = T+400
states = ct.SolutionArray(gas,extra=['time_in_ms','t'])
for n in range(t_end):
time+=1e-3
sim.advance(time)
states.append(r.thermo.state,time_in_ms=time*1e3,t=time)
if (states.T[n]<=T_aft):
t_d=states.time_in_ms[n]
plt.figure(1)
plt.plot(states.time_in_ms,states.T)
return(t_d)
P_start = 1*101325
P_stop = 5*101325
dP = 0.5*101325
t_end = 10000
t_delay=[]
P_init = np.arange(P_start,P_stop,dP)
for i in range (len(P_init)):
P=P_init[i]
T=1250
temp=reac(T,P,t_end)
t_delay.append(temp)
plt.figure(2)
plt.plot(P_init[i]/ct.one_atm,temp,'*',color = 'blue')
plt.figure(2)
plt.plot(P_init/ct.one_atm,t_delay)
plt.xlabel('Initial Pressure(atm)')
plt.ylabel('Ignition Delay(ms)')
plt.grid()
plt.figure(1)
plt.xlabel('Time(ms)')
plt.ylabel('Temperature(K)')
plt.grid()
plt.legend(['P_initial='+str(P)+'(atm)' for P in P_init/ct.one_atm])
plt.show()

Above graph clearly indicates the auto-ignition temperatures at different pressures. It can be observed that with increase in Pressure the autoignition temperature changes marginally.

From the above graph it can be observed that as the initial pressure increases the ignition time delay reduces.
Case 2:
Auto Ignition time of Methane with a constant pressure of 5 atm and temperature varying from 950K to 1450K.
import sys
import numpy as np
import cantera as ct
import matplotlib.pyplot as plt
def reac(T,P,t_end):
gas=ct.Solution('gri30.xml')
gas.TPX=T,P,{'CH4':1,'O2':2,'N2':7.52}
r=ct.IdealGasConstPressureReactor(gas)
sim=ct.ReactorNet([r])
time = 0.0
T_aft = T+400
states = ct.SolutionArray(gas,extra=['time_in_ms','t'])
for n in range(t_end):
time+=1e-3
sim.advance(time)
states.append(r.thermo.state,time_in_ms=time*1e3,t=time)
if (states.T[n]<=T_aft):
t_d=states.time_in_ms[n]
plt.figure(1)
plt.plot(states.time_in_ms,states.T)
return(t_d)
T_start=950
T_stop=1450
dT = 100
T_init = np.arange(T_start,T_stop,dT)
P=5*ct.one_atm
t_end = 10000
t_delay = []
for i in range (len(T_init)):
temp=reac(T_init[i],P,t_end)
t_delay.append(temp)
plt.figure(2)
plt.plot(T_init[i],temp,'*',color = 'blue')
plt.figure(2)
plt.plot(T_init,t_delay)
plt.xlabel('Initial Temperature(K)')
plt.ylabel('Ignition Delay(ms)')
plt.grid()
plt.figure(1)
plt.xlabel('Time(ms)')
plt.ylabel('Temperature(K)')
plt.grid()
plt.legend(['T_initial='+str(T)+'[K]' for T in T_init])
plt.show()

Above graph clearly indicates the auto-ignition temperatures at different temperatures.

From the above graph it can be observed that as the initial temperaure increases the ignition time delay reduces.
Part 2:
Concentration of elements with time at different temperatures
import sys
import numpy as np
import cantera as ct
import matplotlib.pyplot as plt
T_init = [500,1000]
P = 5*ct.one_atm
t_end = 10000
for i in range (len(T_init)):
T=T_init[i]
gas=ct.Solution('gri30.xml')
gas.TPX=T,P,{'CH4':1,'O2':2,'N2':7.52}
r=ct.IdealGasReactor(gas)
sim=ct.ReactorNet([r])
time = 0.0
T_aft = T+400
states=ct.SolutionArray(gas,extra=['time_in_ms'])
for n in range(t_end):
time+=1e-3
sim.advance(time)
states.append(r.thermo.state,time_in_ms=time*1e3)
H2O_conc=states('H2O').x
OH_conc=states('OH').X
O2_conc=states('O2').x
plt.figure(i+1)
plt.plot(states.time_in_ms,H2O_conc)
plt.plot(states.time_in_ms,OH_conc)
plt.plot(states.time_in_ms,O2_conc)
plt.legend(['H2O','OH','O2'])
plt.grid()
plt.xlabel('Time(ms)')
plt.ylabel('Mole fraction of species')
plt.show()

The above graph shows the rate of change of different species at a temperature of 500K

The above graph shows the rate of change of different species at a temperature of 1000K
From the above graph it can be observed that the Concentration of O2 reduces and those of Products of combustion, OH increases.