 Cantera Open-Source

# Auto Ignition using Cantera Open-Source

Objective-Simulate the Auto Ignition Time for Methane under the following conditions, (simulation time = 10 secs)

Part-1

Plot the variation of Auto Ignition time of Methane with a constant temperature of 1250K and pressure varying from 1 to 5 atm.

Plot the variation of Auto Ignition time of Methane with a constant pressure of 5 atm and temperature  varying from 950K to 1450K.

Part-2

The behavior of the graph for the rate of change of molar concentrations of the given elements “H2O, O2, OH” with respect to the time.(simulation time = 10 secs).

1. When Temperature is 1000K and pressure 5 bar

2. When Temperature is 500K and pressure 5 bar

Auto Ignition:

Auto ignition is the spontaneous ignition of a fuel and air mixture without any external source of ignition.The lowest temperature at which it spontaneously ignites is called auto ignition temperature.The time of auto ignition(Ignition delay) is very important for combustion applications such as in IC engines design.

The auto ignition time is calculated as,

TimeIgnitiondeLay=TimeInitialTemp+400K

Coding Approach:

1. A instance gas object is created from solution class and temperature,pressure and moles are set using gas.TPX function.

2. A reactor object ‘r’ is created using “IdealGasReactor” and gas object is passed to it.

3. A reactor network using “Reactornet” is created by passing the reactor to it.

4. A states array is created using SolutionArray for gas,for easy access of properties.

Pyhon Code (Part-1):

To plot the variation of Auto Ignition time of Methane with a constant pressure of 5 atm and temperature  varying from 950K to 1450K.

import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

gas =ct.Solution('gri30.cti')
#Ts=1150
P=5*101325
auto_ignition_time=[]
temp_final=[]
for Ts in range(950,1550,100):

gas.TPX= Ts,P,{'CH4':1,'O2':2,'N2':7.52}

r=ct.IdealGasReactor(gas)
sim=ct.ReactorNet([r])
time=0
states=ct.SolutionArray(gas,extra=['tim'])
for n in range(10000):
time +=1e-3
states.append(r.thermo.state,tim=time)
if (states.T[n]<=Ts+400):
t=(states.tim[n])
temp=(states.T[n])
plt.figure(1)
plt.plot(states.tim,states.T,label='Initial temperature=%s K'% Ts)
plt.title('Temperature vs time')
plt.xlabel('time(sec)')
plt.ylabel('Temperature(K)')
plt.legend()
auto_ignition_time.append(t)
temp_final.append(temp)

plt.figure(2)
plt.plot(temp_final,auto_ignition_time,'*',color='blue')
plt.plot(temp_final,auto_ignition_time)
plt.title('Ignition delay vs temperature')
plt.xlabel('Temperature(K)')
plt.ylabel('Ignition Delay(sec)')
plt.show()

Results: Variation of auto ignition time with temperature: From both the above graph we can see that with increase in initial temperature the auto ignition time is getting reduced.

Pyhon Code:

To plot the variation of Auto Ignition time of Methane with a constant temperature of 1250K and pressure varying from 1 to 5 atm.

import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

gas =ct.Solution('gri30.cti')
Ts=1250
#P=5*101325
auto_ignition_time=[]
pres_final=[]
pb=0
for Ps in range(101325,601325,100000):

gas.TPX= Ts,Ps,{'CH4':1,'O2':2,'N2':7.52}

r=ct.IdealGasReactor(gas)
sim=ct.ReactorNet([r])
time=0
pb=pb+1
states=ct.SolutionArray(gas,extra=['tim'])
for n in range(10000):
time +=1e-3
states.append(r.thermo.state,tim=time)
if (states.T[n]<=Ts+400):
t=(states.tim[n])
pres=(states.P[n])
plt.figure(1)
plt.plot(states.tim,states.T,label='Initial pressure=%d bar'% pb)
plt.title('Temperature vs time')
plt.xlabel('time(sec)')
plt.ylabel('Temperature(K)')
plt.legend()
auto_ignition_time.append(t)
pres_final.append(pres)
#plt.subplot(2,1,1)
pf=[1,2,3,4,5]
plt.figure(2)
plt.plot(pf,auto_ignition_time,'*',color='blue')
plt.plot(pf,auto_ignition_time)
plt.title('Ignition delay vs Pressure')
plt.xlabel('Pressure(bar)')
plt.ylabel('Ignition Delay(sec)')
#plt.legend()
plt.show()

Results: Variation of auto ignition time with pressure: From the above graph we can see that with increase in initial pressure the auto ignition time is getting reduced.

So we can conclude from the above observation that Ignition delay or auto ignition time is sensitive to both temperature and pressure.With increase in temperature and pressure the auto ignition time is decreased.

Pyhon Code(Part-2):

For the rate of change of molar concentrations of the given elements “H2O, O2, OH” with respect to the time.

import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

gas =ct.Solution('gri30.cti')
T=1000
P=5*101325

gas.TPX= T,P,{'CH4':1,'O2':2,'N2':7.52}

r=ct.IdealGasReactor(gas)
sim=ct.ReactorNet([r])
time=0
states=ct.SolutionArray(gas,extra=['tim'])
for n in range(10000):
time +=1e-3
states.append(r.thermo.state,tim=time)

plt.subplot(3,1,1)
plt.plot(states.tim,states.X[:,gas.species_index('H2O')])

plt.ylabel('H2O mole fraction')
plt.subplot(3,1,2)
plt.plot(states.tim,states.X[:,gas.species_index('O2')])
plt.ylabel('O2 mole fraction')
plt.subplot(3,1,3)
plt.plot(states.tim,states.X[:,gas.species_index('OH')])
plt.ylabel('OH mole fraction')
plt.xlabel('time in sec')
#plt.legend()
plt.show()

Results:

When Temperature is 1000K and pressure 5 bar The above graph shows change of molar concentrations of H2O,OH and O2 with a intial temperature of 1000 K and 5 bar pressure.

We can see that after auto-ignition or we can say that after reaction starts, there is a increase in concentration of H2O and OH ,which suggest that these species are being formed in the combustion process.

Where as the concentration of O2 decreases which suggests that O2 has been consumed during the combustion process.

When Temperature is 500K and pressure 5 bar The above graph shows change of molar concentrations of H2O,OH and O2 with a intial temperature of 500 K and 5 bar pressure.

The auto-ignition temperature of methane is around 900 K.So for the above case ignition hasn’t taken place.This can be confirmed from the O2 mole fraction graph which shows no change with time.But there is increase in H2O and OH concentration, this due to the some intermediate reactions taking place at the given condition forming some amount of these species.