.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/hydrology/plot_07_green_ampt_infiltration.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code or to run this example in your browser via JupyterLite. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_hydrology_plot_07_green_ampt_infiltration.py: Green and Ampt's infiltration (1911) ==================================== W. Heber Green and G. A. Ampt pictured water entering a soil as a sharp wetting front, saturated above and dry below, pulled down by gravity and by the capillary suction at the front. The infiltration rate starts high, falls as the wetted zone deepens and tends to the saturated conductivity. Under steady rain the soil first absorbs everything; once its capacity falls to the rain rate the surface ponds and the excess runs off, as in Mein and Larson's (1973) treatment, which ``simulate_infiltration`` integrates. .. GENERATED FROM PYTHON SOURCE LINES 13-38 .. image-sg:: /api/gallery/hydrology/images/sphx_glr_plot_07_green_ampt_infiltration_001.png :alt: Green and Ampt: capacity falls toward K :srcset: /api/gallery/hydrology/images/sphx_glr_plot_07_green_ampt_infiltration_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.hydrology import green_ampt_rate, green_ampt_time, simulate_infiltration conductivity, suction, deficit = 1e-6, 0.11, 0.3 # a loam depth = np.linspace(1e-4, 0.08, 400) ponded_time = green_ampt_time(depth, conductivity, suction, deficit) time = np.linspace(0, 4 * 3600, 481) storm = simulate_infiltration(conductivity, suction, deficit, 1e-5, time) rate = storm.values[:, 1] ponding = time[np.argmax(storm.values[:, 2] > 0)] expected = conductivity * suction * deficit / (1e-5 * (1e-5 - conductivity)) assert abs(ponding - expected) <= time[1] and np.isclose(green_ampt_rate(1e3, conductivity, suction, deficit), conductivity, rtol=1e-4) fig, ax = plt.subplots() ax.plot(ponded_time / 3600, green_ampt_rate(depth, conductivity, suction, deficit) * 3.6e6, label="ponded from the start") ax.plot(time / 3600, rate * 3.6e6, label="steady rain of 36 mm/h") ax.axhline(conductivity * 3.6e6, color="0.5", ls=":", label="saturated conductivity") ax.axvline(expected / 3600, color="0.7", ls="--", lw=1, label="ponding time") ax.set(xlim=(0, 4), ylim=(0, 40), xlabel="time [h]", ylabel="infiltration rate [mm/h]", title="Green and Ampt: capacity falls toward K") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.107 seconds) .. _sphx_glr_download_api_gallery_hydrology_plot_07_green_ampt_infiltration.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: lite-badge .. image:: images/jupyterlite_badge_logo.svg :target: ../../../lite/lab/index.html?path=api/gallery/hydrology/plot_07_green_ampt_infiltration.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_07_green_ampt_infiltration.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_07_green_ampt_infiltration.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_07_green_ampt_infiltration.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_