.. _chemkin_hydrogen_oxidation_tutorial:

Hydrogen oxidation in a batch reactor using CHEMKIN mechanism
-------------------------------------------------------------

This tutorial shows how to import thermodynamic information of species
and kinetic mechanism from CHEMKIN into MFiX. A batch reactor in a single
cell is simulated in this tutorial. The mechanism for the oxidiation of hydrogen from
Conaire et al. [1]_ is applied.


Read the project into MFiX
^^^^^^^^^^^^^^^^^^^^^^^^^^

The basic model has been set up in the input file, "hydrogen_oxidation.mfx".

-  On the main menu select ``Open project``.
-  Open the project by browsing to the tutorial directory ``tutorial/chemkin/hydrogen_oxidation``.

.. note::
    The main purpose of this tutorial is to show how to use CHEMKIN mechanism in MFiX.
    For more details about the model setup, please refer to other tutorials.

.. _fig_open_project:

.. figure:: /media/chemkin/fig_open_project.png
           :width: 8cm
           :alt: open project

Generate mesh
^^^^^^^^^^^^^

On the ``Mesher`` pane:

-  Click ``Generate`` to generate the mesh
-  Clikc ``Accept`` to accept the mesh

.. _fig_create_mesh:

.. figure:: /media/chemkin/fig_create_mesh.png
           :width: 8cm
           :alt: generate mesh

Import species for fluid phase
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
On the ``Fluid`` pane:

-  Click the ``+`` under ``Species``. This will open the Fluid species popup window.

.. figure:: /media/chemkin/fig_add_species.png
            :width: 8cm
            :alt: add species

- Select ``Load from file (CHEMKIN format)`` in ``Source`` of the popup window

.. figure:: /media/chemkin/fig_import_thermo_file.png
            :width: 8cm
            :alt: import thermo file

- Click ``Choose file``, choose "thermodynamicInfo.txt" in the popup window, and click ``Open``.

.. figure:: /media/chemkin/fig_select_thermo_file.png
            :width: 8cm
            :alt: select thermo file

- After importing the file, the species defined in the file will show in the window.
- Select all the species (click on first species "AR" and drag down) and click ``import from database`` to import all species. Click ``Done``.

.. note::
    Users have the flexibility to select the required species for their case from the provided list.
    If a species is not defined in the CHEMKIN file, users can import it from the built-in
    Burcat database or an external Burcat file as well.

.. figure:: /media/chemkin/fig_select_species.png
            :width: 8cm
            :alt: select species

- For reacting cases, constant specific heat capacity is not allowed. Change it to
  "Mixture" in "Properties".

.. figure:: /media/chemkin/fig_setup_cp.png
            :width: 8cm
            :alt: setup cp

Create Initial and Boundary conditions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

On the ``Initial conditions`` pane, set the following conditions as the initial conditions.

+------------------+--------------------------------------------+
| Property         | Initial Value                              |
+==================+============================================+
| Volume Fraction  | 1.0                                        |
+------------------+--------------------------------------------+
| Temperature      | 800 K                                      |
+------------------+--------------------------------------------+
| Pressure         | 101325 Ps                                  |
+------------------+--------------------------------------------+
| U-Velocity       | 0.0 m/s                                    |
+------------------+--------------------------------------------+
| V-Velocity       | 0.0 m/s                                    |
+------------------+--------------------------------------------+
| W-Velocity       | 0.0 m/s                                    |
+------------------+--------------------------------------------+
| Composition      | H2: 0.1, O2: 0.8, N2: 0.1, OH:0.0          |
+------------------+--------------------------------------------+

On the ``Boundary conditions`` pane, No-Slip and adiabatic walls have been setup.

Import kinetic mechanism
^^^^^^^^^^^^^^^^^^^^^^^^

On the ``Chemistry`` pane, ``Options`` sub-pane:

-  Check the ``Enable Arrhenius model for fluid phase reactions`` checkbox
-  Change the ``Minimum mass fraction for reactions`` for ``Fluid reactions`` to 0
   to consider all species with mass fraction larger than 0 in the reactions
-  Check the ``Enable stiff chemistry solver`` checkbox
-  Change the ``Absolute tolerance``, ``Relative tolerance`` and ``Minimum reaction rate``
   in stiff solver to be 1e-09, 1e-08 and 1e-20.

.. note::
    Users can change the minimum mass fraction for reactions and the parameters for stiff solver
    based on the accuracy requirement of their cases.

.. figure:: /media/chemkin/fig_arrhenius_setup.png
            :width: 8cm
            :alt: setup arrhenius rate


On the ``Chemistry`` pane, ``Reactions`` sub-pane:

-  Click ``Load reaction definitions from text file`` and select ``Chemkin format``
-  Select the mechanism file "chemkin_mechanism.CKI" in the popup window. Click ``Open``.

.. figure:: /media/chemkin/fig_import_mechanism.png
            :width: 8cm
            :alt: import mechanism

.. figure:: /media/chemkin/fig_select_mechanism.png
            :width: 8cm
            :alt: select mechanism

-  Then all the reactions with all the information will be imported

.. figure:: /media/chemkin/fig_reactions.png
            :width: 8cm
            :alt: reactions



Setup output, monitor and run parameters
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The output, monitor and run parameters have been setup.
Users can modify them  based on their own requirement.

Run the project
^^^^^^^^^^^^^^^

-  Save the project by clicking the |save| button
-  Run the project by clicking the |play| button
-  On the ``Run Solver`` dialog, select the executable from the combo-box
-  Click the ``Run`` button to start the simulation

This tutorial simulates the oxidation of H2 in a batch reactor.
Users should expect to see consumption of H2 and O2 and a temperature increase
from the exothermic reaction.

References
----------

.. [1] M. O Conaire, H. J. Curran, J. M. Simmie, W. J. Pitz, C. K. Westbrook. A Comprehensive Modelling Study of Hydrogen Oxidation, Intl. J. Chem. Kinet., 36 (11):603\u2013622 (2004).

.. include:: /icons.rst