mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
SAP 10.2 Appendix L §L2a (PDF p.88) verbatim:
GL = 0.9 × Σ (Aw × gL × FF × ZL) / TFA (L2a)
where
FF is the frame factor (fraction of window that is glazed) for
the actual window or from Table 6c
Aw is the area of a window, m²
gL is the light transmittance factor from Table 6b
ZL is the light access factor from Table 6d
Table 6b gL (PDF p.178) — light transmittance column:
Single glazed 0.90
Double glazed (any variant) 0.80
Triple glazed (any variant) 0.70
Table 6d note 2 (PDF p.178): "A solar access factor of 1.0 and a light
access factor of 1.0 should be used for roof windows/rooflights."
Pre-slice `_daylight_factor_from_cert` collapsed every rooflight into
a single `rooflight_total_area_m2 × _G_LIGHT_DEFAULT (0.80) ×
_FRAME_FACTOR_DEFAULT (0.70)` product, overcounting any Triple-glazed
rooflight (gL=0.70) or any non-default frame factor.
Cert 000565 §11 lodges 2 rooflights (per S0380.107 routing):
Item 2 (Ext2 NR rooflight): 1.2 m², "Triple between 2002 and 2021",
PVC FF=0.70 → gL=0.70 (Table 6b Triple). Correct numerator
contribution 1.2 × 0.70 × 0.70 = 0.588; pre-slice cascade used
1.2 × 0.80 × 0.70 = 0.672 (+0.084 over).
Item 5 (Ext4 A rooflight): 0.5 m², "Double between 2002 and 2021",
Wood FF=0.70 → gL=0.80 (Table 6b Double). Already matched.
The +0.084 numerator delta lowered GL → lowered C_daylight → lowered
worksheet (232) by 2.17 kWh/yr.
3-layer fix:
1. `datatypes/epc/domain/epc_property_data.py`: add `glazing_type:
int = 3` to SapRoofWindow (default = Double 2002-2021, the cohort
modal).
2. `datatypes/epc/domain/mapper.py` `_map_elmhurst_roof_window`:
populate `glazing_type` via `_elmhurst_glazing_type_code(w.
glazing_type)` — mirror of `_map_elmhurst_window`.
3. `domain/sap10_calculator/worksheet/internal_gains.py`
`_daylight_factor_from_cert`: iterate `epc.sap_roof_windows` for
the rooflight g_L numerator, dispatching via existing
`_G_LIGHT_BY_GLAZING_CODE` + `rw.frame_factor`. Z_L = 1.0 per
Table 6d note 2.
Test coverage:
- AAA test `test_summary_000565_rooflight_per_window_g_l_routes_via_
glazing_type_per_sap_10_2_appendix_l_l2a` pins both per-rooflight
glazing codes (9 Triple / 3 Double) AND `inputs.lighting_kwh_per_
yr` at 1384.8353 ±1e-4.
- 000516 hand-built fixture updated to explicitly set glazing_type=2
("Double pre 2002") matching the lodged label.
Cert 000565 cascade snapshot (HEAD
|
||
|---|---|---|
| .. | ||
| addresses | ||
| data_transformation | ||
| epc | ||
| sap10_calculator | ||
| sap10_ml | ||
| tasks | ||
| postcode.py | ||