Skip to content

Commit

Permalink
Squashed 'resources/hpxml-measures/' changes from d0460dbb35d..b53481…
Browse files Browse the repository at this point in the history
…141e8

b53481141e8 Catch unmet hours for outage sample files.
ad390f482aa Include limits for unmet hours schedule files.
d0a2d9a31dc Fix utility bill test file.
04460a71576 Updates to workflow inputs docs.
903d442a890 Add sample files for heating, cooling season only.
c0ffa282937 Fix up schedules tests.
e540d48ef28 Fix unmet hours program for simple seasons.
591e0e270a8 Clean up defaults resource.
988cac834eb Default natvent, seasons only if detailed schedules not provided.
877efe2396a Update unmet hours program for detailed seasons.
7bfb66fbf91 Generalize methods so we can support subhourly seasons.
c57c8b6edcc Start filling out seasons from schedule file measure.
0bb1ebd2913 Merge branch 'power-outage' of github.com:NREL/OpenStudio-HPXML into power-outage
726f4292434 Update sample and schedule files.
6a18e956c54 Add object names for sequential fraction schedules.
d78f9e2084a Stub new hourly season methods in schedules resource.
f29085da796 Support hourly sequential fractions and seasons in hvac resource.
75b6ac6ca0f Stub creating season columns from schedule file measure.
f4eb97f27c5 Change from daily seasons to hourly seasons in translator measure.
4a03d5f39be Latest results.
8fe9f64a6cb Typo.
d41be38287f Skip detailed seasons sample file for now.
deb52470c0c Merge branch 'master' into power-outage
2b0108453e5 Fix new schedule test and assign schedule type limits to natvent schedule.
230925090f6 Merge pull request #1191 from NREL/design_temperatures
c4093b93db2 Latest results.
c46885cb6db Add a bunch of tests.
c60665c74c9 Fix switch in airflow resource file.
41a0ad8369f Create natvent column when requested.
28220134852 Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML into design_temperatures
07b5e5f024b Add design temperatures to output files; update docs.
88a61e3aab7 Merge branch 'master' into power-outage
762a1fcc27d Merge pull request #1190 from NREL/requires
c57d9c88952 Simplify/clean up requires.
b9437c605d8 Update docs and tasks for natvent.
4adb8d34f62 Update resource files and add new schedule file csvs.
e13356ce630 Add natvent arg to schedule file measure.
d34db690c0b Merge pull request #1189 from NREL/standbyloss
02f3cf405b2 Update to latest HPXML schema for standby losses. Code backported from NREL/OpenStudio-HPXML#1150.
bf6eac452b6 Latest results.
99fdbbb5da1 Set outage from translator schedules resource.
843bb11b79b Match outage dates to vacancy dates.
61a00344c1d Latest results.
972ab04dee3 Update docs similar to vacancy.
7c37f7a1a30 Add sample file for specifying outage period.
dab965c449d Add support for outage in translator schedules resource.
ff8b8da7224 Update schedule file measure for new outage argument.
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: b53481141e8ab3b84ecf0d61e3d386cc42888319
  • Loading branch information
joseph-robertson committed Oct 5, 2022
1 parent 65d2049 commit 8b1a235
Show file tree
Hide file tree
Showing 57 changed files with 59,061 additions and 993 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>
63 changes: 53 additions & 10 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 Expand Up @@ -57,6 +56,16 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDescription('Specifies the vacancy period. Enter a date like "Dec 15 - Jan 15".')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_outage_period', false)
arg.setDisplayName('Schedules: Outage Period')
arg.setDescription('Specifies the outage period. Enter a date/time like "Dec 15 10am - Jan 15 2pm". 12am is the final hour of a given day.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeBoolArgument('schedules_outage_window_natvent_availability', false)
arg.setDisplayName('Schedules: Outage Period Natural Ventilation Availability')
arg.setDescription('Whether natural ventilation is available during the outage period.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeIntegerArgument('schedules_random_seed', false)
arg.setDisplayName('Schedules: Random Seed')
arg.setUnits('#')
Expand Down Expand Up @@ -162,6 +171,7 @@ def create_schedules(runner, hpxml, epw_file, args)
info_msgs << "RandomSeed=#{args[:random_seed]}" if args[:schedules_random_seed].is_initialized
info_msgs << "GeometryNumOccupants=#{args[:geometry_num_occupants]}"
info_msgs << "VacancyPeriod=#{args[:schedules_vacancy_period].get}" if args[:schedules_vacancy_period].is_initialized
info_msgs << "OutagePeriod=#{args[:schedules_outage_period].get}" if args[:schedules_outage_period].is_initialized

runner.registerInfo("Created #{args[:schedules_type]} schedule with #{info_msgs.join(', ')}")

Expand All @@ -173,7 +183,8 @@ def get_simulation_parameters(hpxml, epw_file, args)
if !hpxml.header.timestep.nil?
args[:minutes_per_step] = hpxml.header.timestep
end
args[:steps_in_day] = 24 * 60 / args[:minutes_per_step]
args[:steps_in_hour] = 60 / args[:minutes_per_step]
args[:steps_in_day] = 24 * args[:steps_in_hour]
args[:mkc_ts_per_day] = 96
args[:mkc_ts_per_hour] = args[:mkc_ts_per_day] / 24

Expand Down Expand Up @@ -208,6 +219,38 @@ def get_generator_inputs(hpxml, epw_file, args)
args[:schedules_vacancy_end_day] = end_day
end

if args[:schedules_outage_period].is_initialized
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(args[:schedules_outage_period].get)
args[:schedules_outage_begin_month] = begin_month
args[:schedules_outage_begin_day] = begin_day
args[:schedules_outage_begin_hour] = begin_hour
args[:schedules_outage_end_month] = end_month
args[:schedules_outage_end_day] = end_day
args[:schedules_outage_end_hour] = end_hour

args[:seasons_heating_begin_month] = 1
args[:seasons_heating_begin_day] = 1
args[:seasons_heating_end_month] = 12
args[:seasons_heating_end_day] = 31
args[:seasons_cooling_begin_month] = 1
args[:seasons_cooling_begin_day] = 1
args[:seasons_cooling_end_month] = 12
args[:seasons_cooling_end_day] = 31
hpxml.hvac_controls.each do |hvac_control|
args[:seasons_heating_begin_month] = hvac_control.seasons_heating_begin_month if !hvac_control.seasons_heating_begin_month.nil?
args[:seasons_heating_begin_day] = hvac_control.seasons_heating_begin_day if !hvac_control.seasons_heating_begin_day.nil?
args[:seasons_heating_end_month] = hvac_control.seasons_heating_end_month if !hvac_control.seasons_heating_end_month.nil?
args[:seasons_heating_end_day] = hvac_control.seasons_heating_end_day if !hvac_control.seasons_heating_end_day.nil?
args[:seasons_cooling_begin_month] = hvac_control.seasons_cooling_begin_month if !hvac_control.seasons_cooling_begin_month.nil?
args[:seasons_cooling_begin_day] = hvac_control.seasons_cooling_begin_day if !hvac_control.seasons_cooling_begin_day.nil?
args[:seasons_cooling_end_month] = hvac_control.seasons_cooling_end_month if !hvac_control.seasons_cooling_end_month.nil?
args[:seasons_cooling_end_day] = hvac_control.seasons_cooling_end_day if !hvac_control.seasons_cooling_end_day.nil?
end

args[:window_natvent_availability] = 3
args[:window_natvent_availability] = hpxml.header.natvent_days_per_week if !hpxml.header.natvent_days_per_week.nil?
end

debug = false
if args[:schedules_type] == 'stochastic' && args[:debug].is_initialized
debug = args[:debug].get
Expand Down
54 changes: 40 additions & 14 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>e95ee413-195f-462b-b8b1-97f196cfa7c2</version_id>
<version_modified>20221005T152836Z</version_modified>
<xml_checksum>03F02484</xml_checksum>
<class_name>BuildResidentialScheduleFile</class_name>
<display_name>Schedule File Builder</display_name>
Expand Down Expand Up @@ -46,6 +46,32 @@
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>schedules_outage_period</name>
<display_name>Schedules: Outage Period</display_name>
<description>Specifies the outage period. Enter a date/time like "Dec 15 10am - Jan 15 2pm". 12am is the final hour of a given day.</description>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>schedules_outage_window_natvent_availability</name>
<display_name>Schedules: Outage Period Natural Ventilation Availability</display_name>
<description>Whether natural ventilation is available during the outage period.</description>
<type>Boolean</type>
<required>false</required>
<model_dependent>false</model_dependent>
<choices>
<choice>
<value>true</value>
<display_name>true</display_name>
</choice>
<choice>
<value>false</value>
<display_name>false</display_name>
</choice>
</choices>
</argument>
<argument>
<name>schedules_random_seed</name>
<display_name>Schedules: Random Seed</display_name>
Expand Down Expand Up @@ -891,27 +917,27 @@
<checksum>127D96AC</checksum>
</file>
<file>
<filename>build_residential_schedule_file_test.rb</filename>
<version>
<software_program>OpenStudio</software_program>
<identifier>3.2.0</identifier>
<min_compatible>3.2.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>41CA164F</checksum>
<usage_type>script</usage_type>
<checksum>5BDD23DE</checksum>
</file>
<file>
<filename>schedules.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>15F4F182</checksum>
<checksum>69CE2AD2</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
<identifier>3.2.0</identifier>
<min_compatible>3.2.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filename>build_residential_schedule_file_test.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>AAE8B0D8</checksum>
<usage_type>test</usage_type>
<checksum>C0798C31</checksum>
</file>
</files>
</measure>

0 comments on commit 8b1a235

Please sign in to comment.