Skip to content

Commit

Permalink
Squashed 'resources/hpxml-measures/' changes from d0460dbb35d..5a94d2…
Browse files Browse the repository at this point in the history
…6ebf1

5a94d26ebf1 Remove results_hvac_sizing.csv, now captured as part of results.csv.
47c14dfda30 Latest results.
9e90bfc75d5 Bugfix.
7b1726c021d Minor cleanup.
3dee61034d0 First pass.
4e6d1a66a77 Merge pull request #1193 from NREL/kiva_initial_temp
fcd1cc6bee1 Latest results.
993bc8ae58f Merge branch 'kiva_initial_temp' of https://github.com/NREL/OpenStudio-HPXML into kiva_initial_temp
0350656ee69 Refinements and some unit tests.
43e2bd4099c Latest results.
6fe9c6c6b8b Handle buildings w/o HVAC. Update base-hvac-none.xml to be in a mild climate.
7b5685541b1 s
b6e3af677b1 Some cleanup and better comments.
535b31c084c Update Changelog.md.
01270816cf3 Initial pass at setting a Kiva:Foundation initial temperature better than E+ does.
230925090f6 Merge pull request #1191 from NREL/design_temperatures
c4093b93db2 Latest results.
28220134852 Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML into design_temperatures
07b5e5f024b Add design temperatures to output files; update docs.
762a1fcc27d Merge pull request #1190 from NREL/requires
c57d9c88952 Simplify/clean up requires.
d34db690c0b Merge pull request #1189 from NREL/standbyloss
02f3cf405b2 Update to latest HPXML schema for standby losses. Code backported from NREL/OpenStudio-HPXML#1150.
f62df2c38c2 Merge pull request #1183 from NREL/ground_conductivity
a7fffdf298c Latest results.
f0ab7cfb2df Use for GSHP model too.
813d3671255 Latest results.
77f053032c2 Merge branch 'ground_conductivity' of https://github.com/NREL/OpenStudio-HPXML into ground_conductivity
bee3915af49 Bugfix.
98821f1b039 Latest results.
36beee646e1 Finish docs [ci skip]
4dc30f7ab47 First pass.
513bfaaa605 Merge pull request #1180 from NREL/surface_type_bugfix
a766a4a6e19 Fixes possible "Could not identify surface type for surface" error.
fddd2df6059 Merge pull request #1179 from NREL/attached_dhw_dist
2da3ebec07c Latest results.
92aa5db8368 Revert temporary change.
74887c5393a Fix validation tests.
fbf953329c4 Allows shared dishwasher/clothes washer to be attached to a hot water distribution system instead of a single water heater.
1a129484770 Merge pull request #1177 from NREL/multiple_climate_zones
3a4cc9e7e9d Clarify end use in docs [ci skip]
acd6980a289 FIx test.
b13b89f2708 Updates the HPXML class to support multiple IECC climate zones. OS-HPXML still only allows a single climate zone to be provided (to prevent confusion as to which will be used).

git-subtree-dir: resources/hpxml-measures
git-subtree-split: 5a94d26ebf140a336fe5c1e1dbecc2bf2abce615
  • Loading branch information
joseph-robertson committed Oct 10, 2022
1 parent 65d2049 commit 70fac6b
Show file tree
Hide file tree
Showing 50 changed files with 2,733 additions and 2,741 deletions.
58 changes: 25 additions & 33 deletions BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,14 @@
require 'pathname'
require 'csv'
require 'oga'
require_relative 'resources/geometry'
require_relative '../HPXMLtoOpenStudio/resources/airflow'
require_relative '../HPXMLtoOpenStudio/resources/battery'
require_relative '../HPXMLtoOpenStudio/resources/constants'
require_relative '../HPXMLtoOpenStudio/resources/constructions'
require_relative '../HPXMLtoOpenStudio/resources/geometry'
require_relative '../HPXMLtoOpenStudio/resources/hotwater_appliances'
require_relative '../HPXMLtoOpenStudio/resources/hpxml_defaults'
require_relative '../HPXMLtoOpenStudio/resources/hpxml'
require_relative '../HPXMLtoOpenStudio/resources/hvac'
require_relative '../HPXMLtoOpenStudio/resources/hvac_sizing'
require_relative '../HPXMLtoOpenStudio/resources/lighting'
require_relative '../HPXMLtoOpenStudio/resources/location'
require_relative '../HPXMLtoOpenStudio/resources/materials'
require_relative '../HPXMLtoOpenStudio/resources/misc_loads'
require_relative '../HPXMLtoOpenStudio/resources/meta_measure'
require_relative '../HPXMLtoOpenStudio/resources/psychrometrics'
require_relative '../HPXMLtoOpenStudio/resources/pv'
require_relative '../HPXMLtoOpenStudio/resources/schedules'
require_relative '../HPXMLtoOpenStudio/resources/unit_conversions'
require_relative '../HPXMLtoOpenStudio/resources/util'
require_relative '../HPXMLtoOpenStudio/resources/utility_bills'
require_relative '../HPXMLtoOpenStudio/resources/validator'
require_relative '../HPXMLtoOpenStudio/resources/version'
require_relative '../HPXMLtoOpenStudio/resources/waterheater'
require_relative '../HPXMLtoOpenStudio/resources/weather'
require_relative '../HPXMLtoOpenStudio/resources/xmlhelper'
Dir["#{File.dirname(__FILE__)}/resources/*.rb"].each do |resource_file|
require resource_file
end
Dir["#{File.dirname(__FILE__)}/../HPXMLtoOpenStudio/resources/*.rb"].each do |resource_file|
next if resource_file.include? 'minitest_helper.rb'

require resource_file
end

# start the measure
class BuildResidentialHPXML < OpenStudio::Measure::ModelMeasure
Expand Down Expand Up @@ -137,6 +118,12 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDescription('Presence of nearby buildings, trees, obstructions for infiltration model. If not provided, the OS-HPXML default is used.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeDoubleArgument('site_ground_conductivity', false)
arg.setDisplayName('Site: Ground Conductivity')
arg.setDescription('Conductivity of the ground soil. If not provided, the OS-HPXML default is used.')
arg.setUnits('Btu/hr-ft-F')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('site_zip_code', false)
arg.setDisplayName('Site: Zip Code')
arg.setDescription('Zip code of the home address.')
Expand Down Expand Up @@ -3724,7 +3711,11 @@ def self.set_header(hpxml, args)

def self.set_site(hpxml, args)
if args[:site_shielding_of_home].is_initialized
shielding_of_home = args[:site_shielding_of_home].get
hpxml.site.shielding_of_home = args[:site_shielding_of_home].get
end

if args[:site_ground_conductivity].is_initialized
hpxml.site.ground_conductivity = args[:site_ground_conductivity].get
end

if args[:site_type].is_initialized
Expand Down Expand Up @@ -3763,7 +3754,6 @@ def self.set_site(hpxml, args)
end

hpxml.site.azimuth_of_front_of_home = args[:geometry_unit_orientation]
hpxml.site.shielding_of_home = shielding_of_home
end

def self.set_neighbor_buildings(hpxml, args)
Expand Down Expand Up @@ -3831,8 +3821,8 @@ def self.set_climate_and_risk_zones(hpxml, args)
hpxml.climate_and_risk_zones.weather_station_id = 'WeatherStation'

if args[:site_iecc_zone].is_initialized
hpxml.climate_and_risk_zones.iecc_zone = args[:site_iecc_zone].get
hpxml.climate_and_risk_zones.iecc_year = 2006
hpxml.climate_and_risk_zones.climate_zone_ieccs.add(zone: args[:site_iecc_zone].get,
year: 2006)
end

weather_station_name = File.basename(args[:weather_station_epw_filepath]).gsub('.epw', '')
Expand Down Expand Up @@ -5219,7 +5209,8 @@ def self.set_water_heating_systems(hpxml, args)
if [HPXML::WaterHeaterTypeCombiTankless, HPXML::WaterHeaterTypeCombiStorage].include? water_heater_type
if args[:water_heater_standby_loss].is_initialized
if args[:water_heater_standby_loss].get > 0
standby_loss = args[:water_heater_standby_loss].get
standby_loss_units = HPXML::UnitsDegFPerHour
standby_loss_value = args[:water_heater_standby_loss].get
end
end
end
Expand Down Expand Up @@ -5282,7 +5273,8 @@ def self.set_water_heating_systems(hpxml, args)
recovery_efficiency: recovery_efficiency,
uses_desuperheater: uses_desuperheater,
related_hvac_idref: related_hvac_idref,
standby_loss: standby_loss,
standby_loss_units: standby_loss_units,
standby_loss_value: standby_loss_value,
jacket_r_value: jacket_r_value,
temperature: temperature,
heating_capacity: heating_capacity,
Expand Down
15 changes: 12 additions & 3 deletions 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>adadab12-4481-4c1f-bb0f-980c6dbdf441</version_id>
<version_modified>20220818T192810Z</version_modified>
<version_id>42bb3575-dfe5-4a6c-a97b-875bb522461b</version_id>
<version_modified>20220930T164344Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -165,6 +165,15 @@
</choice>
</choices>
</argument>
<argument>
<name>site_ground_conductivity</name>
<display_name>Site: Ground Conductivity</display_name>
<description>Conductivity of the ground soil. If not provided, the OS-HPXML default is used.</description>
<type>Double</type>
<units>Btu/hr-ft-F</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>site_zip_code</name>
<display_name>Site: Zip Code</display_name>
Expand Down Expand Up @@ -6404,7 +6413,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>788EEDBC</checksum>
<checksum>CE5383BA</checksum>
</file>
</files>
</measure>
17 changes: 8 additions & 9 deletions BuildResidentialScheduleFile/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@
require 'openstudio'
require 'pathname'
require 'oga'
require_relative 'resources/schedules'
require_relative '../HPXMLtoOpenStudio/resources/constants'
require_relative '../HPXMLtoOpenStudio/resources/geometry'
require_relative '../HPXMLtoOpenStudio/resources/hpxml'
require_relative '../HPXMLtoOpenStudio/resources/lighting'
require_relative '../HPXMLtoOpenStudio/resources/location'
require_relative '../HPXMLtoOpenStudio/resources/meta_measure'
require_relative '../HPXMLtoOpenStudio/resources/schedules'
require_relative '../HPXMLtoOpenStudio/resources/xmlhelper'
Dir["#{File.dirname(__FILE__)}/resources/*.rb"].each do |resource_file|
require resource_file
end
Dir["#{File.dirname(__FILE__)}/../HPXMLtoOpenStudio/resources/*.rb"].each do |resource_file|
next if resource_file.include? 'minitest_helper.rb'

require resource_file
end

# start the measure
class BuildResidentialScheduleFile < OpenStudio::Measure::ModelMeasure
Expand Down
6 changes: 3 additions & 3 deletions BuildResidentialScheduleFile/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_schedule_file</name>
<uid>f770b2db-1a9f-4e99-99a7-7f3161a594b1</uid>
<version_id>76e2188f-cdb8-4abb-b89a-450c51ef51d9</version_id>
<version_modified>20220818T232732Z</version_modified>
<version_id>1242b12b-5a97-40e7-a335-e1c6abb5095d</version_id>
<version_modified>20220930T164345Z</version_modified>
<xml_checksum>03F02484</xml_checksum>
<class_name>BuildResidentialScheduleFile</class_name>
<display_name>Schedule File Builder</display_name>
Expand Down Expand Up @@ -911,7 +911,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>AAE8B0D8</checksum>
<checksum>8FF07C66</checksum>
</file>
</files>
</measure>
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
__New Features__
- **Breaking Change**: Replaces `FrameFloors/FrameFloor` with `Floors/Floor`.
- **Breaking change**: Replaces `SoftwareInfo/extension/SimulationControl/DaylightSaving/Enabled` with `Building/Site/TimeZone/DSTObserved`.
- **Breaking Change**: Replaces `StandbyLoss` with `StandbyLoss[Units="F/hr"]/Value` for an indirect water heater.
- **Breaking Change**: Deprecates ReportHPXMLOutput measure; HVAC autosized capacities & design loads moved to `results_annual.csv`.
- Allows SEER2/HSPF2 efficiency types for central air conditioners and heat pumps.
- 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).
- Allows setting the EnergyPlus temperature capacitance multiplier.
- Allows setting the ground soil conductivity used for foundation heat transfer and ground source heat pumps.
- Allows setting the natural ventilation availability (days/week that operable windows can be opened); default changed from 7 to 3 (M/W/F).
- Allows specifying duct surface area multipliers.
- Design temperatures, used to calculate design loads for HVAC equipment autosizing, are now output in `in.xml` and `results_annual.csv`.
- EnergyPlus modeling changes:
- Switches Kiva foundation model timestep from 'Hourly' to 'Timestep'; small increase in runtime for sub-hourly simulations.
- Annual/timeseries outputs:
Expand All @@ -21,6 +25,8 @@ __New Features__
- Adds optional arguments for utility bill scenarios.
- ReportUtilityBills measure:
- Removes utility rate and PV related arguments in lieu of new utility bill scenarios described inside the HPXML file.
- Allows shared dishwasher/clothes washer to be attached to a hot water distribution system instead of a single water heater.
- Improves Kiva foundation model heat transfer by providing better initial temperature assumptions based on foundation type and insulation levels.

__Bugfixes__
- Fixes possible incorrect autosizing of heat pump *separate* backup systems with respect to duct loads.
Expand All @@ -34,6 +40,7 @@ __Bugfixes__
- Fixes excessive heat transfer when foundation wall interior insulation does not start from the top of the wall.
- Fixes how relative paths are treated when using an OpenStudio Workflow.
- Fixes possible simulation error if a slab has an ExposedPerimeter near zero.
- Fixes possible "Could not identify surface type for surface" error.
- BuildResidentialHPXML measure:
- Fixes aspect ratio convention for single-family attached and multifamily dwelling units.

Expand Down
90 changes: 51 additions & 39 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,11 @@
require 'pathname'
require 'csv'
require 'oga'
require_relative 'resources/airflow'
require_relative 'resources/battery'
require_relative 'resources/utility_bills'
require_relative 'resources/constants'
require_relative 'resources/constructions'
require_relative 'resources/energyplus'
require_relative 'resources/generator'
require_relative 'resources/geometry'
require_relative 'resources/hotwater_appliances'
require_relative 'resources/hpxml'
require_relative 'resources/hpxml_defaults'
require_relative 'resources/hvac'
require_relative 'resources/hvac_sizing'
require_relative 'resources/lighting'
require_relative 'resources/location'
require_relative 'resources/materials'
require_relative 'resources/misc_loads'
require_relative 'resources/psychrometrics'
require_relative 'resources/pv'
require_relative 'resources/schedules'
require_relative 'resources/simcontrols'
require_relative 'resources/unit_conversions'
require_relative 'resources/util'
require_relative 'resources/validator'
require_relative 'resources/version'
require_relative 'resources/waterheater'
require_relative 'resources/weather'
require_relative 'resources/xmlhelper'
Dir["#{File.dirname(__FILE__)}/resources/*.rb"].each do |resource_file|
next if resource_file.include? 'minitest_helper.rb'

require resource_file
end

# start the measure
class HPXMLtoOpenStudio < OpenStudio::Measure::ModelMeasure
Expand Down Expand Up @@ -233,7 +210,7 @@ def self.create(hpxml, runner, model, hpxml_path, epw_path, cache_path, output_d
add_walls(runner, model, spaces)
add_rim_joists(runner, model, spaces)
add_floors(runner, model, spaces)
add_foundation_walls_slabs(runner, model, spaces)
add_foundation_walls_slabs(runner, model, weather, spaces)
add_shading_schedule(model, weather)
add_windows(model, spaces)
add_doors(model, spaces)
Expand Down Expand Up @@ -741,7 +718,7 @@ def self.add_floors(runner, model, spaces)
end
end

def self.add_foundation_walls_slabs(runner, model, spaces)
def self.add_foundation_walls_slabs(runner, model, weather, spaces)
foundation_types = @hpxml.slabs.map { |s| s.interior_adjacent_to }.uniq

foundation_types.each do |foundation_type|
Expand Down Expand Up @@ -820,7 +797,7 @@ def self.add_foundation_walls_slabs(runner, model, spaces)
else
z_origin = -1 * slab.depth_below_grade
end
add_foundation_slab(model, spaces, slab, slab_exp_perim,
add_foundation_slab(model, weather, spaces, slab, slab_exp_perim,
slab_area, z_origin, kiva_foundation)
end

Expand All @@ -830,7 +807,7 @@ def self.add_foundation_walls_slabs(runner, model, spaces)

z_origin = 0
slab_area = total_slab_area * no_wall_slab_exp_perim[slab] / total_slab_exp_perim
add_foundation_slab(model, spaces, slab, no_wall_slab_exp_perim[slab],
add_foundation_slab(model, weather, spaces, slab, no_wall_slab_exp_perim[slab],
slab_area, z_origin, nil)
end

Expand Down Expand Up @@ -963,9 +940,12 @@ def self.add_foundation_wall(runner, model, spaces, foundation_wall, slab_frac,
int_rigid_r = foundation_wall.insulation_interior_r_value
end

soil_k_in = UnitConversions.convert(@hpxml.site.ground_conductivity, 'ft', 'in')

Constructions.apply_foundation_wall(model, [surface], "#{foundation_wall.id} construction",
ext_rigid_offset, int_rigid_offset, ext_rigid_height, int_rigid_height,
ext_rigid_r, int_rigid_r, mat_int_finish, mat_wall, height_ag)
ext_rigid_r, int_rigid_r, mat_int_finish, mat_wall, height_ag,
soil_k_in)

if not assembly_r.nil?
Constructions.check_surface_assembly_rvalue(runner, [surface], inside_film, nil, assembly_r, match)
Expand All @@ -974,7 +954,7 @@ def self.add_foundation_wall(runner, model, spaces, foundation_wall, slab_frac,
return surface.adjacentFoundation.get
end

def self.add_foundation_slab(model, spaces, slab, slab_exp_perim,
def self.add_foundation_slab(model, weather, spaces, slab, slab_exp_perim,
slab_area, z_origin, kiva_foundation)

slab_tot_perim = slab_exp_perim
Expand Down Expand Up @@ -1028,13 +1008,43 @@ def self.add_foundation_slab(model, spaces, slab, slab_exp_perim,
mat_carpet = Material.CoveringBare(slab.carpet_fraction,
slab.carpet_r_value)
end
soil_k_in = UnitConversions.convert(@hpxml.site.ground_conductivity, 'ft', 'in')

Constructions.apply_foundation_slab(model, surface, "#{slab.id} construction",
slab_under_r, slab_under_width, slab_gap_r, slab_perim_r,
slab_perim_depth, slab_whole_r, slab.thickness,
slab_exp_perim, mat_carpet, kiva_foundation)
slab_exp_perim, mat_carpet, soil_k_in, kiva_foundation)

return surface.adjacentFoundation.get
kiva_foundation = surface.adjacentFoundation.get

foundation_walls_insulated = false
foundation_ceiling_insulated = false
@hpxml.foundation_walls.each do |fnd_wall|
next unless fnd_wall.interior_adjacent_to == slab.interior_adjacent_to
next unless fnd_wall.exterior_adjacent_to == HPXML::LocationGround

if fnd_wall.insulation_assembly_r_value.to_f > 5
foundation_walls_insulated = true
elsif fnd_wall.insulation_exterior_r_value.to_f + fnd_wall.insulation_interior_r_value.to_f > 0
foundation_walls_insulated = true
end
end
@hpxml.floors.each do |floor|
next unless floor.interior_adjacent_to == HPXML::LocationLivingSpace
next unless floor.exterior_adjacent_to == slab.interior_adjacent_to

if floor.insulation_assembly_r_value > 5
foundation_ceiling_insulated = true
end
end

Constructions.apply_kiva_initial_temp(kiva_foundation, slab, weather,
spaces[HPXML::LocationLivingSpace].thermalZone.get,
@hpxml.header.sim_begin_month, @hpxml.header.sim_begin_day,
@hpxml.header.sim_calendar_year,
foundation_walls_insulated, foundation_ceiling_insulated)

return kiva_foundation
end

def self.add_conditioned_floor_area(model, spaces)
Expand Down Expand Up @@ -1557,7 +1567,7 @@ def self.add_heat_pump(runner, model, weather, spaces, airloop_map)

airloop_map[sys_id] = HVAC.apply_ground_to_air_heat_pump(model, runner, weather, heat_pump,
sequential_heat_load_fracs, sequential_cool_load_fracs,
living_zone)
living_zone, @hpxml.site.ground_conductivity)

end

Expand Down Expand Up @@ -2442,9 +2452,11 @@ def self.set_surface_exterior(model, spaces, surface, hpxml_surface)
HPXML::LocationOtherNonFreezingSpace, HPXML::LocationOtherHousingUnit].include? exterior_adjacent_to
set_surface_otherside_coefficients(surface, exterior_adjacent_to, model, spaces)
elsif HPXML::conditioned_below_grade_locations.include? exterior_adjacent_to
surface.createAdjacentSurface(create_or_get_space(model, spaces, HPXML::LocationLivingSpace))
adjacent_surface = surface.createAdjacentSurface(create_or_get_space(model, spaces, HPXML::LocationLivingSpace)).get
adjacent_surface.additionalProperties.setFeature('SurfaceType', surface.additionalProperties.getFeatureAsString('SurfaceType').get)
else
surface.createAdjacentSurface(create_or_get_space(model, spaces, exterior_adjacent_to))
adjacent_surface = surface.createAdjacentSurface(create_or_get_space(model, spaces, exterior_adjacent_to)).get
adjacent_surface.additionalProperties.setFeature('SurfaceType', surface.additionalProperties.getFeatureAsString('SurfaceType').get)
end
end

Expand Down

0 comments on commit 70fac6b

Please sign in to comment.