Hi all,
I am trying to write a Cantera script to plot the flammability limits of a fuel-air mixture.
The script goes as below.
I have declared reservoirs for fuel and air (r_f and r_a) along with a reactor filled with H ions where the streams from fuel and air reservoirs meet. The intention is to initiate reaction with the H ions.
ignitor = ct.Solution('gri30.yaml')
ignitor.TPX = 300, ct.one_atm, 'H:1.0'
fuel_conc = 10 # fuel concentration
reac1 = ct.IdealGasReactor(ignitor) # reactor
# calculating fuel and air mass flow rates from the fuel concentration
fuel_mdot = fuel_conc/100*fuel.mean_molecular_weight
air_mdot = (1-fuel_conc/100)*air.mean_molecular_weight
mfc_fuel = ct.MassFlowController(r_f, reac1, mdot=fuel_mdot)
mfc_air = ct.MassFlowController(r_a, reac1, mdot=air_mdot)
outlet = ct.Valve(reac1, downstream, K=1.0)
sim = ct.ReactorNet([reac1])
tfinal = 6.0
tnow = 0.0
while tnow < tfinal:
tnow = sim.step()
I later define the mixture as being flammable if the resulting temperature is above the reservoir temperature
This is giving me values close to experimental values for most fuels but there are some deviations eg. CH4 upper flammability limit from the code is 17% instead of 15% and C2H6 upper flammability limit from the code is 18% instead of 13%.
Can you please take a look at this script and provide some feedback about the mistake here. Should I change the solution strategy or just some error in the code?
Thank you for your help.