Skip to content

Commit

Permalink
feat(certification): Support custom mech-room temperature
Browse files Browse the repository at this point in the history
- WUFI-Export allows for custom mech-room temp
- WUFI-Export allows for custom winter/summer interior air setpoints
- Update tests
  • Loading branch information
ed-p-may committed Mar 16, 2023
1 parent 921fe73 commit be70cee
Show file tree
Hide file tree
Showing 12 changed files with 415 additions and 391 deletions.
8 changes: 5 additions & 3 deletions PHX/from_HBJSON/create_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def add_PhxPhBuildingData_from_hb_room(
# -- Type Aliases
ph_bldg = _variant.phius_cert.ph_building_data # alias
hb_prop_energy: RoomEnergyProperties = _hb_room.properties.energy # type: ignore
hb_prop_ph: RoomPhProperties = _hb_room.properties.ph # type: ignore

# -- Set the occupancy
if hb_prop_energy.people:
Expand All @@ -295,11 +296,12 @@ def add_PhxPhBuildingData_from_hb_room(
ph_bldg.add_foundation(ground.PhxFoundation())

# -- Set the airtightness for Building
ph_bldg.airtightness_q50 = _hb_room.properties.energy.infiltration.flow_per_exterior_area * 3600 # type: ignore
ph_bldg.airtightness_q50 = hb_prop_energy.infiltration.flow_per_exterior_area * 3600

# -- Set the air temp setpoints
ph_bldg.setpoints.winter = _hb_room.properties.ph.ph_bldg_segment.set_points.winter # type: ignore
ph_bldg.setpoints.summer = _hb_room.properties.ph.ph_bldg_segment.set_points.summer # type: ignore
ph_bldg.setpoints.winter = hb_prop_ph.ph_bldg_segment.set_points.winter
ph_bldg.setpoints.summer = hb_prop_ph.ph_bldg_segment.set_points.summer
ph_bldg.mech_room_temp = hb_prop_ph.ph_bldg_segment.mech_room_temp

return None

Expand Down
5 changes: 3 additions & 2 deletions PHX/model/certification.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

@dataclass
class PhxSetpoints:
winter: float = 20 # deg. C
summer: float = 25 # deg. C
winter: float = 20.0 # deg. C
summer: float = 25.0 # deg. C


@dataclass
Expand All @@ -34,6 +34,7 @@ class PhxPhBuildingData:
wind_coefficient_f: float = 15

setpoints: PhxSetpoints = field(default_factory=PhxSetpoints)
mech_room_temp: float = 20.0

foundations: list[ground.PhxFoundation] = field(default_factory=list)

Expand Down
3 changes: 3 additions & 0 deletions PHX/to_WUFI_XML/xml_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ def _PhxPhBuildingData(
None,
_schema_name="_InternalGainsAdditionalData",
),
XML_Node("MechanicalRoomTemperature", _phius_cert.ph_building_data.mech_room_temp),
XML_Node("IndoorTemperature", _phius_cert.ph_building_data.setpoints.winter),
XML_Node("OverheatingTemperatureThreshold", _phius_cert.ph_building_data.setpoints.summer),
]


Expand Down
2 changes: 1 addition & 1 deletion _testing_to_WUFI.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# -- Temp
SOURCE_FILES = [
pathlib.Path(
"/Users/em/Dropbox/bldgtyp-00/00_PH_Tools/PHX/sample/hbjson/Ridgeway_VI_230315.hbjson"
"/Users/em/Dropbox/bldgtyp-00/00_PH_Tools/PHX/sample/hbjson/ducting_test.hbjson"
)
]
TARGET_DIR = pathlib.Path("sample")
Expand Down
7 changes: 5 additions & 2 deletions tests/_reference_xml/Default_Model_Single_Zone.xml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<Components count="3">
<Component index="0">
<IdentNr>5</IdentNr>
<Name>Room_1_43bc1228..Face4</Name>
<Name>Room_204_872fda75..Face4</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>12</IdentNrColorI>
Expand All @@ -219,7 +219,7 @@
</Component>
<Component index="1">
<IdentNr>6</IdentNr>
<Name>Room_1_43bc1228..Face5</Name>
<Name>Room_204_872fda75..Face5</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>7</IdentNrColorI>
Expand Down Expand Up @@ -515,6 +515,9 @@
<UseDefaultValuesSchool>false</UseDefaultValuesSchool>
<MarginalPerformanceRatioDHW>None</MarginalPerformanceRatioDHW>
</InternalGainsAdditionalData>
<MechanicalRoomTemperature>20.0</MechanicalRoomTemperature>
<IndoorTemperature>20.0</IndoorTemperature>
<OverheatingTemperatureThreshold>25.0</OverheatingTemperatureThreshold>
</PH_Building>
</PH_Buildings>
</PassivehouseData>
Expand Down
49 changes: 26 additions & 23 deletions tests/_reference_xml/Multi_Room_Complete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@
</Component>
<Component index="4">
<IdentNr>49</IdentNr>
<Name>Shade_f78f0446</Name>
<Name>Shade_6de4ef8d</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>1</IdentNrColorI>
Expand All @@ -680,7 +680,7 @@
</Component>
<Component index="5">
<IdentNr>50</IdentNr>
<Name>Shade_d5675186</Name>
<Name>Shade_e66e26af</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>1</IdentNrColorI>
Expand All @@ -702,7 +702,7 @@
<IdentNr>1</IdentNr>
<RoomsVentilation count="2">
<Room index="0">
<Name>101-Room_3</Name>
<Name>101-Room_206</Name>
<Type>99</Type>
<IdentNrUtilizationPatternVent>1</IdentNrUtilizationPatternVent>
<IdentNrVentilationUnit>1</IdentNrVentilationUnit>
Expand All @@ -713,7 +713,7 @@
<DesignVolumeFlowRateExhaust unit="m³/h">13.71</DesignVolumeFlowRateExhaust>
</Room>
<Room index="1">
<Name>102-Room_4</Name>
<Name>102-Room_207</Name>
<Type>99</Type>
<IdentNrUtilizationPatternVent>1</IdentNrUtilizationPatternVent>
<IdentNrVentilationUnit>1</IdentNrVentilationUnit>
Expand All @@ -726,14 +726,14 @@
</RoomsVentilation>
<LoadsPersonsPH count="2">
<LoadPerson index="0">
<Name>101-Room_3</Name>
<Name>101-Room_206</Name>
<IdentNrUtilizationPattern>1</IdentNrUtilizationPattern>
<ChoiceActivityPersons>3</ChoiceActivityPersons>
<NumberOccupants>1</NumberOccupants>
<FloorAreaUtilizationZone unit="">9.0</FloorAreaUtilizationZone>
</LoadPerson>
<LoadPerson index="1">
<Name>102-Room_4</Name>
<Name>102-Room_207</Name>
<IdentNrUtilizationPattern>1</IdentNrUtilizationPattern>
<ChoiceActivityPersons>3</ChoiceActivityPersons>
<NumberOccupants>1</NumberOccupants>
Expand Down Expand Up @@ -826,58 +826,58 @@
<ExhaustVents count="0"/>
<ThermalBridges count="8">
<ThermalBridge index="0">
<Name>_unnamed_bldg_segment__28f53c37</Name>
<Name>_unnamed_bldg_segment__3e47aa46</Name>
<Type>-15</Type>
<Length>10.733126291998989</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="1">
<Name>_unnamed_bldg_segment__7b863e04</Name>
<Name>_unnamed_bldg_segment__62266042</Name>
<Type>-15</Type>
<Length>18.0</Length>
<Length>9.391485505499118</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="2">
<Name>_unnamed_bldg_segment__8b9ad271</Name>
<Name>_unnamed_bldg_segment__a97b8318</Name>
<Type>-15</Type>
<Length>9.391485505499118</Length>
<Length>14.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="3">
<Name>_unnamed_bldg_segment__943dbb2d</Name>
<Name>_unnamed_bldg_segment__b20d51e3</Name>
<Type>-15</Type>
<Length>22.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="4">
<Name>_unnamed_bldg_segment__b94268ed</Name>
<Name>_unnamed_bldg_segment__e01700c8</Name>
<Type>-15</Type>
<Length>14.0</Length>
<Length>16.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="5">
<Name>_unnamed_bldg_segment__db546d8a</Name>
<Name>_unnamed_bldg_segment__e615119c</Name>
<Type>-15</Type>
<Length>13.416407864998739</Length>
<Length>18.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="6">
<Name>_unnamed_bldg_segment__f41fe2e7</Name>
<Name>_unnamed_bldg_segment__f1f4b587</Name>
<Type>-15</Type>
<Length>9.391485505499118</Length>
<Length>13.416407864998739</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="7">
<Name>_unnamed_bldg_segment__f8570688</Name>
<Name>_unnamed_bldg_segment__feb7b55d</Name>
<Type>-15</Type>
<Length>16.0</Length>
<Length>9.391485505499118</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
Expand Down Expand Up @@ -1121,6 +1121,9 @@
<UseDefaultValuesSchool>false</UseDefaultValuesSchool>
<MarginalPerformanceRatioDHW>None</MarginalPerformanceRatioDHW>
</InternalGainsAdditionalData>
<MechanicalRoomTemperature>20.0</MechanicalRoomTemperature>
<IndoorTemperature>21.0</IndoorTemperature>
<OverheatingTemperatureThreshold>24.0</OverheatingTemperatureThreshold>
</PH_Building>
</PH_Buildings>
</PassivehouseData>
Expand Down Expand Up @@ -1167,7 +1170,7 @@
</PH_Parameters>
</Device>
<Device index="1">
<Name>33419a8f-64d7-4c12-9e2a-178f4a8a863a</Name>
<Name>db096a27-dd42-4b1c-9b88-16e7c6bb57ab</Name>
<IdentNr>1</IdentNr>
<SystemType>5</SystemType>
<TypeDevice>5</TypeDevice>
Expand Down Expand Up @@ -1227,7 +1230,7 @@
<DistributionCooling/>
<DistributionVentilation count="2">
<Duct index="0">
<Name>d2321da6</Name>
<Name>3db1d936</Name>
<IdentNr>3</IdentNr>
<DuctDiameter unit="mm">160.0</DuctDiameter>
<DuctShapeHeight unit="mm">0.0</DuctShapeHeight>
Expand All @@ -1244,7 +1247,7 @@
</AssignedVentUnits>
</Duct>
<Duct index="1">
<Name>39004a5c</Name>
<Name>46311532</Name>
<IdentNr>4</IdentNr>
<DuctDiameter unit="mm">160.0</DuctDiameter>
<DuctShapeHeight unit="mm">0.0</DuctShapeHeight>
Expand Down
Binary file modified tests/_source_gh/hbph_test_models.gh
Binary file not shown.
Loading

0 comments on commit be70cee

Please sign in to comment.