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

.. only:: html

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

        :ref:`Go to the end <sphx_glr_download_content_examples_20-published_plot_vadose_vangenuchten.py>`
        to download the full example code

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

.. _sphx_glr_content_examples_20-published_plot_vadose_vangenuchten.py:


FLOW: Vadose: van Genuchten
===========================

Shows the water retention curve and the hydraulic conductivity
function for a number of soil types.

For more information about the parameters used see:

The RETC code for quantifying the hydraulic functions of unsaturated
soils, Van Genuchten, M Th, Leij, F J, Yates, S R

.. GENERATED FROM PYTHON SOURCE LINES 13-38



.. image-sg:: /content/examples/20-published/images/sphx_glr_plot_vadose_vangenuchten_001.png
   :alt: Water retention curve, Hydraulic conductivity function
   :srcset: /content/examples/20-published/images/sphx_glr_plot_vadose_vangenuchten_001.png
   :class: sphx-glr-single-img





.. code-block:: default

    import matplotlib.pyplot as plt

    import discretize
    from SimPEG.flow import richards


    def run(plotIt=True):
        mesh = discretize.TensorMesh([10])
        VGparams = richards.empirical.VanGenuchtenParams()
        leg = []
        for p in dir(VGparams):
            if p[0] == "_":
                continue
            leg += [p]
            params = getattr(VGparams, p)
            k_fun, theta_fun = richards.empirical.van_genuchten(mesh, **params)
            theta_fun.plot(ax=plt.subplot(121))
            k_fun.plot(ax=plt.subplot(122))

        plt.legend(leg, loc=3)


    if __name__ == "__main__":
        run()
        plt.show()


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

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

**Estimated memory usage:**  8 MB


.. _sphx_glr_download_content_examples_20-published_plot_vadose_vangenuchten.py:

.. only:: html

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




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

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

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

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


.. only:: html

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

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