How to simulate stratified flames in Cantera?

99 views
Skip to first unread message

Robert Barlow

unread,
Nov 29, 2023, 4:29:50 PM11/29/23
to Cantera Users' Group
I am looking for a python example for an opposed flow flame that has premixed reactants at equivalence ratio, phi_1, flowing against equilibrium products corresponding to a different equivalence ratio, phi_2.  I can do this using CounterflowDiffusionFlame (Cantera 3) as long as one side is rich and the other lean.  However, I also need to run lean vs. lean cases, and that causes an error when CouterFlowDiffusionFlame tries to calculate the stoichiometric value of mixture fraction.  I have not found an example of this type of lean-vs-lean calculation on the web.  The opposed flow premixed flame example seems to build in the assumption that the second inlet flow corresponds to equilibrium products of the reactant inflow, i.e., phi_1 = phi_2.

Another very useful tip would be an example that calculates the local value of equivalence ratio through a premixed or stratified counterflow flame solution.  This is actually quite relevant to the analysis of differential diffusion effects in in both purely premixed flames and stratified flames.

Thanks in advance!

Ray Speth

unread,
Dec 21, 2023, 7:11:52 PM12/21/23
to Cantera Users' Group

Hi Robert,

Thanks for the interesting question. This calculation can be done using the CounterflowPremixedFlame class. While the default behavior is to use equilibrium products of the reactant flow, a different counterflow mixture can be specified. The key steps are to define the composition and temperature of the products object, and to call the set_initial_guess method with the equilibrate=False option to avoid the default behavior. Here’s a complete example of a lean-lean flame:

from pathlib import Path import cantera as ct import numpy as np # parameter values p = ct.one_atm # pressure T_in = 300.0 # inlet temperature mdot_reactants = 3.0 # kg/m^2/s mdot_products = 2.0 # kg/m^2/s rxnmech = 'gri30.yaml' # reaction mechanism file fuel = 'CH4:1.0' ox = 'O2:1.0, N2:3.76' phi_r = 0.8 # unburned reactants equivalence ratio phi_p = 0.5 # burned products equivalence ratio width = 0.02 # m loglevel = 1 # amount of diagnostic output (0 to 5) # Set up the problem gas = ct.Solution(rxnmech) # set unburned mixture gas.TP = T_in, p gas.set_equivalence_ratio(phi_r, fuel, ox) # Create the flame simulation object sim = ct.CounterflowPremixedFlame(gas=gas, grid=np.linspace(0, width, 20)) # Set products composition gas.TP = T_in, p gas.set_equivalence_ratio(phi_p, fuel, ox) gas.equilibrate('HP') sim.products.T = gas.T sim.products.Y = gas.Y # set the boundary flow rates sim.reactants.mdot = mdot_reactants sim.products.mdot = mdot_products # Use pre-defined products composition and temperature sim.set_initial_guess(equilibrate=False) # Set grid refinement parameters sim.set_refine_criteria(ratio=3, slope=0.08, curve=0.15, prune=0.02) sim.solve(loglevel, auto=True)

And to get the equivalence ratio at each point, you can just loop over the states using the set_gas_state method:

phi = np.zeros(sim.grid.shape) for j in range(len(sim.grid)): sim.set_gas_state(j) phi[j] = gas.equivalence_ratio(fuel=fuel, oxidizer=ox)

Regards,
Ray

Reply all
Reply to author
Forward
0 new messages