diff --git a/domain/sap10_calculator/worksheet/heat_transmission.py b/domain/sap10_calculator/worksheet/heat_transmission.py index dff61a08..a961d60f 100644 --- a/domain/sap10_calculator/worksheet/heat_transmission.py +++ b/domain/sap10_calculator/worksheet/heat_transmission.py @@ -980,21 +980,28 @@ def heat_transmission_from_cert( # U_main_wall per spec page 23 ("Common wall U-value is inferred # from the U-value of the main wall in the building part below"; # gables fall under the same Table 4 rule). - rr_a_rr = geom["rr_simplified_a_rr_m2"] - rr_common = geom["rr_common_wall_area_m2"] - rr_gable = geom["rr_gable_area_m2"] + # `rr_roof_area` is the worksheet's simplified A_RR (the notional + # room-in-roof roof area, RdSAP 10 §3.10.1). Its perimeter common + # walls + gables are billed to walls; the leftover residual is the + # roof-going area that takes the roof U-value. + rr_roof_area = geom["rr_simplified_a_rr_m2"] + rr_common_wall_area = geom["rr_common_wall_area_m2"] + rr_gable_area = geom["rr_gable_area_m2"] rr_detailed_area = 0.0 - if rr_a_rr > 0: + if rr_roof_area > 0: rir = part.sap_room_in_roof - assert rir is not None # rr_a_rr > 0 ⇒ rir present per _part_geometry - walls += uw * (rr_common + rr_gable) + assert rir is not None # rr_roof_area > 0 ⇒ rir present per _part_geometry + walls += uw * (rr_common_wall_area + rr_gable_area) # Deduct any "Roof of Room" rooflights piercing the RR shell # (see `rw_area_on_rr` rationale at the gross-roof block). - a_rr_final = max(0.0, rr_a_rr - rr_common - rr_gable - rw_area_on_rr) + rr_residual_roof_area = max( + 0.0, + rr_roof_area - rr_common_wall_area - rr_gable_area - rw_area_on_rr, + ) u_rr = u_rr_default_all_elements( country=country, age_band=rir.construction_age_band, ) - roof += u_rr * a_rr_final + roof += u_rr * rr_residual_roof_area elif part.sap_room_in_roof is not None and part.sap_room_in_roof.detailed_surfaces: # RdSAP10 §3.10 Detailed RR — iterate per-surface lodgement. # Slope / flat_ceiling / stud_wall route to roof (worksheet @@ -1007,7 +1014,8 @@ def heat_transmission_from_cert( # band". Wall-going RIR surfaces (gable_wall, gable_wall_ # external, common_wall) deduct from the simplified A_RR # to leave the residual area, mirroring the Simplified - # branch's `a_rr_final = rr_a_rr - rr_common - rr_gable`. + # branch's `rr_residual_roof_area = rr_roof_area - + # rr_common_wall_area - rr_gable_area`. # Roof-going surfaces (slope / flat_ceiling / stud_wall) # do NOT deduct — they sit inside the RR shell rather than # forming its perimeter walls. @@ -1179,7 +1187,7 @@ def heat_transmission_from_cert( main_wall_area + (alt_walls_total_area - alt_window_area) + roof_area + floor_area_total - + w_area + d_area + rw_area_part + rr_a_rr + rr_detailed_area + + w_area + d_area + rw_area_part + rr_roof_area + rr_detailed_area + cantilever_area ) total_external_area += part_external_area