mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
P5.3: SapResult.intermediate exposes ventilation group
infiltration_ach (the cert-derived input) and infiltration_w_per_k (the derived HLC_V = ACH × volume × 0.33 from SAP 10.2 §4.1) populated on `intermediate`. Diagnostic surface for the §4 / Table 4g sweep. 133 SAP tests pass.
This commit is contained in:
parent
d5b1d0d483
commit
443a7697ff
2 changed files with 20 additions and 0 deletions
|
|
@ -344,6 +344,8 @@ def calculate_sap_from_inputs(inputs: CalculatorInputs) -> SapResult:
|
|||
"windows_w_per_k": ht.windows_w_per_k,
|
||||
"doors_w_per_k": ht.doors_w_per_k,
|
||||
"thermal_bridging_w_per_k": ht.thermal_bridging_w_per_k,
|
||||
"infiltration_ach": inputs.infiltration_ach,
|
||||
"infiltration_w_per_k": hlc_v,
|
||||
}
|
||||
|
||||
return SapResult(
|
||||
|
|
|
|||
|
|
@ -159,6 +159,24 @@ def test_calculate_exposes_heat_transmission_intermediates() -> None:
|
|||
assert result.intermediate["thermal_bridging_w_per_k"] == ht.thermal_bridging_w_per_k
|
||||
|
||||
|
||||
def test_calculate_exposes_ventilation_intermediates() -> None:
|
||||
# Arrange — P5 trace mode: infiltration ach (the cert-derived input) and
|
||||
# the derived ventilation heat-loss W/K must surface so §4 / Table 4g
|
||||
# sweep slices can diff per-cert against the spec formula
|
||||
# HLC_V = ACH × volume × 0.33 (SAP 10.2 §4.1).
|
||||
inputs = _baseline_inputs()
|
||||
|
||||
# Act
|
||||
result = calculate_sap_from_inputs(inputs)
|
||||
|
||||
# Assert
|
||||
assert result.intermediate["infiltration_ach"] == inputs.infiltration_ach
|
||||
expected_hlc_v = inputs.infiltration_ach * inputs.dimensions.volume_m3 * 0.33
|
||||
assert result.intermediate["infiltration_w_per_k"] == pytest.approx(
|
||||
expected_hlc_v, rel=1e-9
|
||||
)
|
||||
|
||||
|
||||
def test_higher_main_heating_efficiency_reduces_fuel_use() -> None:
|
||||
# Arrange — Direction check: doubling the boiler efficiency must halve
|
||||
# the main-heating fuel kWh, holding everything else constant.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue