Ground-source heat pump (GSHP — space conditioning)

GSHP conditions a building zone, drawing or rejecting heat through the same g-function borehole heat exchanger as GSHPB.

Overview

The class is tmhp.GroundSourceHeatPump. Use it when the heat pump’s job is space conditioning rather than DHW production.

For quick parametric studies that do not need the full refrigerant cycle, tmhp.GroundSourceHeatPumpEmpirical provides a simpler EnergyPlus EquationFit COP model with the same borehole-response backbone.

Base usage

from tmhp import GroundSourceHeatPump

gshp = GroundSourceHeatPump(
    ref="R410A",
    N_1=1, N_2=1,
    H_b=150.0,
)

# See API reference below for the full constructor and
# analyze_steady / analyze_dynamic signatures.

Defaults that follow the capacity

GroundSourceHeatPump(hp_capacity=..., ref=...) is a complete machine. Everything on the ground side and the indoor airflow is sized from the capacity, so the rating-point COP is the same from 1 to 100 kW:

Input left out

Default

4 kW / 30 kW

ground_flow_ref_lpm

0.75 × hp_capacity / (ρc × 3 K): the rated source-side heat changes the loop temperature by 3 K (about 4.8 K in cooling, where the loop carries 1.2 × the capacity). Parallel boreholes share it equally.

15.4 / 115.3 L/min (25 % ethylene glycol; 14.3 / 107.5 of water)

E_pmp

ASHRAE pumping grade B, 75 W per ton (21.3 W per kW) of capacity. Used when the hydraulic pump model is off.

85 / 640 W

N_1, N_2, H_b (all three)

Smallest near-square field of 100 m boreholes that keeps the rated source-side heat within 50 W/m.

1 × 1 / 3 × 2

dV_iu_fan_a_rated

Largest blower airflow water-to-air units of that capacity publish: 0.0491 × kW + 0.1305 m³/s (cooling-rated; both capacities here lie outside the 4.7 to 21.6 kW of the catalogue rows, which default_input_estimates reports as extrapolated).

1 177 / 5 773 m³/h

The indoor fan draws E_iu_fan_rated at that airflow: the airflow times dP_iu_fan_rated over eta_iu_fan_rated (60 Pa and 0.6) unless the rated power is given itself, from a catalogue fan power, as E_iu_fan_rated (the two ways together are refused).

The helpers are tmhp.ground_defaults.default_ground_flow_lpm(), tmhp.ground_defaults.default_borefield_layout() and tmhp.pump.default_ground_pump_power(). A value you supply replaces its default. Giving any one of N_1, N_2 or H_b fixes the borefield as given (the others take 1, 1 and 100 m); the flow and the pump power still follow the capacity unless you give them too.

Two sizing slips are reported with a UserWarning at construction instead of being solved silently:

  • a U-tube that is laminar at the reference flow (Re < 2300, for example a flow that was not scaled with the number of parallel boreholes). The borehole resistance is evaluated for laminar flow (film coefficient Nu = 3.66, interpolated to the turbulent correlation between Re 2300 and 4000) and roughly doubles. The Reynolds number is the model attribute Re_bhe_ref.

  • a borefield you sized that carries more than 80 W/m at the rated source-side heat (attribute q_bhe_rated).

The default indoor coil (UA_iu_rated) is the effective conductance that, at the rated duty and this airflow, leaves the supply air 2.79 K from the condensing temperature: the leaving-end approach water-to-air units print at their rating point (Where the defaults come from, Heat-exchanger conductance). The same value serves cooling (the coil is dry). The earlier default, 0.08 × hp_capacity, needed an indoor approach of 18 K for the default 4 kW unit: supply air at 30 °C and condensing at 38 °C in heating from a 20 °C room, supply air at 17 °C and evaporating at 8.6 °C in cooling from 27 °C; a larger unit moves less air per kW and needed more (20 K at 8 kW: supply air at 33 °C and 14 °C). indoor_approach_max_K defaults to 25 K.

The indoor coil takes the density of the room air it draws in, as the coils of Air-source heat pump (ASHP — space conditioning) do (Air density): dV_iu_a [m3/s] and the fan references and limits are volumes at the coil inlet, and the coil NTU, the fan heat, the reported air energy flows and the air exergy all use the mass flow air_density(T_a_room) * dV_iu_a. Room air at 20 to 27 °C is 1.7 to 4.0 % lighter than the 15 °C standard air (1.225 kg/m³) earlier releases used. For the default 4 kW unit as it was then (400 cfm per ton indoors): at a 0 °C borehole wall and a 20 °C room the system COP is 0.4 % lower at nameplate (3.508 → 3.495) and 0.2 % lower at half load; at the ISO 13256-1 cooling point (liquid 25 °C, room 27 °C) the compressor runs 1.4 % faster at nameplate.

Note

Until November 2026 the defaults were fixed at the values of the 4 kW machine (20.04 L/min, 100 W, one borehole) and the indoor airflow was 0.0002 m³/s per W (2 880 m³/h for 4 kW), then 5.37e-5 m³/s per W (400 cfm per ton, 773 m³/h for 4 kW). A larger machine then ran on the small loop: at 30 kW the system COP of rated heating against a 0 °C borehole wall fell from 3.8 to 2.1 and some rating points had no solution; 100 kW could not be constructed. To reproduce results from before, pass ground_flow_ref_lpm=20.04, E_pmp=100, N_1=1, N_2=1, dV_iu_fan_a_rated=0.0002 * hp_capacity, indoor_approach_max_K=20. Fan limits given as absolute flows (dV_iu_fan_a_min/max) are read against the new reference airflow unless dV_iu_fan_a_rated is given as well.

Source-side mechanics

Same g-function-based borehole as Ground-source heat pump boiler (GSHPB). See that page for the detailed mechanic and the g-function figure. As there, the borehole is dynamic by default (heat capacity of fluid, pipe and grout, fluid transit; borehole_dynamics=False gives the steady borehole, see Ground response): with 20 min on / 40 min off the fluid entering the heat pump is 2.0 K warmer in heating and 3.4 K cooler in cooling than the steady borehole gives, and T_bhe [°C] is the physical borehole wall.

source_fluid names the ground-loop liquid (Ground-loop liquid and its freezing limit): 25 % ethylene glycol by default ("MEG-25%", freezing at -11.0 °C), or "water", or another mixture such as "MPG-30%". The loop liquid is never colder than its freezing point plus 3 K – -8.0 °C for the default, 3 °C for water. A heating duty that would chill it further is reduced to the largest one that does not (capacity_clamped == "max", capacity_binding == "source_fluid_freezing"), and when none does the unit is off with failure_reason == "source_fluid_freezing". On the compressor’s speed floor the running machine has no smaller state, so against a prescribed wall or fluid temperature (analyze_steady) a minimum-speed machine that leaves the liquid below the limit is off at every request. In a dynamic step the borehole wall answers the mean load: a unit that cycles with shorter runs sees a warmer loop, and the step is reduced to the largest mean duty whose running liquid stays on the limit (a "max" row that is an on/off mean: runtime_fraction [-] and capacity_ratio [-] below 1, Q_unmet [W] the part not delivered). Cooling warms the loop and is not affected unless the ground itself is below the limit. The ISO 13256-1 ground-loop heating point (liquid entering at 0 °C, leaving near -3 °C) and a 0 °C borehole wall are antifreeze conditions, which the default runs:

gshp = GroundSourceHeatPump()                                        # 4 kW, 25 % ethylene glycol
gshp.analyze_steady(Q_r_iu=-4000, T0=0, T_a_room=20, T_bhe_wall=0)   # leaves at -6.8 °C, system COP 3.70
GroundSourceHeatPump(source_fluid="water").analyze_steady(
    Q_r_iu=-4000, T0=0, T_a_room=20, T_bhe_wall=0
)                                                                    # off: source_fluid_freezing

The default flow keeps the 3 K loop difference with the loop liquid’s heat capacity (15.4 L/min of the default glycol for 4 kW, 14.3 of water) and the borehole resistance is evaluated with its viscosity at 0 °C, the liquid inlet of the heating rating point (0.168 m K/W against 0.163 for water at 4 kW; see tmhp.source_fluid for the design temperature of the viscosity). In the default 26 mm U-tube the default glycol is turbulent down to about 2.6 kW per borehole; a smaller machine, or 25-30 % propylene glycol below about 4 kW per borehole, is laminar: the constructor then warns and R_b is about half as large again, so give a larger ground_flow_ref_lpm for such a loop. What does not follow the loop liquid (the hydraulic pump model, the coupled ground-flow solver, the dynamic borehole response) is listed in Ground-loop liquid and its freezing limit.

In analyze_dynamic the ground fluid is closed inside each step: the borehole wall of step n is the step mean of its response to every load so far, the step’s own included, and the fluid temperature follows from it through R_b* and the loop flow. The cycle of a row is solved with the T_bhe_f_out [°C] reported in that row, so a heating row always has its evaporating temperature below the fluid and a cooling row its condensing temperature above it. (Earlier versions solved the cycle with the fluid left by the previous step; after an off period the first step then ran on undisturbed ground.)

Sink-side mechanics

A zone temperature / load proxy stands in for the building, as in Air-source heat pump (ASHP — space conditioning). The indoor-unit load Q_r_iu selects operating mode: positive values are cooling, negative values are heating, and zero values are off operation.

Part load: cycling and unmet load

The compressor modulates between rps_min and rps_max. A request outside what the unit delivers over that range is still answered, and the row says how — the same convention as Air-source heat pump (ASHP — space conditioning).

Below the minimum capacity the compressor cycles on and off, and the row is the mean over the cycling period (capacity_clamped == "min"):

  • Q_ref_iu [W] equals the request. Q_min [W] is what the unit delivers running continuously at its minimum speed, and capacity_ratio [-] is the request divided by it (the CR of EN 14825).

  • The electrical input carries the EN 14825 degradation for a unit delivering to air: COP = COP_min · (1 − Cd · (1 − CR)) with Cd = 0.25, the value the standard prescribes when a unit has not been tested for it (part_load_factor [-] is that bracket; the table in Air-source heat pump (ASHP — space conditioning) lists it). runtime_fraction [-], the share of the time the compressor runs, is CR / part_load_factor.

  • Compressor and loop-pump power (E_cmp, E_pmp) are the running values times the runtime fraction. The pump is taken to run with the compressor — the usual interlock of a residential flow centre, and what the model already does in its off state, where E_pmp is zero. Heat and flow rates (Q_ref_iu, Q_ref_ground, Q_a_iu_in, Q_a_iu_out, m_dot_ref, dV_iu_a, dV_bhe_f) are the running values times CR, and so is the indoor fan’s power (E_iu_fan): it runs while heat is delivered. The refrigerant cycle and the room air thus stay in balance with the delivered heat. Temperatures, pressures, compressor speed and efficiencies are those of the running machine.

  • Q_bhe [W] is the mean load on the borefield: the mean ground-side duty less (heating) or plus (cooling) the mean pump power.

  • E_cycling_loss [W] is the mean electrical power the compressor and the pump draw beyond CR times their continuous power. It is not part of any heat flow of the row: the ground-side duty of the mean row is the running duty times CR.

The default unit running continuously at its minimum speed delivers about 1.7 kW in heating from a 0 °C borehole wall and 2.4 kW in cooling into a 25 °C one — 41 % and 59 % of the nameplate. Until this model every request below that was answered with the minimum capacity itself: 8.3 times a 200 W heating request and 11.8 times a cooling one, and over a mild 24 h schedule 18 % (heating) and 29 % (cooling) more heat than was asked for.

4 kW R32 unit, heating at 20 °C room and 0 °C borehole wall

Request

Q_ref_iu

runtime_fraction

E_tot

cop_sys

Q_bhe

200 W

200 W

0.155

66 W

3.08

148 W

1 000 W

1 000 W

0.669

286 W

3.54

749 W

1 659 W (Q_min)

1 659 W

1.000

430 W

3.91

1 252 W

Cd_cycling sets the coefficient: a number replaces 0.25, 0 is loss-free cycling, and None restores the earlier behaviour (continuous operation at the minimum speed, Q_ref_iu [W] above the request, runtime_fraction [-] of 1). The operating-point search weighs the degradation, so the minimum-speed point may sit a few watts from the one found with Cd_cycling=None.

In a dynamic run a cycling step loads the ground with its mean: the pulse added to the ground history is the row’s Q_bhe [W], recorded once, and the borehole wall of the step (T_bhe [°C]) answers that mean load. The fluid temperatures of the row (T_bhe_f [°C], T_bhe_f_in [°C], T_bhe_f_out [°C]) are those of the running machine — the borehole resistance and the loop temperature difference act on the running load — so the row’s cycle and its fluid still belong together. Where they start from depends on the borehole response (Ground response):

  • with the dynamic borehole (the default), from the response over the run itself under the running load. The run is taken as one block at the start of the step, mean load / running load of it long, as for a boiler whose compressor runs part of a step. The heat capacity of the borehole then keeps the fluid from dropping by the running load’s full q' R_b the moment a short run begins, and the fluid joins that of a continuous step as the request reaches the minimum capacity;

  • with the steady borehole (borehole_dynamics=False), from the step-mean wall under the mean load: the fluid sits the running load’s q' R_b below it at once.

The running load only sets that fluid temperature; it is never added to the history, so the partial run is not counted twice. The on/off pattern inside a step is not resolved beyond that one block.

Above the maximum capacity the unit runs flat out (capacity_clamped == "max"): Q_ref_iu [W] is the ceiling, Q_max [W] repeats it and capacity_binding names what set it. Q_request [W] (signed, as asked) and Q_unmet [W] (the part of the request that is not delivered) are on every row.

A request that is not delivered in full is also said in words: analyze_steady issues one tmhp.OperatingLimitWarning for a point that runs at its ceiling or does not run at all (the request, what is delivered, the limit and what removes it), and analyze_dynamic one at the end of a run with the steps stopped or limited and the unmet energy; the totals are in df.attrs["operating_limits"] (Being told: OperatingLimitWarning).

With the compressor at rps_max the delivered heat hardly depends on the indoor airflow – it varies by a tenth of a percent across the approaches the fan can serve, while the electrical input varies by several percent. The ceiling row is therefore not the candidate of largest heat: heat within 0.5 % of the largest counts as the same ceiling, and among those candidates the one of least total input is reported, normally the fan at its largest airflow (the least lift). A ceiling found by bisection on the duty (a coil or an envelope limit, capacity_binding other than "compressor") is solved as that duty, so its row is the least-input operating point of the duty too.

What the cycling model does not contain: no standby power is added while the compressor is off, and a start is not resolved in time — the degradation is the standard’s seasonal-average figure.

The coupled ground-flow solver (Coupled ground-loop flow: a prescribed ground flow, or ground_flow_control other than plain constant flow) cycles the same way. Its minimum-speed machine is the one the fixed-flow search finds at that loop flow, averaged as above, so a prescribed flow equal to the reference flow returns the fixed-flow row; a variable flow is chosen for the least mean input for the request. Only with Cd_cycling=None does that solver report a request below its minimum-speed duty as the failure compressor_min_speed.

COP boundary

The physics-based GSHP uses the same final indoor-air delivery definition as Air-source heat pump (ASHP — space conditioning): cop_sys [-] = abs(Q_a_iu_out - Q_a_iu_in) / E_tot. The actual airflow and common outdoor reference temperature define both air energy flows. The final outlet includes indoor fan heat once. The denominator retains the compressor, indoor fan and entire ground-loop pump electricity; this boundary may differ from a standard unit rating. Q_r_iu, rated capacity, PLR and the optimisation remain coil-duty based; cop_ref [-] remains coil duty divided by compressor electricity. Active zero-flow or opposite-mode air delivery is flagged by indoor_heat_direction_valid = False and reported with NaN system COP. Off states have zero air energy flows and NaN COP.

Seasonal performance uses integrated actual air delivery divided by integrated system electricity, separately by mode. Legacy outputs through c5d673e use coil-duty COP; regenerate them before comparing to the final-air metric. The empirical alternative and DHW models retain their existing definitions.

Empirical alternative

tmhp.GroundSourceHeatPumpEmpirical uses the ClimateMaster TCH072 ground-loop curves shipped with EnergyPlus (WaterToAirHeatPumps.idf). The curves give full-load capacity and power at the rated air flow, so the COP does not change with part load (no cycling degradation is applied) and a request above the available capacity Q_cap is served at that ceiling with capacity_clamped = "max". Outside the fitted range — entering water −1.25 to 32.06 °C in heating and 9.85 to 48.72 °C in cooling, entering air 9.85 to 26.51 °C dry-bulb in heating and 9.85 to 23.73 °C wet-bulb in cooling — the unit does not run for that step and failure_reason is "outside_curve_domain". The water temperature is judged at the converged entering water of the step, so cold ground that the step’s own heat rejection brings into range (or warm ground in heating) still runs. The room (entering-air) temperature is the T_a_room input (27 / 21 °C when omitted).

Its conventions differ from the refrigerant-cycle model: the borehole load q_b is injection-positive W/m, temperatures T_b, T_f, T_f_in and T_f_out are in kelvin, COP is 0 when idle, the entering-water temperature is the mean fluid temperature minus half the loop temperature change, and refrigerant temperatures for the exergy terms use fixed approaches (±3 K to the ground fluid, ∓15 K to the room air). The indoor airflow carries the served heat across a 10 K change at the density of the room air (dV_a); the design airflow of the fan curve is that change in 15 °C standard air at the rated capacity. The borehole resistance takes water at the initial ground temperature T_g (1.14 mPa s at 15 °C).

class tmhp.GroundSourceHeatPumpEmpirical(H_b=150.0, D_b=2.0, r_b=0.08, k_p=0.4, k_grout=1.5, r_out=0.016, r_in=0.013, D_s=0.032, k_g=2.0, c_g=800.0, rho_g=2000.0, T_g=15.0, dV_f=20.0, Q_rated_cooling=20590.0, Q_rated_heating=16450.0, E_pmp=100.0, dP_iu_fan_design=60.0, eta_iu_fan_design=0.6, dt_hours=1, sim_hours=8760, gfunc_boundary_condition='UBWT', Q_r_iu=0.0, T0=20.0, T_a_room=None)[source]

Bases: object

Ground source heat pump model using the EnergyPlus EquationFit COP model.

Uses borehole heat exchangers with pygfunction step-response factor array for precise soil thermal response with temporal superposition of dynamic building loads.

This model computes borehole thermal resistance R_b* automatically using the pygfunction multipole method (Hellström 1991), and fan power using the default single-zone VAV surrogate.

Performance curve and its limits. COP and available capacity come from the ClimateMaster TCH072_GLHP EquationFit curves of EnergyPlus (gshp_equation_fit_ratios()). They describe full-load operation at the rated air flow; a smaller load is met by cycling, so the COP does not depend on the part-load ratio (no cycling degradation is applied). The available capacity is Q_rated_{cooling,heating} × CAP_ratio(T_air, EWT); a larger request is served at that ceiling and flagged capacity_clamped = "max". Outside the fitted domain (GSHP_EQFIT_DOMAIN: entering water −1.25–32.06 °C in heating, 9.85–48.72 °C in cooling; entering air 9.85–26.51 °C dry-bulb in heating, 9.85–23.73 °C wet-bulb in cooling; the water temperature is judged at the converged, self-consistent entering water, not at the undisturbed ground) the unit does not run for that step: heat, compressor and pump power are zero, COP is NaN and failure_reason says why. COP and compressor power are therefore never negative.

Time convention. Each call of system_update() is one step of dt_hours; the borehole-wall temperature is the mean over that step, including the response to the step’s own load (step-mean g-function, the same convention as the physics-based ground-source models).

For a full refrigerant-cycle model, see GroundSourceHeatPump.

Parameters:
  • H_b (float)

  • D_b (float)

  • r_b (float)

  • k_p (float)

  • k_grout (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • k_g (float)

  • c_g (float)

  • rho_g (float)

  • T_g (float)

  • dV_f (float)

  • Q_rated_cooling (float)

  • Q_rated_heating (float)

  • E_pmp (float)

  • dP_iu_fan_design (float)

  • eta_iu_fan_design (float)

  • dt_hours (int)

  • sim_hours (int)

  • gfunc_boundary_condition (str)

  • Q_r_iu (float)

  • T0 (float)

  • T_a_room (float | None)

H_b: float = 150.0
D_b: float = 2.0
r_b: float = 0.08
k_p: float = 0.4
k_grout: float = 1.5
r_out: float = 0.016
r_in: float = 0.013
D_s: float = 0.032
k_g: float = 2.0
c_g: float = 800.0
rho_g: float = 2000.0
T_g: float = 15.0
dV_f: float = 20.0
Q_rated_cooling: float = 20590.0
Q_rated_heating: float = 16450.0
E_pmp: float = 100.0
dP_iu_fan_design: float = 60.0
eta_iu_fan_design: float = 0.6
dt_hours: int = 1
sim_hours: int = 8760
gfunc_boundary_condition: str = 'UBWT'
Q_r_iu: float = 0.0
T0: float = 20.0
T_a_room: float | None = None
system_update()[source]

Advance the model by one timestep.

Call this method once per timestep after setting Q_r_iu, T0 and optionally T_a_room. The method computes COP, temperatures, fan power, and component exergy balances.

Status attributes set on every call:

  • failure_reason — "none", or "outside_curve_domain" (entering air or water temperature outside the fitted range; the unit is off for the step and failure_detail names the variable) or "not_converged" (the ground/fluid iteration did not settle).

  • capacity_clamped — "max" when the request exceeds the available capacity Q_cap and None otherwise.

  • Q_iu — the load actually served [W], signed like Q_r_iu.

A physically impossible input (non-finite Q_r_iu; T0 or T_a_room outside −90..100 °C) is a caller error and raises ValueError (tmhp._validation). A valid input whose operating point lies outside the curve fit is a result: the step is reported with failure_reason = "outside_curve_domain", never raised.

Raises:

ValueError – "<name> must be …, got <value>" for an impossible input.

__init__(H_b=150.0, D_b=2.0, r_b=0.08, k_p=0.4, k_grout=1.5, r_out=0.016, r_in=0.013, D_s=0.032, k_g=2.0, c_g=800.0, rho_g=2000.0, T_g=15.0, dV_f=20.0, Q_rated_cooling=20590.0, Q_rated_heating=16450.0, E_pmp=100.0, dP_iu_fan_design=60.0, eta_iu_fan_design=0.6, dt_hours=1, sim_hours=8760, gfunc_boundary_condition='UBWT', Q_r_iu=0.0, T0=20.0, T_a_room=None)
Parameters:
  • H_b (float)

  • D_b (float)

  • r_b (float)

  • k_p (float)

  • k_grout (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • k_g (float)

  • c_g (float)

  • rho_g (float)

  • T_g (float)

  • dV_f (float)

  • Q_rated_cooling (float)

  • Q_rated_heating (float)

  • E_pmp (float)

  • dP_iu_fan_design (float)

  • eta_iu_fan_design (float)

  • dt_hours (int)

  • sim_hours (int)

  • gfunc_boundary_condition (str)

  • Q_r_iu (float)

  • T0 (float)

  • T_a_room (float | None)

API reference

Ground source heat pump — physics-based cycle model with indoor unit.

Resolves a vapour-compression refrigerant cycle coupled to a borehole heat exchanger (BHE) on the source side and an indoor-air heat exchanger on the load side. Supports both cooling (Q_r_iu > 0) and heating (Q_r_iu < 0) modes.

At each time step the model finds the operating point of least electrical input per unit of delivered heat (compressor + BHE pump + indoor fan). The indoor approach temperature is searched (coarse grid, then a bounded refinement); the ground-side approach follows from the ground heat-exchanger balance at the fixed loop flow.

Borehole thermal response is tracked with pygfunction-based multi-borehole g-functions, enabling robust long-term ground temperature drift modelling. The effective borehole thermal resistance R_b* linking the borehole wall to the circulating fluid is derived from the U-tube cross-section geometry unless it is supplied explicitly.

Architecture mirrors GroundSourceHeatPumpBoiler for the BHE side and AirSourceHeatPump for the indoor-unit side.

tmhp.ground_source_heat_pump.WallTemperature = float | collections.abc.Callable[[float], float]

a fixed value, or a function of the borefield load Q_bhe [W] of the point being evaluated (a dynamic step, whose own load moves the wall within the step).

Type:

Borehole-wall temperature seen by a ground closure [K]

class tmhp.ground_source_heat_pump.GroundSourceHeatPump(ref='R32', V_cmp_ref=None, dT_superheat=5.0, dT_subcool=5.0, UA_cond=None, UA_evap=None, dV_iu_fan_a_rated=None, dP_iu_fan_rated=None, A_cross_iu=None, eta_iu_fan_rated=None, vsd_coeffs_iu=None, N_1=None, N_2=None, B=6.0, D_b=0, H_b=None, r_b=0.08, R_b=None, k_g=1.5, k_p=0.4, r_out=0.016, r_in=0.013, D_s=0.025, boundary_condition='uniform_temperature', dV_b_f_lpm=None, k_s=2.0, c_s=800, rho_s=2000, Ts=16.0, E_pmp=None, hp_capacity=4000.0, T_a_room=27.0, dT_hx_min=0.5, PR_cycle_min=1.5, PR_cycle_max=11.0, t_max_s=31536000, dt_s=3600, V_disp_cmp=None, UA_cond_design=None, UA_evap_design=None, dV_iu_fan_a_design=None, dP_iu_fan_design=None, eta_iu_fan_design=None, *, compressor_scale=None, UA_ground_rated=None, UA_ground_evap_rated=None, ground_hx_ua_per_capacity=None, UA_iu_rated=None, indoor_approach_min_K=1.0, indoor_approach_max_K=25.0, rps_rated=None, ground_flow_ref_lpm=None, ground_flow_constant_lpm=None, ground_flow_min_lpm=None, ground_flow_max_lpm=None, ground_flow_control='constant', variable_ground_flow=False, variable_ground_hx_UA=False, variable_Rb=False, hydraulic_pump=False, pump_efficiency=0.6, pump_map=None, pipe_inner_diameter=None, pipe_roughness=1e-06, dp_common=None, dp_aux_ref=0.0, dp_aux_exponent=2.0, ground_flow_min_ratio=None, ground_flow_max_ratio=None, m_dot_ref_rated=None, rated_condition=None, ground_hx_fluid_fraction=0.5, ground_hx_refrigerant_fraction=0.3, ground_hx_constant_fraction=0.2, ground_hx_fluid_exponent=0.8, ground_hx_refrigerant_exponent=0.8, rps_min=15.0, rps_max=None, dV_iu_fan_a_ref=None, dV_iu_fan_a_min=None, dV_iu_fan_a_max=None, T_dis_max='auto', x_suction_min='auto', borehole_dynamics=None, Cd_cycling=0.25, T_cond_max='auto', source_fluid=None, E_iu_fan_rated=None)[source]

Bases: ReferenceStateMixin, CompressorMapPlotMixin

Ground source heat pump with BHE and indoor-unit air heat exchange.

The refrigerant cycle is resolved via CoolProp. The operating point minimises total electrical input (E_cmp + E_pmp + E_iu_fan) per unit of delivered heat over the indoor approach temperature, with the ground-side approach closed by the ground heat-exchanger balance.

When the requested duty exceeds what the unit can deliver, the result is the delivered ceiling with capacity_clamped == "max" and Q_ref_iu [W] below the request; the difference is unmet load, not a solver failure.

Below the minimum capacity. A request below what the unit delivers at its minimum compressor speed is met by switching the compressor on and off. Such a row is reported with capacity_clamped == "min" as the mean over the cycling period (tmhp.cycling), as for AirSourceHeatPump: Q_ref_iu [W] equals the request, the electrical input carries the EN 14825 degradation (Cd_cycling, 0.25 for a unit delivering to air), and runtime_fraction [-] is the share of the time the compressor runs. The loop pump is taken to run with the compressor (it is off in the off state of this model too), so E_pmp [W] is averaged like E_cmp [W]; the indoor fan runs while heat is delivered. The borefield carries the mean load: Q_bhe [W] of a cycling row, and with it the pulse a dynamic step adds to the ground history, is the mean ground-side heat, while the fluid temperatures of the row are those of the running machine. Cd_cycling=None restores continuous operation at the minimum speed (the row then delivers more than the request). The coupled ground-flow solver (a prescribed ground flow, or ground_flow_control other than plain constant flow) cycles the same way: its minimum-speed machine is the one the fixed-flow search finds at that flow, and a variable flow is chosen for the least mean input. Only with Cd_cycling=None is a request below its minimum-speed duty the failure compressor_min_speed.

Defaults that follow the capacity. With only hp_capacity (and ref) given, the ground side and the indoor airflow are sized from it, so the rating-point COP is the same at every capacity:

  • loop flow ground_flow_ref_lpm: 0.75 * hp_capacity / (rho c * 3 K) (default_ground_flow_lpm(); 15.4 L/min of the default glycol for 4 kW), shared equally by the parallel boreholes;

  • pump power E_pmp: ASHRAE pumping grade B, 75 W per ton of capacity (default_ground_pump_power(); 85 W for 4 kW);

  • borefield: when none of N_1, N_2 and H_b is given, the smallest near-square field of 100 m boreholes that keeps the rated source-side heat (0.75 * hp_capacity) within 50 W/m (default_borefield_layout(); one borehole up to 6.67 kW, 3 x 2 for 30 kW). Giving any of the three fixes the field as given (the others default to 1, 1 and 100 m);

  • rated indoor airflow dV_iu_fan_a_rated: the largest blower airflow water-to-air units of this capacity publish (estimate_max_airflow());

  • heat-exchanger conductances: the effective UA that reproduces the leaving-end approach water-to-air units print at their rating point (estimate_hx_UA()) – the coaxial ground exchanger at the rated loop flow, one value as a condenser (UA_ground_rated, cooling) and one as an evaporator (UA_ground_evap_rated, heating), and the indoor coil at the rated airflow (UA_iu_rated, both modes). ground_hx_ua_per_capacity selects the proportional rule coefficient * hp_capacity for the ground exchanger instead.

A supplied value always replaces its default. Two sizing slips are reported with a UserWarning instead of being solved silently: a U-tube that is laminar at the reference flow (Re < 2300; the model attribute Re_bhe_ref) and a caller-sized borefield above 80 W/m at the rated source-side heat (q_bhe_rated).

Dynamic steps. analyze_dynamic() closes the ground-fluid temperature inside each step against the borehole wall, including the wall’s response to that step’s own load. The refrigerant cycle, the fluid temperatures and the wall temperature of one row therefore belong to the same step.

Ground-loop liquid. source_fluid (tmhp.source_fluid) is 25 % ethylene glycol by default ("MEG-25%", freezing at -11.0 °C); "water", another mixture such as "MPG-30%" or a SourceFluid replace it. The loop liquid is never colder than its operating limit, the freezing point plus 3 K (-8.0 °C for the default, 3 °C for water): a heating duty that would chill it further is reduced to the largest one that does not (capacity_clamped == "max", capacity_binding == "source_fluid_freezing"), and when no duty does the unit is off with failure_reason == "source_fluid_freezing". A compressor on its speed floor has no smaller running state: against a prescribed wall or fluid temperature a minimum-speed machine that leaves the liquid below the limit is off at every request. In a dynamic step the wall answers the mean load, so a cycling unit is reduced to the largest mean duty whose running liquid stays on the limit (a "max" row that is an on/off mean, runtime_fraction [-] below 1). The liquid’s density, heat capacity, viscosity and conductivity enter the loop balance, the default flow and the borehole resistance.

Borehole dynamics. borehole_dynamics=None (default) adds the heat capacity of fluid, pipe and grout and the fluid transit through the U-tube to the ground response, from the geometry and properties already given (tmhp.borehole_capacity), wherever the model can use it; with variable_Rb, a variable ground flow or a cross-section that cannot be mapped it keeps the steady borehole. model.borehole_dynamics ("transit" or "off") and model.borehole_dynamics_note say which and why. True raises instead of falling back; False is the steady borehole (a resistance without heat capacity). T_bhe [°C] is the physical borehole wall in both.

Parameters:
  • ref (str)

  • V_cmp_ref (float | None)

  • dT_superheat (float)

  • dT_subcool (float)

  • UA_cond (float | None)

  • UA_evap (float | None)

  • dV_iu_fan_a_rated (float | None)

  • dP_iu_fan_rated (float | None)

  • A_cross_iu (float | None)

  • eta_iu_fan_rated (float | None)

  • vsd_coeffs_iu (dict | None)

  • N_1 (int | None)

  • N_2 (int | None)

  • B (float)

  • D_b (float)

  • H_b (float | None)

  • r_b (float)

  • R_b (float | None)

  • k_g (float)

  • k_p (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • boundary_condition (str)

  • dV_b_f_lpm (float | None)

  • k_s (float)

  • c_s (float)

  • rho_s (float)

  • Ts (float)

  • E_pmp (float | None)

  • hp_capacity (float)

  • T_a_room (float)

  • dT_hx_min (float)

  • PR_cycle_min (float)

  • PR_cycle_max (float)

  • t_max_s (float)

  • dt_s (float)

  • V_disp_cmp (float | None)

  • UA_cond_design (float | None)

  • UA_evap_design (float | None)

  • dV_iu_fan_a_design (float | None)

  • dP_iu_fan_design (float | None)

  • eta_iu_fan_design (float | None)

  • compressor_scale (CompressorMapScale | None)

  • UA_ground_rated (float | None)

  • UA_ground_evap_rated (float | None)

  • ground_hx_ua_per_capacity (float | None)

  • UA_iu_rated (float | None)

  • indoor_approach_min_K (float)

  • indoor_approach_max_K (float)

  • rps_rated (float | None)

  • ground_flow_ref_lpm (float | None)

  • ground_flow_constant_lpm (float | None)

  • ground_flow_min_lpm (float | None)

  • ground_flow_max_lpm (float | None)

  • ground_flow_control (str)

  • variable_ground_flow (bool)

  • variable_ground_hx_UA (bool)

  • variable_Rb (bool)

  • hydraulic_pump (bool)

  • pump_efficiency (float)

  • pump_map (Mapping[str, Any] | None)

  • pipe_inner_diameter (float | None)

  • pipe_roughness (float)

  • dp_common (float | None)

  • dp_aux_ref (float)

  • dp_aux_exponent (float)

  • ground_flow_min_ratio (float | None)

  • ground_flow_max_ratio (float | None)

  • m_dot_ref_rated (float | None)

  • rated_condition (Mapping[str, Any] | RatingCondition | None)

  • ground_hx_fluid_fraction (float)

  • ground_hx_refrigerant_fraction (float)

  • ground_hx_constant_fraction (float)

  • ground_hx_fluid_exponent (float)

  • ground_hx_refrigerant_exponent (float)

  • rps_min (float)

  • rps_max (float | None)

  • dV_iu_fan_a_ref (float | None)

  • dV_iu_fan_a_min (float | None)

  • dV_iu_fan_a_max (float | None)

  • T_dis_max (Union[float, Literal['auto'], None])

  • x_suction_min (Union[float, Literal['auto'], None])

  • borehole_dynamics (bool | None)

  • Cd_cycling (CyclingDegradation | float | None)

  • T_cond_max (Union[float, Literal['auto'], None])

  • source_fluid (str | SourceFluid | None)

  • E_iu_fan_rated (float | None)

__init__(ref='R32', V_cmp_ref=None, dT_superheat=5.0, dT_subcool=5.0, UA_cond=None, UA_evap=None, dV_iu_fan_a_rated=None, dP_iu_fan_rated=None, A_cross_iu=None, eta_iu_fan_rated=None, vsd_coeffs_iu=None, N_1=None, N_2=None, B=6.0, D_b=0, H_b=None, r_b=0.08, R_b=None, k_g=1.5, k_p=0.4, r_out=0.016, r_in=0.013, D_s=0.025, boundary_condition='uniform_temperature', dV_b_f_lpm=None, k_s=2.0, c_s=800, rho_s=2000, Ts=16.0, E_pmp=None, hp_capacity=4000.0, T_a_room=27.0, dT_hx_min=0.5, PR_cycle_min=1.5, PR_cycle_max=11.0, t_max_s=31536000, dt_s=3600, V_disp_cmp=None, UA_cond_design=None, UA_evap_design=None, dV_iu_fan_a_design=None, dP_iu_fan_design=None, eta_iu_fan_design=None, *, compressor_scale=None, UA_ground_rated=None, UA_ground_evap_rated=None, ground_hx_ua_per_capacity=None, UA_iu_rated=None, indoor_approach_min_K=1.0, indoor_approach_max_K=25.0, rps_rated=None, ground_flow_ref_lpm=None, ground_flow_constant_lpm=None, ground_flow_min_lpm=None, ground_flow_max_lpm=None, ground_flow_control='constant', variable_ground_flow=False, variable_ground_hx_UA=False, variable_Rb=False, hydraulic_pump=False, pump_efficiency=0.6, pump_map=None, pipe_inner_diameter=None, pipe_roughness=1e-06, dp_common=None, dp_aux_ref=0.0, dp_aux_exponent=2.0, ground_flow_min_ratio=None, ground_flow_max_ratio=None, m_dot_ref_rated=None, rated_condition=None, ground_hx_fluid_fraction=0.5, ground_hx_refrigerant_fraction=0.3, ground_hx_constant_fraction=0.2, ground_hx_fluid_exponent=0.8, ground_hx_refrigerant_exponent=0.8, rps_min=15.0, rps_max=None, dV_iu_fan_a_ref=None, dV_iu_fan_a_min=None, dV_iu_fan_a_max=None, T_dis_max='auto', x_suction_min='auto', borehole_dynamics=None, Cd_cycling=0.25, T_cond_max='auto', source_fluid=None, E_iu_fan_rated=None)[source]
Parameters:
  • ref (str)

  • V_cmp_ref (float | None)

  • dT_superheat (float)

  • dT_subcool (float)

  • UA_cond (float | None)

  • UA_evap (float | None)

  • dV_iu_fan_a_rated (float | None)

  • dP_iu_fan_rated (float | None)

  • A_cross_iu (float | None)

  • eta_iu_fan_rated (float | None)

  • vsd_coeffs_iu (dict | None)

  • N_1 (int | None)

  • N_2 (int | None)

  • B (float)

  • D_b (float)

  • H_b (float | None)

  • r_b (float)

  • R_b (float | None)

  • k_g (float)

  • k_p (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • boundary_condition (str)

  • dV_b_f_lpm (float | None)

  • k_s (float)

  • c_s (float)

  • rho_s (float)

  • Ts (float)

  • E_pmp (float | None)

  • hp_capacity (float)

  • T_a_room (float)

  • dT_hx_min (float)

  • PR_cycle_min (float)

  • PR_cycle_max (float)

  • t_max_s (float)

  • dt_s (float)

  • V_disp_cmp (float | None)

  • UA_cond_design (float | None)

  • UA_evap_design (float | None)

  • dV_iu_fan_a_design (float | None)

  • dP_iu_fan_design (float | None)

  • eta_iu_fan_design (float | None)

  • compressor_scale (CompressorMapScale | None)

  • UA_ground_rated (float | None)

  • UA_ground_evap_rated (float | None)

  • ground_hx_ua_per_capacity (float | None)

  • UA_iu_rated (float | None)

  • indoor_approach_min_K (float)

  • indoor_approach_max_K (float)

  • rps_rated (float | None)

  • ground_flow_ref_lpm (float | None)

  • ground_flow_constant_lpm (float | None)

  • ground_flow_min_lpm (float | None)

  • ground_flow_max_lpm (float | None)

  • ground_flow_control (str)

  • variable_ground_flow (bool)

  • variable_ground_hx_UA (bool)

  • variable_Rb (bool)

  • hydraulic_pump (bool)

  • pump_efficiency (float)

  • pump_map (Mapping[str, Any] | None)

  • pipe_inner_diameter (float | None)

  • pipe_roughness (float)

  • dp_common (float | None)

  • dp_aux_ref (float)

  • dp_aux_exponent (float)

  • ground_flow_min_ratio (float | None)

  • ground_flow_max_ratio (float | None)

  • m_dot_ref_rated (float | None)

  • rated_condition (Mapping[str, Any] | RatingCondition | None)

  • ground_hx_fluid_fraction (float)

  • ground_hx_refrigerant_fraction (float)

  • ground_hx_constant_fraction (float)

  • ground_hx_fluid_exponent (float)

  • ground_hx_refrigerant_exponent (float)

  • rps_min (float)

  • rps_max (float | None)

  • dV_iu_fan_a_ref (float | None)

  • dV_iu_fan_a_min (float | None)

  • dV_iu_fan_a_max (float | None)

  • T_dis_max (Union[float, Literal['auto'], None])

  • x_suction_min (Union[float, Literal['auto'], None])

  • borehole_dynamics (bool | None)

  • Cd_cycling (CyclingDegradation | float | None)

  • T_cond_max (Union[float, Literal['auto'], None])

  • source_fluid (str | SourceFluid | None)

  • E_iu_fan_rated (float | None)

cycling: CyclingDegradation | None

continuous at minimum speed).

Type:

EN 14825 cycling degradation (None

source_fluid: SourceFluid
ref: str
V_cmp_ref: float
dT_superheat: float
dT_subcool: float
dT_hx_min: float
PR_cycle_min: float
PR_cycle_max: float
hp_capacity: float
rps_min: float
rps_max: float

The rated-speed search bound until _initialize_reference_state() replaces it with default_rps_max(rps_rated) (when _rps_max_derived).

T_dis_max: float | None
T_cond_max: float | None
x_suction_min: float | None
E_iu_fan_rated: float
dP_iu_fan_rated: float | None
eta_iu_fan_rated: float | None
vsd_coeffs_iu: dict
fan_params_iu: dict
E_pmp: float
dV_b_f_m3s: float
q_bhe_rated: float

Specific borehole load at the rated source-side heat [W/m]. A field the caller sized is reported when it exceeds 80 W/m.

mu_bhe_f_design: float

Loop-liquid viscosity of the source-side Reynolds number [Pa s], at the design liquid temperature (heating rating inlet, 0 °C; see tmhp.source_fluid).

Re_bhe_ref: float
R_b_local: float
R_a: float
Ts: float
Ts_K: float
T_a_room: float
dt_s: float
borehole_dynamics: str

the borehole response in use.

Type:

"transit", "lumped" or "off"

borehole_dynamics_note: str

Why it is not "transit" (empty otherwise).

time: ndarray
dt: float
T_bhe_f: float
T_bhe: float
T_bhe_f_in: float
T_bhe_f_in_K: float
T_bhe_f_out: float
T_bhe_f_out_K: float
Q_bhe: float
analyze_steady(Q_r_iu, T0, T_a_room=None, *, return_dict=True, ground_flow_ratio=None, ground_flow_lpm=None, T_bhe_wall=None)[source]

Run a steady-state performance snapshot.

Parameters:
  • Q_r_iu (float) – Indoor thermal load [W]. >0 cooling, <0 heating, 0 off.

  • T0 (float) – Dead-state temperature [°C] (exergy reference only).

  • T_a_room (float | None) – Room air temperature [°C]. Uses the constructor default if None.

  • T_bhe_wall (float | None) – Borehole wall temperature [°C]. The fluid temperature leaving the borefield is then closed against it through R_b* and the loop flow, T_out = T_wall - q' R_b* + Q_bhe / (2 ṁ c_p), the same relation the coupled ground-flow solver uses. When omitted, the fluid leaves the borefield at the model state T_bhe_f_out (the constructor Ts before any dynamic run).

  • ground_flow_lpm (float | None) – Prescribed ground flow; selects the coupled ground-flow solver.

  • ground_flow_ratio (float | None) – Prescribed ground flow; selects the coupled ground-flow solver.

  • return_dict (bool)

Returns:

Cycle state plus diagnostic flags. Notable keys:

  • "converged" (bool) — True only when an operating point was found that closes the indoor and ground heat balances.

  • "failure_reason" (str) — "none" or why no operating point exists: "hx_not_converged" (the indoor coil cannot carry the duty within its fan range), "ground_hx_capacity_insufficient", "pr_above_max", "discharge_temp_above_max" (no duty keeps the discharge temperature within T_dis_max), "condensing_temp_above_max" (none condenses within T_cond_max), "source_fluid_freezing" (no duty keeps the ground-loop liquid at or above its operating limit, -8.0 °C for the default glycol and 3 °C for water; see tmhp.source_fluid) or "cycle_invalid" (coupled solver: see failed_ground_point()).

  • "capacity_clamped" — "max" when the request exceeds the deliverable duty (Q_ref_iu [W] is the ceiling, Q_max [W] and capacity_binding say what bound it: "compressor", "cycle", "discharge_temperature", "condensing_temperature" or "source_fluid_freezing"), "min" when the request is below the minimum-speed duty.

  • "Q_request [W]", "Q_unmet [W]" and the cycling keys "runtime_fraction [-]", "capacity_ratio [-]", "part_load_factor [-]", "Q_min [W]" and "E_cycling_loss [W]" — on every row. A "min" row is the mean over the on/off cycling period: Q_ref_iu [W] equals the request, heat and flow rates are the running machine’s times capacity_ratio [-] (the indoor fan’s power with them), E_cmp [W] and E_pmp [W] carry the EN 14825 degradation (Cd_cycling; the running values times capacity_ratio / part_load_factor), Q_bhe [W] is the mean ground load, and the COP keys are the continuous ones times the part-load factor. Temperatures, pressures and speed are those of the running machine (tmhp.cycling). With Cd_cycling=None the row is the continuous minimum-speed point and delivers more than the request.

Every non-"none" reason returns the HP-off state: heat and power are 0 and the COP keys are NaN. Those numbers describe no operation and must not be used as performance.

Return type:

dict | DataFrame

Raises:

ValueError – For a non-finite load, temperature or flow input.

Warns:

OperatingLimitWarning – Once, when the compressor was asked to run and the result is the off state (failure_reason other than "none") or a running point that delivers less than the request (capacity_clamped == "max"): the request, what is delivered, the limit in words and what removes it. Issued once per model and limit unless the "always" filter is set (tmhp.operating_limits).

analyze_dynamic(simulation_period_sec, dt_s, Q_r_iu_schedule, T0_schedule, T_a_room_schedule=None, result_save_csv_path=None)[source]

Time-stepping dynamic simulation with BHE superposition.

Step n stands for the interval [t_n, t_n + dt]. The borehole wall of the step is the step mean of its response to all loads so far, the step’s own included, and the ground fluid is closed against that wall inside the step (T_out = T_wall - q' R_b* + Q_bhe / (2 m c_p)), so the evaporating temperature of a heating row is below the T_bhe_f_out [°C] of the same row (above it for the condensing temperature of a cooling row). Before this closure the cycle used the fluid temperature left by the previous step: the first step after an off period ran on undisturbed ground, which understated the compressor energy of intermittent operation by 4-7 % in heating and 11-21 % in cooling (20 min on / 40 min off and 1 h on / 2 h off at the default sizing; under 0.5 % in continuous operation).

A step whose request is below the minimum-speed duty is met by cycling (Cd_cycling): its row is the mean over the step, the delivered heat equals the request, and the ground history takes the mean load, once. The wall of the step (T_bhe [°C]) answers that mean load. The fluid temperatures of the row are those of the running machine: the borehole resistance and the loop temperature difference act on the running load. With the steady borehole they start from the step-mean wall; with the dynamic borehole from the wall over the run (a block of mean load / running load of the step at its start) under the running load, so the fluid does not drop by the full q' R_b of the running load the moment a short run begins.

Warns:

OperatingLimitWarning – Once, at the end of a run in which the compressor was called but did not run on some step, or ran below the request: the steps by limit and what they left unserved. The totals are in df.attrs["operating_limits"] (tmhp.operating_limits.summarize_operating_limits()).

Parameters:
  • simulation_period_sec (int)

  • dt_s (int)

  • result_save_csv_path (str | None)

Return type:

DataFrame

postprocess_exergy(df)[source]

Compute GSHP-specific exergy: 6 subsystems × (X_in, Xc, X_out).

Parameters:

df (DataFrame)

Return type:

DataFrame

operating_range(conditions=None)[source]

Solve standard rating conditions and tabulate whether the heat pump runs at each.

A check to call before a simulation; it is not made at construction because it solves the cycle at every condition. One row per condition: whether the compressor runs, delivers the request or a reduced duty, or cycles on and off, its failure_reason, cop_sys [-], and the limit in words. No OperatingLimitWarning is issued and the model is not changed.

The model has no argument for the brine entering it: a condition is solved on a shallow copy whose borefield-outlet fluid (T_bhe_f_out) is at the condition’s brine temperature. With ground-flow control the source is solved from the borehole wall and no brine temperature can be imposed, so the call raises ValueError.

Parameters:

conditions (Iterable[StandardCondition] | None) – Conditions to solve; tmhp.standard_conditions.BRINE_TO_AIR (B0/20 and B25/27 at the nameplate duty) when omitted.

Returns:

Columns tmhp.standard_conditions.COLUMNS; see tmhp.standard_conditions.operating_range().

Return type:

DataFrame

Ground source heat pump — simple COP-based model with indoor unit.

This module provides a simplified GSHP model using the EnergyPlus EquationFit COP correlation rather than a full refrigerant cycle analysis. It is a lightweight alternative to the CoolProp-based GroundSourceHeatPump for quick parametric studies.

Borehole thermal response is tracked with pygfunction-based g-functions and temporal superposition of dynamic building loads. The effective borehole thermal resistance R_b* is automatically computed using the pygfunction multipole method.

tmhp.gshp_empirical.T_A_ROOM_DEFAULT = {'cooling': 27.0, 'heating': 21.0, 'off': 22.0}

Entering (room) air temperature [°C] used when T_a_room is not given.

class tmhp.gshp_empirical.GroundSourceHeatPumpEmpirical(H_b=150.0, D_b=2.0, r_b=0.08, k_p=0.4, k_grout=1.5, r_out=0.016, r_in=0.013, D_s=0.032, k_g=2.0, c_g=800.0, rho_g=2000.0, T_g=15.0, dV_f=20.0, Q_rated_cooling=20590.0, Q_rated_heating=16450.0, E_pmp=100.0, dP_iu_fan_design=60.0, eta_iu_fan_design=0.6, dt_hours=1, sim_hours=8760, gfunc_boundary_condition='UBWT', Q_r_iu=0.0, T0=20.0, T_a_room=None)[source]

Bases: object

Ground source heat pump model using the EnergyPlus EquationFit COP model.

Uses borehole heat exchangers with pygfunction step-response factor array for precise soil thermal response with temporal superposition of dynamic building loads.

This model computes borehole thermal resistance R_b* automatically using the pygfunction multipole method (Hellström 1991), and fan power using the default single-zone VAV surrogate.

Performance curve and its limits. COP and available capacity come from the ClimateMaster TCH072_GLHP EquationFit curves of EnergyPlus (gshp_equation_fit_ratios()). They describe full-load operation at the rated air flow; a smaller load is met by cycling, so the COP does not depend on the part-load ratio (no cycling degradation is applied). The available capacity is Q_rated_{cooling,heating} × CAP_ratio(T_air, EWT); a larger request is served at that ceiling and flagged capacity_clamped = "max". Outside the fitted domain (GSHP_EQFIT_DOMAIN: entering water −1.25–32.06 °C in heating, 9.85–48.72 °C in cooling; entering air 9.85–26.51 °C dry-bulb in heating, 9.85–23.73 °C wet-bulb in cooling; the water temperature is judged at the converged, self-consistent entering water, not at the undisturbed ground) the unit does not run for that step: heat, compressor and pump power are zero, COP is NaN and failure_reason says why. COP and compressor power are therefore never negative.

Time convention. Each call of system_update() is one step of dt_hours; the borehole-wall temperature is the mean over that step, including the response to the step’s own load (step-mean g-function, the same convention as the physics-based ground-source models).

For a full refrigerant-cycle model, see GroundSourceHeatPump.

Parameters:
  • H_b (float)

  • D_b (float)

  • r_b (float)

  • k_p (float)

  • k_grout (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • k_g (float)

  • c_g (float)

  • rho_g (float)

  • T_g (float)

  • dV_f (float)

  • Q_rated_cooling (float)

  • Q_rated_heating (float)

  • E_pmp (float)

  • dP_iu_fan_design (float)

  • eta_iu_fan_design (float)

  • dt_hours (int)

  • sim_hours (int)

  • gfunc_boundary_condition (str)

  • Q_r_iu (float)

  • T0 (float)

  • T_a_room (float | None)

H_b: float = 150.0
D_b: float = 2.0
r_b: float = 0.08
k_p: float = 0.4
k_grout: float = 1.5
r_out: float = 0.016
r_in: float = 0.013
D_s: float = 0.032
k_g: float = 2.0
c_g: float = 800.0
rho_g: float = 2000.0
T_g: float = 15.0
dV_f: float = 20.0
Q_rated_cooling: float = 20590.0
Q_rated_heating: float = 16450.0
E_pmp: float = 100.0
dP_iu_fan_design: float = 60.0
eta_iu_fan_design: float = 0.6
dt_hours: int = 1
sim_hours: int = 8760
gfunc_boundary_condition: str = 'UBWT'
Q_r_iu: float = 0.0
T0: float = 20.0
T_a_room: float | None = None
system_update()[source]

Advance the model by one timestep.

Call this method once per timestep after setting Q_r_iu, T0 and optionally T_a_room. The method computes COP, temperatures, fan power, and component exergy balances.

Status attributes set on every call:

  • failure_reason — "none", or "outside_curve_domain" (entering air or water temperature outside the fitted range; the unit is off for the step and failure_detail names the variable) or "not_converged" (the ground/fluid iteration did not settle).

  • capacity_clamped — "max" when the request exceeds the available capacity Q_cap and None otherwise.

  • Q_iu — the load actually served [W], signed like Q_r_iu.

A physically impossible input (non-finite Q_r_iu; T0 or T_a_room outside −90..100 °C) is a caller error and raises ValueError (tmhp._validation). A valid input whose operating point lies outside the curve fit is a result: the step is reported with failure_reason = "outside_curve_domain", never raised.

Raises:

ValueError – "<name> must be …, got <value>" for an impossible input.

__init__(H_b=150.0, D_b=2.0, r_b=0.08, k_p=0.4, k_grout=1.5, r_out=0.016, r_in=0.013, D_s=0.032, k_g=2.0, c_g=800.0, rho_g=2000.0, T_g=15.0, dV_f=20.0, Q_rated_cooling=20590.0, Q_rated_heating=16450.0, E_pmp=100.0, dP_iu_fan_design=60.0, eta_iu_fan_design=0.6, dt_hours=1, sim_hours=8760, gfunc_boundary_condition='UBWT', Q_r_iu=0.0, T0=20.0, T_a_room=None)
Parameters:
  • H_b (float)

  • D_b (float)

  • r_b (float)

  • k_p (float)

  • k_grout (float)

  • r_out (float)

  • r_in (float)

  • D_s (float)

  • k_g (float)

  • c_g (float)

  • rho_g (float)

  • T_g (float)

  • dV_f (float)

  • Q_rated_cooling (float)

  • Q_rated_heating (float)

  • E_pmp (float)

  • dP_iu_fan_design (float)

  • eta_iu_fan_design (float)

  • dt_hours (int)

  • sim_hours (int)

  • gfunc_boundary_condition (str)

  • Q_r_iu (float)

  • T0 (float)

  • T_a_room (float | None)

See Coupled ground-loop flow for opt-in flow-dependent component physics, optimal pump control, source boundaries, and feasibility diagnostics.