Skip to content

Commit

Permalink
Merge pull request #134 from NREL/develop
Browse files Browse the repository at this point in the history
Version 0.9.0
  • Loading branch information
DavidGoldwasser authored Dec 15, 2023
2 parents 8862e92 + acbb65f commit 4737673
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 143 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# OpenStudio Model Articulation Gems

## Version 0.9.0
* Support for OpenStudio 3.7 (upgrade to standards gem 0.5.0, extension gem 0.6.0)
* Fixed [#128]( https://github.com/NREL/openstudio-model-articulation-gem/pull/128 ), fix infiltration design day schedule inversion
* Fixed [#133]( https://github.com/NREL/openstudio-model-articulation-gem/pull/133 ), remove minimum_operation argument

## Version 0.8.0
* Fixed [#120]( https://github.com/NREL/openstudio-model-articulation-gem/pull/120 ), add set_nist_infiltration_correlations
* Fixed [#121]( https://github.com/NREL/openstudio-model-articulation-gem/pull/121 ), added better infiltration area logging
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ bundle exec rake openstudio:test_with_openstudio

|OpenStudio Model Articulation Gem|OpenStudio|Ruby|
|:--------------:|:----------:|:--------:|
| 0.9.0 | 3.7 | 2.7 |
| 0.8.0 | 3.6 | 2.7 |
| 0.7.0 | 3.5 | 2.7 |
| 0.6.0 - 0.6.1 | 3.4 | 2.7 |
Expand Down
8 changes: 0 additions & 8 deletions lib/measures/radiant_slab_with_doas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,6 @@ Only applicable in radiant floor systems. This will greatly reduce system effect
**Required:** true,
**Model Dependent:** false

### Minimum Operating Hours
Fractional Hours Allowed, e.g. 30 min = 0.5
**Name:** minimum_operation,
**Type:** Double,
**Units:** ,
**Required:** true,
**Model Dependent:** false

### Switch Over Time
Minimum time limitation for when the system can switch between heating and cooling. Fractional hours allowed, e.g. 30 min = 0.5.
**Name:** switch_over_time,
Expand Down
9 changes: 0 additions & 9 deletions lib/measures/radiant_slab_with_doas/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ def arguments(model)
proportional_gain.setDefaultValue(0.3)
args << proportional_gain

# make an argument for minimum operating hours
minimum_operation = OpenStudio::Measure::OSArgument.makeDoubleArgument('minimum_operation', true)
minimum_operation.setDisplayName('Minimum Operating Hours')
minimum_operation.setDescription('Fractional Hours Allowed, e.g. 30 min = 0.5')
minimum_operation.setDefaultValue(1.0)
args << minimum_operation

# make an argument for switch over time
switch_over_time = OpenStudio::Measure::OSArgument.makeDoubleArgument('switch_over_time', true)
switch_over_time.setDisplayName('Switch Over Time')
Expand Down Expand Up @@ -176,7 +169,6 @@ def run(model, runner, user_arguments)
include_carpet = runner.getBoolArgumentValue('include_carpet', user_arguments)
control_strategy = runner.getStringArgumentValue('control_strategy', user_arguments)
proportional_gain = runner.getDoubleArgumentValue('proportional_gain', user_arguments)
minimum_operation = runner.getDoubleArgumentValue('minimum_operation', user_arguments)
switch_over_time = runner.getDoubleArgumentValue('switch_over_time', user_arguments)
radiant_lockout = runner.getBoolArgumentValue('radiant_lockout', user_arguments)
lockout_start_time = runner.getDoubleArgumentValue('lockout_start_time', user_arguments)
Expand Down Expand Up @@ -289,7 +281,6 @@ def run(model, runner, user_arguments)
include_carpet: include_carpet,
control_strategy: control_strategy,
proportional_gain: proportional_gain,
minimum_operation: minimum_operation,
switch_over_time: switch_over_time,
radiant_lockout: radiant_lockout,
radiant_lockout_start_time: lockout_start_time,
Expand Down
71 changes: 31 additions & 40 deletions lib/measures/radiant_slab_with_doas/measure.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0"?>
<measure>
<schema_version>3.0</schema_version>
<schema_version>3.1</schema_version>
<name>radiant_slab_with_doas</name>
<uid>8091a0c3-7760-4da6-adf4-133d55872816</uid>
<version_id>d7f5c831-95c6-49e7-ad76-7f2052b7f620</version_id>
<version_modified>20230602T160042Z</version_modified>
<version_id>0aa5894b-04df-4143-9346-85d813fdac98</version_id>
<version_modified>2023-10-30T17:38:24Z</version_modified>
<xml_checksum>C49A7DAB</xml_checksum>
<class_name>RadiantSlabWithDoas</class_name>
<display_name>Radiant Slab with DOAS</display_name>
Expand Down Expand Up @@ -158,15 +158,6 @@ To reduce unmet hours, use an expanded comfort range as mentioned above, remove
<model_dependent>false</model_dependent>
<default_value>0.3</default_value>
</argument>
<argument>
<name>minimum_operation</name>
<display_name>Minimum Operating Hours</display_name>
<description>Fractional Hours Allowed, e.g. 30 min = 0.5</description>
<type>Double</type>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>1</default_value>
</argument>
<argument>
<name>switch_over_time</name>
<display_name>Switch Over Time</display_name>
Expand Down Expand Up @@ -283,12 +274,35 @@ To reduce unmet hours, use an expanded comfort range as mentioned above, remove
</attribute>
</attributes>
<files>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>BFFB1AA6</checksum>
</file>
<file>
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>9B9C0291</checksum>
</file>
<file>
<filename>README.md.erb</filename>
<filetype>erb</filetype>
<usage_type>readmeerb</usage_type>
<checksum>703C9964</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
<identifier>2.9.0</identifier>
<min_compatible>2.9.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>10219EED</checksum>
</file>
<file>
<filename>USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw</filename>
<filetype>epw</filetype>
Expand All @@ -307,40 +321,17 @@ To reduce unmet hours, use an expanded comfort range as mentioned above, remove
<usage_type>test</usage_type>
<checksum>7CBAD8AA</checksum>
</file>
<file>
<filename>single_zone_office_5A.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>44FD3DF2</checksum>
</file>
<file>
<filename>README.md</filename>
<filetype>md</filetype>
<usage_type>readme</usage_type>
<checksum>8618B20F</checksum>
</file>
<file>
<filename>LICENSE.md</filename>
<filetype>md</filetype>
<usage_type>license</usage_type>
<checksum>BFFB1AA6</checksum>
</file>
<file>
<filename>radiant_slab_with_doas_test.rb</filename>
<filetype>rb</filetype>
<usage_type>test</usage_type>
<checksum>363DB98B</checksum>
<checksum>36014A9D</checksum>
</file>
<file>
<version>
<software_program>OpenStudio</software_program>
<identifier>2.9.0</identifier>
<min_compatible>2.9.0</min_compatible>
</version>
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>BE3F5928</checksum>
<filename>single_zone_office_5A.osm</filename>
<filetype>osm</filetype>
<usage_type>test</usage_type>
<checksum>44FD3DF2</checksum>
</file>
</files>
</measure>
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_number_of_arguments_and_argument_names

# get arguments and test that they are what we are expecting
arguments = measure.arguments(model)
assert_equal(15, arguments.size)
assert_equal(14, arguments.size)
assert_equal('remove_existing_hvac', arguments[0].name)
assert_equal('heating_plant_type', arguments[1].name)
assert_equal('cooling_plant_type', arguments[2].name)
Expand All @@ -146,13 +146,12 @@ def test_number_of_arguments_and_argument_names
assert_equal('include_carpet', arguments[5].name)
assert_equal('control_strategy', arguments[6].name)
assert_equal('proportional_gain', arguments[7].name)
assert_equal('minimum_operation', arguments[8].name)
assert_equal('switch_over_time', arguments[9].name)
assert_equal('radiant_lockout', arguments[10].name)
assert_equal('lockout_start_time', arguments[11].name)
assert_equal('lockout_end_time', arguments[12].name)
assert_equal('add_output_variables', arguments[13].name)
assert_equal('standards_template', arguments[14].name)
assert_equal('switch_over_time', arguments[8].name)
assert_equal('radiant_lockout', arguments[9].name)
assert_equal('lockout_start_time', arguments[10].name)
assert_equal('lockout_end_time', arguments[11].name)
assert_equal('add_output_variables', arguments[12].name)
assert_equal('standards_template', arguments[13].name)
end

def test_single_zone_office_5A_floor
Expand Down
28 changes: 21 additions & 7 deletions lib/measures/set_nist_infiltration_correlations/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
OpenStudio(R), Copyright (c) 2008, 2023 Alliance for Sustainable Energy, LLC.
OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistribution and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
(1) Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
(2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Redistribution of this software, without modification, must refer to the software by the same designation. Redistribution of a modified version of this software (i) may not refer to the modified version by the same designation, or by any confusingly similar designation, and (ii) must refer to the underlying software originally provided by Alliance as “OpenStudio®”. Except to comply with the foregoing, the term “OpenStudio®”, or any confusingly similar designation may not be used to refer to any modified version of this software or any modified version of the underlying software originally provided by Alliance without the prior written consent of Alliance.
(3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
or promote products derived from this software without specific prior written permission from the
respective party.

4. The name of the copyright holder(s), any contributors, the United States Government, the United States Department of Energy, or any of their employees may not be used to endorse or promote products derived from this software without specific prior written permission from the respective party.
(4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
designation without specific prior written permission from Alliance for Sustainable Energy, LLC.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
93 changes: 66 additions & 27 deletions lib/measures/set_nist_infiltration_correlations/measure.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
# *******************************************************************************
# OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
# See also https://openstudio.net/license
# OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# (1) Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# (2) Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# (3) Neither the name of the copyright holder nor the names of any contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission from the respective party.
#
# (4) Other than as required in clauses (1) and (2), distributions in any form
# of modifications or other derivative works may not use the "OpenStudio"
# trademark, "OS", "os", or any other confusingly similar designation without
# specific prior written permission from Alliance for Sustainable Energy, LLC.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# *******************************************************************************

require 'csv'
Expand Down Expand Up @@ -114,44 +144,53 @@ def infer_nist_building_type(model)
return results
end

# method to invert a schedule day
def invert_schedule_day(old_schedule_day, new_schedule_day, new_schedule_name)
new_schedule_day.setName("#{new_schedule_name}")
for index in 0..old_schedule_day.times.size-1
old_value = old_schedule_day.values[index]
if old_value == 0
new_value = 1
else
new_value = 0
end
new_schedule_day.addValue(old_schedule_day.times[index], new_value)
end

return new_schedule_day
end

# method to invert a schedule ruleset
def invert_schedule_ruleset(schedule_ruleset, new_schedule_name)
model = schedule_ruleset.model
new_schedule = OpenStudio::Model::ScheduleRuleset.new(model, 0.0)
new_schedule.setName(new_schedule_name)

# change summer design day
summer_design_day_schedule = schedule_ruleset.summerDesignDaySchedule
new_summer_design_day_schedule = OpenStudio::Model::ScheduleDay.new(model)
invert_schedule_day(summer_design_day_schedule, new_summer_design_day_schedule, "#{new_schedule_name} Summer Design Day Schedule")
new_schedule.setSummerDesignDaySchedule(new_summer_design_day_schedule)

# change winter design day
winter_design_day_schedule = schedule_ruleset.winterDesignDaySchedule
new_winter_design_day_schedule = OpenStudio::Model::ScheduleDay.new(model)
invert_schedule_day(winter_design_day_schedule, new_winter_design_day_schedule, "#{new_schedule_name} Winter Design Day Schedule")
new_schedule.setWinterDesignDaySchedule(new_winter_design_day_schedule)

# change the default day values
default_day_schedule = schedule_ruleset.defaultDaySchedule
new_default_day_schedule = new_schedule.defaultDaySchedule
new_default_day_schedule.setName("#{new_schedule_name} Default Day Schedule")
for index in 0..default_day_schedule.times.size-1
old_value = default_day_schedule.values[index]
if old_value == 0
new_value = 1
else
new_value = 0
end
new_default_day_schedule.addValue(default_day_schedule.times[index], new_value)
end
invert_schedule_day(default_day_schedule, new_default_day_schedule, "#{new_schedule_name} Default Day Schedule")

# change for schedule rules
schedule_ruleset.scheduleRules.each_with_index do |rule, i|
old_day_schedule = rule.daySchedule
new_day_schedule = OpenStudio::Model::ScheduleDay.new(model)
new_day_schedule.setName("#{new_schedule_name} Schedule Day #{i}")
index = 0
for index in 0..old_day_schedule.times.size-1
old_value = old_day_schedule.values[index]
if old_value == 0
new_value = 1
else
new_value = 0
end
new_day_schedule.addValue(old_day_schedule.times[index], new_value)
end
old_schedule_day = rule.daySchedule
new_schedule_day = OpenStudio::Model::ScheduleDay.new(model)
invert_schedule_day(old_schedule_day, new_schedule_day, "#{new_schedule_name} Schedule Day #{i}")

new_rule = OpenStudio::Model::ScheduleRule.new(new_schedule, new_day_schedule)
new_rule.setName("#{new_day_schedule.name} Rule")
new_rule = OpenStudio::Model::ScheduleRule.new(new_schedule, new_schedule_day)
new_rule.setName("#{new_schedule_day.name} Rule")
new_rule.setApplySunday(rule.applySunday)
new_rule.setApplyMonday(rule.applyMonday)
new_rule.setApplyTuesday(rule.applyTuesday)
Expand Down
Loading

0 comments on commit 4737673

Please sign in to comment.