.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/fluid_engineering/drag/plot_01_stokes_drag.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_drag_plot_01_stokes_drag.py: Stokes's drag on a sphere (1851) ================================ George Gabriel Stokes, correcting pendulum experiments for the air dragged along with the bob, solved the slow viscous flow past a sphere in a paper read to the Cambridge Philosophical Society in December 1850 and printed in 1851. The drag is :math:`3\pi\mu dV` (:func:`~engineeringkit.fluid_engineering.stokes_drag`), so a small sphere settles at :math:`(\rho_p - \rho)gd^2/(18\mu)` (:func:`~engineeringkit.fluid_engineering.stokes_settling_velocity`). The law fails once inertia matters, near :math:`Re = 1`; the measured drag curve (:func:`~engineeringkit.fluid_engineering.sphere_drag_coefficient`) takes over. This example draws the curve and finds how fast sand grains of different sizes fall through water (:func:`~engineeringkit.fluid_engineering.terminal_velocity`). .. GENERATED FROM PYTHON SOURCE LINES 20-31 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.fluid_engineering import ( reynolds_number, sphere_drag_coefficient, stokes_drag, stokes_settling_velocity, terminal_velocity, ) .. GENERATED FROM PYTHON SOURCE LINES 32-37 The sphere drag curve --------------------- Stokes's :math:`C_D = 24/Re` is the straight line at the left; the curve levels off near 0.4 in Newton's range before the drag crisis. .. GENERATED FROM PYTHON SOURCE LINES 37-47 .. code-block:: Python Re = np.geomspace(0.01, 2e5, 200) fig, ax = plt.subplots(figsize=(6, 4)) ax.loglog(Re, sphere_drag_coefficient(Re), label="drag curve (White's fit)") ax.loglog(Re[Re < 10], 24 / Re[Re < 10], "--", label="Stokes, 24/Re") ax.set(xlabel="Reynolds number", ylabel="drag coefficient $C_D$", title="Drag on a smooth sphere") ax.legend() ax.grid(True, which="both", lw=0.3) fig.tight_layout() .. image-sg:: /api/gallery/fluid_engineering/drag/images/sphx_glr_plot_01_stokes_drag_001.png :alt: Drag on a smooth sphere :srcset: /api/gallery/fluid_engineering/drag/images/sphx_glr_plot_01_stokes_drag_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 48-53 Settling sand ------------- Quartz sand (2650 kg/m³) falling through water at 20 °C. Stokes's velocity is accurate for silt but overestimates coarse sand badly. .. GENERATED FROM PYTHON SOURCE LINES 53-60 .. code-block:: Python rho, mu, rho_p = 998.0, 1.0e-3, 2650.0 for d in [20e-6, 100e-6, 500e-6, 2e-3]: V = terminal_velocity(d, rho_p, rho, mu) V_stokes = stokes_settling_velocity(d, rho_p, rho, mu) print(f"d = {d * 1e6:6.0f} µm: V = {V * 1000:7.3f} mm/s, Stokes {V_stokes * 1000:9.3f} mm/s, Re = {reynolds_number(rho, V, d, mu):.3g}") .. rst-class:: sphx-glr-script-out .. code-block:: none d = 20 µm: V = 0.359 mm/s, Stokes 0.360 mm/s, Re = 0.00717 d = 100 µm: V = 8.042 mm/s, Stokes 9.000 mm/s, Re = 0.803 d = 500 µm: V = 76.071 mm/s, Stokes 225.008 mm/s, Re = 38 d = 2000 µm: V = 247.453 mm/s, Stokes 3600.130 mm/s, Re = 494 .. GENERATED FROM PYTHON SOURCE LINES 61-63 The drag on a 20 µm silt grain at its settling speed equals its weight less its buoyancy. .. GENERATED FROM PYTHON SOURCE LINES 63-73 .. code-block:: Python d = 20e-6 V = stokes_settling_velocity(d, rho_p, rho, mu) weight = (rho_p - rho) * 9.80665 * np.pi * d**3 / 6 assert np.isclose(stokes_drag(mu, V, d), weight) assert np.isclose(terminal_velocity(d, rho_p, rho, mu), V, rtol=1e-2) assert terminal_velocity(2e-3, rho_p, rho, mu) < 0.2 * stokes_settling_velocity(2e-3, rho_p, rho, mu) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.188 seconds) .. _sphx_glr_download_api_gallery_fluid_engineering_drag_plot_01_stokes_drag.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/drag/plot_01_stokes_drag.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_stokes_drag.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_stokes_drag.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_stokes_drag.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_