Challenge

Week 7 - Auto ignition using Cantera

AUTO IGNITION USING CANTERA

AIM: Simulate the Auto Ignition Time for Methane in the Combustion Chamber under the given conditions and We will write the Python code for this Study

Objective:-

PART A

Use the same reactor network code as shown in the video to simulate the Auto Ignition Time for Methane under the following conditions, (simulation time = 10 secs)

  • 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 B

Further, observe and print the rate of change of molar concentrations of the given elements "H2O, O2, OH" with respect to the time, (simulation time = 10 secs)

Explain the behavior of the graph for 2 cases,

  • When Temperature is 1000K and pressure 5 bar
  • When Temperature is 500K and pressure 5 bar

THEORY:-

Auto-ignition is the self-ignition of the fuel/air mixture before the spark has fired. This can be caused by hot combustion residuals or hot parts of the cylinder wall. Auto-ignition leads to high temperatures and pressures and also can be harmful to the engine. Basically, it is the Lowest temperatureare which Ignition take place.

Ignition Delay is the Time required for Ignition to take place and It depends on the Temperature, Pressure and the Equivilance ratio of the Mixture. Ignition Delay is the time interval between Spark ignition and the achieving the Self ignition temperature by Air-fuel mixture. Ignition delay is basically, due to two causes physical delay+chemical delay.

Physical delay wherein atomization, vaporization and mixing of air-fuel mixture occurs and Chemical delay attributted to pre-combustion reactions. Physical and chemical delays occurs simlutaneously. To reduce NOx the method adopted in modern engines is to reduce the Ignition delay.

Part_A Case1:

Python code by the reactor network to stimulate the Auto ignition by Cantera at constant Temperature 1250K and pressure varying from 1 atm to 5 atm.

"""
Reactor newtork to solve Zero D equations at constant Temperature
"""
import sys
import numpy as np 
import cantera as ct 
import matplotlib.pyplot as plt 

gas = ct.Solution('gri30.xml')
p_start = ct.one_atm
p_end = ct.one_atm*5
n =5
pressure = np.linspace(p_start,p_end,n)
ignition_delay = []

for i in range(1,6):
	P = ct.one_atm*i
	T = 1250
	gas.TPX = T,P,{'CH4':1,'O2':2,'N2':7.52}
	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	time = 0.0
	sim_time = 10*100
	states = ct.SolutionArray(gas,extra = ['time_in_ms','t'])
	Told = T

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

		Tnew = states.T
		Tnew = Tnew[j-1]

		if ((Tnew-Told)>=400):
			ignition_delay.append(time)

		Told = states.T
		Told = Told[j-1]

		plt.subplot(2,1,1)
		plt.plot(states.t, states.T)
		plt.xlabel('time (ms)')
		plt.ylabel('Temperature (K)')
		plt.legend(['pressure - '+str(P)+'[atm]' for P in pressure])

plt.subplot(2,1,2)
plt.plot((pressure/101325),ignition_delay,'-o')
plt.xlabel('pressure')
plt.ylabel('ignition_delay')
plt.show()

Output:

As you seen in the above plot Temperature increases propotionally to the pressure when we plot the Ignition of Methane as a fuel under the Constant temperature with varying pressure form 1atm to 5atm. In the second plot Ignition delay decreases as the pressure increases It is because According, to the Ideal gas law as the Temperature increases the Pressure is also increases As, the Pressure is directly proportional to the Temperature.

`uarr PV = nRT uarr`

As the Pressure increases the Temperature is also increases and As, the Initial temperature is high Ignition delay is low.

Case2:

Python code by the reactor network to stimulate the Auto ignition by Cantera at constant Pressure 5 atm with varying Temperature from 950K to 1450K

"""
Reactor newtork to solve Zero D equations constant Pressure
"""

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

gas = ct.Solution('gri30.xml')
T_start = 950
T_end = 1450
n = 10
Temperature = np.linspace(T_start,T_end,n)
ignition_delay = []

for i in range(len(Temperature)):
	P = ct.one_atm*5
	gas.TPX = Temperature[i],P,{'CH4':1,'O2':2,'N2':7.52}
	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	time = 0
	states = ct.SolutionArray(gas,extra = ['time_in_ms','t'])
	sim_time = 10*100
	Told = Temperature[i]

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

		Tnew = states.T
		Tnew = Tnew[j-1]

		if ((Tnew-Told)>=400):
			ignition_delay.append(time)

		Told = states.T
		Told = Told[j-1]

		plt.subplot(2,1,1)
		plt.plot(states.t, states.T)
		plt.xlabel('time (ms)')
		plt.ylabel('Temperature (K)')
		plt.legend(['Temperature -'+str(T)+'[K]' for T in Temperature])

plt.subplot(2,1,2)
plt.plot(Temperature,ignition_delay,'-o')
plt.xlabel('Temperature')
plt.ylabel('ignition_delay')
plt.show()

Output:

As we seen in the above graph Temperature is increases as the Ignition delay is decreases when we plot the Ignition of Methane as a fuel under the Constant Pressure 5atm with varying Tmperature from 950K to 1450K. Initionally, Temperature needs more time to Auto-ignite the Fuel and If the temperature is low, Ignition delay is high that is not an Ideal condition for Combustion.

In the Pressure graph Ignition delay is faster because of the high Temperature that is help in the Auto-Ignition.

Part_B:

When the Temperature is [1000K, 500K] and pressure is 5 bars We have to calculate the molar concentration of the given species. here, is the respective Code in Cantera.

Python code to observe and print the rate of change of molar concentrations of the given elements "H2O, O2, OH" with respect to the time, (simulation time = 10 secs)

"""
Code for Auto-Ignition by using Cantera and also observe the rate of change molar concentration of the Species :'H2O','O2','OH'
"""
import numpy as np 
import cantera as ct 
import matplotlib.pyplot as plt 

Temperature = [1000,500]
P = 5*101325

for T in Temperature:
	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 
	states = ct.SolutionArray(gas,extra = ['time_in_ms','t'])
	sim_time = 10*100
	states_temperature = []

	i = 1
	for i in range(sim_time+1):
		time += 1e-3
		sim.advance(time)

		states.append(r.thermo.state, time_in_ms = time*1e-3, t = time)

	#plot for H2O
	plt.subplot(3,1,1)
	plt.plot(states.t, states.X[:,gas.species_index('H2O')])
	plt.xlabel('time [ms]')
	plt.ylabel('H2O mole fraction')
	plt.title('Rate of concentration')

	#plot for O2
	plt.subplot(3,1,2)
	plt.plot(states.t, states.X[:,gas.species_index('O2')])
	plt.xlabel('time [ms]')
	plt.ylabel('O2 mole fraction')


	#plot for OH
	plt.subplot(3,1,3)
	plt.plot(states.t, states.X[:,gas.species_index('OH')])
	plt.xlabel('time [ms]')
	plt.ylabel('OH mole fraction')


	plt.show()

Output:-

Auto-Ignition at Temperature => 1000K and Pressure => 5bar :

Molar Concentration values of the given species: 'H2O', 'O2', 'OH'.

From the above graph we can conclude that In the first plot 'H2O' is less before Auto-Ignition of the Fuel Methane (CH4). When CH$ is react with oxygen it forms H2O as product and It starting very little after Ignition takes place and then increases gradually at some Point it stable this is called Equilibruim chemistry. In the Equilibruim Chemistry condition in the course of a reversible chemical reaction in which no net change in the amounts of reactants and products occurs.

In the Second plot Oxygen (O2) is decreases It is because When the air reacts with the fuel it gets oxidised and In the third plot mole fraction of 'OH' is less before Auto-ignition

Auto-ignition at Temperature => 500K and pressure => 5bar :

Molar Concentration values of the given species: 'H2O', 'O2', 'OH'.

From the above plots we can conclude that when the Temeprature is 500K the rate of mole fraction is less as compared to the rate of mole fraction when Temperature is 1000KIt is because the initial Temperature is very low. In these plots the Auto-ignition takes place very very slowly and O2 is also not properly atomised becuse of the Initial Temperature is very low.

Conslusion:-

From this Study we can conclude that the Auto-ignition is the function of Temperature, Pressure and Equivalence ratio or Mixture composition. As we can say that Auto-Ignition or Ignition Delay depends on these factors.

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.