Project

Auto igniton using Cantera

A. INTRODUCTION & BACKGROUND:

Auto-Ignition is the lowest temperature at which ignitions takes place. Auto-Ignition delay is the time required for the ignition to start provided the required combustion conditions. Ignition delay is usually in order of micro or milloi seconds. It depends on factors such as Temperature, Pressure and quantitative composition of the air-fuel mixture. In this project, the effect of temperature, Pressure on Ignition delay for methane fuel is studied. Also, behavior of molar concentrations of various species like O2, H2O and OH at different physical conditions is studied.

B. ABOUT SIMULATION MODEL USED:

The project is carried out in Cantera coded in python. This project is done in a 0-D Reactor network. It means that the combustion reaction is carried out in a constant pressure, 0-Dimensional reactor for Ideal gases. A reactor network is an object that is used to control the reactor and one of its function is to advance the state of the reactor according to the time provided in the program.

Numerically ignition delay is calculated as the time required for the mixture to attain a temperature of `(Tunderset(i nitial)() + 400) K` [initial temperature + 400 K].

The given simulation time is 10 seconds. Hence accordingly the timestep and the number of states of required is passed to the reactor network.

C. SIMULATIONS:

C1. AUTO IGNITION DELAY FOR METHANE UNDER CONSTANT TEMP. & VARYING PRESSURE

PRESSURE: 1-5atm & TEMP: 1250K

INFERENCE:

For convenience, Ignition delay is plotted in X-axis.

  1. It is observed that the ignition delay decreases as the pressure increases. But this change is gradual over a large scale of pressure.
  2. It is because of the reason that as the pressure increases, the contents of the A/F mixture are compressed due to which heat would increase and hence favour combustion process.

C2. AUTO IGNITION DELAY FOR METHANE UNDER CONSTANT PRESSURE & VARYING TEMP.

PRESSURE: 5atm & TEMP: 950K - 1450K

INFERENCE:

For convenience, Ignition delay is plotted in X-axis.

  1. It can be observed that as temperature increases, the ignition delay reduces sharply. It is because of the obvious fact that heat favours combustion.
  2. It can also be said that, as temperature factor is more sensitive to combustion than pressure as small change in temperature brings about a large change in the ignition delay.

C3. RATE OF CHANGE OF MOLAR CONCENTRATIONS ON INCREASING TEMPERATURE:

C3A) PLOTS AT TEMP 500K & PRESSURE 5 bar

C3B) PLOTS AT TEMP 1000K & PRESSURE 5 bar

INFERENCE:

  1. The stoichiometric combustion of methane is given by `CHunderset(4)() + 2Ounderset(2)() + 7.52Nunderset(2)() iff COunderset(2)() + 2Hunderset(2)()O + 7.52Nunderset(2)()`
  2. The auto-ignition temperature of methane fuel is around 540`overset(@)()`C i.e. around 813K.
  3. In the first plot which is obtained at 500K, ignition has not happened yet. This can be evidently said from the first plot. There are no spikes in any molar concentrations w.r.t time. Also concentration of oxygen is constant because it is not being consumed due to lack of combustoion.
  4. The second plot is plotted above the auto-ignition temperature and hence combustion had taken place.
  5. Since H2O is a product of combustion, the sudden rise in its concentration followed by equilibrium is observed.
  6. Since O2 gets consumed during combustion ( it is a reactant) we can see the sudden decrease in its concentration followed by its equilibrium.
  7. OH is also a by-product of combustion is one of its elementary reactions. And hence it has a similar behavior to H2O.

SOURCE CODES:

PYTHON CODES:

1. AUTO IGNITION DELAY FOR METHANE UNDER CONSTANT TEMP. & VARYING PRESSURE

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

gas = ct.Solution(\'gri30.xml\')
T =  1250
P = ct.one_atm*np.linspace(1,5,100)	#Row vector
time_cur = []

for i in range(0,len(P)):

	#print(i)
	gas.TPX = T, P[i], {\'CH4\':1, \'O2\':2, \'N2\':7.52}

	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	
	time = 0
	temp = 0
	
	
	for n in range(1,1000000):			#timeloop which accounts for running 10 seconds			
		
		while(temp < T+400):
			time += 1e-5		#each time step increment of 1e-5 sec
			sim.advance(time)		
			temp = r.T
			#print(temp)
			
				
		time_cur.append(time*1e3)	#timestep in milliseconds
		break
	
	
print(time_cur)	
plt.plot(time_cur,(P/ct.one_atm))
plt.xlabel(\'Ignition Delay in milliseconds\')
plt.ylabel(\'Pressure in atm\')
plt.show()

2. AUTO IGNITION DELAY FOR METHANE UNDER CONSTANT PRESSURE & VARYING TEMP.

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

gas = ct.Solution(\'gri30.xml\')
T =  np.linspace(950,1450,100)	#Row vector with 5 elements
P = ct.one_atm*5 #*np.linspace(1,5,100)	#Row vector
time_cur = []

for i in range(0,len(T)):

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

	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	
	
	time = 0
	temp = 0
	
	
	for n in range(1,100000):			#timeloop which accounts for running 10 seconds
			
		
		while(temp < T[i]+400):
			time += 1e-4			#each time step increment of 1e-4 sec
			sim.advance(time)		
			temp = r.T
			#print(temp)
								
		time_cur.append(time*1e3)	#time in milliseconds
		break
	
	
print(time_cur)	
plt.plot(time_cur,T)
plt.xlabel(\'Ignition Delay in milliseconds\')
plt.ylabel(\'Temperature in K\')
plt.show()

3. RATE OF CHANGE OF MOLAR CONCENTRATIONS ON INCREASING TEMPERATURE:

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

gas = ct.Solution(\'gri30.xml\')
time_plot = np.linspace(0,1e-3*9999,9999)
T = [500,1000]
P = 5*101325
x1 = x2 = x3 = x4 = x5 = x6 = []


for i in range(0,2):
	gas.TPX = T[i], P, {\'CH4\':1, \'O2\':2, \'N2\':7.52}

	r = ct.IdealGasReactor(gas)
	sim = ct.ReactorNet([r])
	states = ct.SolutionArray(gas)
	
	temp = 0
	time = 0	
	
	if i == 0:
		for n in range(1,10000):			#timeloop which accounts for running 10 seconds			
		
			time += 1e-3		#each time step increment of 1e-5 sec
			sim.advance(time)		
			states.append(r.thermo.state)
			x1 = states.X[:,gas.species_index(\'OH\')]
			x2 = states.X[:,gas.species_index(\'O2\')]
			x3 = states.X[:,gas.species_index(\'H2O\')]
				

	else:
		for n in range(1,10000):			#timeloop which accounts for running 10 seconds			
		
			time += 1e-3		#each time step increment of 1e-3 sec
			sim.advance(time)		
			states.append(r.thermo.state)
			x4 = states.X[:,gas.species_index(\'OH\')]
			x5 = states.X[:,gas.species_index(\'O2\')]
			x6 = states.X[:,gas.species_index(\'H2O\')]
			


plt.figure()
plt.subplot(3,1,1).set_title(\'Molar Concentration of various species at 500K and 5 bar\')
plt.plot(time_plot*1000,x1)			#Time in milliseconds
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of OH\')

plt.subplot(3,1,2)
plt.plot(time_plot*1000,x2)
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of O2\')

plt.subplot(3,1,3)
plt.plot(time_plot*1000,x3)
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of H2O\')


plt.figure()
plt.subplot(3,1,1).set_title(\'Molar Concentration of various species at 1000K and 5 bar\')
plt.plot(time_plot*1000,x4)
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of OH\')

plt.subplot(3,1,2)
plt.plot(time_plot*1000,x5)
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of O2\')

plt.subplot(3,1,3)
plt.plot(time_plot*1000,x6)
plt.grid(\'on\')
plt.xlabel(\'Time in ms\')
plt.ylabel(\'Molar Concentration of H2O\')


plt.show()
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.