.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/hydrology/plot_02_chezy_open_channel_formula.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_02_chezy_open_channel_formula.py: Chézy's open-channel formula (1775) =================================== Antoine de Chézy was asked to size a canal bringing the water of the Yvette to Paris. He reasoned that in uniform flow the weight of the water down the slope balances a bed friction that grows as the square of the velocity, so the mean velocity is ``C sqrt(R S)``, with ``R`` the cross-sectional area over the wetted perimeter. The example evaluates a rectangular canal: deepening it raises the hydraulic radius and the velocity, which tends to the wide-channel limit where ``R`` equals the depth. .. GENERATED FROM PYTHON SOURCE LINES 13-32 .. image-sg:: /api/gallery/hydrology/images/sphx_glr_plot_02_chezy_open_channel_formula_001.png :alt: Chézy: v = C sqrt(R S), C = 50, S = 4e-4 :srcset: /api/gallery/hydrology/images/sphx_glr_plot_02_chezy_open_channel_formula_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.hydrology import chezy_velocity, hydraulic_radius depth = np.linspace(0.05, 3, 120) fig, ax = plt.subplots() for width in (1.0, 4.0, 20.0): radius = hydraulic_radius(width, depth) ax.plot(depth, chezy_velocity(50, radius, 4e-4), label=f"width {width:g} m") wide = chezy_velocity(50, depth, 4e-4) ax.plot(depth, wide, "k--", label="wide channel, R = depth") assert np.all(chezy_velocity(50, hydraulic_radius(20.0, depth), 4e-4) < wide) assert np.isclose(chezy_velocity(50, 1.0, 4e-4), 2 * chezy_velocity(50, 0.25, 4e-4)) ax.set(xlabel="flow depth [m]", ylabel="mean velocity [m/s]", title="Chézy: v = C sqrt(R S), C = 50, S = 4e-4") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.098 seconds) .. _sphx_glr_download_api_gallery_hydrology_plot_02_chezy_open_channel_formula.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_02_chezy_open_channel_formula.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_02_chezy_open_channel_formula.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_02_chezy_open_channel_formula.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_02_chezy_open_channel_formula.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_