.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/atmosphere/plot_12_richardson_turbulence_criterion.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_atmosphere_plot_12_richardson_turbulence_criterion.py: Richardson's turbulence criterion (1920) ======================================== Lewis Fry Richardson asked when wind shear can stir up a stably stratified layer. Turbulence must lift heavy air against buoyancy, at a rate set by ``N^2``, using energy drawn from the shear. Their ratio, the Richardson number, decides: Miles and Howard later proved that a stratified shear flow can become unstable only where it falls below 1/4. Over a night-time boundary layer, the critical value marks the height where turbulence dies out. .. GENERATED FROM PYTHON SOURCE LINES 12-36 .. image-sg:: /api/gallery/atmosphere/images/sphx_glr_plot_12_richardson_turbulence_criterion_001.png :alt: A stable night-time layer :srcset: /api/gallery/atmosphere/images/sphx_glr_plot_12_richardson_turbulence_criterion_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none turbulence can persist below about 99 m | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from earthsciencekit.atmosphere import brunt_vaisala_squared, richardson_number from earthsciencekit.constants import GRAVITY height = np.linspace(10, 500, 200) theta_gradient = 0.01 * (1 - np.exp(-height / 150)) shear = 8 / 200 * np.exp(-height / 200) + 1e-3 ri = richardson_number(brunt_vaisala_squared(290, theta_gradient, GRAVITY), shear) assert np.all(np.diff(ri) > 0) crossing = height[np.argmax(ri > 0.25)] assert ri[0] < 0.25 < ri[-1] assert np.isclose(richardson_number(-1e-4, 0.01), -1) print(f"turbulence can persist below about {crossing:.0f} m") fig, ax = plt.subplots() ax.semilogx(ri, height) ax.axvline(0.25, color="k", ls="--", label="Ri = 1/4") ax.set(xlabel="gradient Richardson number", ylabel="height [m]", title="A stable night-time layer") ax.legend() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.108 seconds) .. _sphx_glr_download_api_gallery_atmosphere_plot_12_richardson_turbulence_criterion.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/atmosphere/plot_12_richardson_turbulence_criterion.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_12_richardson_turbulence_criterion.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_12_richardson_turbulence_criterion.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_12_richardson_turbulence_criterion.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_