diff --git a/doc/sphinx/cython/onedim.rst b/doc/sphinx/cython/onedim.rst index c67735b5e..49ed23b4c 100644 --- a/doc/sphinx/cython/onedim.rst +++ b/doc/sphinx/cython/onedim.rst @@ -29,7 +29,7 @@ CounterflowPremixedFlame ImpingingJet ^^^^^^^^^^^^ -.. autoclass:: ImpingingJet(gas, grid=None) +.. autoclass:: ImpingingJet(gas, grid=None, width=None) Flow Domains ------------ diff --git a/interfaces/cython/cantera/examples/onedim/stagnation_flame.py b/interfaces/cython/cantera/examples/onedim/stagnation_flame.py index 18003378d..fc2146833 100644 --- a/interfaces/cython/cantera/examples/onedim/stagnation_flame.py +++ b/interfaces/cython/cantera/examples/onedim/stagnation_flame.py @@ -31,10 +31,8 @@ mdot = [0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12] # kg/m^2/s rxnmech = 'h2o2.cti' # reaction mechanism file comp = 'H2:1.8, O2:1, AR:7' # premixed gas composition -# The solution domain is chosen to be 50 cm, and a point very near the -# downstream boundary is added to help with the zero-gradient boundary -# condition at this boundary. -initial_grid = np.linspace(0.0, 0.2, 12) # m +# The solution domain is chosen to be 20 cm +width = 0.2 # m tol_ss = [1.0e-5, 1.0e-13] # [rtol atol] for steady-state problem tol_ts = [1.0e-4, 1.0e-9] # [rtol atol] for time stepping @@ -56,7 +54,7 @@ gas.TPX = tburner, p, comp # Create the stagnation flow object with a non-reactive surface. (To make the # surface reactive, supply a surface reaction mechanism. See example # catalytic_combustion.py for how to do this.) -sim = ct.ImpingingJet(gas=gas, grid=initial_grid) +sim = ct.ImpingingJet(gas=gas, width=width) # set the mass flow rate at the inlet sim.inlet.mdot = mdot[0] diff --git a/interfaces/cython/cantera/examples/surface_chemistry/catalytic_combustion.py b/interfaces/cython/cantera/examples/surface_chemistry/catalytic_combustion.py index cc6434399..6a3d47f82 100644 --- a/interfaces/cython/cantera/examples/surface_chemistry/catalytic_combustion.py +++ b/interfaces/cython/cantera/examples/surface_chemistry/catalytic_combustion.py @@ -30,8 +30,8 @@ comp1 = 'H2:0.05, O2:0.21, N2:0.78, AR:0.01' # composition of the inlet premixed gas for the methane/air case comp2 = 'CH4:0.095, O2:0.21, N2:0.78, AR:0.01' -# the initial grid, in meters. The inlet/surface separation is 10 cm. -initial_grid = [0.0, 0.02, 0.04, 0.06, 0.08, 0.1] # m +# The inlet/surface separation is 10 cm. +width = 0.1 # m # numerical parameters tol_ss = [1.0e-5, 1.0e-9] # [rtol, atol] for steady-state problem @@ -65,7 +65,7 @@ surf_phase.advance_coverages(1.0) # create the object that simulates the stagnation flow, and specify an initial # grid -sim = ct.ImpingingJet(gas=gas, grid=initial_grid, surface=surf_phase) +sim = ct.ImpingingJet(gas=gas, width=width, surface=surf_phase) # Objects of class StagnationFlow have members that represent the gas inlet # ('inlet') and the surface ('surface'). Set some parameters of these objects. diff --git a/interfaces/cython/cantera/onedim.py b/interfaces/cython/cantera/onedim.py index 7d3129e5d..fd429a93f 100644 --- a/interfaces/cython/cantera/onedim.py +++ b/interfaces/cython/cantera/onedim.py @@ -788,13 +788,18 @@ class ImpingingJet(FlameBase): """An axisymmetric flow impinging on a surface at normal incidence.""" __slots__ = ('inlet', 'flame', 'surface') - def __init__(self, gas, grid=None, surface=None): + def __init__(self, gas, grid=None, width=None, surface=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 the initial grid; Use the `width` parameter + instead. + :param width: + Defines a grid on the interval [0, width] with internal points + determined automatically by the solver. :param surface: A Kinetics object used to compute any surface reactions. @@ -805,6 +810,9 @@ class ImpingingJet(FlameBase): self.inlet = Inlet1D(name='inlet', phase=gas) self.flame = AxisymmetricStagnationFlow(gas, name='flame') + if width is not None: + grid = np.array([0.0, 0.2, 0.4, 0.6, 0.8, 1.0]) * width + if surface is None: self.surface = Surface1D(name='surface', phase=gas) self.surface.T = gas.T