Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Whole building MF Common Spaces #1850

Draft
wants to merge 41 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
57e268c
same as adjacency first cut
yzhou601 Oct 4, 2024
8edc860
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Oct 4, 2024
37aac01
update measures
yzhou601 Oct 4, 2024
db9794d
simplify implementation with additional properties
yzhou601 Oct 4, 2024
4ea65c6
oops
yzhou601 Oct 4, 2024
e0979da
skipped creating duplicate surfaces, addressed default and hvac sizing
yzhou601 Oct 11, 2024
5ee2c83
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Oct 11, 2024
c96242e
bugfix, name change
yzhou601 Oct 12, 2024
edd9aee
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Oct 21, 2024
ad4c8a0
change to only use sameas in one element instead of both elements
yzhou601 Oct 22, 2024
c31f15d
bugfix and some cleanups
yzhou601 Oct 22, 2024
bb5e641
simplify EPvalidator.xml
yzhou601 Oct 22, 2024
c1f0dd3
update measures
yzhou601 Oct 22, 2024
11f013f
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Oct 22, 2024
a1126ef
simplified the approach further more: store adjacent surface id in sp…
yzhou601 Oct 23, 2024
6c065d6
Add test file to include unconditioned common spaces and shared surfaces
yzhou601 Oct 24, 2024
6cad724
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Oct 24, 2024
4f0e0dd
Oops, forgot to add the generated test file
yzhou601 Oct 24, 2024
774b737
more fix
yzhou601 Oct 24, 2024
a8a6c50
test validations
yzhou601 Oct 24, 2024
388025e
fixed util.rb, relax the unused schedule check for common spaces(may …
yzhou601 Oct 24, 2024
60feccc
Latest results.
Oct 24, 2024
45a9415
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Nov 15, 2024
0e2fe3d
fix foundation wall attachment, reconfigure test files to include attics
yzhou601 Nov 19, 2024
cf686cc
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
yzhou601 Nov 19, 2024
c250a6a
Merge branch 'whole_building_common_spaces' of https://github.com/NRE…
yzhou601 Nov 19, 2024
5d6080a
fix ci
yzhou601 Nov 19, 2024
0872523
change the approach to create surfaces at unit models to avoid compon…
yzhou601 Nov 21, 2024
136c569
Latest results.
Nov 21, 2024
faf101c
fix typos
yzhou601 Nov 21, 2024
97682d9
Merge branch 'whole_building_common_spaces' of https://github.com/NRE…
yzhou601 Nov 21, 2024
19ecece
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
shorowit Nov 27, 2024
944bd45
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
shorowit Dec 16, 2024
3f6a380
Merge branch 'whole-mf-bldg-zero-occupants' of https://github.com/NRE…
shorowit Dec 17, 2024
c995c2e
Latest results.
Dec 17, 2024
57e65fe
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
shorowit Dec 27, 2024
9373f61
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
shorowit Jan 17, 2025
98d4b67
add reverse surface description test file
yzhou601 Jan 23, 2025
fc65762
Latest results.
Jan 23, 2025
6a0e79c
add EPvalidator check for wholebuildingsimulation
yzhou601 Jan 23, 2025
8b631ae
Merge branch 'whole_building_common_spaces' of https://github.com/NRE…
yzhou601 Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>5c60d469-73ac-415f-b37f-8b8401c8d5f3</version_id>
<version_modified>2024-10-16T17:32:33Z</version_modified>
<version_id>0439e328-3e9a-4cc4-a656-fcd1cfec0cfe</version_id>
<version_modified>2024-10-22T19:44:00Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -327,7 +327,7 @@
<filename>defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>1B4820ED</checksum>
<checksum>FDB6D733</checksum>
</file>
<file>
<filename>energyplus.rb</filename>
Expand All @@ -345,7 +345,7 @@
<filename>geometry.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>6C147EFE</checksum>
<checksum>889C89A1</checksum>
</file>
<file>
<filename>hotwater_appliances.rb</filename>
Expand All @@ -357,7 +357,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>F866C769</checksum>
<checksum>11C988DD</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand All @@ -375,7 +375,7 @@
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>BD9733AC</checksum>
<checksum>B6286188</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand All @@ -393,7 +393,7 @@
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>BEF6DAA5</checksum>
<checksum>9AAEBC2F</checksum>
</file>
<file>
<filename>internal_gains.rb</filename>
Expand Down Expand Up @@ -447,7 +447,7 @@
<filename>model.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>A578B92B</checksum>
<checksum>41C15CE6</checksum>
</file>
<file>
<filename>output.rb</filename>
Expand Down Expand Up @@ -735,7 +735,7 @@
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>7CB39E62</checksum>
<checksum>B725AA13</checksum>
</file>
<file>
<filename>test_water_heater.rb</filename>
Expand Down
6 changes: 6 additions & 0 deletions HPXMLtoOpenStudio/resources/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,8 @@ def self.apply_rim_joists(hpxml_bldg)
# @return [nil]
def self.apply_walls(hpxml_bldg)
hpxml_bldg.walls.each do |wall|
next unless wall.is_fully_described

if wall.azimuth.nil?
wall.azimuth = get_azimuth_from_orientation(wall.orientation)
wall.azimuth_isdefaulted = true
Expand Down Expand Up @@ -1342,6 +1344,8 @@ def self.apply_walls(hpxml_bldg)
# @return [nil]
def self.apply_foundation_walls(hpxml_bldg)
hpxml_bldg.foundation_walls.each do |foundation_wall|
next unless foundation_wall.is_fully_described

if foundation_wall.type.nil?
foundation_wall.type = HPXML::FoundationWallTypeSolidConcrete
foundation_wall.type_isdefaulted = true
Expand Down Expand Up @@ -1402,6 +1406,8 @@ def self.apply_foundation_walls(hpxml_bldg)
# @return [nil]
def self.apply_floors(runner, hpxml_bldg)
hpxml_bldg.floors.each do |floor|
next unless floor.is_fully_described

if floor.floor_or_ceiling.nil?
if floor.is_ceiling
floor.floor_or_ceiling = HPXML::FloorOrCeilingCeiling
Expand Down
71 changes: 68 additions & 3 deletions HPXMLtoOpenStudio/resources/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ def self.apply_walls(runner, model, spaces, hpxml_bldg, hpxml_header)
_walls_top, foundation_top = get_foundation_and_walls_top(hpxml_bldg)

hpxml_bldg.walls.each do |wall|
if not wall.is_fully_described
# Store wall id in the space to process later
space = get_interior_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg)
adjacent_surface_ids = space.additionalProperties.getFeatureAsString('adjacentSurfaceIDs')
if adjacent_surface_ids.is_initialized
adjacent_surface_ids_new = [adjacent_surface_ids, wall.id].join(', ')
space.additionalProperties.setFeature('adjacentSurfaceIDs', adjacent_surface_ids_new)
else
space.additionalProperties.setFeature('adjacentSurfaceIDs', wall.id)
end
next
end
next if wall.net_area < 1.0 # skip modeling net surface area for surfaces comprised entirely of subsurface area

if wall.azimuth.nil?
Expand Down Expand Up @@ -220,6 +232,18 @@ def self.apply_rim_joists(runner, model, spaces, hpxml_bldg)
_walls_top, foundation_top = get_foundation_and_walls_top(hpxml_bldg)

hpxml_bldg.rim_joists.each do |rim_joist|
if not rim_joist.is_fully_described
# Store rim_joist id in the space to process later
space = get_interior_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg)
adjacent_surface_ids = space.additionalProperties.getFeatureAsString('adjacentSurfaceIDs')
if adjacent_surface_ids.is_initialized
adjacent_surface_ids_new = [adjacent_surface_ids, rim_joist.id].join(', ')
space.additionalProperties.setFeature('adjacentSurfaceIDs', adjacent_surface_ids_new)
else
space.additionalProperties.setFeature('adjacentSurfaceIDs', rim_joist.id)
end
next
end
if rim_joist.azimuth.nil?
if rim_joist.is_exterior
azimuths = default_azimuths # Model as four directions for average exterior incident solar
Expand Down Expand Up @@ -303,6 +327,18 @@ def self.apply_floors(runner, model, spaces, hpxml_bldg, hpxml_header)
walls_top, foundation_top = get_foundation_and_walls_top(hpxml_bldg)

hpxml_bldg.floors.each do |floor|
if not floor.is_fully_described
# Store floor id in the space to process later
space = get_interior_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg)
adjacent_surface_ids = space.additionalProperties.getFeatureAsString('adjacentSurfaceIDs')
if adjacent_surface_ids.is_initialized
adjacent_surface_ids_new = [adjacent_surface_ids, floor.id].join(', ')
space.additionalProperties.setFeature('adjacentSurfaceIDs', adjacent_surface_ids_new)
else
space.additionalProperties.setFeature('adjacentSurfaceIDs', floor.id)
end
next
end
next if floor.net_area < 1.0 # skip modeling net surface area for surfaces comprised entirely of subsurface area

area = floor.net_area
Expand Down Expand Up @@ -449,6 +485,18 @@ def self.apply_foundation_walls_slabs(runner, model, spaces, weather, hpxml_bldg
int_fnd_walls.each do |fnd_wall|
next unless fnd_wall.is_interior

if not fnd_wall.is_fully_described
# Store fnd_wall id in the space to process later
space = get_interior_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg)
adjacent_surface_ids = space.additionalProperties.getFeatureAsString('adjacentSurfaceIDs')
if adjacent_surface_ids.is_initialized
adjacent_surface_ids_new = [adjacent_surface_ids, fnd_wall.id].join(', ')
space.additionalProperties.setFeature('adjacentSurfaceIDs', adjacent_surface_ids_new)
else
space.additionalProperties.setFeature('adjacentSurfaceIDs', fnd_wall.id)
end
next
end
ag_height = fnd_wall.height - fnd_wall.depth_below_grade
ag_net_area = fnd_wall.net_area * ag_height / fnd_wall.height
next if ag_net_area < 1.0
Expand Down Expand Up @@ -971,6 +1019,7 @@ def self.apply_conditioned_floor_area(model, spaces, hpxml_bldg)
sum_cfa = 0.0
hpxml_bldg.floors.each do |floor|
next unless floor.is_floor
# FIXME: If the hpxml Building that represents an unconditioned space (without HVACPlant), does the hpxml_bldg.building_construction.conditioned_floor_area accounts to the total cfa? Is E+ reporting the correct total cfa? (Need to double-check)
next unless [HPXML::LocationConditionedSpace, HPXML::LocationBasementConditioned].include?(floor.interior_adjacent_to) ||
[HPXML::LocationConditionedSpace, HPXML::LocationBasementConditioned].include?(floor.exterior_adjacent_to)

Expand Down Expand Up @@ -1701,13 +1750,24 @@ def self.get_temperature_scheduled_space_values(location)
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param surface [OpenStudio::Model::Surface] an OpenStudio::Model::Surface object
# @param hpxml_surface [HPXML::Wall or HPXML::Roof or HPXML::RimJoist or HPXML::FoundationWall or HPXML::Slab] any HPXML surface
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @return [nil]
def self.set_surface_interior(model, spaces, surface, hpxml_surface, hpxml_bldg)
interior_adjacent_to = hpxml_surface.interior_adjacent_to
surface.setSpace(get_interior_space(model, spaces, hpxml_surface.interior_adjacent_to, hpxml_bldg))
end

# Return the OpenStudio Space based on the adjacent interior location of an HPXML Surface.
#
# @param model [OpenStudio::Model::Model] OpenStudio Model object
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param interior_adjacent_to [String] HPXML interior location
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @return [OpenStudio::Model::Space] the OpenStudio::Model::Space object based on the interior location
def self.get_interior_space(model, spaces, interior_adjacent_to, hpxml_bldg)
if HPXML::conditioned_below_grade_locations.include? interior_adjacent_to
surface.setSpace(create_or_get_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg))
return create_or_get_space(model, spaces, HPXML::LocationConditionedSpace, hpxml_bldg)
else
surface.setSpace(create_or_get_space(model, spaces, interior_adjacent_to, hpxml_bldg))
return create_or_get_space(model, spaces, interior_adjacent_to, hpxml_bldg)
end
end

Expand All @@ -1717,10 +1777,15 @@ def self.set_surface_interior(model, spaces, surface, hpxml_surface, hpxml_bldg)
# @param spaces [Hash] Map of HPXML locations => OpenStudio Space objects
# @param surface [OpenStudio::Model::Surface] an OpenStudio::Model::Surface object
# @param hpxml_surface [HPXML::Wall or HPXML::Roof or HPXML::RimJoist or HPXML::FoundationWall or HPXML::Slab] any HPXML surface
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @return [nil]
def self.set_surface_exterior(model, spaces, surface, hpxml_surface, hpxml_bldg)
exterior_adjacent_to = hpxml_surface.exterior_adjacent_to
is_adiabatic = hpxml_surface.is_adiabatic
if hpxml_surface.is_attached_by_sameas
surface.additionalProperties.setFeature('HPXMLID', hpxml_surface.id)
surface.additionalProperties.setFeature('HPXMLSameasID', hpxml_surface.sameas_id)
end
if [HPXML::LocationOutside, HPXML::LocationManufacturedHomeUnderBelly].include? exterior_adjacent_to
surface.setOutsideBoundaryCondition(EPlus::BoundaryConditionOutdoors)
elsif exterior_adjacent_to == HPXML::LocationGround
Expand Down
Loading