Challenge

 STUDY OF AUTO-IGNITION TIME OF METHANE USING CANTERA  

STUDY OF AUTO-IGNITION TIME OF METHANE USING CANTERA

l. OBJECTIVES

1. Simulate the combustion of methane and calculate its Auto-Ignition time using a reactor network code.

2. Study the variation of Auto-Ignition time of methane at constant temperature and varying pressure.

3. Study the variation of Auto-Ignition time of methane at constant pressure and varying temperature.

4. Study the rate of change in the mole fractions of `H_2O, O_2`and OH.

ll. INTRODUCTION

1. Auto-Ignition

The minimum temperature at which the products of combustion when placed in a reactor chamber, spontaneously ignites is called the Auto-Ignition temperature.

However, even when the temperature in the chamber is above the auto-ignition temperature, the combustion process does not ignite immediately and there is a small delay called the Ignition-Delay.

The auto-ignition time is the time when the temperature of the reactor is the initial temperature plus 400K

  • `Time_(Ignition Delay)= Time_(Initial Temperature) + 400`

The stoichiometric equation of the combustion of methane can be represented as follows -

  • `CH_4+2O_2+7.56N_2 rarr` Products of Combustion
    • where `CO_2, H_2O, and N_2`constitutes the major species among the products of combustion.

2. Cantera Reactor Network

A Cantera reactor network represents the simplest form of a chemical reacting system. It corresponds to an extensive thermodynamic control volume V, in which all state variables are homogeneously distributed. Transient state changes due to chemical reactions are possible, however, thermodynamic (and not chemical) equilibrium is assumed to be model the reactor class. The advance(time) function is used to advance the reactor to the specified time. This thermodynamic state of the reactor can then be extracted at each time step to study the transient behavior of the reactor. A reactor network must be created in Cantera even for a single reaction to visualize the transient behavior. For this problem, we are defining a reactor network for an ideal gas reactor whose state variables are:

  • `m[kg]:` the mass of the reactor's content.
  • `V[m^3]:` the reactor volume.
  • `T[K]:` the temperature (for describing the energy of the system).
  • `Y_k:` the mass fraction of each species.

The governing equations for the reactor are modeled as:

1. Mass Conservation

`(dm)/(dt)=sum_text(in)dotm_text(in)-sum_text(in)dotm_text(out)+dotm_text(wall)`

2. Species Conservation

`dotm_(k, text(gen))=Vdotomega_(k)W_(k)+ dotm_(wall)`

`(d(mY_k))/(dt)=sum_text(in)dotm_text(in)Y_(k, text(in))-sum_(out)dotm_(out)Y_(k)+dotm_(k,text(gen))`

3. Energy Conservation

`U=msum_(k)Y_(k)u_(k)(T)`

`(dU)/(dt)=u(dm)/dt+mc_v(dT)/dt+msum_(k)u_(k)(dY_(k))/(dt)`

lll. METHODOLOGY

The auto-ignition study of methane is performed as per the following steps:

  • Defining the initial temperature and pressure condition and the mass fractions of each species (`CH_4, O_2 and N_2`).
  • Defining the solution time (10 sec for this case)
  • Initializing the Solution Object using the initial condition
  • Defining the type of reactor (Ideal gas reactor for this case)
  • Creating the reactor network from the single reactor.
  • Initializing the thermodynamic state array of the reactor for output.
  • Advancing the reactor network through the desired time and adding the thermodynamic state at each time step to the output.
  • Post-processing the output data.

lV. EFFECT OF VARIATION IN PRESSURE AND TEMPERATURE ON THE IGNITION DELAY

CASE 1 - VARIATION IN PRESSURE AT A CONSTANT TEMPERATURE

1. PROBLEM STATEMENT

1. The temperature in the Combustion chamber is 1250 K.

2. The pressure in the combustion chamber varies from 1 atm to 5 atm.

3. The combustion process is simulated for 10 seconds.

2. CODE

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

def ign_delay(T, P, t_sim):
	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_combustion_start = T + 400
	states = ct.SolutionArray(gas, extra = ['time_in_ms','t'])

	for n in range(t_sim):
		time += 1e-3
		sim.advance(time)
		states.append(r.thermo.state, time_in_ms =  time*1e3, t = time)

		if (states.T[n] <= T_combustion_start):
			t_id = states.time_in_ms[n]

	plt.figure(1)
	plt.plot(states.t, states.T)

	plt.figure(2)
	plt.plot(states.time_in_ms, states.T)

	return t_id

	

# Variation of Auto-Ignition time with Pressure at constant Temperature

T = 1250 # k
p_i = 101325*np.linspace(1,5,9)

t_sim = 10000 # ms
time_delay = []
iter = 1
for i in range(len(p_i)):
	p = p_i[i]
	ignition_delay = ign_delay(T, p, t_sim)
	time_delay.append(ignition_delay)

	log_message = 'iteration # = {0}, Initial pressure = {1} atm, Initial Temperature = {2} k, Ignition Delay = {3} ms'.format(iter, p/101325, T, round(ignition_delay,2))
	print(log_message)
	iter = iter+1


plt.figure(1)
plt.title(" Variation Of Temperature at different instances of Time")
plt.xlabel("Time (s)")
plt.ylabel("Temperature (k)")
plt.grid(which ='major')
plt.minorticks_on()
plt.grid(which='minor', alpha = 0.2)
plt.legend(['Initial pressure ='+str(p)+ 'atm' for p in p_i/101325])

plt.figure(2)
plt.xlim(0, 25)
plt.title("Variation of Temperature at different instances of Time")
plt.xlabel("Time (ms)")
plt.ylabel("Temperature (k)")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)
plt.legend(['Initial Pressure ='+str(p)+' atm' for p in p_i])

plt.figure(3)
plt.plot(p_i,time_delay)
plt.title("Effeect of variation of initial pressure on the Ignition Delay")
plt.xlabel("Pressure (atm)")
plt.ylabel("Ignition Delay (ms)")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)

plt.show()

3.OUTPUTS

iteration # = 1, Initial pressure = 1.0 atm, Initial Temperature = 1250 k, Ignition Delay = 21.0 ms
iteration # = 2, Initial pressure = 1.5 atm, Initial Temperature = 1250 k, Ignition Delay = 15.0 ms
iteration # = 3, Initial pressure = 2.0 atm, Initial Temperature = 1250 k, Ignition Delay = 11.0 ms
iteration # = 4, Initial pressure = 2.5 atm, Initial Temperature = 1250 k, Ignition Delay = 9.0 ms
iteration # = 5, Initial pressure = 3.0 atm, Initial Temperature = 1250 k, Ignition Delay = 8.0 ms
iteration # = 6, Initial pressure = 3.5 atm, Initial Temperature = 1250 k, Ignition Delay = 7.0 ms
iteration # = 7, Initial pressure = 4.0 atm, Initial Temperature = 1250 k, Ignition Delay = 6.0 ms
iteration # = 8, Initial pressure = 4.5 atm, Initial Temperature = 1250 k, Ignition Delay = 5.0 ms
iteration # = 9, Initial pressure = 5.0 atm, Initial Temperature = 1250 k, Ignition Delay = 4.0 ms

3.1 Figure 1 -

The plot shows that as the initial pressure increases, the maximum temperature attained by the system increases.

3.2 Figure 2 -

In Figure 1, we can see that there is a sudden increase in the temperature as soon as the simulation starts. To properly observe the behavior of ignition delay at different pressures, we need to limit the x-axis to 25 milliseconds.

The plot shows that as the pressure of the system increases, the maximum temperature of the system is attained more quickly.

3.3 Figure 3 -

The plot shows that as the initial pressure of the system increases, there is a decrease in the ignition delay of the system.

CASE 2 - VARIATION IN TEMPERATURE AT A CONSTANT PRESSURE

1. PROBLEM STATEMENT

1. The pressure in the combustion chamber is 5 atm.

2. The temperature in the combustion chamber varies from 950 K to 1450 K.

3. The combustion process is simulated from 10 seconds.

2. CODE

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

def reac(T,P,t_sim):
	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_combustion_start=T+400
	states=ct.SolutionArray(gas, extra = ['time_in_ms','t'])
	
	for n in range(t_sim):
		time+=1e-3
		sim.advance(time)
		states.append(r.thermo.state, time_in_ms = time*1e3, t = time)
		
		if (states.T[n] <= T_combustion_start):
			t_id=states.time_in_ms[n]
	
	plt.figure(1)		
	plt.plot(states.time_in_ms,states.T)		
	
	return (t_id)		

# Variation of Auto-Ignition time with Pressure at constant Temperature

P=5*ct.one_atm
T_start=950
T_stop=1450
dT=100

T_init=np.arange(T_start,T_stop,dT)

t_sim=10000
time_delay = []
iter = 1

for i in range (len(T_init)):
	T = T_init[i]
	temp=reac(T,P,t_sim)
	time_delay.append(temp)
	

	log_message = 'iteration # = {0}, Initial Pressure = {1} atm, Initial Temperature = {2} K, Ignition Delay = {3} ms'.format(iter, P/101325, T, round(temp, 2))
	print(log_message)
	iter = iter + 1


plt.figure(1)
plt.title(" Variation of Temperature at different instances of Time")
plt.xlim(0,450)
plt.xlabel('Time(ms)')
plt.ylabel('Temperature(K)')
plt.grid(which ='major')
plt.minorticks_on()
plt.grid(which='minor', alpha = 0.2)
plt.legend(['T_initial ='+str(T)+ '[K]' for T in T_init])

plt.figure(2)
plt.plot(T_init,time_delay)
plt.title("Variation of Temperature at different instances of Time")
plt.xlabel('Initial Temperature(K)')
plt.ylabel('Ignition Delay(ms)')
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)

plt.show()

3. Output

iteration # = 1, Initial Pressure = 5.0 atm, Initial Temperature = 950 K, Ignition Delay = 435.0 ms
iteration # = 2, Initial Pressure = 5.0 atm, Initial Temperature = 1050 K, Ignition Delay = 80.0 ms
iteration # = 3, Initial Pressure = 5.0 atm, Initial Temperature = 1150 K, Ignition Delay = 19.0 ms
iteration # = 4, Initial Pressure = 5.0 atm, Initial Temperature = 1250 K, Ignition Delay = 5.0 ms
iteration # = 5, Initial Pressure = 5.0 atm, Initial Temperature = 1350 K, Ignition Delay = 1.0 ms

3.1 Figure 1

we can see that there is a sudden increase in the temperature as soon as the simulation starts. to properly observes the behavior of ignition delay at different pressures, we need to limit the x-axis to 450 milliseconds.

The plot shows that as the initial temperature of the system increases, the maximum temperature of the system is attained more quickly

3.2 Figure 2

The plot shows that as the initial temperature of the system increases, there is a decrease in the ignition delay of the system.

V. EFFECT OF VARIATION IN MOLE FRACTIONS OF DIFFERENT SPECIES AT DIFFERENT TEMPERATURES

CASE 1 - MOLE FRACTIONS OF SPECIES AT T = 1000 K

1. PROBLEM STATEMENT

1. The temperature in the combustion chamber is 1000 k

2. The pressure in the combustion chamber is 5 bar.

3. The combustion process is simulated for 10 seconds.

2. CODE

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

P = 5*1e5  # bar
T = 1000 # k

t_sim = 10000 # ms
time_delay = []

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_combustion_start = T + 400
states = ct.SolutionArray(gas, extra = ['time_in_ms','t'])

for n in range (t_sim):
	time += 1e-3
	sim.advance(time)
	states.append(r.thermo.state, time_in_ms = time*1e3, t = time)


	if (states.T[n] <= T_combustion_start):
		
		t_id = states.time_in_ms[n]

species_H2O = states.X[:, gas.species_index('H2O')]
species_O2 = states.X[:, gas.species_index('O2')]
species_OH = states.X[:, gas.species_index('OH')]

plt.subplot(3,1,1)
plt.plot(states.t, species_H2O, color = 'b')
plt.title("Effect of Variation Of Mole Fraction Of Species n" +"at different instances of time")
plt.xlabel("Time (s)")
plt.ylabel("Mole Fraction of Species")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)
plt.legend(['$H_2O$'])

plt.subplot(3,1,2)
plt.plot(states.t, species_O2, color = 'k')
plt.xlabel("Time (s)")
plt.ylabel("Mole Fraction of Species")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)
plt.legend(['$O_2$'])


plt.subplot(3,1,3)
plt.plot(states.t, species_OH, color = 'y')
plt.xlabel("Time (s)")
plt.ylabel("Mole Fraction of Species")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)
plt.legend(['$OH$'])

plt.show()

3. OUTPUTS

Figure 1 -

There is a sudden decrease in the mole fraction of `O_2` and a sudden increase in the mole fractions of `H_2O and OH` at the start of the combustion process. This is because the Oxygen present in the system is consumed to initiate the combustion process to give `H_2O and OH` as products.

Also, as `H_2O` is the major species in the combustion process, it has a higher mole fraction than `O_2 and OH`, which corresponds to the minor species.

CASE 2 - MOLE FRACTION OF SPECIES AT T = 500 K

1. PROBLEM STATEMENT

1. The temperature in the combustion chamber is 500 k

2. The pressure in the combustion chamber is 5 bar.

3. The combustion process is simulated for 10 seconds.

2. CODE

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

P = 5*1e5  # bar
T = 500 # k

t_sim = 10000 # ms
time_delay = []

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_combustion_start = T + 400
states = ct.SolutionArray(gas, extra = ['time_in_ms','t'])

for n in range (t_sim):
	time += 1e-3
	sim.advance(time)
	states.append(r.thermo.state, time_in_ms = time*1e3, t = time)


	if (states.T[n] <= T_combustion_start):
		
		t_id = states.time_in_ms[n]

species_H2O = states.X[:, gas.species_index('H2O')]
species_O2 = states.X[:, gas.species_index('O2')]
species_OH = states.X[:, gas.species_index('OH')]

plt.figure(1)
plt.plot(states.t, species_H2O, color = 'b')
plt.plot(states.t, species_O2, color = 'k')
plt.plot(states.t, species_OH, color = 'y')
plt.title("Effect of Variation Of Mole Fraction Of Species n" +"at different instances of time")
plt.xlabel("Time (s)")
plt.ylabel("Mole Fraction of Species")
plt.grid(which='major')
plt.minorticks_on()
plt.grid(which='minor', alpha=0.2)
plt.legend(['$H_2O$','$O_2$', '$OH$'])


plt.show()

3. OUTPUTS

Figure 1 -

In any combustion process, the initial temperature of the system should be high enough to auto-ignite the reactants. This temperature is called the auto-ignition temperature.

It can be seen in the plot, that the mole fractions of the species remain the same until the end of the process. It occurs as the temperature of the system is lower than the auto-ignition temperature, and hence the combustion of the system is not initiated.

Vl. RESULTS

1. Increasing the initial pressure of the system causes an increase in the maximum temperature attained by the system and decreases the ignition delay.

2. Increasing the initial temperature of the system causes an increase in the maximum temperature attained by the system and a decrease in the ignition delay.

3.The combustion reaction is a spontaneous process, and the change in mole fraction of reactants and products take place almost instantaneously within a few milliseconds.

4.The temperature of the system needs to be higher than the auto-ignition temperature for the combustion process to be initiated.

Vll. CONCLUSIONS

The combustion of methane has been successfully simulated and the effect of change in the initial pressure and temperature on the ignition delay has been studied. Also, the mole fractions of different species are analyzed at temperatures both higher and lower than the auto-ignition temperature

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.