.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/fluid_engineering/measurement/plot_04_thomson_v_notch_weir.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_fluid_engineering_measurement_plot_04_thomson_v_notch_weir.py: James Thomson's triangular notch (1858) ======================================= James Thomson, engineer and elder brother of Lord Kelvin, reported to the British Association in 1858 that a V-shaped notch measures small flows better than a rectangular weir. The flow section keeps the same shape as the head changes, so the discharge coefficient hardly varies, and the flow grows as :math:`H^{5/2}` (:func:`~engineeringkit.fluid_engineering.v_notch_weir_flow`) instead of :math:`H^{3/2}` (:func:`~engineeringkit.fluid_engineering.rectangular_weir_flow`), so a small flow still gives a readable head. This example compares the rating curves of the two weirs and finds how precisely each must be read. .. GENERATED FROM PYTHON SOURCE LINES 17-22 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.fluid_engineering import rectangular_weir_flow, rehbock_discharge_coefficient, v_notch_weir_flow .. GENERATED FROM PYTHON SOURCE LINES 23-28 Rating curves ------------- A 90° notch and a 0.5 m rectangular weir standing 0.4 m above the bed of a laboratory flume, with Rehbock's coefficient for the rectangle. .. GENERATED FROM PYTHON SOURCE LINES 28-41 .. code-block:: Python H = np.linspace(0.005, 0.3, 200) P, b = 0.4, 0.5 Q_vee = v_notch_weir_flow(H) Q_rect = rectangular_weir_flow(H, b, rehbock_discharge_coefficient(H, P)) fig, ax = plt.subplots(figsize=(6, 4)) ax.loglog(Q_vee * 1000, H, label="90° V-notch, $Q \\propto H^{5/2}$") ax.loglog(Q_rect * 1000, H, label="0.5 m rectangular weir, $Q \\propto H^{3/2}$") ax.set(xlabel="flow [L/s]", ylabel="head over the crest [m]", title="Sharp-crested weir rating curves") ax.legend() fig.tight_layout() .. image-sg:: /api/gallery/fluid_engineering/measurement/images/sphx_glr_plot_04_thomson_v_notch_weir_001.png :alt: Sharp-crested weir rating curves :srcset: /api/gallery/fluid_engineering/measurement/images/sphx_glr_plot_04_thomson_v_notch_weir_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 42-47 Head for a small flow --------------------- For 2 L/s the notch stands several times higher than the rectangle, so a 1 mm reading error matters far less. .. GENERATED FROM PYTHON SOURCE LINES 47-54 .. code-block:: Python Q = 2e-3 h_vee = np.interp(Q, Q_vee, H) h_rect = np.interp(Q, Q_rect, H) for name, h, n in [("V-notch", h_vee, 2.5), ("rectangular", h_rect, 1.5)]: print(f"{name}: head {h * 1000:.1f} mm; a 1 mm error is a {100 * n * 1e-3 / h:.1f}% flow error") .. rst-class:: sphx-glr-script-out .. code-block:: none V-notch: head 73.4 mm; a 1 mm error is a 3.4% flow error rectangular: head 16.9 mm; a 1 mm error is a 8.9% flow error .. GENERATED FROM PYTHON SOURCE LINES 55-56 The slopes of the log-log curves are the exponents of the head. .. GENERATED FROM PYTHON SOURCE LINES 56-64 .. code-block:: Python slope_vee = np.polyfit(np.log(H), np.log(Q_vee), 1)[0] print(f"fitted exponent of the notch: {slope_vee:.3f}") assert np.isclose(slope_vee, 2.5) assert h_vee > 2.5 * h_rect plt.show() .. rst-class:: sphx-glr-script-out .. code-block:: none fitted exponent of the notch: 2.500 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.188 seconds) .. _sphx_glr_download_api_gallery_fluid_engineering_measurement_plot_04_thomson_v_notch_weir.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/fluid_engineering/measurement/plot_04_thomson_v_notch_weir.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_04_thomson_v_notch_weir.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_04_thomson_v_notch_weir.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_04_thomson_v_notch_weir.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_