Premixed Strained Flame¶
This example shows how to simulate a steady premixed strained flame. This is essentially the “default” flame configuration for Ember, and most other flame configurations are described by how they differ from this one.
example_single.py:
#!/usr/bin/python
"""
Similar to as is done experimentally (https://doi.org/10.1016/j.combustflame.2009.06.011),
a single disc flame opposing a cold inert is established at a given strain rate. Infinite
burner separation distance assumed. The converged axial velocity profile is plotted.
"""
from ember import *
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
output = 'run/ex_single'
a = 300.0
conf = Config(
Paths(outputDir=output),
# Chemistry(mechanismFile='gri30.yaml'),
General(twinFlame=False,
flameGeometry= 'disc',
nThreads=4),
InitialCondition(fuel='CH4:1.0',
oxidizer = 'N2:3.76, O2:1.0',
equivalenceRatio=1.0,
counterflow = 'N2:1.0',
Tcounterflow = 300.0,
xLeft=-0.01,
xRight=0.01,
centerWidth=0.005,
slopeWidth=0.001,
),
StrainParameters(initial=a,
final=a),
)
if __name__ == '__main__':
conf.run()
struct = utils.load(output + '/profNow.h5')
plt.figure()
plt.plot(struct.x, struct.V / struct.rho)
plt.xlabel('Position [m]')
plt.ylabel('Axial Velocity [m/s]')
plt.savefig(output+'/FinalAxialVelocity.png')
plt.close()
The given configuration parameters override default values. The full set of configuration parameters is described in Configuration Options.
-
outputDiris the directory where periodic periodic output profiles (prof000000.h5,prof0000001.h5, etc.) and time series output files (out.h5) will be saved. If a relative path is given (as in this example), the path is relative to the directory from which the script is run.
InitialConditionIn this example, the molar fuel composition is specified using the string format supported by Cantera. Alternatively, a vector of mole fractions can be supplied. Here, the oxidizer composition is left with at the default value, which corresponds to air, i.e."N2:3.76, O2:1.0".StrainParametersspecifies how the strain rate imposed on the flame varies as a function of time. In this case we specify a constant strain rate.TerminationConditionspecifies the conditions under which the time integration will be terminated. Here, we specify integration until a specific time. Another option is to integrate until a steady-state solution is reached.
To try this example, run the following command:
$ python -m ember.examples.example_premixed
Or copy the example_premixed.py file to another directory, make any
modifications you desire, then run:
$ python example_premixed.py