Skip to content

Commit

Permalink
Merge branch 'latest-os-hpxml' of https://github.com/NREL/OpenStudio-ERI
Browse files Browse the repository at this point in the history
 into latest-os-hpxml-mf_aext_infiltration

# Conflicts:
#	rulesets/resources/301ruleset.rb
  • Loading branch information
shorowit committed Feb 23, 2024
2 parents 75c49a5 + 4a85890 commit 1db4f90
Show file tree
Hide file tree
Showing 49 changed files with 2,540 additions and 871 deletions.
37 changes: 24 additions & 13 deletions hpxml-measures/BuildResidentialHPXML/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,39 +77,37 @@ Absolute/relative paths of csv files containing user-specified detailed schedule

<br/>

**Schedules: Vacancy Period**
**Schedules: Vacancy Periods**

Specifies the vacancy period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).
Specifies the vacancy periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.

- **Name:** ``schedules_vacancy_period``
- **Name:** ``schedules_vacancy_periods``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Schedules: Power Outage Period**
**Schedules: Power Outage Periods**

Specifies the power outage period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).
Specifies the power outage periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.

- **Name:** ``schedules_power_outage_period``
- **Name:** ``schedules_power_outage_periods``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Schedules: Power Outage Period Window Natural Ventilation Availability**
**Schedules: Power Outage Periods Window Natural Ventilation Availability**

The availability of the natural ventilation schedule during the outage period.
The availability of the natural ventilation schedule during the power outage periods. Valid choices are 'regular schedule', 'always available', 'always unavailable'. If multiple periods, use a comma-separated list.

- **Name:** ``schedules_power_outage_window_natvent_availability``
- **Type:** ``Choice``
- **Name:** ``schedules_power_outage_periods_window_natvent_availability``
- **Type:** ``String``

- **Required:** ``false``

- **Choices:** `regular schedule`, `always available`, `always unavailable`

<br/>

**Simulation Control: Timestep**
Expand Down Expand Up @@ -4956,9 +4954,22 @@ Whether there are any ceiling fans.

<br/>

**Ceiling Fan: Label Energy Use**

The label average energy use of the ceiling fan(s). If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see <a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.

- **Name:** ``ceiling_fan_label_energy_use``
- **Type:** ``Double``

- **Units:** ``W``

- **Required:** ``false``

<br/>

**Ceiling Fan: Efficiency**

The efficiency rating of the ceiling fan(s) at medium speed. If not provided, the OS-HPXML default (see <a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.
The efficiency rating of the ceiling fan(s) at medium speed. Only used if Label Energy Use not provided. If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see <a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.

- **Name:** ``ceiling_fan_efficiency``
- **Type:** ``Double``
Expand Down
82 changes: 57 additions & 25 deletions hpxml-measures/BuildResidentialHPXML/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,24 +69,19 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDescription('Absolute/relative paths of csv files containing user-specified detailed schedules. If multiple files, use a comma-separated list.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_vacancy_period', false)
arg.setDisplayName('Schedules: Vacancy Period')
arg.setDescription('Specifies the vacancy period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).')
arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_vacancy_periods', false)
arg.setDisplayName('Schedules: Vacancy Periods')
arg.setDescription('Specifies the vacancy periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.')
args << arg

arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_power_outage_period', false)
arg.setDisplayName('Schedules: Power Outage Period')
arg.setDescription('Specifies the power outage period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).')
arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_power_outage_periods', false)
arg.setDisplayName('Schedules: Power Outage Periods')
arg.setDescription('Specifies the power outage periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.')
args << arg

natvent_availability_choices = OpenStudio::StringVector.new
natvent_availability_choices << HPXML::ScheduleRegular
natvent_availability_choices << HPXML::ScheduleAvailable
natvent_availability_choices << HPXML::ScheduleUnavailable

arg = OpenStudio::Measure::OSArgument.makeChoiceArgument('schedules_power_outage_window_natvent_availability', natvent_availability_choices, false)
arg.setDisplayName('Schedules: Power Outage Period Window Natural Ventilation Availability')
arg.setDescription('The availability of the natural ventilation schedule during the outage period.')
arg = OpenStudio::Measure::OSArgument.makeStringArgument('schedules_power_outage_periods_window_natvent_availability', false)
arg.setDisplayName('Schedules: Power Outage Periods Window Natural Ventilation Availability')
arg.setDescription("The availability of the natural ventilation schedule during the power outage periods. Valid choices are '#{[HPXML::ScheduleRegular, HPXML::ScheduleAvailable, HPXML::ScheduleUnavailable].join("', '")}'. If multiple periods, use a comma-separated list.")
args << arg

arg = OpenStudio::Measure::OSArgument::makeIntegerArgument('simulation_control_timestep', false)
Expand Down Expand Up @@ -2917,10 +2912,16 @@ def arguments(model) # rubocop:disable Lint/UnusedMethodArgument
arg.setDefaultValue(true)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('ceiling_fan_label_energy_use', false)
arg.setDisplayName('Ceiling Fan: Label Energy Use')
arg.setUnits('W')
arg.setDescription("The label average energy use of the ceiling fan(s). If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see <a href='#{docs_base_url}#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.")
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('ceiling_fan_efficiency', false)
arg.setDisplayName('Ceiling Fan: Efficiency')
arg.setUnits('CFM/W')
arg.setDescription("The efficiency rating of the ceiling fan(s) at medium speed. If not provided, the OS-HPXML default (see <a href='#{docs_base_url}#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.")
arg.setDescription("The efficiency rating of the ceiling fan(s) at medium speed. Only used if Label Energy Use not provided. If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see <a href='#{docs_base_url}#hpxml-ceiling-fans'>HPXML Ceiling Fans</a>) is used.")
args << arg

arg = OpenStudio::Measure::OSArgument::makeIntegerArgument('ceiling_fan_quantity', false)
Expand Down Expand Up @@ -3490,6 +3491,22 @@ def argument_errors(args)
error = args[:rim_joist_assembly_r].is_initialized && !args[:geometry_rim_joist_height].is_initialized
errors << 'Specified a rim joist assembly R-value but no rim joist height.' if error

if args[:schedules_power_outage_periods].is_initialized && args[:schedules_power_outage_periods_window_natvent_availability].is_initialized
schedules_power_outage_periods_lengths = [args[:schedules_power_outage_periods].get.count(','),
args[:schedules_power_outage_periods_window_natvent_availability].get.count(',')]

error = (schedules_power_outage_periods_lengths.uniq.size != 1)
errors << 'One power outage periods schedule argument does not have enough comma-separated elements specified.' if error
end

if args[:schedules_power_outage_periods_window_natvent_availability].is_initialized
natvent_availabilities = args[:schedules_power_outage_periods_window_natvent_availability].get.split(',').map(&:strip)
natvent_availabilities.each do |natvent_availability|
error = ![HPXML::ScheduleRegular, HPXML::ScheduleAvailable, HPXML::ScheduleUnavailable].include?(natvent_availability)
errors << "Window natural ventilation availability '#{natvent_availability}' during a power outage is invalid." if error
end
end

hvac_perf_data_heating_args_initialized = [args[:hvac_perf_data_heating_outdoor_temperatures].is_initialized,
args[:hvac_perf_data_heating_min_speed_capacities].is_initialized,
args[:hvac_perf_data_heating_max_speed_capacities].is_initialized,
Expand Down Expand Up @@ -3840,22 +3857,32 @@ def self.set_header(runner, hpxml, args)
hpxml.header.whole_sfa_or_mf_building_sim = args[:whole_sfa_or_mf_building_sim].get
end

if args[:schedules_vacancy_period].is_initialized
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(args[:schedules_vacancy_period].get)
if args[:schedules_vacancy_periods].is_initialized
schedules_vacancy_periods = args[:schedules_vacancy_periods].get.split(',').map(&:strip)
schedules_vacancy_periods.each do |schedules_vacancy_period|
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(schedules_vacancy_period)

if not unavailable_period_exists(hpxml, 'Vacancy', begin_month, begin_day, begin_hour, end_month, end_day, end_hour)
hpxml.header.unavailable_periods.add(column_name: 'Vacancy', begin_month: begin_month, begin_day: begin_day, begin_hour: begin_hour, end_month: end_month, end_day: end_day, end_hour: end_hour, natvent_availability: HPXML::ScheduleUnavailable)
if not unavailable_period_exists(hpxml, 'Vacancy', begin_month, begin_day, begin_hour, end_month, end_day, end_hour)
hpxml.header.unavailable_periods.add(column_name: 'Vacancy', begin_month: begin_month, begin_day: begin_day, begin_hour: begin_hour, end_month: end_month, end_day: end_day, end_hour: end_hour, natvent_availability: HPXML::ScheduleUnavailable)
end
end
end
if args[:schedules_power_outage_period].is_initialized
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(args[:schedules_power_outage_period].get)
if args[:schedules_power_outage_periods].is_initialized
schedules_power_outage_periods = args[:schedules_power_outage_periods].get.split(',').map(&:strip)

if args[:schedules_power_outage_window_natvent_availability].is_initialized
natvent_availability = args[:schedules_power_outage_window_natvent_availability].get
natvent_availabilities = []
if args[:schedules_power_outage_periods_window_natvent_availability].is_initialized
natvent_availabilities = args[:schedules_power_outage_periods_window_natvent_availability].get.split(',').map(&:strip)
end

if not unavailable_period_exists(hpxml, 'Power Outage', begin_month, begin_day, begin_hour, end_month, end_day, end_hour, natvent_availability)
hpxml.header.unavailable_periods.add(column_name: 'Power Outage', begin_month: begin_month, begin_day: begin_day, begin_hour: begin_hour, end_month: end_month, end_day: end_day, end_hour: end_hour, natvent_availability: natvent_availability)
schedules_power_outage_periods = schedules_power_outage_periods.zip(natvent_availabilities)
schedules_power_outage_periods.each do |schedules_power_outage_period|
outage_period, natvent_availability = schedules_power_outage_period
begin_month, begin_day, begin_hour, end_month, end_day, end_hour = Schedule.parse_date_time_range(outage_period)

if not unavailable_period_exists(hpxml, 'Power Outage', begin_month, begin_day, begin_hour, end_month, end_day, end_hour, natvent_availability)
hpxml.header.unavailable_periods.add(column_name: 'Power Outage', begin_month: begin_month, begin_day: begin_day, begin_hour: begin_hour, end_month: end_month, end_day: end_day, end_hour: end_hour, natvent_availability: natvent_availability)
end
end
end

Expand Down Expand Up @@ -6796,6 +6823,10 @@ def self.set_cooking_range_oven(hpxml_bldg, args)
def self.set_ceiling_fans(hpxml_bldg, args)
return unless args[:ceiling_fan_present]

if args[:ceiling_fan_label_energy_use].is_initialized
label_energy_use = args[:ceiling_fan_label_energy_use].get
end

if args[:ceiling_fan_efficiency].is_initialized
efficiency = args[:ceiling_fan_efficiency].get
end
Expand All @@ -6806,6 +6837,7 @@ def self.set_ceiling_fans(hpxml_bldg, args)

hpxml_bldg.ceiling_fans.add(id: "CeilingFan#{hpxml_bldg.ceiling_fans.size + 1}",
efficiency: efficiency,
label_energy_use: label_energy_use,
count: quantity)
end

Expand Down
55 changes: 25 additions & 30 deletions 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>c8848d28-0d8b-41e8-91f1-abec125fca07</version_id>
<version_modified>2024-02-19T20:13:13Z</version_modified>
<version_id>de0e30ab-3bb4-41e5-ad00-abf50a094dc5</version_id>
<version_modified>2024-02-22T18:12:31Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>BuildResidentialHPXML</class_name>
<display_name>HPXML Builder</display_name>
Expand Down Expand Up @@ -70,42 +70,28 @@
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>schedules_vacancy_period</name>
<display_name>Schedules: Vacancy Period</display_name>
<description>Specifies the vacancy period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).</description>
<name>schedules_vacancy_periods</name>
<display_name>Schedules: Vacancy Periods</display_name>
<description>Specifies the vacancy periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.</description>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>schedules_power_outage_period</name>
<display_name>Schedules: Power Outage Period</display_name>
<description>Specifies the power outage period. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24).</description>
<name>schedules_power_outage_periods</name>
<display_name>Schedules: Power Outage Periods</display_name>
<description>Specifies the power outage periods. Enter a date like "Dec 15 - Jan 15". Optionally, can enter hour of the day like "Dec 15 2 - Jan 15 20" (start hour can be 0 through 23 and end hour can be 1 through 24). If multiple periods, use a comma-separated list.</description>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>schedules_power_outage_window_natvent_availability</name>
<display_name>Schedules: Power Outage Period Window Natural Ventilation Availability</display_name>
<description>The availability of the natural ventilation schedule during the outage period.</description>
<type>Choice</type>
<name>schedules_power_outage_periods_window_natvent_availability</name>
<display_name>Schedules: Power Outage Periods Window Natural Ventilation Availability</display_name>
<description>The availability of the natural ventilation schedule during the power outage periods. Valid choices are 'regular schedule', 'always available', 'always unavailable'. If multiple periods, use a comma-separated list.</description>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
<choices>
<choice>
<value>regular schedule</value>
<display_name>regular schedule</display_name>
</choice>
<choice>
<value>always available</value>
<display_name>always available</display_name>
</choice>
<choice>
<value>always unavailable</value>
<display_name>always unavailable</display_name>
</choice>
</choices>
</argument>
<argument>
<name>simulation_control_timestep</name>
Expand Down Expand Up @@ -6237,10 +6223,19 @@
</choice>
</choices>
</argument>
<argument>
<name>ceiling_fan_label_energy_use</name>
<display_name>Ceiling Fan: Label Energy Use</display_name>
<description>The label average energy use of the ceiling fan(s). If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see &lt;a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'&gt;HPXML Ceiling Fans&lt;/a&gt;) is used.</description>
<type>Double</type>
<units>W</units>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>ceiling_fan_efficiency</name>
<display_name>Ceiling Fan: Efficiency</display_name>
<description>The efficiency rating of the ceiling fan(s) at medium speed. If not provided, the OS-HPXML default (see &lt;a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'&gt;HPXML Ceiling Fans&lt;/a&gt;) is used.</description>
<description>The efficiency rating of the ceiling fan(s) at medium speed. Only used if Label Energy Use not provided. If neither Efficiency nor Label Energy Use provided, the OS-HPXML default (see &lt;a href='https://openstudio-hpxml.readthedocs.io/en/v1.7.0/workflow_inputs.html#hpxml-ceiling-fans'&gt;HPXML Ceiling Fans&lt;/a&gt;) is used.</description>
<type>Double</type>
<units>CFM/W</units>
<required>false</required>
Expand Down Expand Up @@ -7167,7 +7162,7 @@
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>58E2B548</checksum>
<checksum>BD2232F1</checksum>
</file>
<file>
<filename>README.md.erb</filename>
Expand All @@ -7184,7 +7179,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>4E5B7CEC</checksum>
<checksum>776E5EEC</checksum>
</file>
<file>
<filename>geometry.rb</filename>
Expand All @@ -7196,7 +7191,7 @@
<filename>test_build_residential_hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>63FD5BD3</checksum>
<checksum>15E37B7A</checksum>
</file>
</files>
</measure>
Loading

0 comments on commit 1db4f90

Please sign in to comment.