The calculator exposes the dwelling design heat loss for heat-pump sizing 🟥

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-03 10:16:43 +00:00
parent 7707df3294
commit cd4ed81185
2 changed files with 23 additions and 0 deletions

View file

@ -403,6 +403,11 @@ class SapResult:
space_heating_kwh_per_yr: float
space_cooling_kwh_per_yr: float
fabric_energy_efficiency_kwh_per_m2_yr: float
# The dwelling's SAP design heat loss (kW) — the annual-average heat loss
# coefficient at the design temperature difference (24.2 K). Output-only:
# it is the quantity Appendix N's PSR divides a heat pump's rated output by,
# so the ASHP recommendation sizes the pump to the dwelling from it.
design_heat_loss_kw: float
main_heating_fuel_kwh_per_yr: float
main_2_heating_fuel_kwh_per_yr: float
secondary_heating_fuel_kwh_per_yr: float
@ -872,6 +877,7 @@ def calculate_sap_from_inputs(inputs: CalculatorInputs) -> SapResult:
space_heating_kwh_per_yr=space_heating_kwh,
space_cooling_kwh_per_yr=space_cooling_kwh,
fabric_energy_efficiency_kwh_per_m2_yr=inputs.fabric_energy_efficiency_kwh_per_m2_yr,
design_heat_loss_kw=0.0, # stub — computed in GREEN
main_heating_fuel_kwh_per_yr=main_fuel_kwh,
main_2_heating_fuel_kwh_per_yr=inputs.energy_requirements.main_2_fuel_kwh_per_yr,
secondary_heating_fuel_kwh_per_yr=secondary_fuel_kwh,

View file

@ -815,3 +815,20 @@ def test_split_tariff_charges_space_heating_at_off_peak_rate() -> None:
+ (r_e7.pumps_fans_kwh_per_yr + r_e7.lighting_kwh_per_yr) * 0.1319
)
assert r_e7.total_fuel_cost_gbp == pytest.approx(expected_cost, rel=1e-6)
def test_calculate_exposes_the_design_heat_loss_for_heat_pump_sizing() -> None:
# The ASHP recommendation sizes the pump to the dwelling's SAP design heat
# loss — the annual-average HLC at the design temperature difference (24.2 K),
# the quantity Appendix N's PSR divides the pump's rated output by. The
# calculator surfaces it as a typed output, derived from the HLC it already
# computes.
# Arrange
inputs = _baseline_inputs()
# Act
result = calculate_sap_from_inputs(inputs)
# Assert — HLC (W/K) x 24.2 K / 1000 = design heat loss (kW).
hlc = result.intermediate["heat_transfer_coefficient_w_per_k"]
assert result.design_heat_loss_kw == pytest.approx(hlc * 24.2 / 1000)