.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/thermodynamics/cycles/plot_03_brayton_cycle.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_thermodynamics_cycles_plot_03_brayton_cycle.py: Brayton's constant-pressure cycle (1872) ======================================== George Brayton's "Ready Motor" (patented 1872) compressed air in one cylinder, burned fuel in it at constant pressure, and expanded the gases in another. The engine itself lost out to Otto's, but its cycle (also called Joule's) is the cycle of every gas turbine and jet engine: isentropic compression, heat addition at constant pressure, isentropic expansion and heat rejection at constant pressure. With a calorically perfect gas the efficiency depends only on the pressure ratio, :math:`\eta = 1 - r_p^{(1-\gamma)/\gamma}` (:func:`~engineeringkit.thermodynamics.brayton_efficiency`). The example rebuilds that result from the four state temperatures. .. GENERATED FROM PYTHON SOURCE LINES 18-23 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.thermodynamics import brayton_efficiency, isentropic_temperature_ratio, thermal_efficiency .. GENERATED FROM PYTHON SOURCE LINES 24-29 Four states from the first law ------------------------------ Air at 300 K enters a compressor of pressure ratio 12; the turbine inlet is 1400 K. Heat in is :math:`c_p(T_3 - T_2)`, heat out :math:`c_p(T_4 - T_1)`. .. GENERATED FROM PYTHON SOURCE LINES 29-40 .. code-block:: Python cp, gamma, T1, T3, rp = 1005.0, 1.4, 300.0, 1400.0, 12.0 tau = isentropic_temperature_ratio(rp, gamma) T2, T4 = T1 * tau, T3 / tau q_in, q_out = cp * (T3 - T2), cp * (T4 - T1) eta = thermal_efficiency(q_in, q_out) print(f"T2 = {T2:.0f} K, T4 = {T4:.0f} K; net work {(q_in - q_out) / 1e3:.0f} kJ/kg") print(f"efficiency from the states {eta:.4f}, from the formula {brayton_efficiency(rp, gamma):.4f}") assert np.isclose(eta, brayton_efficiency(rp, gamma)) assert np.isclose(eta, 1 - T1 / T2) # the efficiency is that of the compressor alone .. rst-class:: sphx-glr-script-out .. code-block:: none T2 = 610 K, T4 = 688 K; net work 404 kJ/kg efficiency from the states 0.5083, from the formula 0.5083 .. GENERATED FROM PYTHON SOURCE LINES 41-49 Efficiency against pressure ratio --------------------------------- A monatomic gas (:math:`\gamma = 5/3`), as in closed-cycle helium turbines, reaches a given efficiency at a lower pressure ratio than air. The efficiency keeps rising with pressure ratio, but the net work per kilogram does not: compressor work grows and, with the turbine inlet fixed, less heat can be added. .. GENERATED FROM PYTHON SOURCE LINES 49-61 .. code-block:: Python ratios = np.linspace(1, 40, 200) fig, ax = plt.subplots(figsize=(6, 3.5)) for g, name in ((1.4, "air, γ = 1.4"), (5 / 3, "helium, γ = 5/3")): ax.plot(ratios, [brayton_efficiency(r, g) for r in ratios], label=name) ax.axvline(rp, color="gray", ls=":") ax.set(xlabel="pressure ratio", ylabel="ideal efficiency", ylim=(0, 1), title="Ideal Brayton cycle") ax.legend() fig.tight_layout() assert brayton_efficiency(1.0) == 0 and brayton_efficiency(rp, 5 / 3) > brayton_efficiency(rp, 1.4) plt.show() .. image-sg:: /api/gallery/thermodynamics/cycles/images/sphx_glr_plot_03_brayton_cycle_001.png :alt: Ideal Brayton cycle :srcset: /api/gallery/thermodynamics/cycles/images/sphx_glr_plot_03_brayton_cycle_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.033 seconds) .. _sphx_glr_download_api_gallery_thermodynamics_cycles_plot_03_brayton_cycle.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/thermodynamics/cycles/plot_03_brayton_cycle.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_brayton_cycle.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_brayton_cycle.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_brayton_cycle.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_