.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/fluids/viscous_flow/plot_reynolds_number_scaling.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. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_fluids_viscous_flow_plot_reynolds_number_scaling.py: The Reynolds number: one ratio, regardless of size or fluid ================================================================= Osborne Reynolds injected a thread of dye into water flowing through a glass pipe and found that a single dimensionless ratio, .. math:: Re = \frac{UL}{\nu}, controls exactly where the flow transitions from smooth to chaotic -- regardless of the pipe's size or the fluid's identity. That dimensional-similarity claim is the founding result of scaled experimental testing in fluid mechanics: a wind-tunnel model and a full-size aircraft behave identically whenever their Reynolds numbers match, however different their absolute sizes or fluids. This example makes that "regardless of size or fluid" claim concrete using :func:`~physicskit.fluids.systems.viscous_flow.stokes_drag` as a source of physically realizable flows: a sphere settling at Stokes terminal velocity provides a natural way to sweep both the length scale (the sphere's radius) and the fluid's identity (its viscosity) independently, and :func:`~physicskit.fluids.utils.dimensionless.reynolds_number` computes the resulting ratio at every combination. The single :math:`Re=1` contour that results cuts across both axes at once -- exactly the dimensional-similarity signature Reynolds' 1883 experiments established, rather than a property tied to any one sphere size or any one fluid. .. GENERATED FROM PYTHON SOURCE LINES 30-38 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from physicskit.fluids.systems.viscous_flow import stokes_drag from physicskit.fluids.utils.dimensionless import reynolds_number from physicskit.fluids.visualizers import theme .. GENERATED FROM PYTHON SOURCE LINES 39-44 Sweep both sphere radius and fluid viscosity independently --------------------------------------------------------------- For each combination, a sphere of density ``rho_sphere`` settling under gravity through a fluid of density ``rho_fluid`` and viscosity ``mu`` reaches a Stokes terminal velocity that fixes its own Reynolds number. .. GENERATED FROM PYTHON SOURCE LINES 44-63 .. code-block:: Python rho_fluid, rho_sphere, g = 1000.0, 2500.0, 9.81 # water-like fluid, glass bead radii = np.geomspace(1e-5, 1e-3, 40) mu_sweep = np.geomspace(1e-4, 1e-1, 60) # from water-like to honey-like Re_grid = np.array( [ [ reynolds_number( velocity=((4.0 / 3.0) * np.pi * R**3 * (rho_sphere - rho_fluid) * g) / stokes_drag(m, R, 1.0), length=2 * R, nu=m / rho_fluid, ) for R in radii ] for m in mu_sweep ] ) .. GENERATED FROM PYTHON SOURCE LINES 64-70 A single Re = 1 contour, regardless of radius or viscosity ----------------------------------------------------------------- The same ratio governs the transition everywhere along this contour, even though the sphere radius spans two decades and the viscosity spans three -- exactly Reynolds' claim that the ratio alone, not the size or the fluid separately, decides the regime. .. GENERATED FROM PYTHON SOURCE LINES 70-94 .. code-block:: Python mu_water = 1.0e-3 fig, ax = plt.subplots(figsize=(7, 5)) im = ax.pcolormesh(radii, mu_sweep, np.log10(Re_grid), cmap=theme.SEQUENTIAL_CMAP, shading="auto") fig.colorbar(im, ax=ax, label=r"$\log_{10} Re$") cs = ax.contour(radii, mu_sweep, Re_grid, levels=[1.0], colors="white", linewidths=1.5) ax.clabel(cs, fmt={1.0: "Re = 1"}) ax.axhline(mu_water, color=theme.MUTED, ls="--", lw=1.0, label=r"water-like $\mu$") ax.set_xscale("log") ax.set_yscale("log") ax.set_xlabel("sphere radius (m)") ax.set_ylabel(r"fluid viscosity $\mu$ (Pa s)") ax.legend() ax.set_title("Re = 1 cuts across both radius and viscosity alike") fig.tight_layout() n_water = np.argmin(np.abs(mu_sweep - mu_water)) crossing = radii[np.argmin(np.abs(Re_grid[n_water] - 1.0))] print(f"at water-like viscosity, Re crosses 1 near radius {crossing * 1e6:.1f} microns") print("the same Re = 1 threshold recurs at every viscosity in the sweep, at a") print("correspondingly different radius -- the ratio, not either quantity") print("alone, is what is physically meaningful.") plt.show() .. image-sg:: /api/gallery/fluids/viscous_flow/images/sphx_glr_plot_reynolds_number_scaling_001.png :alt: Re = 1 cuts across both radius and viscosity alike :srcset: /api/gallery/fluids/viscous_flow/images/sphx_glr_plot_reynolds_number_scaling_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none at water-like viscosity, Re crosses 1 near radius 52.2 microns the same Re = 1 threshold recurs at every viscosity in the sweep, at a correspondingly different radius -- the ratio, not either quantity alone, is what is physically meaningful. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.132 seconds) .. _sphx_glr_download_api_gallery_fluids_viscous_flow_plot_reynolds_number_scaling.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_reynolds_number_scaling.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_reynolds_number_scaling.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_reynolds_number_scaling.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_