[1D] Provide reasonable initial grid for BurnerFlame

This commit is contained in:
Ray Speth 2016-03-13 23:41:56 -04:00
parent 1f3e8dd0d7
commit 87a8419380
4 changed files with 15 additions and 7 deletions

View file

@ -17,7 +17,7 @@ FreeFlame
BurnerFlame
^^^^^^^^^^^
.. autoclass:: BurnerFlame(gas, grid=None)
.. autoclass:: BurnerFlame(gas, grid=None, width=None)
CounterflowDiffusionFlame
^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -10,7 +10,7 @@ tburner = 373.0
mdot = 0.06
reactants = 'H2:1.5, O2:1, AR:7' # premixed gas composition
initial_grid = np.linspace(0.0, 0.5, 10) # m
width = 0.5 # m
tol_ss = [1.0e-5, 1.0e-13] # [rtol atol] for steady-state problem
tol_ts = [1.0e-4, 1.0e-10] # [rtol atol] for time stepping
loglevel = 1 # amount of diagnostic output (0 to 5)
@ -19,7 +19,7 @@ refine_grid = 1 # 1 to enable refinement, 0 to disable
gas = ct.Solution('h2o2.xml')
gas.TPX = tburner, p, reactants
f = ct.BurnerFlame(gas, initial_grid)
f = ct.BurnerFlame(gas, width=width)
f.burner.mdot = mdot
f.set_initial_guess()

View file

@ -14,7 +14,7 @@ mdot = 0.04 # kg/m^2/s
comp = 'CH4:0.65, O2:1, N2:3.76' # premixed gas composition
# The solution domain is chosen to be 1 cm
initial_grid = np.linspace(0.0, 0.01, 6) # m
width = 0.01 # m
tol_ss = [1.0e-5, 1.0e-9] # [rtol atol] for steady-state problem
tol_ts = [1.0e-5, 1.0e-4] # [rtol atol] for time stepping
@ -33,7 +33,7 @@ gas = ct.Solution('gri30.xml', 'gri30_mix')
gas.TPX = tburner, p, comp
# create the BurnerFlame object.
f = ct.BurnerFlame(gas=gas, grid=initial_grid)
f = ct.BurnerFlame(gas=gas, width=width)
# set the mass flow rate at the burner
f.burner.mdot = mdot

View file

@ -441,13 +441,18 @@ class BurnerFlame(FlameBase):
"""A burner-stabilized flat flame."""
__slots__ = ('burner', 'flame', 'outlet')
def __init__(self, gas, grid=None):
def __init__(self, gas, grid=None, width=None):
"""
:param gas:
`Solution` (using the IdealGas thermodynamic model) used to
evaluate all gas properties and reaction rates.
:param grid:
Array of initial grid points
A list of points to be used as the initial grid. Not recommended
unless solving only on a fixed grid; Use the `width` parameter
instead.
:param width:
Defines a grid on the interval [0, width] with internal points
determined automatically by the solver.
A domain of class `AxisymmetricStagnationFlow` named ``flame`` will
be created to represent the flame. The three domains comprising the
@ -458,6 +463,9 @@ class BurnerFlame(FlameBase):
self.outlet = Outlet1D(name='outlet', phase=gas)
self.flame = AxisymmetricStagnationFlow(gas, name='flame')
if width is not None:
grid = np.array([0.0, 0.1, 0.2, 0.3, 0.5, 0.7, 1.0]) * width
super(BurnerFlame, self).__init__((self.burner, self.flame, self.outlet),
gas, grid)