Skip to content

Commit

Permalink
Merge pull request #1120 from NREL/generic-locations
Browse files Browse the repository at this point in the history
Test OS-HPXML 1463
  • Loading branch information
joseph-robertson committed Aug 15, 2023
2 parents 3085093 + 9999e0e commit 19db1e5
Show file tree
Hide file tree
Showing 17 changed files with 17,819 additions and 17,724 deletions.
9 changes: 0 additions & 9 deletions project_national/national_upgrades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ upgrades:
- value: 1.05
multiplier: Wall Area, Below-Grade (ft^2)
lifetime: 999
- &duct_location_unvented_crawlspace
option: Duct Location|Unvented Crawlspace
apply_logic:
and:
- Geometry Foundation Type|Vented Crawlspace
- or: # Ensure that the dwelling unit being modeled is either (1) not in a multifamily building, or (2) on the bottom floor of a multifamily building and therefore above the crawlspace.
- Geometry Building Level MF|None
- Geometry Building Level MF|Bottom

- upgrade_name: Rim Joists
options:
Expand Down Expand Up @@ -239,7 +231,6 @@ upgrades:
- *insulation_sheathing_r_5
- *geometry_foundation_type_unvented_crawlspace
- *insulation_foundation_wall_wall_r_10_exterior
- *duct_location_unvented_crawlspace
- *insulation_rim_joist_r_13_interior
- *insulation_ceiling_r_60
- *infiltration_reduction_25_percent
Expand Down
9 changes: 0 additions & 9 deletions project_testing/testing_upgrades.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,6 @@ upgrades:
- value: 1.05
multiplier: Wall Area, Below-Grade (ft^2)
lifetime: 999
- &duct_location_unvented_crawlspace
option: Duct Location|Unvented Crawlspace
apply_logic:
and:
- Geometry Foundation Type|Vented Crawlspace
- or: # Ensure that the dwelling unit being modeled is either (1) not in a multifamily building, or (2) on the bottom floor of a multifamily building and therefore above the crawlspace.
- Geometry Building Level MF|None
- Geometry Building Level MF|Bottom

- upgrade_name: Rim Joists
options:
Expand Down Expand Up @@ -278,7 +270,6 @@ upgrades:
- *insulation_sheathing_r_5
- *geometry_foundation_type_unvented_crawlspace
- *insulation_foundation_wall_wall_r_10_exterior
- *duct_location_unvented_crawlspace
- *insulation_rim_joist_r_13_interior
- *insulation_ceiling_r_60
- *infiltration_reduction_25_percent
Expand Down
43 changes: 37 additions & 6 deletions resources/hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1437,9 +1437,11 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
duct_location_choices << HPXML::LocationLivingSpace
duct_location_choices << HPXML::LocationBasementConditioned
duct_location_choices << HPXML::LocationBasementUnconditioned
duct_location_choices << HPXML::LocationCrawlspace
duct_location_choices << HPXML::LocationCrawlspaceVented
duct_location_choices << HPXML::LocationCrawlspaceUnvented
duct_location_choices << HPXML::LocationCrawlspaceConditioned
duct_location_choices << HPXML::LocationAttic
duct_location_choices << HPXML::LocationAtticVented
duct_location_choices << HPXML::LocationAtticUnvented
duct_location_choices << HPXML::LocationGarage
Expand Down Expand Up @@ -1802,8 +1804,10 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
water_heater_location_choices << HPXML::LocationBasementConditioned
water_heater_location_choices << HPXML::LocationBasementUnconditioned
water_heater_location_choices << HPXML::LocationGarage
water_heater_location_choices << HPXML::LocationAttic
water_heater_location_choices << HPXML::LocationAtticVented
water_heater_location_choices << HPXML::LocationAtticUnvented
water_heater_location_choices << HPXML::LocationCrawlspace
water_heater_location_choices << HPXML::LocationCrawlspaceVented
water_heater_location_choices << HPXML::LocationCrawlspaceUnvented
water_heater_location_choices << HPXML::LocationCrawlspaceConditioned
Expand Down Expand Up @@ -2219,9 +2223,11 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
battery_location_choices << HPXML::LocationLivingSpace
battery_location_choices << HPXML::LocationBasementConditioned
battery_location_choices << HPXML::LocationBasementUnconditioned
battery_location_choices << HPXML::LocationCrawlspace
battery_location_choices << HPXML::LocationCrawlspaceVented
battery_location_choices << HPXML::LocationCrawlspaceUnvented
battery_location_choices << HPXML::LocationCrawlspaceConditioned
battery_location_choices << HPXML::LocationAttic
battery_location_choices << HPXML::LocationAtticVented
battery_location_choices << HPXML::LocationAtticUnvented
battery_location_choices << HPXML::LocationGarage
Expand Down Expand Up @@ -5049,7 +5055,7 @@ def self.set_hvac_distribution(hpxml, args)
hvac_system.distribution_system_idref = hpxml.hvac_distributions[-1].id
end
set_duct_leakages(args, hpxml.hvac_distributions[-1])
set_ducts(args, hpxml.hvac_distributions[-1])
set_ducts(hpxml, args, hpxml.hvac_distributions[-1])
end

if fan_coil_distribution_systems.size > 0
Expand All @@ -5074,13 +5080,38 @@ def self.set_duct_leakages(args, hvac_distribution)
duct_leakage_total_or_to_outside: HPXML::DuctLeakageToOutside)
end

def self.set_ducts(args, hvac_distribution)
def self.get_location(location, foundation_type, attic_type)
if location == HPXML::LocationCrawlspace
if foundation_type == HPXML::FoundationTypeCrawlspaceUnvented
return HPXML::LocationCrawlspaceUnvented
elsif foundation_type == HPXML::FoundationTypeCrawlspaceVented
return HPXML::LocationCrawlspaceVented
elsif foundation_type == HPXML::FoundationTypeCrawlspaceConditioned
return HPXML::LocationCrawlspaceConditioned
else
fail "Specified '#{location}' but foundation type is '#{foundation_type}'."
end
elsif location == HPXML::LocationAttic
if attic_type == HPXML::AtticTypeUnvented
return HPXML::LocationAtticUnvented
elsif attic_type == HPXML::AtticTypeVented
return HPXML::LocationAtticVented
elsif attic_type == HPXML::AtticTypeConditioned
return HPXML::LocationLivingSpace
else
fail "Specified '#{location}' but attic type is '#{attic_type}'."
end
end
return location
end

def self.set_ducts(hpxml, args, hvac_distribution)
if args[:ducts_supply_location].is_initialized
ducts_supply_location = args[:ducts_supply_location].get
ducts_supply_location = get_location(args[:ducts_supply_location].get, hpxml.foundations[-1].foundation_type, hpxml.attics[-1].attic_type)
end

if args[:ducts_return_location].is_initialized
ducts_return_location = args[:ducts_return_location].get
ducts_return_location = get_location(args[:ducts_return_location].get, hpxml.foundations[-1].foundation_type, hpxml.attics[-1].attic_type)
end

if args[:ducts_supply_surface_area].is_initialized
Expand Down Expand Up @@ -5471,7 +5502,7 @@ def self.set_water_heating_systems(hpxml, args)
end

if args[:water_heater_location].is_initialized
location = args[:water_heater_location].get
location = get_location(args[:water_heater_location].get, hpxml.foundations[-1].foundation_type, hpxml.attics[-1].attic_type)
end

if args[:water_heater_tank_volume].is_initialized
Expand Down Expand Up @@ -5756,7 +5787,7 @@ def self.set_battery(hpxml, args)
return unless args[:battery_present]

if args[:battery_location].is_initialized
location = args[:battery_location].get
location = get_location(args[:battery_location].get, hpxml.foundations[-1].foundation_type, hpxml.attics[-1].attic_type)
end

if args[:battery_power].is_initialized
Expand Down
40 changes: 36 additions & 4 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.1</schema_version>
<name>build_residential_hpxml</name>
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
<version_id>a5a42263-d8b3-45cc-a81f-0348eaabd6ba</version_id>
<version_modified>2023-07-31T19:28:38Z</version_modified>
<version_id>093be6a0-b0ee-4df4-aa77-2a9827f24028</version_id>
<version_modified>2023-08-15T14:05:14Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -3000,6 +3000,10 @@
<value>basement - unconditioned</value>
<display_name>basement - unconditioned</display_name>
</choice>
<choice>
<value>crawlspace</value>
<display_name>crawlspace</display_name>
</choice>
<choice>
<value>crawlspace - vented</value>
<display_name>crawlspace - vented</display_name>
Expand All @@ -3012,6 +3016,10 @@
<value>crawlspace - conditioned</value>
<display_name>crawlspace - conditioned</display_name>
</choice>
<choice>
<value>attic</value>
<display_name>attic</display_name>
</choice>
<choice>
<value>attic - vented</value>
<display_name>attic - vented</display_name>
Expand Down Expand Up @@ -3136,6 +3144,10 @@
<value>basement - unconditioned</value>
<display_name>basement - unconditioned</display_name>
</choice>
<choice>
<value>crawlspace</value>
<display_name>crawlspace</display_name>
</choice>
<choice>
<value>crawlspace - vented</value>
<display_name>crawlspace - vented</display_name>
Expand All @@ -3148,6 +3160,10 @@
<value>crawlspace - conditioned</value>
<display_name>crawlspace - conditioned</display_name>
</choice>
<choice>
<value>attic</value>
<display_name>attic</display_name>
</choice>
<choice>
<value>attic - vented</value>
<display_name>attic - vented</display_name>
Expand Down Expand Up @@ -3798,6 +3814,10 @@
<value>garage</value>
<display_name>garage</display_name>
</choice>
<choice>
<value>attic</value>
<display_name>attic</display_name>
</choice>
<choice>
<value>attic - vented</value>
<display_name>attic - vented</display_name>
Expand All @@ -3806,6 +3826,10 @@
<value>attic - unvented</value>
<display_name>attic - unvented</display_name>
</choice>
<choice>
<value>crawlspace</value>
<display_name>crawlspace</display_name>
</choice>
<choice>
<value>crawlspace - vented</value>
<display_name>crawlspace - vented</display_name>
Expand Down Expand Up @@ -4639,6 +4663,10 @@
<value>basement - unconditioned</value>
<display_name>basement - unconditioned</display_name>
</choice>
<choice>
<value>crawlspace</value>
<display_name>crawlspace</display_name>
</choice>
<choice>
<value>crawlspace - vented</value>
<display_name>crawlspace - vented</display_name>
Expand All @@ -4651,6 +4679,10 @@
<value>crawlspace - conditioned</value>
<display_name>crawlspace - conditioned</display_name>
</choice>
<choice>
<value>attic</value>
<display_name>attic</display_name>
</choice>
<choice>
<value>attic - vented</value>
<display_name>attic - vented</display_name>
Expand Down Expand Up @@ -6709,7 +6741,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>85ADFF0F</checksum>
<checksum>41B0EEFA</checksum>
</file>
<file>
<filename>geometry.rb</filename>
Expand All @@ -6721,7 +6753,7 @@
<filename>build_residential_hpxml_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>E0489256</checksum>
<checksum>4D646B5D</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ def test_workflows
'extra-emissions-fossil-fuel-factors.xml' => 'base-sfd.xml',
'extra-bills-fossil-fuel-rates.xml' => 'base-sfd.xml',
'extra-seasons-building-america.xml' => 'base-sfd.xml',
'extra-ducts-crawlspace.xml' => 'base-sfd.xml',
'extra-ducts-attic.xml' => 'base-sfd.xml',
'extra-water-heater-crawlspace.xml' => 'base-sfd.xml',
'extra-water-heater-attic.xml' => 'base-sfd.xml',
'extra-battery-crawlspace.xml' => 'base-sfd.xml',
'extra-battery-attic.xml' => 'base-sfd.xml',

'extra-sfa-atticroof-flat.xml' => 'base-sfa.xml',
'extra-sfa-atticroof-conditioned-eaves-gable.xml' => 'extra-sfa-slab.xml',
Expand Down Expand Up @@ -805,6 +811,34 @@ def _set_measure_argument_values(hpxml_file, args)
elsif ['extra-seasons-building-america.xml'].include? hpxml_file
args['hvac_control_heating_season_period'] = HPXML::BuildingAmerica
args['hvac_control_cooling_season_period'] = HPXML::BuildingAmerica
elsif ['extra-ducts-crawlspace.xml'].include? hpxml_file
args['geometry_foundation_type'] = HPXML::FoundationTypeCrawlspaceUnvented
args['geometry_foundation_height'] = 4
args['floor_over_foundation_assembly_r'] = 18.7
args['foundation_wall_insulation_distance_to_bottom'] = 4
args['ducts_supply_location'] = HPXML::LocationCrawlspace
args['ducts_return_location'] = HPXML::LocationCrawlspace
elsif ['extra-ducts-attic.xml'].include? hpxml_file
args['ducts_supply_location'] = HPXML::LocationAttic
args['ducts_return_location'] = HPXML::LocationAttic
elsif ['extra-water-heater-crawlspace.xml'].include? hpxml_file
args['geometry_foundation_type'] = HPXML::FoundationTypeCrawlspaceUnvented
args['geometry_foundation_height'] = 4
args['floor_over_foundation_assembly_r'] = 18.7
args['foundation_wall_insulation_distance_to_bottom'] = 4
args['water_heater_location'] = HPXML::LocationCrawlspace
elsif ['extra-water-heater-attic.xml'].include? hpxml_file
args['water_heater_location'] = HPXML::LocationAttic
elsif ['extra-battery-crawlspace.xml'].include? hpxml_file
args['geometry_foundation_type'] = HPXML::FoundationTypeCrawlspaceUnvented
args['geometry_foundation_height'] = 4
args['floor_over_foundation_assembly_r'] = 18.7
args['foundation_wall_insulation_distance_to_bottom'] = 4
args['battery_present'] = true
args['battery_location'] = HPXML::LocationCrawlspace
elsif ['extra-battery-attic.xml'].include? hpxml_file
args['battery_present'] = true
args['battery_location'] = HPXML::LocationAttic
elsif ['extra-sfa-atticroof-flat.xml'].include? hpxml_file
args['geometry_attic_type'] = HPXML::AtticTypeFlatRoof
args['ducts_supply_leakage_to_outside_value'] = 0.0
Expand Down
1 change: 1 addition & 0 deletions resources/hpxml-measures/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ __New Features__
- BuildResidentialHPXML measure:
- Allow duct area fractions (as an alternative to duct areas in ft^2).
- Allow duct locations to be provided while defaulting duct areas (i.e., without providing duct area/fraction inputs).
- Add generic "attic" and "crawlspace" location choices for supply/return ducts, water heater, and battery.

__Bugfixes__
- Fixes lighting multipliers not being applied when kWh/yr inputs are used.
Expand Down
4 changes: 2 additions & 2 deletions resources/hpxml-measures/HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2334,8 +2334,8 @@ def self.add_component_loads_output(model, living_zone, liv_load_sensors, intgai
s = "Set hr_#{loadtype} = hr_#{loadtype}"
sensors.each do |sensor|
if sensor.name.to_s.include? 'gain'
# FIXME: Workaround for https://github.com/NREL/EnergyPlus/issues/9934
# Remove when the issue is resolved
# Workaround for https://github.com/NREL/EnergyPlus/issues/9934
# FUTURE: Remove when the issue is resolved
if loadtype == 'infil'
s += " - (#{sensor.name} * 3600)"
else
Expand Down
10 changes: 5 additions & 5 deletions resources/hpxml-measures/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>ff18138e-a233-4bf4-a79d-88bfe798002a</version_id>
<version_modified>2023-07-31T23:29:26Z</version_modified>
<version_id>2a50aafc-36c4-4030-831e-1423f8406746</version_id>
<version_modified>2023-08-14T17:53:43Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -238,7 +238,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>A2730455</checksum>
<checksum>666237E8</checksum>
</file>
<file>
<filename>hpxml_defaults.rb</filename>
Expand Down Expand Up @@ -274,7 +274,7 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8B94E964</checksum>
<checksum>344197E3</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
Expand Down Expand Up @@ -568,7 +568,7 @@
<filename>test_validation.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>788ADA20</checksum>
<checksum>7B23CDE1</checksum>
</file>
<file>
<filename>test_water_heater.rb</filename>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def self.apply(runner, model, pv_systems, battery, schedules_file)
elcs.setCellVoltageatEndofNominalZone(default_nominal_cell_voltage)
if not voltage_dependence
elcs.setBatteryCellInternalElectricalResistance(0.002) # 2 mOhm/cell, based on OCHRE defaults (which are based on fitting to lab results)
# FIXME: if the voltage reported during charge/discharge is different, energy may not balance
# Note: if the voltage reported during charge/discharge is different, energy may not balance
# elcs.setFullyChargedCellVoltage(default_nominal_cell_voltage)
# elcs.setCellVoltageatEndofExponentialZone(default_nominal_cell_voltage)
end
Expand Down
2 changes: 2 additions & 0 deletions resources/hpxml-measures/HPXMLtoOpenStudio/resources/hpxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,14 @@ class HPXML < Object
LightingTypeCFL = 'CompactFluorescent'
LightingTypeLED = 'LightEmittingDiode'
LightingTypeLFL = 'FluorescentTube'
LocationAttic = 'attic'
LocationAtticUnconditioned = 'attic - unconditioned'
LocationAtticUnvented = 'attic - unvented'
LocationAtticVented = 'attic - vented'
LocationBasementConditioned = 'basement - conditioned'
LocationBasementUnconditioned = 'basement - unconditioned'
LocationBath = 'bath'
LocationCrawlspace = 'crawlspace'
LocationCrawlspaceConditioned = 'crawlspace - conditioned'
LocationCrawlspaceUnvented = 'crawlspace - unvented'
LocationCrawlspaceVented = 'crawlspace - vented'
Expand Down

0 comments on commit 19db1e5

Please sign in to comment.