.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/thermodynamics/refrigeration/plot_03_perkins_r134a_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_refrigeration_plot_03_perkins_r134a_cycle.py: Perkins's cycle on a modern refrigerant (1834) ============================================== Perkins's cycle of evaporation, compression, condensation and throttling is unchanged. The working fluid is: ether gave way to ammonia, then to the fluorocarbons, and R-134a ran most car air conditioners and domestic refrigerators from the 1990s. With its properties from the Peng-Robinson equation of state (:func:`~engineeringkit.thermodynamics.refrigerant_properties`), :func:`~engineeringkit.thermodynamics.vapor_compression_cycle` solves the cycle state by state. .. GENERATED FROM PYTHON SOURCE LINES 16-21 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from engineeringkit.thermodynamics import carnot_cop_refrigerator, vapor_compression_cycle .. GENERATED FROM PYTHON SOURCE LINES 22-27 Çengel and Boles's refrigerator ------------------------------- Example 11-1: R-134a between 0.14 and 0.8 MPa at 0.05 kg/s. The tables give 7.18 kW of cooling for 1.81 kW of work, a COP of 3.97. .. GENERATED FROM PYTHON SOURCE LINES 27-42 .. code-block:: Python ideal = vapor_compression_cycle(0.14e6, 0.8e6) for label, st in zip(ideal.labels, ideal.states): print(f"{label:18s} {st.p / 1e3:6.0f} kPa {st.T - 273.15:6.1f} °C h = {st.h / 1e3:6.1f} kJ/kg ({st.phase})") print( f"cooling {0.05 * ideal.q_evaporator / 1e3:.2f} kW, work {0.05 * ideal.compressor_work / 1e3:.2f} kW, COP {ideal.cop_refrigerator:.2f}" ) assert abs(ideal.cop_refrigerator - 3.97) < 0.08 real = vapor_compression_cycle(0.14e6, 0.8e6, superheat=5.0, subcooling=3.0, compressor_efficiency=0.8) carnot = carnot_cop_refrigerator(ideal.states[2].T, ideal.states[0].T) print(f"with 5 K superheat, 3 K subcooling and an 80% compressor: COP {real.cop_refrigerator:.2f}; Carnot {carnot:.2f}") assert real.cop_refrigerator < ideal.cop_refrigerator < carnot fig, ax = ideal.plot() .. image-sg:: /api/gallery/thermodynamics/refrigeration/images/sphx_glr_plot_03_perkins_r134a_cycle_001.png :alt: R-134a vapour-compression cycle, COP = 3.94 :srcset: /api/gallery/thermodynamics/refrigeration/images/sphx_glr_plot_03_perkins_r134a_cycle_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none compressor inlet 140 kPa -18.7 °C h = 387.9 kJ/kg (mixture) compressor outlet 800 kPa 34.4 °C h = 424.1 kJ/kg (vapour) condenser outlet 800 kPa 31.4 °C h = 245.4 kJ/kg (mixture) evaporator inlet 140 kPa -18.7 °C h = 245.4 kJ/kg (mixture) cooling 7.12 kW, work 1.81 kW, COP 3.94 with 5 K superheat, 3 K subcooling and an 80% compressor: COP 3.27; Carnot 5.08 .. GENERATED FROM PYTHON SOURCE LINES 43-47 A warmer kitchen ---------------- Raising the condensing pressure, as on a hot day, lowers the COP. .. GENERATED FROM PYTHON SOURCE LINES 47-57 .. code-block:: Python p_cond = np.linspace(0.6e6, 1.6e6, 11) cops = [vapor_compression_cycle(0.14e6, p).cop_refrigerator for p in p_cond] fig, ax = plt.subplots(figsize=(6, 3.5)) ax.plot(p_cond / 1e6, cops, "o-") ax.set(xlabel="condenser pressure [MPa]", ylabel="COP", title="R-134a, evaporator at 0.14 MPa") fig.tight_layout() assert np.all(np.diff(cops) < 0) plt.show() .. image-sg:: /api/gallery/thermodynamics/refrigeration/images/sphx_glr_plot_03_perkins_r134a_cycle_002.png :alt: R-134a, evaporator at 0.14 MPa :srcset: /api/gallery/thermodynamics/refrigeration/images/sphx_glr_plot_03_perkins_r134a_cycle_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.429 seconds) .. _sphx_glr_download_api_gallery_thermodynamics_refrigeration_plot_03_perkins_r134a_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/refrigeration/plot_03_perkins_r134a_cycle.ipynb :alt: Launch JupyterLite :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_perkins_r134a_cycle.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_perkins_r134a_cycle.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_perkins_r134a_cycle.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_