.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/heat_transfer/plot_heat_transfer_benchmark.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_heat_transfer_plot_heat_transfer_benchmark.py: Cooling and the lumped time constant ==================================== A small copper sphere has a small Biot number in the chosen convection field. Its excess temperature should decrease to 1/e of its initial value at one lumped time constant. All temperatures are absolute. .. GENERATED FROM PYTHON SOURCE LINES 9-27 .. image-sg:: /api/gallery/heat_transfer/images/sphx_glr_plot_heat_transfer_benchmark_001.png :alt: plot heat transfer benchmark :srcset: /api/gallery/heat_transfer/images/sphx_glr_plot_heat_transfer_benchmark_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.heat_transfer import biot_number, lumped_temperature radius, h, k, rho, cp = 0.005, 10, 400, 8960, 385 A, V = 4 * np.pi * radius**2, 4 * np.pi * radius**3 / 3 assert biot_number(h, V / A, k) < 0.1 tau = rho * cp * V / (h * A) t = np.linspace(0, 5 * tau, 101) T = lumped_temperature(373, 293, h, A, rho, cp, V, t) assert np.isclose(lumped_temperature(373, 293, h, A, rho, cp, V, tau), 293 + 80 / np.e) fig, ax = plt.subplots() ax.plot(t / tau, (T - 293) / 80) ax.set(xlabel="time / time constant", ylabel="normalized excess temperature") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.060 seconds) .. _sphx_glr_download_api_gallery_heat_transfer_plot_heat_transfer_benchmark.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/heat_transfer/plot_heat_transfer_benchmark.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_heat_transfer_benchmark.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_heat_transfer_benchmark.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_heat_transfer_benchmark.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_