

.. _sphx_glr_examples_python_reactors:

Reactor networks
----------------



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Since reactors can have multiple inlets and outlets, they can be used to implement mixers, splitters, etc. In this example, air and methane are mixed in stoichiometric proportions. Due to the low temperature, no reactions occur. Note that the air stream and the methane stream use different reaction mechanisms, with different numbers of species and reactions. When gas flows from one reactor or reservoir to another one with a different reaction mechanism, species are matched by name. If the upstream reactor contains a species that is not present in the downstream reaction mechanism, it will be ignored. In general, reaction mechanisms for downstream reactors should contain all species that might be present in any upstream reactor.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_mix1_thumb.svg
    :alt:

  :ref:`sphx_glr_examples_python_reactors_mix1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Mixing two streams</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates a continuously stirred tank reactor (CSTR) with steady inputs but periodic interior state.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_periodic_cstr_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_periodic_cstr.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Continuously stirred tank reactor with periodic behavior</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Calculate steady-state solutions for a combustor, modeled as a single well-stirred reactor, for different residence times.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_combustor_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_combustor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Combustor residence time</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Requires: cantera &gt;= 3.2.0, matplotlib &gt;= 2.0">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_reactor1_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_reactor1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Constant-pressure, adiabatic kinetics simulation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This file uses a similar approach as custom.py, where the governing equations are implemented in Python, to solve the electron concentration in a plasma.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_plasma_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_plasma.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plasma Reactor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Two reactors separated by a piston that moves with a speed proportional to the pressure difference between the reactors.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_piston_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_piston.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Reactors separated by a moving piston</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Solve a constant pressure ignition problem where the governing equations are implemented in Python.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_custom_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_custom.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Integrating constant pressure ignition using SciPy</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Requires: cantera &gt;= 3.2.0, matplotlib &gt;= 2.0">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_sensitivity1_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_sensitivity1.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Constant-pressure, adiabatic kinetics simulation with sensitivity analysis</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates the partial oxidation of methane over a platinum catalyst in a packed bed reactor. This example solves the DAE system directly, using the FlowReactor class and the SUNDIALS IDA solver, in contrast to the approximation as a chain of steady-state WSRs used in surf_pfr_chain.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_surf_pfr_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_surf_pfr.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plug flow reactor with surface chemistry</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Ideal gas, constant-pressure, adiabatic kinetics simulation that compares preconditioned and non-preconditioned integration of n-hexane.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_preconditioned_integration_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_preconditioned_integration.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Acceleration of reactor integration using a sparse preconditioned solver</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Two reactors connected with a piston, with heat loss to the environment">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_reactor2_thumb.svg
    :alt:

  :ref:`sphx_glr_examples_python_reactors_reactor2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Reactors with walls and heat transfer</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Simulation of fuel injection into a vitiated air mixture to show formation of soot precursors.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_fuel_injection_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_fuel_injection.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Soot precursor formation with time-varying mass flow rate</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Solve an ignition problem where the normal reactor governing equations are extended with additional equations implemented in Python.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_custom2_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_custom2.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Using ExtensibleReactor to implement wall inertia</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example solves a plug flow reactor problem, where the chemistry is surface chemistry. The specific problem simulated is the partial oxidation of methane over a platinum catalyst in a packed bed reactor. To avoid needing to solve a DAE system, the PFR is approximated as a chain of successive WSRs. See surf_pfr for a more advanced implementation that solves the DAE system directly.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_surf_pfr_chain_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_surf_pfr_chain.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plug flow reactor modeled as a chain of well stirred reactors</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="A 1-D steady state plug-flow reactor demonstrating silicon nitride (Si3N4) deposition from ammonia (NH3) and silicon tetrafluoride (SiF4).">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_1D_pfr_surfchem_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_1D_pfr_surfchem.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plug flow reactor: silicon nitride deposition</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example solves a plug-flow reactor problem of hydrogen-oxygen combustion. The PFR is computed by two approaches: The simulation of a Lagrangian fluid particle, and the simulation of a chain of reactors.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_pfr_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_pfr.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Plug flow reactor modeling approaches</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example simulates a nanosecond-scale pulse discharge in a reactor. A Gaussian-shaped electric field pulse is applied over a short timescale. The plasma reaction mechanism used is based on Colin Pavan&#x27;s mechanism for methane-air plasmas which is described in his Ph.D. dissertation and the corresponding AIAA SciTech conference papers:">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_nanosecond_pulse_discharge_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_nanosecond_pulse_discharge.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Nanosecond Pulse Plasma Simulation</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example we will illustrate how Cantera can be used to simulate a continuously stirred tank reactor (CSTR), also interchangeably referred to as a perfectly stirred reactor (PSR), a well stirred reactor (WSR), a jet stirred reactor (JSR), or a Longwell reactor (and there may well be more &quot;aliases&quot;).">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_continuous_reactor_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_continuous_reactor.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Continuously Stirred Tank Reactor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="In this example we illustrate how to setup and use a constant volume, adiabatic reactor to simulate reflected shock tube experiments. This reactor is then used to compute the ignition delay of a gas at a specified initial temperature and pressure.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_non_ideal_shock_tube_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_non_ideal_shock_tube.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Ignition delay time using the Redlich-Kwong real gas model</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The simulation uses n-dodecane as fuel, which is injected close to top dead center. Note that this example uses numerous simplifying assumptions and thus serves for illustration purposes only.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_ic_engine_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_ic_engine.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Diesel-type internal combustion engine simulation with gaseous fuel</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The model shown in this example simulates heterogeneous catalytic processes inside packed-bed, catalytic membrane reactors. The gas-phase and surface-phase species conservation equations are derived and the system of differential-algebraic equations (DAE) is solved using the scikits.odes.dae IDA solver.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_1D_packed_bed_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_1D_packed_bed.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">One-dimensional packed-bed, catalytic-membrane reactor</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Showcases the use of ExtensibleReactor to add a temperature equation for a solid-phase and custom heat transfer/radiation models.">

.. only:: html

  .. image:: /examples/python/reactors/images/thumb/sphx_glr_porous_media_burner_thumb.png
    :alt:

  :ref:`sphx_glr_examples_python_reactors_porous_media_burner.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Reactor cascade model for reactive flows in inert porous media</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /examples/python/reactors/mix1
   /examples/python/reactors/periodic_cstr
   /examples/python/reactors/combustor
   /examples/python/reactors/reactor1
   /examples/python/reactors/plasma
   /examples/python/reactors/piston
   /examples/python/reactors/custom
   /examples/python/reactors/sensitivity1
   /examples/python/reactors/surf_pfr
   /examples/python/reactors/preconditioned_integration
   /examples/python/reactors/reactor2
   /examples/python/reactors/fuel_injection
   /examples/python/reactors/custom2
   /examples/python/reactors/surf_pfr_chain
   /examples/python/reactors/1D_pfr_surfchem
   /examples/python/reactors/pfr
   /examples/python/reactors/nanosecond_pulse_discharge
   /examples/python/reactors/continuous_reactor
   /examples/python/reactors/non_ideal_shock_tube
   /examples/python/reactors/ic_engine
   /examples/python/reactors/1D_packed_bed
   /examples/python/reactors/porous_media_burner

