Why physics-based?

The name “Thermodynamic Models for Heat Pumps” describes what TMHP is — a library of thermodynamic cycle models. How those models are written is the part this page is about: every cycle is solved from first principles, not fitted against catalogue data.

Most building-energy simulators take the opposite route. They model a heat pump as an empirical curve fit — typically a polynomial in (outdoor temperature, leaving-water temperature) calibrated against the manufacturer’s test points. That approach is cheap and accurate inside the calibration envelope, but it carries three structural limitations that this library was built to remove.

The three structural limits of curve fits

Curve-fit models

TMHP

Operating range

Tied to the manufacturer’s test points; extrapolation is unreliable.

Predictive across the full refrigerant envelope — limited by the EOS, not by training data.

Refrigerant

Baked into the fitted coefficients. Changing R410A → R290 requires a new dataset.

The refrigerant is a constructor argument (ref="R290"). Anything CoolProp supports works.

State visibility

Cycle state is hidden behind the fit. You see COP; you don’t see why.

Every cycle node (compressor in/out, expander in/out, evaporator / condenser saturation) is in the result frame at every step.

Two sources over the same three days

The figure below runs an air-source and a ground-source unit through the same three winter days. Both are the same machine apart from the source — R290, 8 kW nominal, heating a 50 °C tank at 6 kW — so the difference between their COP curves comes from the temperature each one draws heat from. The outdoor air swings below freezing every night, and below about 5 °C the outdoor coil frosts and has to be defrosted (the penalty is deepest around 2 °C), so the air-source COP falls further than the colder air alone would explain. The ground-loop fluid dips by a few kelvin only while the heat pump is making hot water, and recovers between draws. Both curves come out of the cycle, heat-exchanger, frost and borehole models; no coefficient is fitted to either machine.

Two stacked panels over 72 hours. Panel (a): outdoor air swinging between about -8 and +4 °C, and ground-loop fluid between about 12 and 15 °C. Panel (b): system COP of the air-source unit between about 2.1 and 3.3, and of the ground-source unit near 4.

Source temperature (a) and system COP at the same duty (b) of an air-source and a ground-source unit over three winter days. The load is hot water only and the ground starts near its undisturbed temperature, so the loop stays at 12–15 °C: in midwinter, with a space-heating load drawing on the field, the loop runs colder than this. The outdoor air is a synthetic profile (a 5 K daily swing on a 3 K cold spell), and each COP is the steady state of the running machine at that hour’s source temperature — thermostat on and off cycles are not included. Generated by scripts/visualization/source_cop_timeseries.py.

What gets solved at every time step

Each released cycle-resolved family couples a closed refrigerant cycle to its surrounding system. Boiler families target tank charge; ASHP and GSHP target indoor-unit load, with positive Q_r_iu selecting cooling and negative Q_r_iu selecting heating. The cycle solver then finds a feasible low-power operating point rather than evaluating fitted coefficients.

Sub-model

Method

Refrigerant state points

CoolProp (REFPROP-grade EOS).

Compressor work

Isentropic + volumetric + mechanical efficiency.

Condenser / evaporator

ε-NTU heat exchanger model.

Outdoor unit fan

ASHRAE 90.1-style VSD power curve, air-side ε-NTU.

Borehole (GSHP)

g-function via pygfunction.

PV / solar thermal

pvlib-driven irradiance and power.

Cycle closure

Internal minimisation → optimal evaporating temperature.

The same core cycle is reused across the released cycle-resolved families — what changes is the source boundary (air / ground / water), the demand boundary (DHW tank or building load), and optional PV / STC / ESS subsystems.

The compute trade-off

Solving an EOS state at every cycle node is more expensive than evaluating a polynomial. In practice it lands around a few hundred steps per second on a single core for the ASHPB reference case — fast enough that a year-long minute-resolution run takes hours, not minutes.

If that is still too slow for your use case, a fitted surrogate is the right escape hatch. TMHP tracks commercial catalogue data well enough (see Validation) that you can train the surrogate against this library itself, without collecting fresh bench data.