From fac64a90cc13b29b61db4ab2dc56b879eca6f1a8 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 16 Jul 2026 18:38:02 +0000 Subject: [PATCH] =?UTF-8?q?Bill=20community-heating=20DHW=20at=20the=20net?= =?UTF-8?q?work=20fuel=20rate=20=F0=9F=9F=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When DHW is supplied by a community heat network (WHC 901/902/914 on a heat-network main), the network heat -- space AND water -- bills at the main's Table-12 heat-network rate. The STANDARD-tariff §10a cost path (_fuel_cost) re-derived the DHW rate inline from the cert-lodged HW fuel, which Elmhurst defaults to 'Mains gas' (Table 32 code 26, 3.48 p/kWh) on community certs -- under-costing DHW and over-rating SAP. Now inherits the main heat-network rate via _fuel_cost_gbp_per_kwh, mirroring the .173 inherit already applied on the legacy/off-peak HW-rate paths. Scoped to community heating, so all other certs are unchanged; the RdSAP-21.0.1 corpus gauge improves 78.6%->78.9% within-0.5 (MAE 0.628->0.622) with all 195 Elmhurst worksheet pins green. Co-Authored-By: Claude Opus 4.8 (1M context) --- domain/sap10_calculator/rdsap/cert_to_inputs.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/domain/sap10_calculator/rdsap/cert_to_inputs.py b/domain/sap10_calculator/rdsap/cert_to_inputs.py index cd68d5099..ecb72917c 100644 --- a/domain/sap10_calculator/rdsap/cert_to_inputs.py +++ b/domain/sap10_calculator/rdsap/cert_to_inputs.py @@ -7698,9 +7698,16 @@ def _fuel_cost( if main_2_fuel_code is not None else main_1_high_rate_gbp_per_kwh ) + # When DHW is supplied by a community heat network (WHC 901/902/914 on a + # heat-network main), the network heat — space AND water — bills at the + # main's Table-12 heat-network rate, NOT the cert-lodged HW fuel (which + # Elmhurst defaults to "Mains gas"). Mirror the .173 inherit already applied + # on the legacy/off-peak HW-rate paths (`_hot_water_fuel_cost_gbp_per_kwh`) + # into this §10a STANDARD-tariff path, which is the one that drives (255)/SAP. water_high_rate_gbp_per_kwh = ( - table_32_unit_price_p_per_kwh(water_heating_fuel_code) - * _PENCE_TO_GBP + _fuel_cost_gbp_per_kwh(main, prices) + if _is_community_heating_hw_from_main(epc) + else table_32_unit_price_p_per_kwh(water_heating_fuel_code) * _PENCE_TO_GBP ) # Secondary fuel cost: route through the cert's `secondary_fuel_type` # when lodged (e.g. mains-gas fire SAP code 605 → fuel 26 → Table 32