openstudio-load-flexibility-measures 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/LICENSE.md +27 -0
- data/README.md +9 -5
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/doc_templates/copyright_js.txt +1 -1
- data/doc_templates/copyright_ruby.txt +1 -1
- data/lib/measures/ShiftScheduleByType/LICENSE.md +27 -0
- data/lib/measures/ShiftScheduleByType/README.md +40 -0
- data/lib/measures/ShiftScheduleByType/README.md.erb +42 -0
- data/lib/measures/ShiftScheduleByType/measure.rb +385 -0
- data/lib/measures/ShiftScheduleByType/measure.xml +115 -0
- data/lib/measures/ShiftScheduleByType/tests/3Story2Space.osm +3030 -0
- data/lib/measures/ShiftScheduleByType/tests/ShiftScheduleByType_Test.rb +193 -0
- data/lib/measures/add_central_ice_storage/LICENSE.md +1 -1
- data/lib/measures/add_central_ice_storage/measure.rb +1 -1
- data/lib/measures/add_central_ice_storage/measure.xml +11 -11
- data/lib/measures/add_central_ice_storage/resources/OsLib_Schedules.rb +1 -1
- data/lib/measures/add_central_ice_storage/tests/add_central_ice_storage_test.rb +1 -1
- data/lib/measures/add_hpwh/LICENSE.md +1 -1
- data/lib/measures/add_hpwh/measure.rb +15 -4
- data/lib/measures/add_hpwh/measure.xml +10 -10
- data/lib/measures/add_hpwh/tests/add_hpwh_test.rb +104 -4
- data/lib/measures/add_packaged_ice_storage/LICENSE.md +1 -1
- data/lib/measures/add_packaged_ice_storage/measure.rb +1 -1
- data/lib/measures/add_packaged_ice_storage/measure.xml +10 -10
- data/lib/measures/add_packaged_ice_storage/tests/add_packaged_ice_storage_test.rb +1 -1
- data/lib/openstudio/load_flexibility_measures/version.rb +2 -2
- data/lib/openstudio/load_flexibility_measures.rb +1 -1
- data/openstudio-load-flexibility-measures.gemspec +1 -1
- metadata +12 -4
@@ -0,0 +1,193 @@
|
|
1
|
+
# *******************************************************************************
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
|
+
# All rights reserved.
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
6
|
+
#
|
7
|
+
# (1) Redistributions of source code must retain the above copyright notice,
|
8
|
+
# this list of conditions and the following disclaimer.
|
9
|
+
#
|
10
|
+
# (2) Redistributions in binary form must reproduce the above copyright notice,
|
11
|
+
# this list of conditions and the following disclaimer in the documentation
|
12
|
+
# and/or other materials provided with the distribution.
|
13
|
+
#
|
14
|
+
# (3) Neither the name of the copyright holder nor the names of any contributors
|
15
|
+
# may be used to endorse or promote products derived from this software without
|
16
|
+
# specific prior written permission from the respective party.
|
17
|
+
#
|
18
|
+
# (4) Other than as required in clauses (1) and (2), distributions in any form
|
19
|
+
# of modifications or other derivative works may not use the "OpenStudio"
|
20
|
+
# trademark, "OS", "os", or any other confusingly similar designation without
|
21
|
+
# specific prior written permission from Alliance for Sustainable Energy, LLC.
|
22
|
+
#
|
23
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
|
24
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
25
|
+
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
26
|
+
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
|
27
|
+
# UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
|
28
|
+
# THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
29
|
+
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
30
|
+
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
31
|
+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
32
|
+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
33
|
+
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
34
|
+
# *******************************************************************************
|
35
|
+
|
36
|
+
require 'openstudio'
|
37
|
+
require 'openstudio/measure/ShowRunnerOutput'
|
38
|
+
require 'fileutils'
|
39
|
+
|
40
|
+
require_relative '../measure.rb'
|
41
|
+
require 'minitest/autorun'
|
42
|
+
|
43
|
+
class ShiftScheduleByType_Test < Minitest::Test
|
44
|
+
def test_ShiftScheduleByType_a
|
45
|
+
# create an instance of the measure
|
46
|
+
measure = ShiftScheduleByType.new
|
47
|
+
|
48
|
+
# create an instance of a runner
|
49
|
+
runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
|
50
|
+
|
51
|
+
# load the test model
|
52
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
53
|
+
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/3Story2Space.osm')
|
54
|
+
model = translator.loadModel(path)
|
55
|
+
assert(!model.empty?)
|
56
|
+
model = model.get
|
57
|
+
|
58
|
+
# set argument values to good values and run the measure on model with spaces
|
59
|
+
arguments = measure.arguments(model)
|
60
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
61
|
+
|
62
|
+
shift_value = arguments[0].clone
|
63
|
+
assert(shift_value.setValue(1.5))
|
64
|
+
argument_map['shift_value'] = shift_value
|
65
|
+
|
66
|
+
schedchoice = arguments[1].clone
|
67
|
+
assert(schedchoice.setValue('CoolHeat'))
|
68
|
+
argument_map['schedchoice'] = schedchoice
|
69
|
+
|
70
|
+
measure.run(model, runner, argument_map)
|
71
|
+
result = runner.result
|
72
|
+
show_output(result)
|
73
|
+
assert(result.value.valueName == 'Success')
|
74
|
+
assert(result.warnings.empty?)
|
75
|
+
# assert(result.info.size == 5)
|
76
|
+
|
77
|
+
# save the model
|
78
|
+
# output_file_path = OpenStudio::Path.new('C:\SVN_Utilities\OpenStudio\measures\test.osm')
|
79
|
+
# model.save(output_file_path,true)
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_ShiftScheduleByType_b
|
83
|
+
# create an instance of the measure
|
84
|
+
measure = ShiftScheduleByType.new
|
85
|
+
|
86
|
+
# create an instance of a runner
|
87
|
+
runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
|
88
|
+
|
89
|
+
# load the test model
|
90
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
91
|
+
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/3Story2Space.osm')
|
92
|
+
model = translator.loadModel(path)
|
93
|
+
assert(!model.empty?)
|
94
|
+
model = model.get
|
95
|
+
|
96
|
+
# set argument values to good values and run the measure on model with spaces
|
97
|
+
arguments = measure.arguments(model)
|
98
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
99
|
+
|
100
|
+
shift_value = arguments[0].clone
|
101
|
+
assert(shift_value.setValue(-6.0))
|
102
|
+
argument_map['shift_value'] = shift_value
|
103
|
+
|
104
|
+
schedchoice = arguments[1].clone
|
105
|
+
assert(schedchoice.setValue('CoolHeat'))
|
106
|
+
argument_map['schedchoice'] = schedchoice
|
107
|
+
|
108
|
+
measure.run(model, runner, argument_map)
|
109
|
+
result = runner.result
|
110
|
+
show_output(result)
|
111
|
+
assert(result.value.valueName == 'Success')
|
112
|
+
assert(result.warnings.empty?)
|
113
|
+
# assert(result.info.size == 5)
|
114
|
+
|
115
|
+
# save the model
|
116
|
+
# output_file_path = OpenStudio::Path.new('C:\SVN_Utilities\OpenStudio\measures\test.osm')
|
117
|
+
# model.save(output_file_path,true)
|
118
|
+
end
|
119
|
+
|
120
|
+
def test_ShiftScheduleByType_all_schedules
|
121
|
+
# create an instance of the measure
|
122
|
+
measure = ShiftScheduleByType.new
|
123
|
+
|
124
|
+
# create an instance of a runner
|
125
|
+
runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
|
126
|
+
|
127
|
+
# load the test model
|
128
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
129
|
+
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/3Story2Space.osm')
|
130
|
+
model = translator.loadModel(path)
|
131
|
+
assert(!model.empty?)
|
132
|
+
model = model.get
|
133
|
+
|
134
|
+
# set argument values to good values and run the measure on model with spaces
|
135
|
+
arguments = measure.arguments(model)
|
136
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
137
|
+
|
138
|
+
shift_value = arguments[0].clone
|
139
|
+
assert(shift_value.setValue(-6.0))
|
140
|
+
argument_map['shift_value'] = shift_value
|
141
|
+
|
142
|
+
schedchoice = arguments[1].clone
|
143
|
+
assert(schedchoice.setValue('CoolHeat'))
|
144
|
+
argument_map['schedchoice'] = schedchoice
|
145
|
+
|
146
|
+
measure.run(model, runner, argument_map)
|
147
|
+
result = runner.result
|
148
|
+
show_output(result)
|
149
|
+
assert(result.value.valueName == 'Success')
|
150
|
+
# assert(result.warnings.size == 0)
|
151
|
+
# assert(result.info.size == 5)
|
152
|
+
|
153
|
+
# save the model
|
154
|
+
# output_file_path = OpenStudio::Path.new('C:\SVN_Utilities\OpenStudio\measures\test.osm')
|
155
|
+
# model.save(output_file_path,true)
|
156
|
+
end
|
157
|
+
|
158
|
+
def test_ShiftScheduleByType_NA
|
159
|
+
# create an instance of the measure
|
160
|
+
measure = ShiftScheduleByType.new
|
161
|
+
|
162
|
+
# create an instance of a runner
|
163
|
+
runner = OpenStudio::Measure::OSRunner.new(OpenStudio::WorkflowJSON.new)
|
164
|
+
|
165
|
+
# load the test model
|
166
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
167
|
+
path = OpenStudio::Path.new(File.dirname(__FILE__) + '/3Story2Space.osm')
|
168
|
+
model = translator.loadModel(path)
|
169
|
+
assert(!model.empty?)
|
170
|
+
model = model.get
|
171
|
+
|
172
|
+
# set argument values to good values and run the measure on model with spaces
|
173
|
+
arguments = measure.arguments(model)
|
174
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
175
|
+
|
176
|
+
shift_value = arguments[0].clone
|
177
|
+
assert(shift_value.setValue(24))
|
178
|
+
argument_map['shift_value'] = shift_value
|
179
|
+
|
180
|
+
schedchoice = arguments[1].clone
|
181
|
+
assert(schedchoice.setValue('CoolHeat'))
|
182
|
+
argument_map['schedchoice'] = schedchoice
|
183
|
+
|
184
|
+
measure.run(model, runner, argument_map)
|
185
|
+
result = runner.result
|
186
|
+
show_output(result)
|
187
|
+
assert(result.value.valueName == 'NA')
|
188
|
+
|
189
|
+
# save the model
|
190
|
+
# output_file_path = OpenStudio::Path.new('C:\SVN_Utilities\OpenStudio\measures\test.osm')
|
191
|
+
# model.save(output_file_path,true)
|
192
|
+
end
|
193
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008-
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
4
|
provided that the following conditions are met:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<schema_version>3.0</schema_version>
|
4
4
|
<name>add_central_ice_storage</name>
|
5
5
|
<uid>48f37812-0cb6-4770-b695-beb8d8a5660d</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>25303cd9-74a2-451a-bf78-b4e03d2bd1a7</version_id>
|
7
|
+
<version_modified>20221011T225330Z</version_modified>
|
8
8
|
<xml_checksum>6394841D</xml_checksum>
|
9
9
|
<class_name>AddCentralIceStorage</class_name>
|
10
10
|
<display_name>Add Central Ice Storage</display_name>
|
@@ -464,29 +464,29 @@
|
|
464
464
|
<usage_type>doc</usage_type>
|
465
465
|
<checksum>090841B0</checksum>
|
466
466
|
</file>
|
467
|
-
<file>
|
468
|
-
<filename>LICENSE.md</filename>
|
469
|
-
<filetype>md</filetype>
|
470
|
-
<usage_type>license</usage_type>
|
471
|
-
<checksum>E0468DD6</checksum>
|
472
|
-
</file>
|
473
467
|
<file>
|
474
468
|
<filename>README.md</filename>
|
475
469
|
<filetype>md</filetype>
|
476
470
|
<usage_type>readme</usage_type>
|
477
471
|
<checksum>962B1D2E</checksum>
|
478
472
|
</file>
|
473
|
+
<file>
|
474
|
+
<filename>LICENSE.md</filename>
|
475
|
+
<filetype>md</filetype>
|
476
|
+
<usage_type>license</usage_type>
|
477
|
+
<checksum>64FFEBDE</checksum>
|
478
|
+
</file>
|
479
479
|
<file>
|
480
480
|
<filename>OsLib_Schedules.rb</filename>
|
481
481
|
<filetype>rb</filetype>
|
482
482
|
<usage_type>resource</usage_type>
|
483
|
-
<checksum>
|
483
|
+
<checksum>0582294E</checksum>
|
484
484
|
</file>
|
485
485
|
<file>
|
486
486
|
<filename>add_central_ice_storage_test.rb</filename>
|
487
487
|
<filetype>rb</filetype>
|
488
488
|
<usage_type>test</usage_type>
|
489
|
-
<checksum>
|
489
|
+
<checksum>B4007921</checksum>
|
490
490
|
</file>
|
491
491
|
<file>
|
492
492
|
<version>
|
@@ -497,7 +497,7 @@
|
|
497
497
|
<filename>measure.rb</filename>
|
498
498
|
<filetype>rb</filetype>
|
499
499
|
<usage_type>script</usage_type>
|
500
|
-
<checksum>
|
500
|
+
<checksum>554632ED</checksum>
|
501
501
|
</file>
|
502
502
|
</files>
|
503
503
|
</measure>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008-
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
4
|
provided that the following conditions are met:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -94,6 +94,7 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
|
|
94
94
|
|
95
95
|
# find available water heaters and get default volume
|
96
96
|
default_vol = 80.0 # gallons
|
97
|
+
wheaters = []
|
97
98
|
wh_names = ['All Water Heaters (Simplified Only)']
|
98
99
|
if !model.getWaterHeaterMixeds.empty?
|
99
100
|
wheaters = model.getWaterHeaterMixeds
|
@@ -283,6 +284,18 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
|
|
283
284
|
db_temp = runner.getDoubleArgumentValue('db_temp', user_arguments)
|
284
285
|
sched = runner.getStringArgumentValue('sched', user_arguments)
|
285
286
|
|
287
|
+
# get zone of one was selected
|
288
|
+
if zone.to_s != 'N/A - Simplified'
|
289
|
+
if model.getThermalZoneByName(zone).is_initialized
|
290
|
+
zone = model.getThermalZoneByName(zone).get
|
291
|
+
else
|
292
|
+
runner.registerError("Could not find zone named #{zone} in the moodel")
|
293
|
+
return false
|
294
|
+
end
|
295
|
+
else
|
296
|
+
zone = 'N/A - Simplified'
|
297
|
+
end
|
298
|
+
|
286
299
|
4.times do |n|
|
287
300
|
flex << runner.getStringArgumentValue("flex#{n}", user_arguments)
|
288
301
|
flex_hrs << runner.getStringArgumentValue("flex_hrs#{n}", user_arguments)
|
@@ -531,12 +544,11 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
|
|
531
544
|
# => openstudio-standards/prototypes/common/objects/Prototype.ServiceWaterHeating.rb
|
532
545
|
if type != 'Simplified'
|
533
546
|
# convert zone name from STRING into OS model OBJECT
|
534
|
-
zone = model.getThermalZoneByName(zone).get
|
535
547
|
hpwh = std.model_add_heatpump_water_heater(model, # model
|
536
548
|
type: type, # type
|
537
549
|
water_heater_capacity: (cap * 1000 / cop), # water_heater_capacity
|
538
550
|
electric_backup_capacity: (bu_cap * 1000), # electric_backup_capacity
|
539
|
-
water_heater_volume: v,
|
551
|
+
water_heater_volume: v.to_f, # water_heater_volume
|
540
552
|
service_water_temperature: OpenStudio.convert(140.0, 'F', 'C').get, # service_water_temperature
|
541
553
|
parasitic_fuel_consumption_rate: 3.0, # parasitic_fuel_consumption_rate
|
542
554
|
swh_temp_sch: sched, # swh_temp_sch
|
@@ -548,7 +560,6 @@ class AddHpwh < OpenStudio::Measure::ModelMeasure
|
|
548
560
|
flowrate_schedule: nil, # flowrate_schedule
|
549
561
|
water_heater_thermal_zone: zone) # water_heater_thermal_zone
|
550
562
|
else
|
551
|
-
# zone = whtr.ambientTemperatureThermalZone.get
|
552
563
|
hpwh = std.model_add_water_heater(model, # model
|
553
564
|
(cap * 1000), # water_heater_capacity
|
554
565
|
v.to_f, # water_heater_volume
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<schema_version>3.0</schema_version>
|
4
4
|
<name>add_hpwh</name>
|
5
5
|
<uid>518cde6f-1806-4b9a-bee9-ccaac49c7a53</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>5f32552c-4726-4ed6-b89a-a991afaecd60</version_id>
|
7
|
+
<version_modified>20221011T225330Z</version_modified>
|
8
8
|
<xml_checksum>A374667A</xml_checksum>
|
9
9
|
<class_name>AddHpwh</class_name>
|
10
10
|
<display_name>Add HPWH for Domestic Hot Water</display_name>
|
@@ -363,12 +363,6 @@ The flexibility of the system is based on user-defined temperatures and times, w
|
|
363
363
|
<usage_type>test</usage_type>
|
364
364
|
<checksum>EB637B7E</checksum>
|
365
365
|
</file>
|
366
|
-
<file>
|
367
|
-
<filename>LICENSE.md</filename>
|
368
|
-
<filetype>md</filetype>
|
369
|
-
<usage_type>license</usage_type>
|
370
|
-
<checksum>E0468DD6</checksum>
|
371
|
-
</file>
|
372
366
|
<file>
|
373
367
|
<filename>Flexible Domestic Hot Water Implementation Guide.pdf</filename>
|
374
368
|
<filetype>pdf</filetype>
|
@@ -381,6 +375,12 @@ The flexibility of the system is based on user-defined temperatures and times, w
|
|
381
375
|
<usage_type>readme</usage_type>
|
382
376
|
<checksum>5E6E20CF</checksum>
|
383
377
|
</file>
|
378
|
+
<file>
|
379
|
+
<filename>LICENSE.md</filename>
|
380
|
+
<filetype>md</filetype>
|
381
|
+
<usage_type>license</usage_type>
|
382
|
+
<checksum>64FFEBDE</checksum>
|
383
|
+
</file>
|
384
384
|
<file>
|
385
385
|
<version>
|
386
386
|
<software_program>OpenStudio</software_program>
|
@@ -390,13 +390,13 @@ The flexibility of the system is based on user-defined temperatures and times, w
|
|
390
390
|
<filename>measure.rb</filename>
|
391
391
|
<filetype>rb</filetype>
|
392
392
|
<usage_type>script</usage_type>
|
393
|
-
<checksum>
|
393
|
+
<checksum>BDB9B944</checksum>
|
394
394
|
</file>
|
395
395
|
<file>
|
396
396
|
<filename>add_hpwh_test.rb</filename>
|
397
397
|
<filetype>rb</filetype>
|
398
398
|
<usage_type>test</usage_type>
|
399
|
-
<checksum>
|
399
|
+
<checksum>85B7D1A6</checksum>
|
400
400
|
</file>
|
401
401
|
</files>
|
402
402
|
</measure>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -85,12 +85,12 @@ class AddHpwhTest < Minitest::Test
|
|
85
85
|
measure.run(model, runner, argument_map)
|
86
86
|
result = runner.result
|
87
87
|
|
88
|
-
# assert that it ran correctly
|
89
|
-
assert_equal('Success', result.value.valueName)
|
90
|
-
|
91
88
|
# show the output
|
92
89
|
show_output(result)
|
93
90
|
|
91
|
+
# assert that it ran correctly
|
92
|
+
assert_equal('Success', result.value.valueName)
|
93
|
+
|
94
94
|
# save the model to test output directory
|
95
95
|
output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
|
96
96
|
model.save(output_file_path, true)
|
@@ -134,4 +134,104 @@ class AddHpwhTest < Minitest::Test
|
|
134
134
|
assert_equal('Fail', result.value.valueName)
|
135
135
|
assert(result.errors.size == 1)
|
136
136
|
end
|
137
|
+
|
138
|
+
def test_custom_args_PumpedCondenser_specific_zone
|
139
|
+
# create an instance of the measure
|
140
|
+
measure = AddHpwh.new
|
141
|
+
|
142
|
+
# create runner with empty OSW
|
143
|
+
osw = OpenStudio::WorkflowJSON.new
|
144
|
+
runner = OpenStudio::Measure::OSRunner.new(osw)
|
145
|
+
|
146
|
+
# load the test model
|
147
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
148
|
+
path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
|
149
|
+
model = translator.loadModel(path)
|
150
|
+
assert(!model.empty?)
|
151
|
+
model = model.get
|
152
|
+
|
153
|
+
# get arguments
|
154
|
+
arguments = measure.arguments(model)
|
155
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
156
|
+
|
157
|
+
# create hash of argument values.
|
158
|
+
# If the argument has a default that you want to use, you don't need it in the hash
|
159
|
+
args_hash = {}
|
160
|
+
args_hash['zone'] = 'FrontOfficeFlr1 ZN'
|
161
|
+
args_hash['type'] = 'PumpedCondenser'
|
162
|
+
# using defaults values from measure.rb for other arguments
|
163
|
+
|
164
|
+
# populate argument with specified hash value if specified
|
165
|
+
arguments.each do |arg|
|
166
|
+
temp_arg_var = arg.clone
|
167
|
+
if args_hash.key?(arg.name)
|
168
|
+
assert(temp_arg_var.setValue(args_hash[arg.name]))
|
169
|
+
end
|
170
|
+
argument_map[arg.name] = temp_arg_var
|
171
|
+
end
|
172
|
+
|
173
|
+
# run the measure
|
174
|
+
measure.run(model, runner, argument_map)
|
175
|
+
result = runner.result
|
176
|
+
|
177
|
+
# show the output
|
178
|
+
show_output(result)
|
179
|
+
|
180
|
+
# assert that it ran correctly
|
181
|
+
assert_equal('Success', result.value.valueName)
|
182
|
+
|
183
|
+
# save the model to test output directory
|
184
|
+
output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
|
185
|
+
model.save(output_file_path, true)
|
186
|
+
end
|
187
|
+
|
188
|
+
def test_custom_args_WrappedCondenser_specific_zone
|
189
|
+
# create an instance of the measure
|
190
|
+
measure = AddHpwh.new
|
191
|
+
|
192
|
+
# create runner with empty OSW
|
193
|
+
osw = OpenStudio::WorkflowJSON.new
|
194
|
+
runner = OpenStudio::Measure::OSRunner.new(osw)
|
195
|
+
|
196
|
+
# load the test model
|
197
|
+
translator = OpenStudio::OSVersion::VersionTranslator.new
|
198
|
+
path = "#{File.dirname(__FILE__)}/SmallHotel-2A.osm"
|
199
|
+
model = translator.loadModel(path)
|
200
|
+
assert(!model.empty?)
|
201
|
+
model = model.get
|
202
|
+
|
203
|
+
# get arguments
|
204
|
+
arguments = measure.arguments(model)
|
205
|
+
argument_map = OpenStudio::Measure.convertOSArgumentVectorToMap(arguments)
|
206
|
+
|
207
|
+
# create hash of argument values.
|
208
|
+
# If the argument has a default that you want to use, you don't need it in the hash
|
209
|
+
args_hash = {}
|
210
|
+
args_hash['zone'] = 'FrontOfficeFlr1 ZN'
|
211
|
+
args_hash['type'] = 'WrappedCondenser'
|
212
|
+
# using defaults values from measure.rb for other arguments
|
213
|
+
|
214
|
+
# populate argument with specified hash value if specified
|
215
|
+
arguments.each do |arg|
|
216
|
+
temp_arg_var = arg.clone
|
217
|
+
if args_hash.key?(arg.name)
|
218
|
+
assert(temp_arg_var.setValue(args_hash[arg.name]))
|
219
|
+
end
|
220
|
+
argument_map[arg.name] = temp_arg_var
|
221
|
+
end
|
222
|
+
|
223
|
+
# run the measure
|
224
|
+
measure.run(model, runner, argument_map)
|
225
|
+
result = runner.result
|
226
|
+
|
227
|
+
# show the output
|
228
|
+
show_output(result)
|
229
|
+
|
230
|
+
# assert that it ran correctly
|
231
|
+
assert_equal('Success', result.value.valueName)
|
232
|
+
|
233
|
+
# save the model to test output directory
|
234
|
+
output_file_path = "#{File.dirname(__FILE__)}//output/test_output.osm"
|
235
|
+
model.save(output_file_path, true)
|
236
|
+
end
|
137
237
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008-
|
1
|
+
OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC. All rights reserved.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
4
4
|
provided that the following conditions are met:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<schema_version>3.0</schema_version>
|
4
4
|
<name>add_packaged_ice_storage</name>
|
5
5
|
<uid>2aa8c128-53b9-49fd-9aaf-9253a1f05936</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>12ace3fc-b9d5-4236-9087-9c2fb61ec8c2</version_id>
|
7
|
+
<version_modified>20221011T225330Z</version_modified>
|
8
8
|
<xml_checksum>2617824F</xml_checksum>
|
9
9
|
<class_name>AddPackagedIceStorage</class_name>
|
10
10
|
<display_name>Add Packaged Ice Storage</display_name>
|
@@ -212,23 +212,23 @@ If 'AutoSize' is selected for ice capacity, these inputs set an ice capacity siz
|
|
212
212
|
<usage_type>test</usage_type>
|
213
213
|
<checksum>DC0DCC4B</checksum>
|
214
214
|
</file>
|
215
|
-
<file>
|
216
|
-
<filename>LICENSE.md</filename>
|
217
|
-
<filetype>md</filetype>
|
218
|
-
<usage_type>license</usage_type>
|
219
|
-
<checksum>E0468DD6</checksum>
|
220
|
-
</file>
|
221
215
|
<file>
|
222
216
|
<filename>README.md</filename>
|
223
217
|
<filetype>md</filetype>
|
224
218
|
<usage_type>readme</usage_type>
|
225
219
|
<checksum>E6FBC489</checksum>
|
226
220
|
</file>
|
221
|
+
<file>
|
222
|
+
<filename>LICENSE.md</filename>
|
223
|
+
<filetype>md</filetype>
|
224
|
+
<usage_type>license</usage_type>
|
225
|
+
<checksum>64FFEBDE</checksum>
|
226
|
+
</file>
|
227
227
|
<file>
|
228
228
|
<filename>add_packaged_ice_storage_test.rb</filename>
|
229
229
|
<filetype>rb</filetype>
|
230
230
|
<usage_type>test</usage_type>
|
231
|
-
<checksum>
|
231
|
+
<checksum>F32CF657</checksum>
|
232
232
|
</file>
|
233
233
|
<file>
|
234
234
|
<version>
|
@@ -239,7 +239,7 @@ If 'AutoSize' is selected for ice capacity, these inputs set an ice capacity siz
|
|
239
239
|
<filename>measure.rb</filename>
|
240
240
|
<filetype>rb</filetype>
|
241
241
|
<usage_type>script</usage_type>
|
242
|
-
<checksum>
|
242
|
+
<checksum>85F2A9C5</checksum>
|
243
243
|
</file>
|
244
244
|
</files>
|
245
245
|
</measure>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -35,6 +35,6 @@
|
|
35
35
|
|
36
36
|
module OpenStudio
|
37
37
|
module LoadFlexibilityMeasures
|
38
|
-
VERSION = '0.
|
38
|
+
VERSION = '0.5.1'.freeze
|
39
39
|
end
|
40
40
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) 2008-
|
2
|
+
# OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
|
3
3
|
# All rights reserved.
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
5
5
|
# modification, are permitted provided that the following conditions are met:
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_dependency 'bundler', '~> 2.1'
|
27
27
|
spec.add_dependency 'openstudio-extension', '~> 0.5.1'
|
28
|
-
spec.add_dependency 'openstudio-standards', '~> 0.2.
|
28
|
+
spec.add_dependency 'openstudio-standards', '~> 0.2.16'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'rake', '~> 13.0'
|
31
31
|
spec.add_development_dependency 'rspec', '~> 3.9'
|