
:html_theme.sidebar_secondary.remove:

.. py:currentmodule:: cantera


.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "examples/python/transport/dusty_gas.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_examples_python_transport_dusty_gas.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_examples_python_transport_dusty_gas.py:


Porous media transport using the dusty gas model
================================================

The dusty gas model is a multicomponent transport model for gas transport through the
pores of a stationary porous medium. This example shows how to create a
:ct:`DustyGasTransport` transport manager and use it to compute the multicomponent
diffusion coefficients and thermal conductivity.

Requires:  cantera >= 2.6.0

.. tags:: Python, transport, multicomponent transport

.. GENERATED FROM PYTHON SOURCE LINES 14-47




.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    [[6.04508090e-06 5.08766385e-15 3.25479753e-15 3.14850575e-15
      3.20206408e-15 3.45606084e-15 3.12231914e-15 3.09705157e-15
      2.93158491e-15 3.34034042e-15]
     [1.01753277e-06 1.00958790e-05 5.90075989e-07 5.81739641e-07
      5.80048574e-07 6.46426219e-07 5.76758643e-07 5.71958453e-07
      5.40893417e-07 6.19780798e-07]
     [3.25479753e-15 2.95037995e-15 2.40949353e-06 2.88943424e-15
      2.75176543e-15 3.02825178e-15 2.87229210e-15 2.85554720e-15
      2.73667448e-15 3.03234039e-15]
     [9.44551726e-07 8.72609462e-07 8.66830273e-07 2.56333987e-06
      8.61491428e-07 9.76129827e-07 9.16169964e-07 9.12147326e-07
      8.83873384e-07 9.56240421e-07]
     [3.20206408e-07 2.90024287e-07 2.75176543e-07 2.87163809e-07
      2.62193878e-06 3.00229073e-07 2.85495338e-07 2.83864493e-07
      2.72212593e-07 3.01201643e-07]
     [3.45606084e-15 3.23213110e-15 3.02825178e-15 3.25376609e-15
      3.00229073e-15 2.08733697e-06 3.19842752e-15 3.18054135e-15
      3.08206496e-15 3.39813658e-15]
     [3.12231914e-15 2.88379321e-15 2.87229210e-15 3.05389988e-15
      2.85495338e-15 3.19842752e-15 1.62389081e-06 3.02741253e-15
      2.93465022e-15 3.17235064e-15]
     [3.09705157e-15 2.85979227e-15 2.85554720e-15 3.04049109e-15
      2.83864493e-15 3.18054135e-15 3.02741253e-15 1.60552909e-06
      2.92320487e-15 3.15749189e-15]
     [2.93158491e-15 2.70446709e-15 2.73667448e-15 2.94624461e-15
      2.72212593e-15 3.08206496e-15 2.93465022e-15 2.92320487e-15
      1.51929655e-06 3.05528917e-15]
     [2.00420427e-26 1.85934241e-26 1.81940425e-26 1.91248086e-26
      1.80720988e-26 2.03888197e-26 1.90341041e-26 1.89449515e-26
      1.83317352e-26 1.69942484e-06]]
    0.10370420076461835
    [-0. -0. -0. -0. -0. -0. -0. -0. -0. -0.]
    [-6.91013095e-14 -1.84055444e-05 -3.65033606e-14 -9.28936887e-06
     -3.58912540e-06 -3.54798563e-14 -3.07293580e-14 -3.05028036e-14
     -2.92624373e-14 -1.04352991e-25]






|

.. code-block:: Python


    import cantera as ct

    # create a gas-phase object to represent the gas in the pores, with a
    # dusty gas transport manager
    g = ct.DustyGas('h2o2.yaml')

    # set the gas state
    composition = {"OH": 1, "H": 2, "O2": 3, "O": 1.0E-8, "H2": 1.0E-8, "H2O": 1.0E-8,
                   "H2O2": 1.0E-8, "HO2": 1.0E-8, "AR": 1.0E-8}
    g.TPX = 500.0, ct.one_atm, composition

    # set its parameters
    g.porosity = 0.2
    g.tortuosity = 4.0
    g.mean_pore_radius = 1.5e-7
    g.mean_particle_diameter = 1.5e-6  # lengths in meters

    # print the multicomponent diffusion coefficients
    print(g.multi_diff_coeffs)

    # print the thermal conductivity of the gas phase
    print(g.thermal_conductivity)

    # compute molar species fluxes
    T1, rho1, Y1 = g.TDY

    g.TP = g.T, 1.2 * ct.one_atm
    T2, rho2, Y2 = g.TDY
    delta = 0.001

    print(g.molar_fluxes(T1, T1, rho1, rho1, Y1, Y1, delta))
    print(g.molar_fluxes(T1, T2, rho1, rho2, Y1, Y2, delta))


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 0.018 seconds)


.. _sphx_glr_download_examples_python_transport_dusty_gas.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: dusty_gas.ipynb <dusty_gas.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: dusty_gas.py <dusty_gas.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: dusty_gas.zip <dusty_gas.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
