Challenge

Effect of initial pressure and temperature on auto ignition using Cantera   (Cantera, Skill Lync, Medium)

Aim:

To understand the effect of initial pressure and temperature on auto ignition time delay.

Introduction:

The fuel air mixture can automatically combust if it attains proper environment to do so. It depends on temperature, pressure, equivalence ratio of mixture, etc. The lowest temperature at a given environment settings, when the fuel air mixture ignites by itself is called auto ignition temperature. It is usually stated as (in Kelvin):

This temperature is required to supply the activation energy needed for combustion. The time between attaining the temperature and starting the combustion is called auto ignition delay. This time is usually in milliseconds. It is useful in designing the IC engine chamber.

The following report presents the effect of temperature and pressure on autoignition delay time. Second part of report shows the concentration of species for different initial temperatures. The calculations are done using Cantera. It is a open source chemical kinetics, combustion library with solver. To simulate the combustion chamber, the 'Reactor' method of cantera is used with 'ReactorNetwork' of cantera. Its a zero dimensional solver, i.e. it simulates the combustion for a point.

The report aims at performing calculations for cases:

case 1: Initial temperature at 1250 K and varying initial pressure from 1 atm to 5 atm.

case 2: Initial pressure at 5 atm and varying initial temperature from 950 K to 1450 K.

case 3: Species concentration for initial temperature of 500 K and 1000 K and initial pressure of 5 atm.

How does code work?

1) The required values of pressure and temperature are recorded in an array.

2) The temperature, pressure and mole fraction properties are passed to 'gas' object.

3) The gas object is passed to 'IdealGasReactor' which is then passed on to 'ReactorNet'

4) The 'States' variable is given the values of the solution at the start.

5) The time loop runs with timestep of 1e-3. The cantera software simulates the combustion using its own timestep till the 'time', which we pass as an argument to 'advance' method.

6) The 'States' object is then appended with new values of reactor 'r' object

7) If the temperature at any point in time, the temperature in reactor increases by 400K from initial temperature, the time and temperature values are noted down. This happens only once in outer loop. This helps is finding the auto ignition time delay.

8) Then required parameters are plotted on time scale.

Code 1: Initial temperature at 1250 K and varying initial pressure from 1 atm to 5 atm.

#Program to find the effect of pressue and temperature on ignition delay of methane air combustion
import sys
import cantera as ct
import numpy as np
import matplotlib.pyplot as plt

gas = ct.Solution('gri30.cti')

T_ini = 1250			# Kelvin
P_low = 1*101325		# Lower limit of pressure in Pa
P_high = 5*101325		# Higher limit of pressure in Pa
dP = 0.5*101325			# Step size of pressure in Pa
P_val = np.arange(P_low,P_high+dP,dP)		# Pressure values to test for

ai_T = []	# auto ignition temperature
ai_t = []	# auto ignition time


# loop for different pressure values
for i in range(0,len(P_val)):

	gas.TPX = T_ini, P_val[i], {'CH4':1,'O2':2,'N2':7.52}
	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	time = 0.0
	states = ct.SolutionArray(gas, extra = ['t_ms','t'])
	flag = 0

	for n in range(10000):
		time += 1e-3
		sim.advance(time)
		states.append(r.thermo.state, t_ms = time*1e3,t =time)
		
		if (states.T[n]>=(T_ini+400))and flag==0:
			
			ai_T.append(states.T[n])
			ai_t.append(states.t_ms[n])
			flag = 1
	plt.figure(1)
	plt.plot(states.t_ms,states.T)

plt.figure(1)
plt.xlabel('Time(ms)')
plt.ylabel('Temperature(K)')
plt.title('Temperature vs time')
plt.grid(True)
plt.minorticks_on()
plt.grid(which = 'minor', alpha = 0.2)
plt.legend(['P_ini = '+ str(P)+' (atm)' for P in P_val/101325])

plt.figure(2)
plt.plot(P_val/101325,ai_t,'-o')
plt.xlabel('Initial Pressure(atm)')
plt.ylabel('Ignition Delay(ms)')
plt.title('Effect of initial pressure of mixture on ignition delay time')
plt.grid(True)
plt.minorticks_on()
plt.grid(which = 'minor', alpha = 0.2)
plt.show()

Case 2: Initial pressure at 5 atm and varying initial temperature from 950 K to 1450 K.

#Program to find the effect of pressue and temperature on ignition delay of methane air combustion

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

gas = ct.Solution('gri30.cti')

P_ini = 5*101325			# Pa
T_low = 950			# Lower limit of Temperature in K
T_high = 1450		# Higher limit of Temperature in K
dT = 100			# Step size of Temperature in K
T_val = np.arange(T_low,T_high+dT,dT)		# Temperature values to test for

ai_T = []	# auto ignition temperature
ai_t = []	# auto ignition time


# loop for different Temperature values
for i in range(0,len(T_val)):

	gas.TPX = T_val[i], P_ini, {'CH4':1,'O2':2,'N2':7.52}
	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	time = 0.0
	states = ct.SolutionArray(gas, extra = ['t_ms','t'])
	flag = 0

	for n in range(10000):
		time += 1e-3
		sim.advance(time)
		states.append(r.thermo.state, t_ms = time*1e3,t =time)
		
		if (states.T[n]>=(T_val[i]+400))and flag==0:
			
			ai_T.append(states.T[n])
			ai_t.append(states.t_ms[n])
			flag = 1
	plt.figure(1)
	plt.plot(states.t_ms,states.T)

plt.figure(1)
plt.xlabel('Time(ms)')
plt.ylabel('Temperature(K)')
plt.title('Temperature vs time')
plt.grid(True)
plt.minorticks_on()
plt.grid(which = 'minor', alpha = 0.2)
plt.legend(['T_ini = '+ str(T)+' (K)' for T in T_val])

plt.figure(2)
plt.plot(T_val,ai_t,'-o')
plt.xlabel('Initial Temperature (K)')
plt.ylabel('Ignition Delay(ms)')
plt.title('Effect of initial temperature of mixture on ignition delay time')
plt.grid(True)
plt.minorticks_on()
plt.grid(which = 'minor', alpha = 0.2)
plt.show()

Results:

1) Case 1: Initial temperature at 1250 K and varying initial pressure from 1 atm to 5 atm:

The graph shows the temperature in reactor versus time. As the initial pressure increased from 1 atm to 5 atm, the ignition delay time reduced from 22 milliseconds to 5 milliseconds. Also, the temperature of reactor increased from 2835 K to 2965 K. These both effects happen because the pressure reduces the activation energy required for reaction to start. If we keep on increasing initial pressure, the temperature rise will happen only till a certain point.

The ignition delay time and pressure graph also shows that delay time reduces with initial pressure increase. If we keep on increasing the pressure, decrease in delay time will slow down and eventually there will be no decrease in delay time.

Case 2: Initial pressure at 5 atm and varying initial temperature from 950 K to 1450 K

As we increase the initial temperature from 950 K to 1450 K, the delay time reduces from 426 milliseconds to 1 milliseconds. This happens because at higher initial temperature the mixture will have more energy and thus would require only small time to auto ignite. At initial increaments we get higher decreaments in ignition delay time. When the initial temperature goes beyond 1150 K, the decrease in delay time becomes smaller. Same thing is explained in next plot.

Part 2 of Report:

Case3: Species concentration for initial temperature of 500 K and 1000 K and initial pressure of 5 atm

#Program to find the effect of pressue and temperature on ignition delay of methane air combustion

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

gas = ct.Solution('gri30.cti')

P = 5*101325	# Pa
T = 1000		# K

gas.TPX = T, P, {'CH4':1,'O2':2,'N2':7.52}
r = ct.IdealGasReactor(gas)
sim = ct.ReactorNet([r])
time = 0.0
states = ct.SolutionArray(gas)
Temp_s = []
time_s = []

for n in range(10000):
	time += 1e-3
	sim.advance(time)
	states.append(r.thermo.state)
	Temp_s.append(states.T[n])
	time_s.append(time)

CH4_species = states.X[:, gas.species_index('CH4')]
O2_species = states.X[:, gas.species_index('O2')]
N2_species = states.X[:, gas.species_index('N2')]
CO2_species = states.X[:, gas.species_index('CO2')]
H2O_species = states.X[:, gas.species_index('H2O')]
CO_species = states.X[:, gas.species_index('CO')]
OH_species = states.X[:, gas.species_index('OH')]


fig1,a1 = plt.subplots(2,4)
plt.suptitle('Temperature and Mole Fractions for Reaction at 1000 K and 5 bar')
a1[0,0].plot(time_s,Temp_s)
a1[0,0].set_title('Temperature')
a1[0,0].set_xlabel('Time (s)')
a1[0,0].set_ylabel('Temperature (K)')
a1[0,0].grid('both')

a1[0,1].plot(time_s,CH4_species)
a1[0,1].set_title('CH4 mole fraction')
a1[0,1].set_xlabel('Time (s)')
a1[0,1].grid('both')

a1[0,2].plot(time_s,O2_species)
a1[0,2].set_title('O2 mole fraction')
a1[0,2].set_xlabel('Time (s)')
a1[0,2].grid('both')

a1[0,3].plot(time_s,N2_species)
a1[0,3].set_title('N2 mole fraction')
a1[0,3].set_xlabel('Time (s)')
a1[0,3].grid('both')

a1[1,0].plot(time_s,CO2_species)
a1[1,0].set_title('CO2 mole fraction')
a1[1,0].set_xlabel('Time (s)')
a1[1,0].grid('both')

a1[1,1].plot(time_s,H2O_species)
a1[1,1].set_title('H2O mole fraction')
a1[1,1].set_xlabel('Time (s)')
a1[1,1].grid('both')

a1[1,2].plot(time_s,OH_species)
a1[1,2].set_title('OH mole fraction')
a1[1,2].set_xlabel('Time (s)')
a1[1,2].grid('both')

a1[1,3].plot(time_s,CO_species)
a1[1,3].set_title('CO mole fraction')
a1[1,3].set_xlabel('Time (s)')
a1[1,3].grid('both')

plt.show()

Results:

As the initial temperature was 1000K, the mixture was likely to auto ignite and it did ignite. This took the temperature to approximately 2880 K. At the same time it can be seen that CH4 mole fraction went straight to 0. The CO2 and H2O mole fractions also increased from 0. The N2 mole fraction was expected to not change but it did change and it must have formed minor species of NOx. Also, the O2 mole fraction reduced to some value but not zero. The OH and CO mole fraction were also present in the end.

The auto ignition temperature of methane at 1 atm is 873 K. The initial temperature was 500 K (i.e. It is below auto ignition temperature) and the fuel mixture would require much high amount of activation energy to auto ignite. Due to this, the temperature and other mole fraction didn't change as much. The mole fractions of species in bottom half of image show increase in mole fraction. It is very negligible but it did increase.

Conclusion:

The effect of increasing initial pressure or temperature is decrease in ignition delay time and increase in final temperature.

Below auto ignition temperature, the combustion does not take place on its own.

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.