Bill community-heating DHW at the network fuel rate 🟩

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) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-07-16 18:38:02 +00:00
parent eb5f52e9c4
commit fac64a90cc

View file

@ -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