Here is my code. I am using GRI-Mech for CH4/air flames. I intend to model CO2 dilution, hence the lines contemplating a dilution percentage.
I am computing an estimate of mdot using results I already have for CH4/air flames SL.
Cantera 2.3.0 with Python.
"""
A burner-stabilized premixed biogas(CH4+CO2)-air flame at atmospheric pressure.
"""
import cantera as ct
import numpy as np
# Simulation parameters
p = 1 * ct.one_atm # pressure [Pa]
Tbur = 300.0 # burner temperature [K]
Phi = 1.0 # equivalence ratio
Sl = 0.3842 # laminar flame speed [m/s]
width = 5
tol_ss = [1.0e-2, 1.0e-4] # [rtol atol] for steady-state problem
tol_ts = [1.0e-2, 1.0e-4] # [rtol atol] for time stepping
loglevel = 1 # amount of diagnostic output (0 to 5)
refine_grid = 1 # 1 to enable refinement, 0 to disable
# IdealGasMix object used to compute mixture properties
gas = ct.Solution('gri30.cti','gri30_mix') # Gri-Mech 3.0
# Definition of the premixed gas composition
fuel = 'CH4' #definition of the fuel species
perc_diluent = 5 #percentage of the diluent in the fuel mixture
diluent = 'CO2' #definition of the diluent species
m = gas.n_species
stoich_O2 = gas.n_atoms(fuel,'C')+0.25*gas.n_atoms(fuel,'H')
air_N2_O2_ratio = 3.76
ifuel = gas.species_index(fuel)
idiluent = gas.species_index(diluent)
iO2 = gas.species_index('O2')
iN2 = gas.species_index('N2')
# Creation of the reactants vector
reactants = np.zeros(m,'d')
reactants[ifuel] = Phi
reactants[idiluent] = (perc_diluent*Phi)/(100-perc_diluent)
reactants[iO2] = stoich_O2
reactants[iN2] = stoich_O2*air_N2_O2_ratio
# Calculation of the mass flow rate
rhoO2 = 1.428 # density (kg/m^3)
rhoN2 = 1.250
rhoCH4 = 0.714
rhoCO2 = 1.963
sum_reactants = sum(reactants)
rho = (rhoO2*reactants[iO2]+rhoN2*reactants[iN2]+rhoCH4*reactants[ifuel]+rhoCO2*reactants[idiluent])/sum_reactants
mdot = Sl*rho # mass flow rate (kg/m^2/s)
# Set the gas state to that of the unburned gas
gas.TPX = Tbur, p, reactants
# Flame object
f = ct.BurnerFlame(gas, width=width)
f.burner.T = Tbur
f.burner.X = reactants
f.burner.mdot = mdot
f.set_initial_guess()
f.flame.set_steady_tolerances(default=tol_ss)
f.flame.set_transient_tolerances(default=tol_ts)
f.show_solution()
f.energy_enabled = False
f.set_max_jac_age(10, 10)
f.solve(loglevel, refine_grid=False)
f.save('bg1_burner_flame.xml', 'no_energy',
'solution with the energy equation disabled')
f.set_refine_criteria(ratio=9.0, slope=0.50, curve=0.60)
f.energy_enabled = True
f.solve(loglevel, refine_grid)
f.save('bg1_burner_flame.xml', 'energy',
'solution with the energy equation enabled')
f.transport_model = 'Multi'
f.solve(loglevel, refine_grid)
f.show_solution()
print('multicomponent flamespeed = ', f.u[0])
f.save('bg1_burner_flame_1.xml','energy_multi',
'solution with the energy equation enabled and multicomponent transport')
f.write_csv('bg_burner_flame_sim_q7_phi-1.0_binary_test5.csv', quiet=False)