diff --git a/domain/sap10_calculator/docs/HANDOVER_CERT_9501_AND_HEATPUMPS.md b/domain/sap10_calculator/docs/HANDOVER_CERT_9501_AND_HEATPUMPS.md index 3e05df3c..105aaa9c 100644 --- a/domain/sap10_calculator/docs/HANDOVER_CERT_9501_AND_HEATPUMPS.md +++ b/domain/sap10_calculator/docs/HANDOVER_CERT_9501_AND_HEATPUMPS.md @@ -52,39 +52,80 @@ PYTHONPATH=/workspaces/model python -m pytest \ ## Outstanding workstreams (in priority order) -### 1. Heat-pump workstream — 7 ASHP certs (DEFERRED until go-ahead) +### 1. Heat-pump workstream — cert 0380 IN PROGRESS -Cert refs (per the prior handover): 0350, 0380, 2225, 2636, 3800, -9285, 9418. Predominantly PCDB index 104568 (one model 102421). The -mapper has never been validated against a heat-pump cert. +Cert refs: 0380, 0350, 2225, 2636, 3800, 9285, 9418. Predominantly +PCDB index 104568 (one model 102421). -Cert 0380 fixtures are already staged (commit `17646c8a`). Original -probe showed: +#### Cert 0380 state at session end (semi-detached bungalow, ASHP, age D) -| Path | Cascade SAP | Δ vs worksheet 88.5104 | -|---|---|---| -| Summary mapper | 18.08 | **-70.43** (catastrophic — Summary identifies HP as 80% boiler) | -| API mapper | 70.14 | **-18.37** | +Worksheet target SAP: **88.5104** -The Summary mapper is fundamentally broken on heat pumps; the API -mapper is partially-broken. Likely 15-30 slice workstream. Sketch -(from the prior handover, unchanged): +| Path | Cascade SAP | Δ vs worksheet | Status | +|---|---|---|---| +| Summary mapper | 30.14 | **-58.37** | Still broken on HPs (Summary identifies HP wrong) | +| API mapper | 91.43 | **+2.92** | HLC EXACT match worksheet; cost gap dominates | -1. **API mapper**: surface `main_heating_index_number`, set - `main_heating_category` for HPs, `main_fuel_type=29` (electric - heat pump). -2. **Cascade**: ensure `cert_to_inputs._main_heating_efficiency` - reads PCDB HP COP correctly. Investigate Table 4a/4b vs PCDB - precedence for HPs. -3. **Fuel cost**: HW + space heating on electricity tariffs - (Table 12) — check if the cascade has electric-tariff fuel-cost - plumbing wired up. -4. **Appendix N**: HP-specific efficiency adjustments (climate + - flow temperature). Likely the biggest cascade-side gap. -5. **Summary mapper**: separate slice — needs to identify HPs from - the Summary PDF's heating section. +API path closed gaps this session (Slices 101a-c): -**Do NOT start HP slices without an explicit go-ahead from the user.** +- **101a** API `glazing_type=14` → SAP 10.2 Table 24 post-2022 DG + (U=1.4, g=0.72). Closed windows HLC. +- **101b** Cavity wall + filled cavity + external insulation: + added `WALL_INSULATION_CAVITY_PLUS_EXTERNAL=6` + + `WALL_INSULATION_CAVITY_PLUS_INTERNAL=7` constants + composite + U formula `1/(1/U_filled + R_ins)` with 2-d.p. rounding to match + the dr87 worksheet. Walls HLC 14.87 → 11.62 (worksheet exact). +- **101b** SAP 10.2 Table 11 cat-4 (HP) secondary fraction = 0 + (dict was missing the entry; HP certs fell through to DEFAULT + 0.10). Removed £72 incorrect secondary heating cost. +- **101c** SAP 10.2 Table 4f cat-4 (HP) pumps/fans = 0 (dict was + missing the entry; HP certs fell through to DEFAULT 130 kWh → + £17 incorrect pumps/fans cost). Worksheet line (249) shows 0 kWh. + +(37) total fabric heat loss EXACT match worksheet 96.0889. + +#### Remaining cert 0380 API gaps (HW cascade — dominant Δ +2.92 SAP): + +Component cost breakdown (cert 0380 API vs worksheet): + +| Component | Cascade £ | Worksheet £ | Δ £ | +|---|---|---|---| +| main heating | 313.86 | 316.36 | -2.50 | +| secondary | 0.00 | 0.00 | ✓ | +| **hot water** | **66.36** | **115.82** | **-49.46 (BIG)** | +| pumps_fans | 0.00 | 0.00 | ✓ | +| lighting | 23.17 | 23.75 | -0.58 | +| electric shower | 88.93 | 88.93 | ✓ | +| PV credit | -338.11 | -338.11 | ✓ | +| **TOTAL** | **154.21** | **206.75** | **-52.54** | + +Hot water cascade for HP needs: + +1. **HP HW-specific COP** — worksheet uses 1.711 (PCDB-derived for + model 104568); cascade uses 2.3 (Table 4a generic HP COP). HW + needs higher water temp than space heating → lower COP. PCDB + likely has a separate `water_heating_efficiency` field. +2. **Cylinder storage + primary losses** — worksheet (47) lodges + cylinder size 160 L with (56) storage loss ~444 kWh + (59) + primary loss ~503 kWh. Cascade computes HW heat demand of 1157 + kWh vs worksheet 1502 kWh (Δ -345 kWh, likely the storage loss + not applied). Cert 0380's `cylinder_size: 3` is an integer + schema code (not litres) — needs lookup to actual volume. +3. **Possibly two**: HW heat demand AND HP HW COP both need + fixing to land at worksheet's 878 kWh fuel. + +#### Summary path (cert 0380) — still catastrophic + +The Summary mapper produces SAP 30.14 vs worksheet 88.51 (Δ -58.37). +The Elmhurst extractor likely identifies the HP as a different +heating system. Significant work — defer until API path is closed. + +#### Remaining HP certs + +Cert 0380's HW + HP HW COP work will likely benefit ALL 7 ASHP +certs (they share PCDB idx 104568 or 102421). Once cert 0380 closes +to 1e-4 on the API path, the other 6 ASHPs should close in 1-3 +slices each (shape variations). ### 2. 8 cohort golden certs without worksheets