mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
RdSAP 10 §3.9.2 step (b) (PDF p.23) verbatim:
"Software calculates the area of each gable or adjacent wall by
using the equation:
A_RR_gable = L_gable × (0.25 + H_gable) − [(H_gable − H_common_1)² / 2
+ (H_gable − H_common_2)² / 2]"
Step (d):
A_RR_final = A_RR_wall − (Σ A_common + Σ A_gable + Σ A_party
+ Σ A_sheltered + Σ A_connected)
The spec equation is signed and applies for all L > 0 — including
H_gable = 0. When the gable is shorter than the common walls the
correction term `(H_gable − H_common)² / 2` exceeds the
L × (0.25 + H_gable) term, producing a negative A_RR_gable.
Elmhurst's worksheet evaluates the equation literally; the negative
value adjusts A_RR_final upward via step (d) without billing a
physical wall area.
Cert 000565 §8.1 lodges Ext3's RR (Simplified Type 2) with an
absent Gable Wall 2:
Gable Wall 1 L=9.00 H=7.00 Exposed U=0.45
Gable Wall 2 L=4.00 H=0.00 U=0.00 ← lodged but H=0
Common Wall 1 L=5.00 H=1.50 U=0.45
Common Wall 2 L=7.50 H=0.30 U=0.45
Spec equation for Gable Wall 2:
A_gable_2 = 4 × (0.25 + 0) − (0 − 1.5)²/2 − (0 − 0.30)²/2
= 1.0 − 1.125 − 0.045 = −0.17 m²
Worksheet (30) Ext3 residual = 17.35 m² back-solves exactly:
A_RR_shell = 12.5 × √(32.0 / 1.5) = 57.7350
Σ walls (incl. -0.17 absent gable) = 40.3850
residual = shell − walls = 17.3500 ✓ 4 d.p.
Pre-slice the mapper had two clamps that together dropped the
spec-computed −0.17 m² adjustment:
mapper.py:3350 `if length_m <= 0 or height_m <= 0: return None`
→ filtered out any H=0 surface
mapper.py:3443 `area_m2 = max(0.0, length_m * (0.25 + H) − correction)`
→ clamped negative gable areas at 0
Combined the cascade computed residual = 17.18 m² (cascade UNDER
by 0.17). Plus a related secondary `if height_m > h` filter on the
correction sum that masked the all-common-walls-taller case.
3-layer fix:
1. `datatypes/epc/domain/mapper.py` `_map_elmhurst_rir_surface`:
- Split the early-return filter: drop only when L<=0 (no wall),
OR when H<=0 AND not (Simplified Type 2 with common walls).
- Apply the spec gable-area formula to BOTH `gable_wall` (party
default) and `gable_wall_external` kinds in Simplified Type 2
(the U-value routing differs by kind, but the area equation
is the same).
- Remove `max(0.0, ...)` clamp so the signed result reaches the
cascade.
- Remove `if height_m > h` correction-sum filter (spec applies
the full square unconditionally).
2. `domain/sap10_calculator/worksheet/heat_transmission.py` per-
surface loop:
- `gable_wall` branch: skip `party += 0.25 × area` when area < 0
(wall doesn't exist physically) but still add the signed area
to `rr_walls_in_a_rr_area` so the residual deduction in step (d)
grows by |area|.
- `gable_wall_external` branch: same skip pattern for `walls +=
u × area` and `rr_detailed_area += area`.
Cohort safety: only cert 000565 Ext3 hits this in the corpus. All
other cohort certs are Type 1 RR (no common walls, formula gives
the same answer) or have all gables H > 0. The cascade's per-element
test pins (Ext1's Connected gable + Exposed gable, Ext4's Detailed
RR) unchanged.
Cert 000565 cascade snapshot (HEAD
|
||
|---|---|---|
| .. | ||
| domain | ||
| loaders | ||
| schema | ||
| search | ||
| surveys | ||
| __init__.py | ||
| construction_age_band.py | ||
| efficiency.py | ||
| floor.py | ||
| fuel.py | ||
| heating_controls.py | ||
| hotwater.py | ||
| main_heating.py | ||
| property_type_built_form.py | ||
| roof.py | ||
| walls.py | ||
| windows.py | ||