Skip to main content

The Heat Pump Lab

The Heat Pump Lab, from the Ahuora Centre at the University of Waikato, is a Python package for building and analysing high-temperature heat pump cycles. It solves steady-state cycle designs with real-fluid properties, including zeotropic refrigerant mixtures and transcritical and supercritical operation, and reports COP, pressures, compressor duties and heat-exchanger approaches.

The package contains seven cycle models. Each is a module under HeatPumpLab.cycles:

Cycle Module What it models Reference
Recuperative heat pump (RHP) RecuperativeHeatPump One or two compressors with up to three recuperative heat exchangers (RHX) placed between the gas coolers, for high-temperature glide heating. Includes Bayesian optimisation of the design. [1]
Split-stream heat pump (SLTHP) SplitHeatPump Two-stage cycle with RHX1 in parallel with the low-temperature gas cooler. [1]
Steam-generating heat pump ConventionalHeatPump Single-stage rating model with compressor maps, heat losses and steam raising. [2]
Transcritical–transcritical CO₂ cascade TTCascadeHeatPump The bottom cycle gives its heat to the top cycle's suction gas in a cascade gas cooler; the top cycle heats the air in two gas coolers, with optional secondary air. IHXs in both cycles, optional expanders. [3–5]
n-level cascade CascadeHeatPump Two to four levels heating the air in series through each level's subcooler and its share of condenser heat. Optional IHX per level and expanders. [6]
Heat pump with MVR steam MVRHeatPump A vapour-compression cycle heats the air and raises low-pressure steam, which a chain of mechanical vapour recompression fans, with water injection and splits to the process, lifts to heat the air to the target. [2]
sCO₂ reverse Brayton heat pump BraytonHeatPump Supercritical CO₂ cycle with split compression, a preheater, an IHX and a turbine expander, architectures 1 and 2. [7]

Web apps

Two of the models also run in the browser, with CoolProp compiled to WebAssembly. Nothing is installed and no inputs leave the browser:

  • Advanced dryer heat pumps (apps/dryer): the air-drying cycles (all but the steam-generating heat pump), solved live, plus the results of the REFPROP design study.
  • Steam-generating heat pump (apps/steam): the single-stage cycle raising steam, with compressor maps, saved cases, side-by-side comparison and sweeps.

A landing page (apps/index.html) links the two. They are published at https://waikato-ahuora-smart-energy-systems.github.io/HeatPumpLab/. To run them locally:

python3 -m http.server 8000 --directory apps

Then open http://localhost:8000. The Python models reproduce the apps' results.

Requirements

  • Python 3.12 or later, and uv (recommended) or pip.

  • Fluid properties come from CoolProp (free, installed with the package) by default, for every cycle. Mixtures use phase-imposed flashes with cached bubble and dew points, plus a phase-envelope fallback near the critical point, so zeotropic blends solve robustly and quickly.

  • NIST REFPROP 10 (optional) can be used instead. REFPROP is commercial software and is not included; you need your own licence. HeatPumpLab looks for it at:

    • macOS: /Library/REFPROP/ (librefprop.dylib, librefprop-source.dylib, librefprop-sink.dylib)
    • Windows: C:/Program Files (x86)/REFPROP/ (REFPROP.DLL, REFPROP-source.DLL, REFPROP-sink.DLL)

    The three library files are copies of the same REFPROP library, so the refrigerant, source and sink fluids can be loaded at the same time.

Installation

git clone https://github.com/waikato-ahuora-smart-energy-systems/HeatPumpLab.git
cd HeatPumpLab
uv sync                      # core dependencies (including CoolProp), and the package itself
uv sync --extra refprop      # optional: the REFPROP backend (needs a REFPROP installation)
uv sync --group dev          # optional: pytest and ruff

To use REFPROP, set HEATPUMPLAB_PROPERTY_BACKEND=refprop, or pass property_backend="refprop" to the steam-generating heat pump's configuration (ConventionalHPConfig). The two backends agree closely; mixture results can differ slightly where their binary interaction parameters differ, and absolute enthalpies and entropies of some mixtures differ by a constant (reference state), which does not affect cycle results. The fluid property overview table (get_fluid_prop_overview_table) uses REFPROP-only outputs such as ODP and GWP.

Run the examples below with uv run python your_script.py from the repository root.

Quick start

Recuperative heat pump

from HeatPumpLab.cycles.RecuperativeHeatPump import RecuperativeHP

hp = RecuperativeHP(
    refrigerant="Propane;Isopentane|0.2;0.8|mass",  # components; fractions; basis
    T_source_in=40.0,       # heat source (water) inlet, °C
    Tref_evap_inlet=10.0,   # refrigerant entering the evaporator, °C
    T_air_inlet=15.0,       # sink (air) inlet, °C
    T_air_tar=200.0,        # sink outlet target, °C
    dT_GC_min_tar=20.0,     # gas-cooler minimum approach, K
    dTmin_rhx=5.0,          # recuperator minimum approach, K
    n_comp=2,               # compression stages
    dT_rhx1_cold=60.0,      # RHX1 lift on the stage-1 suction, K
    dT_rhx2_cold=0.0,       # RHX2 lift before stage 2, K
    comp2_power_frac=0.5,   # pressure-ratio allocation to stage 2
    sink="Air",
    source="water",
).solve()

print(hp.converged, hp.COP)              # True 2.59
print(hp.get_report()["Pmax"])           # maximum pressure, kPa

Design optimisation

optimise_recuperative_heat_pump searches the RHX lifts, stage allocation and, optionally, the mixture composition with Bayesian optimisation (BoTorch). Solves run in worker processes, so call it from a script with a main guard:

from HeatPumpLab.cycles.RecuperativeHeatPump.optimisation import (
    OuterDesignOptimisationConfig, optimise_recuperative_heat_pump,
)

if __name__ == "__main__":
    result = optimise_recuperative_heat_pump(
        refrigerant="Propane;Butane|0.3;0.7|mass",
        config=OuterDesignOptimisationConfig(
            max_exact_evaluations=200, seed=20260910,
            vary_composition=False, preserve_incumbent=False,
        ),
    )
    print(result.best.cop, result.best.x)

A 200-evaluation search takes roughly ten to fifteen minutes on a laptop. See the optimisation protocol for the settings and their limits.

Split-stream heat pump

from HeatPumpLab.cycles.SplitHeatPump import SplitHeatPump, SplitHPConfig

res = SplitHeatPump(SplitHPConfig(
    refrigerant="Propane;Isopentane|0.2;0.8|mass",
    dT_rhx1_cold=80.0,          # RHX1 lift, K
)).solve()
print(res.success, res.COP, res.P_H)    # gas-cooler pressure, MPa

Steam-generating heat pump

from HeatPumpLab.cycles.ConventionalHeatPump import ConventionalHeatPump, ConventionalHPConfig

res = ConventionalHeatPump(ConventionalHPConfig()).solve()       # n-butane, Recip-M compressor map
res = ConventionalHeatPump(ConventionalHPConfig(T_evap=40.0, T_cond=110.0)).solve()
print(res.COP, res.report["Q_heat_kW"], res.report["T_discharge"])

# REFPROP instead of CoolProp (needs `uv sync --extra refprop` and a REFPROP installation)
res = ConventionalHeatPump(ConventionalHPConfig(property_backend="refprop")).solve()

The defaults model n-butane on the Recip-M reciprocating compressor map, raising 120 °C steam from a 55 °C heat source, with hot water from the subcooler. Compressors can be described by efficiency maps, efficiency against pressure ratio, or EN 12900 polynomials (compressor_curves.py).

Refrigerants

Fluids use REFPROP-style names (Propane, Butane, Isopentane, ...), which are mapped to CoolProp's names automatically. A mixture is written as "Fluid1;Fluid2|x1;x2|basis" with basis mass or mol, for example "Propane;Isopentane|0.2;0.8|mass". Ternary mixtures use the same form.

Repository layout

HeatPumpLab/
  components/      compressors, heat exchangers, valves, streams and solver relationships
  cycles/          one module per cycle (see the table above), and shared helpers in common/
  utils/           property packages (CoolProp, REFPROP), caching, parallel solving, plotting
apps/              web apps: landing page, dryer/ and steam/ (published with GitHub Pages)
tests/             test suite
rhp_*.py           research search scripts for the recuperative heat pump (Pareto, MOBO, trust region)

Tests

uv sync --group dev
uv run pytest

Tests that check the REFPROP backend skip automatically when it is not installed.

Further documentation

Detailed notes on the recuperative heat pump solver and optimiser are in HeatPumpLab/cycles/RecuperativeHeatPump/, including:

References

  1. T.G. Walmsley, K.-M. Adamson, C. Arpagaus, F. Schlosser, Recuperative heat pump cycle concept for high-temperature glide process heating applications, Applied Thermal Engineering 301 (2026) 131660. https://doi.org/10.1016/j.applthermaleng.2026.131660
  2. T.G. Walmsley, B. Ong, K. Hall, B. Lincoln, F. Schlosser, J. Walden, R. Padullés, D. Hoang, M. Walmsley, C. Arpagaus, Steam cogeneration heat pumps for the food, dairy and meat industries, in: 5th High-Temperature Heat Pump Symposium 2026, Book of Presentations, Copenhagen, Denmark, February 2026, pp. 270–275.
  3. L. Kong, New high temperature transcritical CO₂ heat pump concept for spray drying, PhD thesis, The University of Waikato (2026). https://hdl.handle.net/10289/18056 (the TT cascade model follows cycle TT-4, with the additional gas cooler)
  4. L. Kong, T.G. Walmsley, D.K. Hoang, F. Schlosser, Q. Chen, J.K. Carson, D.J. Cleland, Transcritical-transcritical cascade CO₂ heat pump cycles for high-temperature heating: A numerical evaluation, Applied Thermal Engineering 238 (2024) 122005. https://doi.org/10.1016/j.applthermaleng.2023.122005
  5. L. Kong, F. Schlosser, S. Kloeppel, J.K. Carson, D.J. Cleland, T.G. Walmsley, Transcritical–transcritical cascade CO₂ heat pump with expansion work recovery: A thermodynamic analysis, Energies 19 (2026) 3767. https://doi.org/10.3390/en19163767
  6. D.K. Hoang, T.G. Walmsley, D.J. Cleland, Q. Chen, J.K. Carson, Thermo-economic investigation and multi objective optimization of cascade high temperature heat pump using low global warming refrigerants, Applied Thermal Engineering 279 (2025) 127901. https://doi.org/10.1016/j.applthermaleng.2025.127901
  7. V. Dalal, S. Klöppel, C. Rose, T.G. Walmsley, Evaluating sCO₂ heat pump architectures for large-scale industrial air drying above 150 °C, European sCO₂ Conference (Euro sCO₂ 2027), under review.

Citing

If you use HeatPumpLab in published work, please cite reference [1], and the reference for any other cycle you use.

Licence

Copyright 2021–2026 The University of Waikato.

Licensed under the Apache License, Version 2.0. See LICENSE.

Contact

Tim Walmsley, Ahuora Centre, University of Waikato: tim.walmsley@waikato.ac.nz

Metadata

Release files for heatpumplab 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for heatpumplab 0.1.0
File Size Uploaded Provenance Actions
heatpumplab-0.1.0.tar.gz 268.1 kB With provenance Details for heatpumplab-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for heatpumplab 0.1.0
File Interpreter ABI Platform Actions
heatpumplab-0.1.0-py3-none-any.whl Python 3 none any Details for heatpumplab-0.1.0-py3-none-any.whl

Total release size: 599.1 kB

Release files / heatpumplab-0.1.0.tar.gz

Download URL heatpumplab-0.1.0.tar.gz
Size 268.1 kB
Tags Source
SHA-256 checksum
How to use checksums
92934b7b44496d91403b08d2c52070f76d432f3466ad2bbfcaf1b3bc78061505
BLAKE2b-256 checksum
How to use checksums
da1a87e2f641e15162a313b6aaf78bd5a23123f3e19f92bbf99324954bcfa430
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Release files / heatpumplab-0.1.0-py3-none-any.whl

Download URL heatpumplab-0.1.0-py3-none-any.whl
Size 331.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b9f1ecbc1881f3841a538564b3c517f4faaac09c23e739538a8950d96b0c893
BLAKE2b-256 checksum
How to use checksums
ca8c259e86395ea6c130ddd34d9a135f480b27e6d703dd5fca2495814ec93a1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

Security for heatpumplab 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for heatpumplab-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page