import cantera as ct import numpy as np import matplotlib.pyplot as plt # Parameters of the solver loglevel = 1 refine_grid = 'refine' thickness_list = [1.0, 2.0, 5.0, 10.0] for thick in thickness_list: # Setting up the gas object (operating conditions) gas = ct.Solution('GRI-Mech3.0.cti') p = 1e5 tin = 300.0 phi = 1.0 fuel = {'CH4':1} oxidizer = {'O2': 1, 'N2': 3.76} gas.TP = tin, p gas.set_equivalence_ratio(phi, fuel, oxidizer) # Setting up the flame object f = ct.FreeFlame(gas, width=0.2) # Careful about the domain size if you want to retrieve the same profile ! f.inlet.X = gas.X f.inlet.T = gas.T f.energy_enabled = True f.set_refine_criteria(ratio=2.0, slope=0.05, curve=0.05, prune=0.01) f.set_max_jac_age(10, 10) f.set_time_step(1e-8, [10, 20, 40, 80, 100, 100, 150]) f.max_time_step_count = 500 # Command to thicken the flame f.flame.thick = thick f.solve(loglevel, refine_grid) # Checking the results plt.plot(f.flame.grid/thick, f.T, label='F = '+str(thick)) plt.xlabel('Flame grid [m]') plt.ylabel('Temperature [K]') plt.legend() plt.show()