Skip to content

Commit

Permalink
feat(components): Support custom aperture install-depth
Browse files Browse the repository at this point in the history
  • Loading branch information
ed-p-may authored Mar 8, 2023
2 parents 1c73ad8 + 9bc2f2f commit ee9da74
Show file tree
Hide file tree
Showing 9 changed files with 381 additions and 379 deletions.
1 change: 1 addition & 0 deletions PHX/from_HBJSON/create_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def create_component_from_hb_aperture(
phx_ap.window_type = _window_type_dict[hb_ap_prop_energy.construction.identifier]
phx_ap.window_type_id_num = hb_ap_const_prop_ph.id_num
phx_ap.variant_type_name = hb_ap_prop_ph.variant_type
phx_ap.install_depth = hb_ap_prop_ph.install_depth

# -- Create new Aperture Element (Sash)
new_phx_ap_element = components.PhxApertureElement(_host=phx_ap)
Expand Down
1 change: 1 addition & 0 deletions PHX/model/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ def __init__(self, _host: PhxComponentOpaque):
)
self.window_type_id_num: int = -1
self.variant_type_name: str = "_unnamed_type_"
self.install_depth: float = 0.1016 #m

self.elements: List[PhxApertureElement] = []

Expand Down
4 changes: 2 additions & 2 deletions PHX/to_WUFI_XML/xml_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _PhxComponentOpaque(_c: components.PhxComponentOpaque) -> List[xml_writable]
]


def _PhxComponentAperture(_c: building.PhxComponentAperture) -> List[xml_writable]:
def _PhxComponentAperture(_c: components.PhxComponentAperture) -> List[xml_writable]:
return [
XML_Node("IdentNr", _c.id_num),
XML_Node("Name", _c.display_name),
Expand All @@ -263,7 +263,7 @@ def _PhxComponentAperture(_c: building.PhxComponentAperture) -> List[xml_writabl
"IdentNrPolygons",
[XML_Node("IdentNr", n, "index", i) for i, n in enumerate(_c.polygon_ids)],
),
XML_Node("DepthWindowReveal", 0.1016, "unit", "m"),
XML_Node("DepthWindowReveal", _c.install_depth, "unit", "m"),
]


Expand Down
4 changes: 2 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_a525cb97..Face4</Name>
<Name>Room_1_83c3a676..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_a525cb97..Face5</Name>
<Name>Room_1_83c3a676..Face5</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>7</IdentNrColorI>
Expand Down
34 changes: 17 additions & 17 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_c89a47c0</Name>
<Name>Shade_ab2669e6</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_2c89d08a</Name>
<Name>Shade_f142ee09</Name>
<Visual>true</Visual>
<Type>1</Type>
<IdentNrColorI>1</IdentNrColorI>
Expand Down Expand Up @@ -826,58 +826,58 @@
<ExhaustVents count="0"/>
<ThermalBridges count="8">
<ThermalBridge index="0">
<Name>_unnamed_bldg_segment__9363dcd8</Name>
<Name>_unnamed_bldg_segment__66570846</Name>
<Type>-15</Type>
<Length>14.0</Length>
<Length>16.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="1">
<Name>_unnamed_bldg_segment__9749eff3</Name>
<Name>_unnamed_bldg_segment__6c6c1726</Name>
<Type>-15</Type>
<Length>10.733126291998989</Length>
<Length>22.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="2">
<Name>_unnamed_bldg_segment__a6447dab</Name>
<Name>_unnamed_bldg_segment__7e6a76bf</Name>
<Type>-15</Type>
<Length>18.0</Length>
<Length>14.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="3">
<Name>_unnamed_bldg_segment__bd212f70</Name>
<Name>_unnamed_bldg_segment__802271b9</Name>
<Type>-15</Type>
<Length>22.0</Length>
<Length>13.416407864998739</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="4">
<Name>_unnamed_bldg_segment__c022de4a</Name>
<Name>_unnamed_bldg_segment__a435dd89</Name>
<Type>-15</Type>
<Length>9.391485505499118</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="5">
<Name>_unnamed_bldg_segment__efc9ea4f</Name>
<Name>_unnamed_bldg_segment__d00f5dac</Name>
<Type>-15</Type>
<Length>9.391485505499118</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="6">
<Name>_unnamed_bldg_segment__f402cd77</Name>
<Name>_unnamed_bldg_segment__d357206b</Name>
<Type>-15</Type>
<Length>13.416407864998739</Length>
<Length>18.0</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
<ThermalBridge index="7">
<Name>_unnamed_bldg_segment__f77a0042</Name>
<Name>_unnamed_bldg_segment__f2d18dd1</Name>
<Type>-15</Type>
<Length>16.0</Length>
<Length>10.733126291998989</Length>
<PsiValue>0.01</PsiValue>
<IdentNrOptionalClimate>-1</IdentNrOptionalClimate>
</ThermalBridge>
Expand Down Expand Up @@ -1167,7 +1167,7 @@
</PH_Parameters>
</Device>
<Device index="1">
<Name>d24ca25c-be9e-4ab1-a0d2-40cfe14094a9</Name>
<Name>71839b4a-7668-4f43-891e-f73e6a23385a</Name>
<IdentNr>1</IdentNr>
<SystemType>5</SystemType>
<TypeDevice>5</TypeDevice>
Expand Down
Binary file modified tests/_source_gh/hbph_test_models.gh
Binary file not shown.
78 changes: 39 additions & 39 deletions tests/_source_hbjson/Default_Model_Single_Zone.hbjson
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"PHIUS2021_cooling_load": 10.0
},
"name": "Unnamed_Bldg_Segment",
"identifier": "0180061f-e5e1-46f2-9b9b-af328e63fcf4",
"identifier": "b312da56-27e2-448d-8bc4-601e269bcc03",
"site": {
"climate": {
"monthly_radiation": {
Expand Down Expand Up @@ -89,8 +89,8 @@
"june": 0.0,
"november": 0.0
},
"identifier": "94e9655e-b201-45ef-a361-4c11e71cdc74",
"display_name": "94e9655e-b201-45ef-a361-4c11e71cdc74",
"identifier": "4fe8f980-38f6-4c1d-a5ef-0d170b529721",
"display_name": "4fe8f980-38f6-4c1d-a5ef-0d170b529721",
"glob": {
"february": 0.0,
"july": 0.0,
Expand Down Expand Up @@ -136,8 +136,8 @@
"dewpoint": null,
"rad_west": 0.0,
"ground_temp": null,
"identifier": "2a2cfb7c-29dd-4bd6-a777-e35787d82d7f",
"display_name": "2a2cfb7c-29dd-4bd6-a777-e35787d82d7f",
"identifier": "b2b7dc27-2160-4a34-8833-b2253dc8aac9",
"display_name": "b2b7dc27-2160-4a34-8833-b2253dc8aac9",
"rad_south": 0.0,
"rad_north": 0.0,
"sky_temp": null
Expand All @@ -149,8 +149,8 @@
"dewpoint": null,
"rad_west": 0.0,
"ground_temp": null,
"identifier": "9267a296-62a1-4aa8-9e97-9fa6de05dba0",
"display_name": "9267a296-62a1-4aa8-9e97-9fa6de05dba0",
"identifier": "aa003edd-c921-4d5b-8f16-4179023ba8a0",
"display_name": "aa003edd-c921-4d5b-8f16-4179023ba8a0",
"rad_south": 0.0,
"rad_north": 0.0,
"sky_temp": null
Expand All @@ -162,23 +162,23 @@
"dewpoint": null,
"rad_west": 0.0,
"ground_temp": null,
"identifier": "9c2bda03-24e1-476d-9ff2-932f6069edb7",
"display_name": "9c2bda03-24e1-476d-9ff2-932f6069edb7",
"identifier": "3f3987a0-710a-4657-8803-278ab35c2fee",
"display_name": "3f3987a0-710a-4657-8803-278ab35c2fee",
"rad_south": 0.0,
"rad_north": 0.0,
"sky_temp": null
},
"identifier": "6e1c8a2d-3bdf-4016-a042-5c94cf4a182a",
"display_name": "6e1c8a2d-3bdf-4016-a042-5c94cf4a182a",
"identifier": "b5fb2b46-0a55-4887-b6a1-3fd5a763c8cf",
"display_name": "b5fb2b46-0a55-4887-b6a1-3fd5a763c8cf",
"cooling_load_2": {
"temp": 0.0,
"rad_global": 0.0,
"rad_east": 0.0,
"dewpoint": null,
"rad_west": 0.0,
"ground_temp": null,
"identifier": "a44b7946-e99c-4e05-95b0-ee1e0f24b976",
"display_name": "a44b7946-e99c-4e05-95b0-ee1e0f24b976",
"identifier": "0c7814cb-5b2b-4907-a812-b2b719a89317",
"display_name": "0c7814cb-5b2b-4907-a812-b2b719a89317",
"rad_south": 0.0,
"rad_north": 0.0,
"sky_temp": null
Expand Down Expand Up @@ -227,8 +227,8 @@
"june": 0.0,
"november": 0.0
},
"identifier": "1cec77e9-b967-49b8-823e-3bd0fc447eb3",
"display_name": "1cec77e9-b967-49b8-823e-3bd0fc447eb3",
"identifier": "b513b350-8ec8-4450-accf-8e7515cfdf0b",
"display_name": "b513b350-8ec8-4450-accf-8e7515cfdf0b",
"dewpoints": {
"february": 0.0,
"july": 0.0,
Expand All @@ -244,7 +244,7 @@
"november": 0.0
}
},
"identifier": "c6f3496b-7e08-4fc7-a399-ca964e8800d0",
"identifier": "4a2231c4-3729-4cfc-abff-ed5b87c46b23",
"display_name": "New York",
"summer_daily_temperature_swing": 8.0,
"station_elevation": 0.0
Expand All @@ -254,17 +254,17 @@
"latitude": 40.600000000000001,
"longitude": -73.799999999999997,
"hours_from_UTC": -4,
"identifier": "772ab6c7-4c87-4287-a62c-6806c057166c",
"display_name": "772ab6c7-4c87-4287-a62c-6806c057166c",
"identifier": "ba295e8b-d1b6-4fad-900d-53e968e44152",
"display_name": "ba295e8b-d1b6-4fad-900d-53e968e44152",
"climate_zone": 1
},
"identifier": "0829a6f2-f63e-4026-9c60-bdf578548fb3",
"display_name": "0829a6f2-f63e-4026-9c60-bdf578548fb3",
"identifier": "8761820c-8fd7-4bc2-bcce-c774d011b87b",
"display_name": "8761820c-8fd7-4bc2-bcce-c774d011b87b",
"phpp_library_codes": {
"country_code": "US-United States of America",
"region_code": "New York",
"dataset_name": "US0055b-New York",
"identifier": "aa8d3b0d-e14b-43c5-9ddf-169bf2742ea4",
"identifier": "0ba04850-5294-4ff0-b77d-43a38d829681",
"display_name": "US0055b-New York"
}
},
Expand Down Expand Up @@ -312,7 +312,7 @@
},
"type": "IdealAirSystemProperties"
},
"identifier": "Room_1_a525cb97 Ideal Loads Air System",
"identifier": "Room_1_83c3a676 Ideal Loads Air System",
"cooling_air_temperature": 13.0,
"demand_controlled_ventilation": false,
"cooling_limit": {
Expand Down Expand Up @@ -2109,7 +2109,7 @@
"ph": {
"type": "PeoplePhProperties",
"dwellings": {
"identifier": "0c8d563c-7333-4dc3-bfa7-cd9c08d35f18",
"identifier": "b11aa676-d114-4893-82d5-68f6c17425e1",
"num_dwellings": 0
},
"id_num": 0,
Expand Down Expand Up @@ -2312,18 +2312,18 @@
}
},
"version": "1.53.1",
"identifier": "unnamed_97678b08",
"identifier": "unnamed_e62133bd",
"display_name": "unnamed",
"rooms": [
{
"properties": {
"ph": {
"type": "RoomPhPropertiesAbridged",
"ph_bldg_segment_id": "0180061f-e5e1-46f2-9b9b-af328e63fcf4",
"ph_bldg_segment_id": "b312da56-27e2-448d-8bc4-601e269bcc03",
"spaces": []
},
"energy": {
"hvac": "Room_1_a525cb97 Ideal Loads Air System",
"hvac": "Room_1_83c3a676 Ideal Loads Air System",
"type": "RoomEnergyPropertiesAbridged",
"program_type": "Generic Office Program"
},
Expand All @@ -2332,7 +2332,7 @@
"type": "RoomRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97",
"identifier": "Room_1_83c3a676",
"display_name": "Room_1",
"faces": [
{
Expand Down Expand Up @@ -2401,8 +2401,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face0",
"display_name": "Room_1_a525cb97..Face0",
"identifier": "Room_1_83c3a676..Face0",
"display_name": "Room_1_83c3a676..Face0",
"type": "Face"
},
{
Expand Down Expand Up @@ -2471,8 +2471,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face1",
"display_name": "Room_1_a525cb97..Face1",
"identifier": "Room_1_83c3a676..Face1",
"display_name": "Room_1_83c3a676..Face1",
"type": "Face"
},
{
Expand Down Expand Up @@ -2541,8 +2541,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face2",
"display_name": "Room_1_a525cb97..Face2",
"identifier": "Room_1_83c3a676..Face2",
"display_name": "Room_1_83c3a676..Face2",
"type": "Face"
},
{
Expand Down Expand Up @@ -2611,8 +2611,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face3",
"display_name": "Room_1_a525cb97..Face3",
"identifier": "Room_1_83c3a676..Face3",
"display_name": "Room_1_83c3a676..Face3",
"type": "Face"
},
{
Expand Down Expand Up @@ -2676,8 +2676,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face4",
"display_name": "Room_1_a525cb97..Face4",
"identifier": "Room_1_83c3a676..Face4",
"display_name": "Room_1_83c3a676..Face4",
"type": "Face"
},
{
Expand Down Expand Up @@ -2746,8 +2746,8 @@
"type": "FaceRadiancePropertiesAbridged"
}
},
"identifier": "Room_1_a525cb97..Face5",
"display_name": "Room_1_a525cb97..Face5",
"identifier": "Room_1_83c3a676..Face5",
"display_name": "Room_1_83c3a676..Face5",
"type": "Face"
}
],
Expand Down
Loading

0 comments on commit ee9da74

Please sign in to comment.