Challenge

Week 7 - Auto ignition using Cantera

Auto-Ignition:-

Autoignition occurs when a mixture of gases or vapors ignites spontaneously with no external ignition source and after reaching a certain temperature, the autoignition temperature. The autoignition temperature is not an intrinsic property of the gases or vapors (Kanury 1975) but is the lowest temperature in a system where the rate of heat evolved from the gases or vapors increases beyond the rate of heat loss to the surroundings, resulting in ignition. The autoignition temperature of a mixture of gases or vapors is affected by pressure, vessel shape and volume, surface activity, contaminants, flow rate, reaction rate, droplet and mist formation, gravity, and Reactant Concentration.

Part 1:

Case 1;-Auto ignition time of methane with constant temp of 1250K and pressure varing from 1 to 5 atm

Code:-

"""
Auto ignition delay time with variation of pressure and constant temperature at 1250K
"""
import numpy as np
import matplotlib.pyplot as plt
import cantera as ct

gas = ct.Solution('gri30.xml')
Pressure=np.linspace(1,5,9)
T=1250
time_start=0
time_end=10
dt=1e-3
n=int((time_end-time_start)/dt)
auto_ignition_delay_P=[]
temp_diff_pressure=[]



for P in Pressure:
  	gas.TPX=T, P*ct.one_atm,{'CH4':1,'O2':2,'N2':7.52}
  	temperature_auto_ignition=0
  	time_auto_ignition=0
  	time=0
  	r=ct.IdealGasReactor(gas)
  	sim=ct.ReactorNet([r])
  	states =ct.SolutionArray(gas,extra=['time_in_ms','t'])
  	print('{:10s}  {:10s} {:10s}'.format('t[s]','T[k]','p[pa]'))

  	for n in range(n):
  		time+=1e-3 #time= time + 1e-3
  		sim.advance(time)
  		states.append(r.thermo.state,time_in_ms=time*1e3,t=time)
  		print('{:10.2e}{:10.3f}  {:10.3f}'.format(sim.time,r.T,r.thermo.P))
  	temp_diff_pressure.append(states.T)

  	for i in range (n):
  		T_error = states.T[i] - T -400
  		if T_error >0:
  			 temperature_auto_ignition=states.T[i]
  			 time_auto_ignition=states.time_in_ms[i]
  			 break

  	auto_ignition_delay_P.append(time_auto_ignition)

temp_diff_pressure=np.array(temp_diff_pressure)


for k in range (len(Pressure)):
  plt.figure(1)
  plt.plot(temp_diff_pressure[k])
  plt.xlabel('Number of Iteration')
  plt.ylabel('Temperature')
  plt.grid('on')
  plt.title('variation of auto ignition temperature with change in Pressure')
  plt.legend(['1 bar','1.5 bar','2 bar','2.5 bar','3 bar','3.5 bar','4 bar','4.5 bar','5 bar'])

plt.figure(2)
plt.plot(Pressure,auto_ignition_delay_P,'-*')
plt.xlabel('temperature')
plt.ylabel('Time [ms]')
plt.grid('on')
plt.title('ignition delay with change in Pressure')
print('{:10s}' '{:10s}'.format('ignition_delay[ms]','Pressure[P]'))

for j in range(len(Pressure)):
  print('{:10.2f}  {:10.2f}'.format(auto_ignition_delay_P[j],Pressure[j]))
#print(auto_ignition_delay_p[j],pressure[j])
#print(auto_ignotion_delay_p)
#print(pressure)
plt.show()

From the above table and plot , we can coclude that lower the pressure higher will be the ignition delay and higher the pressure lower will be ignotion delay . Hence in order to achieve the lower ignition delay we need to have higher pressure at constant temperature.

From above we can say that there is exponential decrease in time with respect change in pressure from 1to 2.5 that is decrease in igniation delayabout 22.5 ms to 10 ms respectively.

we can say that pressure is not suitable for combustion.

From the graph we cas say there is linerar decrese in time wrt change in pressure from 2.5 to 5 atm that is decreased in ignition delay about 10 ms to 5 ms respectively. we can say that pressure is suitable for combustion.

Case 2;-Auto ignition time of methane with constant Pressure of 5 ATM and Temperature varing from 950 to 1450K

Code:-

"""
Auto ignition delay time with variation of temperature fro 
950k to 1450K with constant pressure at 5 atm
"""
import numpy as np
import matplotlib.pyplot as plt
import cantera as ct

gas = ct.Solution('gri30.xml')
Temperature =np.linspace(950,1450,11)
p=5
time_start=0
time_end=10
dt=1e-3
n=int((time_end-time_start)/dt)
auto_ignition_delay_T=[]
temp_diff_pressure=[]



for T in Temperature:
  	gas.TPX=T, p*ct.one_atm,{'CH4':1,'O2':2,'N2':7.52}
  	temperature_auto_ignition=0
  	time_auto_ignition=0
  	time=0
  	r=ct.IdealGasReactor(gas)
  	sim=ct.ReactorNet([r])
  	states =ct.SolutionArray(gas,extra=['time_in_ms','t'])
  	print('{:10s}  {:10s} {:10s}'.format('t[s]','T[k]','p[pa]'))

  	for n in range(n):
  		time+=1e-3 #time= time + 1e-3
  		sim.advance(time)
  		states.append(r.thermo.state,time_in_ms=time*1e3,t=time)
  		print('{:10.2e}{:10.3f}  {:10.3f}'.format(sim.time,r.T,r.thermo.P))
  	temp_diff_pressure.append(states.T)

  	for i in range (n):
  		T_error = states.T[i] - T -400
  		if T_error >0:
  			 temperature_auto_ignition=states.T[i]
  			 time_auto_ignition=states.time_in_ms[i]
  			 break

  	auto_ignition_delay_T.append(time_auto_ignition)

temp_diff_pressure=np.array(temp_diff_pressure)


for k in range (len(Temperature)):
  plt.figure(1)
  plt.plot(temp_diff_pressure[k])
  plt.xlabel('Number of Iteration')
  plt.ylabel('Temperature')
  plt.grid('on')
  plt.title('variation pf auto ignition temperature with change in inlet temperature')
  plt.legend(['950 k','1000 k','1050 k','1200 k','1250 k','1300 k', '1350 k','1400 k','1450 k'])

plt.figure(2)
plt.plot(Temperature,auto_ignition_delay_T,'-*')
plt.xlabel('temperature')
plt.ylabel('Time [ms]')
plt.grid('on')
plt.title('ignition delay with change in inlet Temperature')
print('{:10s}' '{:10s}'.format('ignition_delay[ms]','Temperature[k]'))

for j in range(len(Temperature)):
  print('{:10.2f}  {:10.2f}'.format(auto_ignition_delay_T[j],Temperature[j]))
#print(auto_ignition_delay_p[j],pressure[j])
#print(auto_ignotion_delay_p)
#print(pressure)
plt.show()

Conclusion:-

All the case studied show that the auto ignition delay is in order of ms

If we increased the temp or Pressure at the initial mixture we leads a quicker combustion

The reduction in delay is exponetial

Auto ignition is more sensible to temperature the bigger the initial temp the lower auto ignition time.

Part 2:-

Case 1 :When Temperature is 1000K and pressure 5 bar

code:

"""
Auto ignition delay rate of molar concentration with respect to time
"""
import numpy as np
import matplotlib.pyplot as plt
import cantera as ct

gas = ct.Solution('gri30.xml')
Temperature =np.linspace(950,1450,11)
p=5
time_start=0
time_end=10
dt=1e-3
n=int((time_end-time_start)/dt)
auto_ignition_delay_T=[]
temp_diff_pressure=[]



for T in Temperature:
  	gas.TPX=T, p*ct.one_atm,{'CH4':1,'O2':2,'N2':7.52}
  	temperature_auto_ignition=0
  	time_auto_ignition=0
  	time=0
  	r=ct.IdealGasReactor(gas)
  	sim=ct.ReactorNet([r])
  	states =ct.SolutionArray(gas,extra=['time_in_ms','t'])
  	print('{:10s}  {:10s} {:10s}'.format('t[s]','T[k]','p[pa]'))

  	for n in range(n):
  		time+=1e-3 #time= time + 1e-3
  		sim.advance(time)
  		states.append(r.thermo.state,time_in_ms=time*1e3,t=time)
  		print('{:10.2e}{:10.3f}  {:10.3f}'.format(sim.time,r.T,r.thermo.P))
  	temp_diff_pressure.append(states.T)

  	for i in range (n):
  		T_error = states.T[i] - T -400
  		if T_error >0:
  			 temperature_auto_ignition=states.T[i]
  			 time_auto_ignition=states.time_in_ms[i]
  			 break

  	auto_ignition_delay_T.append(time_auto_ignition)

plt.figure(1)

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('Mole connentration of H2O for 10 sec of simulation')

plt.subplot(3,1,2)
plt.plot(states.t,states.X[:,gas.species_index('O2')])
plt.xlabel('Time(ms)')
plt.xlabel('O2 mole fraction')
plt.title('Mole connentration of O2 for 10sec of simulation')

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.title('Mole connentration of OH for 10 sec of simulation')

plt.tight_layout()
plt.show()


At 500K

AT 1000K

Conclusion:

Comparing to the above plot there is no variation in the mole fraction of oxygen elemets , where OH and H2O element have a very low variation. This phenamenon is coz of the sturcture of thire bonds.

The water mole fraction is increased and stabled throught the simulation time. This is coz in mathane combution water is product. The OH mole fraction is also the same as the warer. I is increase and maintain stability ,it is also the product of methane in combution.

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.