Week 7 - Auto ignition using Cantera
Aim
To simulate an AutoIgnition Time for Methane in two cases and find the rate of change of molar concentration of the H2O , O2 and OH at 500 K and 1000 K with 5 bar pressure.
- Constant Temperature with varying Pressure.
- Constant Pressure with varying Temperarure.
Auto Ignition
The lowest temperature at which ignition takes place is called as Auto Ignition. It depends upon Air/Fuel composition and Temperature.
Ignition delay
The time required for ignition to take place is knowns as Ignition Delay. It depends upon temperature,pressure and mixture composition.
Ignition Time Delay = Temperature Initial + 400K.
Ignition Delay is lower at lower temperatures.
Ignition delay can be didvided into two parts.
- Mixing Period which is the time requried for atomisation and evaporation of the fuel and mixing with air.
- Interaction Period the time in which molecular interaction prepares rge mix for and initiates the combustion phase.
There are also several factors affecting Ignition delay.
- Compression Ratio
- Inlet Air Temperature
- Coolant Temperature
- Engine Speed
Case 1 Constant Temperature with varying Pressure.
""""
Calculation of Auto Ignition Time for Methane for the following condition.
Constant Tenperature with varying Pressure
"""
import cantera as ct
import numpy as np
import sys
import matplotlib.pyplot as plt
gas = ct.Solution('gri30.xml')
#Temperature in K
T = 1250
#Pressure changes from 1 atm to 5 atm
p_start = 101325
p_end = 5*101325
Pressure = np.linspace(p_start,p_end,5)
#Ignition Delay
ignition_delay = []
#Conditions for Pressure change
for P in Pressure:
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'])
time_int = T
for i in range(10000):
time +=1e-3
sim.advance(time)
states.append(r.thermo.state, time_in_ms = time*1e3, t =time)
time_id = states.T
time_id = time_id[i]
if((time_id-time_int-400)>=0):
ignition_delay.append(time)
time_int = states.T
time_int = time_int[i]
plt.figure(1)
plt.plot(states.time_in_ms,states.T)
plt.legend(['Pressure at = '+ str(P/101325) +'[atm]' for P in Pressure])
plt.xlabel('Time (ms)')
plt.ylabel('Temperature(K)')
plt.figure(2)
plt.title('Ignition Delay with varing Pressure')
plt.plot(Pressure,ignition_delay,'-*')
plt.xlabel('Pressure (Pa)')
plt.ylabel('Ignition_delay in ms')
plt.show()
From the plots we can see that as the pressure is increased the ignition delay time is decresed for the corresponding pressure values.This happens because of the pressure increase which is an factor which affects the Ignition delay.
Case 2 Constant Pressure with varying Temperarure.
""""
Calculation of Auto Ignition Time for Methane for the following condition.
Constant Pressure with varying Temperature
"""
import cantera as ct
import numpy as np
import sys
import matplotlib.pyplot as plt
gas = ct.Solution('gri30.xml')
#Temparature Changes from 950 K to 1450 K
T_start= 950
T_end = 1450
#Pressure of 5 atm. Here it is in Pascals
P = 5*101325
Temperature = np.linspace(T_start,T_end,11)
#Ignition Delay
Ignition_delay = []
#Conditions for Temperature change
for T in Temperature:
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'])
time_int = T
for i in range(10000):
time +=1e-3
sim.advance(time)
states.append(r.thermo.state, time_in_ms = time*1e3, t =time)
time_id = states.T
time_id = time_id[i]
#Ignition Delay Calcutaion
if((time_id-time_int-400)>=0):
Ignition_delay.append(time)
time_int = states.T
time_int = time_int[i]
plt.figure(1)
plt.plot(states.time_in_ms,states.T)
plt.legend(['Temperature at = '+ str(T) +'[K]'for T in Temperature])
plt.xlabel('Time (ms)')
plt.ylabel('Temperature(K)')
plt.figure(2)
plt.title('Ignition Delay with varing Temperature')
plt.plot(Temperature,Ignition_delay,'-*')
plt.xlabel('Temperature(K)')
plt.ylabel('Ignition_delay(ms)')
plt.show()
From the plots we can see that ignition delay is initial high for the lower temperatures but as the the temperature is increased the ignition delay decreases with respect to the temperature.Ignition delay decreased because the temperature is increased meaning temperature affects Ignition delay. Also you can see that at some point the ignition delay tends to be constant as the temperature increased indicating that the ignition delay cannot increase for this corresponding pressure value.
Rate of Change of Molar Concentration
"""
Observing the rate of change of molar concentration for H2O,O2 and OH.
"""
import cantera as ct
import numpy as np
import sys
import matplotlib.pyplot as plt
gas = ct.Solution('gri30.xml')
#Temperature in K
T = 1000
#Pressure in Pascals
P = 5*101325
gas.TPX = T,P,{'CH4':1,'O2':2,'N2':7.52}
r = ct.IdealGasReactor(gas)
sim = ct.ReactorNet([r])
time = 0.0
state = ct.SolutionArray(gas,extra =['time_in_ms','t'])
for n in range(10000):
time += 1e-3
sim.advance(time)
state.append(r.thermo.state, time_in_ms = time*1e3, t =time)
print(state.X[:,gas.species_index('H2O')])
print(state.X[:,gas.species_index('OH')])
print(state.X[:,gas.species_index('O2')])
plt.subplot(3,1,1)
plt.plot(state.t,state.X[:,gas.species_index('H2O')])
plt.xlabel('Time in seconds')
plt.ylabel('Mole Concentartion of H2O')
plt.subplot(3,1,2)
plt.plot(state.t,state.X[:,gas.species_index('OH')])
plt.xlabel('Time in seconds')
plt.ylabel('Mole Concentartion of OH')
plt.subplot(3,1,3)
plt.plot(state.t,state.X[:,gas.species_index('O2')])
plt.xlabel('Time in seconds')
plt.ylabel('Mole Concentartion of O2')
plt.show()
At 1000 K
At 500 K
When looking at the charts we can see that the at 1000 K the production of OH has increased at a sharper rates initially and remained constant than at the 500 K temperature.In the 500K the OH production was linear as the time progress. For the O2,molar concentartion dropped because of its high temperature but at 500K temperature the O2 concentartion remained constant because of its low temperature. As for the H2O the molar concentration is high at 1000 K which reached rapidly and in 500 K the H2O concentartion increased along with time.