Hi all,
-----SHORT Version --------------
I am having difficulties in calculating the lower flammability limit with Cantera. The gas mixture does not react in a simulated reactor, but does so under same starting conditions when using gas.equilibrate('UV'). Where is the difference?
-------LONG Version-------------
My aim is to calculate the lower flammability limit for ammonia in O2-enriched air. To test my code, I started with using the gri3.0 mechanism for the lower flammability limit for methane as there are more experimental data available to validate the calculations. However, according to my results a mixture of methane in air with equivalence ratio 1.0 is not reacting, when I simulate a reactor with this gas mixture. In contrast, the equilibrate() function shows that methane is combusted to CO2.
----------------------------------------
My code:
import cantera as ct
#parameters for reaction proceeding and explosion check
t_step = 0.5 # s
t_end = 600 # s
temp_change = 0 # K/ms
explosion_limit = 0.1 # K/ms
LEL_found = True
Explosion = False
#Set starting conditions of gas in reactor network "sim"
P = ct.one_atm
T_start = 25+273.15 # K
fuel = "CH4"
air = "O2:0.21,N2:0.79"
gas = ct.Solution('gri30.yaml')
gas.TP = T_start, P
gas.set_equivalence_ratio(phi=1.0, fuel = 'CH4:1', oxidizer=air)
print(gas())
print('{:10s} {:10s} {:10s} {:10s} {:14s}'.format('t [s]', 'T [K]', 'P [Pa]', 'temp_change [K/ms]', 'mol fuel'))
r1 = ct.Reactor(contents = gas, energy = 'on')
sim = ct.ReactorNet([r1])
states = ct.SolutionArray(gas, extra=['t'])
states.append(r1.thermo.state,t=sim.time * 1e3)
#Check for explosion by running the reactor network "sim"
while gas.T < (T_start + 1500) and sim.time < t_end:
print('{:10.3e} {:10.3f} {:10.3f} {:14.6f} {:10.3f} {:10.3f}'.format(sim.time, r1.T, r1.thermo.P, r1.thermo.u,temp_change,states.X[-1, gas.species_index('CH4')]))
sim.advance(sim.time + t_step)
states.append(r1.thermo.state, t=sim.time * 1e3)
temp_change = (states.T[-1] - states.T[-2]) / (states.t[-1] - states.t[-2]) # [K/ms]
#Check if gas mixture exploded
if temp_change > explosion_limit:
Explosion = True
LEL_found = False
break
gas.equilibrate('UV')
print(gas())
-------------------------------------
I don't understand why the Methane-Air mixture is not reacting in the reactor network as it should and does when using the equilibrate function. Is my code wrong?
Any help is very much appreciated!
Best,
Nicole
------------------------------
Cantera 2.5.1
Python 3.9
OS: Windows 10