Skip to content

Commit

Permalink
Merge pull request #965 from NREL/latest-os-hpxml
Browse files Browse the repository at this point in the history
Latest OS-HPXML
  • Loading branch information
shorowit committed Jul 16, 2022
2 parents 9f973dc + 94c4b32 commit 5a7201c
Show file tree
Hide file tree
Showing 470 changed files with 4,332 additions and 4,266 deletions.
12 changes: 6 additions & 6 deletions measures/UpgradeCosts/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,14 @@ def get_bldg_output(cost_mult_type, values, existing_hpxml, upgraded_hpxml)
if !upgraded_hpxml.nil?
ceiling_assembly_r = { existing_hpxml => [], upgraded_hpxml => [] }
[existing_hpxml, upgraded_hpxml].each do |hpxml_obj|
hpxml_obj.frame_floors.each do |frame_floor|
next unless frame_floor.is_thermal_boundary
next unless frame_floor.is_interior
next unless frame_floor.is_ceiling
hpxml_obj.floors.each do |floor|
next unless floor.is_thermal_boundary
next unless floor.is_interior
next unless floor.is_ceiling
next unless [HPXML::LocationAtticVented,
HPXML::LocationAtticUnvented].include?(frame_floor.exterior_adjacent_to)
HPXML::LocationAtticUnvented].include?(floor.exterior_adjacent_to)

ceiling_assembly_r[hpxml_obj] << frame_floor.insulation_assembly_r_value unless frame_floor.insulation_assembly_r_value.nil?
ceiling_assembly_r[hpxml_obj] << floor.insulation_assembly_r_value unless floor.insulation_assembly_r_value.nil?
end
end
fail 'Found multiple ceiling assembly R-values.' if ceiling_assembly_r[existing_hpxml].uniq.size > 1 || ceiling_assembly_r[upgraded_hpxml].uniq.size > 1
Expand Down
6 changes: 3 additions & 3 deletions measures/UpgradeCosts/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>upgrade_costs</name>
<uid>ef51212c-acc4-48d7-9b29-cf2a5c6c4449</uid>
<version_id>f69ef381-9e5b-474b-9698-f1d7f940b929</version_id>
<version_modified>20220624T204207Z</version_modified>
<version_id>67dbd688-e316-4a0c-a9c7-58d52e3fe7b4</version_id>
<version_modified>20220715T195222Z</version_modified>
<xml_checksum>9BF1E6AC</xml_checksum>
<class_name>UpgradeCosts</class_name>
<display_name>Upgrade Costs</display_name>
Expand Down Expand Up @@ -181,7 +181,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>F60D925A</checksum>
<checksum>7CB40E44</checksum>
</file>
</files>
</measure>
44 changes: 22 additions & 22 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ def self.create(runner, model, args, epw_file)
set_rim_joists(hpxml, model, args, sorted_surfaces)
set_walls(hpxml, model, args, sorted_surfaces)
set_foundation_walls(hpxml, model, args, sorted_surfaces)
set_frame_floors(hpxml, args, sorted_surfaces)
set_floors(hpxml, args, sorted_surfaces)
set_slabs(hpxml, model, args, sorted_surfaces)
set_windows(hpxml, model, args, sorted_subsurfaces)
set_skylights(hpxml, args, sorted_subsurfaces)
Expand Down Expand Up @@ -3331,15 +3331,15 @@ def self.create(runner, model, args, epw_file)
# Collapse surfaces so that we don't get, e.g., individual windows
# or the front wall split because of the door. Exclude foundation walls
# from the list so we get all 4 foundation walls.
hpxml.collapse_enclosure_surfaces([:roofs, :walls, :rim_joists, :frame_floors,
hpxml.collapse_enclosure_surfaces([:roofs, :walls, :rim_joists, :floors,
:slabs, :windows, :skylights, :doors])

# After surfaces are collapsed, round all areas
(hpxml.roofs +
hpxml.rim_joists +
hpxml.walls +
hpxml.foundation_walls +
hpxml.frame_floors +
hpxml.floors +
hpxml.slabs +
hpxml.windows +
hpxml.skylights +
Expand Down Expand Up @@ -4126,7 +4126,7 @@ def self.set_foundation_walls(hpxml, model, args, sorted_surfaces)
end
end

def self.set_frame_floors(hpxml, args, sorted_surfaces)
def self.set_floors(hpxml, args, sorted_surfaces)
if [HPXML::FoundationTypeBasementConditioned,
HPXML::FoundationTypeCrawlspaceConditioned].include?(args[:geometry_foundation_type]) && (args[:floor_over_foundation_assembly_r] > 2.1)
args[:floor_over_foundation_assembly_r] = 2.1 # Uninsulated
Expand All @@ -4149,9 +4149,9 @@ def self.set_frame_floors(hpxml, args, sorted_surfaces)
elsif surface.outsideBoundaryCondition == 'Adiabatic'
exterior_adjacent_to = HPXML::LocationOtherHousingUnit
if surface.surfaceType == 'Floor'
other_space_above_or_below = HPXML::FrameFloorOtherSpaceBelow
other_space_above_or_below = HPXML::FloorOtherSpaceBelow
elsif surface.surfaceType == 'RoofCeiling'
other_space_above_or_below = HPXML::FrameFloorOtherSpaceAbove
other_space_above_or_below = HPXML::FloorOtherSpaceAbove
end
end

Expand All @@ -4161,23 +4161,23 @@ def self.set_frame_floors(hpxml, args, sorted_surfaces)
HPXML::LocationBasementConditioned,
HPXML::LocationCrawlspaceConditioned].include? exterior_adjacent_to

hpxml.frame_floors.add(id: "FrameFloor#{hpxml.frame_floors.size + 1}",
exterior_adjacent_to: exterior_adjacent_to,
interior_adjacent_to: interior_adjacent_to,
area: UnitConversions.convert(surface.grossArea, 'm^2', 'ft^2'),
other_space_above_or_below: other_space_above_or_below)
@surface_ids[surface.name.to_s] = hpxml.frame_floors[-1].id
hpxml.floors.add(id: "Floor#{hpxml.floors.size + 1}",
exterior_adjacent_to: exterior_adjacent_to,
interior_adjacent_to: interior_adjacent_to,
area: UnitConversions.convert(surface.grossArea, 'm^2', 'ft^2'),
other_space_above_or_below: other_space_above_or_below)
@surface_ids[surface.name.to_s] = hpxml.floors[-1].id

if hpxml.frame_floors[-1].is_thermal_boundary
if hpxml.floors[-1].is_thermal_boundary
if [HPXML::LocationAtticUnvented, HPXML::LocationAtticVented].include? exterior_adjacent_to
hpxml.frame_floors[-1].insulation_assembly_r_value = args[:ceiling_assembly_r]
hpxml.floors[-1].insulation_assembly_r_value = args[:ceiling_assembly_r]
elsif [HPXML::LocationGarage].include? exterior_adjacent_to
hpxml.frame_floors[-1].insulation_assembly_r_value = args[:floor_over_garage_assembly_r]
hpxml.floors[-1].insulation_assembly_r_value = args[:floor_over_garage_assembly_r]
else
hpxml.frame_floors[-1].insulation_assembly_r_value = args[:floor_over_foundation_assembly_r]
hpxml.floors[-1].insulation_assembly_r_value = args[:floor_over_foundation_assembly_r]
end
else
hpxml.frame_floors[-1].insulation_assembly_r_value = 2.1 # Uninsulated
hpxml.floors[-1].insulation_assembly_r_value = 2.1 # Uninsulated
end
end
end
Expand Down Expand Up @@ -4398,7 +4398,7 @@ def self.set_doors(hpxml, model, args, sorted_subsurfaces)
def self.set_attics(hpxml, args)
surf_ids = { 'roofs' => { 'surfaces' => hpxml.roofs, 'ids' => [] },
'walls' => { 'surfaces' => hpxml.walls, 'ids' => [] },
'frame_floors' => { 'surfaces' => hpxml.frame_floors, 'ids' => [] } }
'floors' => { 'surfaces' => hpxml.floors, 'ids' => [] } }

attic_locations = [HPXML::LocationAtticUnconditioned, HPXML::LocationAtticUnvented, HPXML::LocationAtticVented]
surf_ids.values.each do |surf_hash|
Expand All @@ -4423,12 +4423,12 @@ def self.set_attics(hpxml, args)
attic_type: args[:geometry_attic_type],
attached_to_roof_idrefs: surf_ids['roofs']['ids'],
attached_to_wall_idrefs: surf_ids['walls']['ids'],
attached_to_frame_floor_idrefs: surf_ids['frame_floors']['ids'])
attached_to_floor_idrefs: surf_ids['floors']['ids'])
end

def self.set_foundations(hpxml, args)
surf_ids = { 'slabs' => { 'surfaces' => hpxml.slabs, 'ids' => [] },
'frame_floors' => { 'surfaces' => hpxml.frame_floors, 'ids' => [] },
'floors' => { 'surfaces' => hpxml.floors, 'ids' => [] },
'foundation_walls' => { 'surfaces' => hpxml.foundation_walls, 'ids' => [] },
'walls' => { 'surfaces' => hpxml.walls, 'ids' => [] },
'rim_joists' => { 'surfaces' => hpxml.rim_joists, 'ids' => [] }, }
Expand All @@ -4444,7 +4444,7 @@ def self.set_foundations(hpxml, args)
next unless (foundation_locations.include? surface.interior_adjacent_to) ||
(foundation_locations.include? surface.exterior_adjacent_to) ||
(surf_type == 'slabs' && surface.interior_adjacent_to == HPXML::LocationLivingSpace) ||
(surf_type == 'frame_floors' && surface.exterior_adjacent_to == HPXML::LocationOutside)
(surf_type == 'floors' && surface.exterior_adjacent_to == HPXML::LocationOutside)

surf_hash['ids'] << surface.id
end
Expand All @@ -4453,7 +4453,7 @@ def self.set_foundations(hpxml, args)
hpxml.foundations.add(id: "Foundation#{hpxml.foundations.size + 1}",
foundation_type: args[:geometry_foundation_type],
attached_to_slab_idrefs: surf_ids['slabs']['ids'],
attached_to_frame_floor_idrefs: surf_ids['frame_floors']['ids'],
attached_to_floor_idrefs: surf_ids['floors']['ids'],
attached_to_foundation_wall_idrefs: surf_ids['foundation_walls']['ids'],
attached_to_wall_idrefs: surf_ids['walls']['ids'],
attached_to_rim_joist_idrefs: surf_ids['rim_joists']['ids'])
Expand Down
6 changes: 3 additions & 3 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>54a3e780-1de3-4711-a305-eb8bdaf3a4fe</version_id>
<version_modified>20220630T165822Z</version_modified>
<version_id>746c9008-60d3-41dc-9914-3b93f6474db7</version_id>
<version_modified>20220706T191514Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -6378,7 +6378,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>9B166751</checksum>
<checksum>8664E480</checksum>
</file>
</files>
</measure>
1 change: 1 addition & 0 deletions resources/hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## OpenStudio-HPXML v1.5.0

__New Features__
- **Breaking Change**: Replaces `FrameFloors/FrameFloor` with `Floors/Floor`.
- Allows heating/cooling seasons that don't span the entire year.
- Allows calculating one or more utility bill scenarios (e.g., net metering vs feed-in tariff compensation types for a simulation with PV).
- EnergyPlus modeling changes:
Expand Down
48 changes: 24 additions & 24 deletions resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def self.create(hpxml, runner, model, hpxml_path, epw_path, cache_path, output_d
add_roofs(runner, model, spaces)
add_walls(runner, model, spaces)
add_rim_joists(runner, model, spaces)
add_frame_floors(runner, model, spaces)
add_floors(runner, model, spaces)
add_foundation_walls_slabs(runner, model, spaces)
add_shading_schedule(model, weather)
add_windows(model, spaces)
Expand Down Expand Up @@ -628,18 +628,18 @@ def self.add_rim_joists(runner, model, spaces)
end
end

def self.add_frame_floors(runner, model, spaces)
@hpxml.frame_floors.each do |frame_floor|
area = frame_floor.area
def self.add_floors(runner, model, spaces)
@hpxml.floors.each do |floor|
area = floor.area
width = Math::sqrt(area)
length = area / width
if frame_floor.interior_adjacent_to.include?('attic') || frame_floor.exterior_adjacent_to.include?('attic')
if floor.interior_adjacent_to.include?('attic') || floor.exterior_adjacent_to.include?('attic')
z_origin = @walls_top
else
z_origin = @foundation_top
end

if frame_floor.is_ceiling
if floor.is_ceiling
vertices = Geometry.create_ceiling_vertices(length, width, z_origin, @default_azimuths)
surface = OpenStudio::Model::Surface.new(vertices, model)
surface.additionalProperties.setFeature('SurfaceType', 'Ceiling')
Expand All @@ -649,19 +649,19 @@ def self.add_frame_floors(runner, model, spaces)
surface.additionalProperties.setFeature('SurfaceType', 'Floor')
end
surface.additionalProperties.setFeature('Tilt', 0.0)
set_surface_interior(model, spaces, surface, frame_floor)
set_surface_exterior(model, spaces, surface, frame_floor)
surface.setName(frame_floor.id)
if frame_floor.is_interior
set_surface_interior(model, spaces, surface, floor)
set_surface_exterior(model, spaces, surface, floor)
surface.setName(floor.id)
if floor.is_interior
surface.setSunExposure('NoSun')
surface.setWindExposure('NoWind')
elsif frame_floor.is_floor
elsif floor.is_floor
surface.setSunExposure('NoSun')
end

# Apply construction

if frame_floor.is_ceiling
if floor.is_ceiling
if @apply_ashrae140_assumptions
# Attic floor
inside_film = Material.AirFilmFloorASHRAE140
Expand All @@ -670,7 +670,7 @@ def self.add_frame_floors(runner, model, spaces)
inside_film = Material.AirFilmFloorAverage
outside_film = Material.AirFilmFloorAverage
end
mat_int_finish = Material.InteriorFinishMaterial(frame_floor.interior_finish_type, frame_floor.interior_finish_thickness)
mat_int_finish = Material.InteriorFinishMaterial(floor.interior_finish_type, floor.interior_finish_thickness)
if mat_int_finish.nil?
fallback_mat_int_finish = nil
else
Expand All @@ -694,12 +694,12 @@ def self.add_frame_floors(runner, model, spaces)
covering = Material.CoveringBare(1.0)
else
inside_film = Material.AirFilmFloorReduced
if frame_floor.is_exterior
if floor.is_exterior
outside_film = Material.AirFilmOutside
else
outside_film = Material.AirFilmFloorReduced
end
if frame_floor.interior_adjacent_to == HPXML::LocationLivingSpace
if floor.interior_adjacent_to == HPXML::LocationLivingSpace
covering = Material.CoveringBare
end
end
Expand All @@ -716,21 +716,21 @@ def self.add_frame_floors(runner, model, spaces)
WoodStudConstructionSet.new(Material.Stud2x4, 0.01, 0.0, 0.0, nil, fallback_covering), # Fallback
]
end
assembly_r = frame_floor.insulation_assembly_r_value
assembly_r = floor.insulation_assembly_r_value

match, constr_set, cavity_r = Constructions.pick_wood_stud_construction_set(assembly_r, constr_sets, inside_film, outside_film)

install_grade = 1
if frame_floor.is_ceiling
if floor.is_ceiling

Constructions.apply_ceiling(model, [surface], "#{frame_floor.id} construction",
Constructions.apply_ceiling(model, [surface], "#{floor.id} construction",
cavity_r, install_grade,
constr_set.rigid_r, constr_set.framing_factor,
constr_set.stud.thick_in, constr_set.mat_int_finish,
inside_film, outside_film)

else # Floor
Constructions.apply_floor(model, [surface], "#{frame_floor.id} construction",
Constructions.apply_floor(model, [surface], "#{floor.id} construction",
cavity_r, install_grade,
constr_set.framing_factor, constr_set.stud.thick_in,
constr_set.osb_thick_in, constr_set.rigid_r,
Expand Down Expand Up @@ -1041,12 +1041,12 @@ def self.add_conditioned_floor_area(model, spaces)
# This ensures that the E+ reported Conditioned Floor Area is correct.

sum_cfa = 0.0
@hpxml.frame_floors.each do |frame_floor|
next unless frame_floor.is_floor
next unless [HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include?(frame_floor.interior_adjacent_to) ||
[HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include?(frame_floor.exterior_adjacent_to)
@hpxml.floors.each do |floor|
next unless floor.is_floor
next unless [HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include?(floor.interior_adjacent_to) ||
[HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include?(floor.exterior_adjacent_to)

sum_cfa += frame_floor.area
sum_cfa += floor.area
end
@hpxml.slabs.each do |slab|
next unless [HPXML::LocationLivingSpace, HPXML::LocationBasementConditioned].include? slab.interior_adjacent_to
Expand Down

0 comments on commit 5a7201c

Please sign in to comment.