openstudio-ee 0.12.3 → 0.12.5

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.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.coverage +0 -0
  3. data/.github/workflows/test-with-openstudio.yml +109 -74
  4. data/.gitignore +21 -0
  5. data/.rubocop.yml +15 -2
  6. data/CHANGELOG.md +6 -0
  7. data/Gemfile +7 -8
  8. data/README.md +3 -2
  9. data/WORKFLOW_CHANGES.md +74 -0
  10. data/lib/measures/AddDaylightSensors/measure.rb +79 -79
  11. data/lib/measures/AddDaylightSensors/measure.xml +4 -4
  12. data/lib/measures/AddOverhangsByProjectionFactor/measure.rb +38 -41
  13. data/lib/measures/AddOverhangsByProjectionFactor/measure.xml +4 -4
  14. data/lib/measures/EnableDemandControlledVentilation/measure.rb +37 -40
  15. data/lib/measures/EnableDemandControlledVentilation/measure.xml +4 -4
  16. data/lib/measures/EnableEconomizerControl/measure.rb +36 -37
  17. data/lib/measures/EnableEconomizerControl/measure.xml +4 -4
  18. data/lib/measures/GLHEProExportLoadsforGroundHeatExchangerSizing/measure.rb +27 -41
  19. data/lib/measures/GLHEProExportLoadsforGroundHeatExchangerSizing/measure.xml +4 -4
  20. data/lib/measures/GLHEProGFunctionImport/measure.rb +11 -15
  21. data/lib/measures/GLHEProGFunctionImport/measure.xml +4 -4
  22. data/lib/measures/GLHEProSetupExportLoadsforGroundHeatExchangerSizing/measure.rb +5 -9
  23. data/lib/measures/GLHEProSetupExportLoadsforGroundHeatExchangerSizing/measure.xml +3 -3
  24. data/lib/measures/ImproveFanBeltEfficiency/measure.rb +78 -95
  25. data/lib/measures/ImproveFanBeltEfficiency/measure.xml +6 -6
  26. data/lib/measures/ImproveMotorEfficiency/measure.rb +75 -100
  27. data/lib/measures/ImproveMotorEfficiency/measure.xml +6 -6
  28. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.rb +137 -130
  29. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.xml +4 -4
  30. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/measure.rb +114 -115
  31. data/lib/measures/IncreaseInsulationRValueForExteriorWallsByPercentage/measure.xml +3 -3
  32. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.rb +137 -130
  33. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.xml +4 -4
  34. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/measure.rb +114 -115
  35. data/lib/measures/IncreaseInsulationRValueForRoofsByPercentage/measure.xml +3 -3
  36. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.rb +69 -63
  37. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.xml +6 -6
  38. data/lib/measures/ReduceLightingLoadsByPercentage/measure.rb +77 -66
  39. data/lib/measures/ReduceLightingLoadsByPercentage/measure.xml +6 -6
  40. data/lib/measures/ReduceNightTimeElectricEquipmentLoads/measure.rb +45 -43
  41. data/lib/measures/ReduceNightTimeElectricEquipmentLoads/measure.xml +4 -4
  42. data/lib/measures/ReduceNightTimeLightingLoads/measure.rb +45 -43
  43. data/lib/measures/ReduceNightTimeLightingLoads/measure.xml +4 -4
  44. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.rb +58 -52
  45. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.xml +6 -6
  46. data/lib/measures/ReduceVentilationByPercentage/measure.rb +49 -46
  47. data/lib/measures/ReduceVentilationByPercentage/measure.xml +6 -6
  48. data/lib/measures/add_variable_speed_rtu_control_logic/measure.rb +31 -23
  49. data/lib/measures/add_variable_speed_rtu_control_logic/measure.xml +4 -4
  50. data/lib/measures/create_variable_speed_rtu/measure.rb +166 -174
  51. data/lib/measures/create_variable_speed_rtu/measure.xml +6 -6
  52. data/lib/measures/fan_assist_night_ventilation/measure.rb +33 -32
  53. data/lib/measures/fan_assist_night_ventilation/measure.xml +4 -4
  54. data/lib/measures/nze_hvac/measure.rb +72 -62
  55. data/lib/measures/nze_hvac/measure.xml +4 -4
  56. data/lib/measures/replace_water_heater_mixed_with_thermal_storage_chilled_water/measure.rb +16 -19
  57. data/lib/measures/replace_water_heater_mixed_with_thermal_storage_chilled_water/measure.xml +4 -4
  58. data/lib/measures/window_enhancement/LICENSE.md +14 -0
  59. data/lib/measures/window_enhancement/README.md +112 -0
  60. data/lib/measures/window_enhancement/docs/.gitkeep +0 -0
  61. data/lib/measures/window_enhancement/measure.py +386 -0
  62. data/lib/measures/window_enhancement/measure.xml +271 -0
  63. data/lib/measures/window_enhancement/resources/EC3_lookup.py +321 -0
  64. data/lib/measures/window_enhancement/resources/Test_API.py +32 -0
  65. data/lib/measures/window_enhancement/resources/__pycache__/EC3_lookup.cpython-39.pyc +0 -0
  66. data/lib/measures/window_enhancement/resources/__pycache__/Original_EC3_lookup.py +322 -0
  67. data/lib/measures/window_enhancement/resources/__pycache__/Test_API.cpython-39.pyc +0 -0
  68. data/lib/measures/window_enhancement/resources/calculate_perimeter.py +39 -0
  69. data/lib/measures/window_enhancement/test_output.log +39 -0
  70. data/lib/openstudio/ee_measures/version.rb +1 -1
  71. data/openstudio-ee.gemspec +10 -8
  72. data/test-workflow-locally.sh +152 -0
  73. metadata +64 -35
  74. data/Jenkinsfile +0 -11
@@ -19,7 +19,7 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
19
19
  # define the name that a user will see, this method may be deprecated as
20
20
  # the display name in PAT comes from the name field in measure.xml
21
21
  def name
22
- return 'ReduceVentilationByPercentage'
22
+ 'ReduceVentilationByPercentage'
23
23
  end
24
24
 
25
25
  # define the arguments that the user will input
@@ -40,7 +40,7 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
40
40
  # looping through sorted hash of model objects
41
41
  space_type_args_hash.sort.map do |key, value|
42
42
  # only include if space type is used in the model
43
- if !value.spaces.empty?
43
+ unless value.spaces.empty?
44
44
  space_type_handles << value.handle.to_s
45
45
  space_type_display_names << key
46
46
  end
@@ -52,20 +52,23 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
52
52
  space_type_display_names << '*Entire Building*'
53
53
 
54
54
  # make a choice argument for space type
55
- space_type = OpenStudio::Measure::OSArgument.makeChoiceArgument('space_type', space_type_handles, space_type_display_names)
55
+ space_type = OpenStudio::Measure::OSArgument.makeChoiceArgument('space_type', space_type_handles,
56
+ space_type_display_names)
56
57
  space_type.setDisplayName('Apply the Measure to a Specific Space Type or to the Entire Model.')
57
58
  space_type.setDefaultValue('*Entire Building*') # if no space type is chosen this will run on the entire building
58
59
  args << space_type
59
60
 
60
61
  # make an argument for reduction percentage
61
- design_spec_outdoor_air_reduction_percent = OpenStudio::Measure::OSArgument.makeDoubleArgument('design_spec_outdoor_air_reduction_percent', true)
62
+ design_spec_outdoor_air_reduction_percent = OpenStudio::Measure::OSArgument.makeDoubleArgument(
63
+ 'design_spec_outdoor_air_reduction_percent', true
64
+ )
62
65
  design_spec_outdoor_air_reduction_percent.setDisplayName('Design Specification Outdoor Air Reduction (%).')
63
66
  design_spec_outdoor_air_reduction_percent.setDefaultValue(30.0)
64
67
  args << design_spec_outdoor_air_reduction_percent
65
68
 
66
69
  # no cost required to reduce required amount of outdoor air. Cost increase or decrease will relate to system sizing and ongoing energy use due to change in outdoor air provided.
67
70
 
68
- return args
71
+ args
69
72
  end
70
73
 
71
74
  # define what happens when the measure is run
@@ -73,13 +76,13 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
73
76
  super(model, runner, user_arguments)
74
77
 
75
78
  # use the built-in error checking
76
- if !runner.validateUserArguments(arguments(model), user_arguments)
77
- return false
78
- end
79
+ return false unless runner.validateUserArguments(arguments(model), user_arguments)
79
80
 
80
81
  # assign the user inputs to variables
81
82
  object = runner.getOptionalWorkspaceObjectChoiceValue('space_type', user_arguments, model)
82
- design_spec_outdoor_air_reduction_percent = runner.getDoubleArgumentValue('design_spec_outdoor_air_reduction_percent', user_arguments)
83
+ design_spec_outdoor_air_reduction_percent = runner.getDoubleArgumentValue(
84
+ 'design_spec_outdoor_air_reduction_percent', user_arguments
85
+ )
83
86
 
84
87
  # check the space_type for reasonableness and see if measure should run on space type or on the entire building
85
88
  apply_to_building = false
@@ -92,15 +95,13 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
92
95
  runner.registerError("The selected space type with handle '#{handle}' was not found in the model. It may have been removed by another measure.")
93
96
  end
94
97
  return false
98
+ elsif !object.get.to_SpaceType.empty?
99
+ space_type = object.get.to_SpaceType.get
100
+ elsif !object.get.to_Building.empty?
101
+ apply_to_building = true
95
102
  else
96
- if !object.get.to_SpaceType.empty?
97
- space_type = object.get.to_SpaceType.get
98
- elsif !object.get.to_Building.empty?
99
- apply_to_building = true
100
- else
101
- runner.registerError('Script Error - argument not showing up as space type or building.')
102
- return false
103
- end
103
+ runner.registerError('Script Error - argument not showing up as space type or building.')
104
+ return false
104
105
  end
105
106
 
106
107
  # check the design_spec_outdoor_air_reduction_percent and for reasonableness
@@ -119,11 +120,11 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
119
120
 
120
121
  # helper to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure.
121
122
  def neat_numbers(number, roundto = 2) # round to 0 or 2)
122
- if roundto == 2
123
- number = format '%.2f', number
124
- else
125
- number = number.round
126
- end
123
+ number = if roundto == 2
124
+ format '%.2f', number
125
+ else
126
+ number.round
127
+ end
127
128
  # regex to add commas
128
129
  number.to_s.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\1,').reverse
129
130
  end
@@ -136,10 +137,10 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
136
137
  altered_instances = 0
137
138
 
138
139
  # reporting initial condition of model
139
- if !design_spec_outdoor_air_objects.empty?
140
- runner.registerInitialCondition("The initial model contained #{design_spec_outdoor_air_objects.size} design specification outdoor air objects.")
141
- else
140
+ if design_spec_outdoor_air_objects.empty?
142
141
  runner.registerInitialCondition('The initial model did not contain any design specification outdoor air.')
142
+ else
143
+ runner.registerInitialCondition("The initial model contained #{design_spec_outdoor_air_objects.size} design specification outdoor air objects.")
143
144
  end
144
145
 
145
146
  # get space types in model
@@ -157,22 +158,21 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
157
158
  design_spec_outdoor_air_objects.each do |design_spec_outdoor_air_object|
158
159
  direct_use_count = design_spec_outdoor_air_object.directUseCount
159
160
  next if direct_use_count <= 1
161
+
160
162
  direct_uses = design_spec_outdoor_air_object.sources
161
163
  original_cloned = false
162
164
 
163
165
  # adjust count test for direct uses that are component data
164
166
  direct_uses.each do |direct_use|
165
167
  component_data_source = direct_use.to_ComponentData
166
- if !component_data_source.empty?
167
- direct_use_count -= 1
168
- end
168
+ direct_use_count -= 1 unless component_data_source.empty?
169
169
  end
170
170
  next if direct_use_count <= 1
171
171
 
172
172
  direct_uses.each do |direct_use|
173
173
  # clone and hookup design spec OA
174
174
  space_type_source = direct_use.to_SpaceType
175
- if !space_type_source.empty?
175
+ unless space_type_source.empty?
176
176
  space_type_source = space_type_source.get
177
177
  cloned_object = design_spec_outdoor_air_object.clone
178
178
  space_type_source.setDesignSpecificationOutdoorAir(cloned_object.to_DesignSpecificationOutdoorAir.get)
@@ -180,12 +180,12 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
180
180
  end
181
181
 
182
182
  space_source = direct_use.to_Space
183
- if !space_source.empty?
184
- space_source = space_source.get
185
- cloned_object = design_spec_outdoor_air_object.clone
186
- space_source.setDesignSpecificationOutdoorAir(cloned_object.to_DesignSpecificationOutdoorAir.get)
187
- original_cloned = true
188
- end
183
+ next if space_source.empty?
184
+
185
+ space_source = space_source.get
186
+ cloned_object = design_spec_outdoor_air_object.clone
187
+ space_source.setDesignSpecificationOutdoorAir(cloned_object.to_DesignSpecificationOutdoorAir.get)
188
+ original_cloned = true
189
189
  end
190
190
 
191
191
  # delete the now unused design spec OA
@@ -196,15 +196,15 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
196
196
  end
197
197
 
198
198
  # def to alter performance and life cycle costs of objects
199
- def alter_performance(object, design_spec_outdoor_air_reduction_percent, runner)
199
+ def alter_performance(object, design_spec_outdoor_air_reduction_percent, _runner)
200
200
  # edit instance based on percentage reduction
201
201
  instance = object
202
202
 
203
203
  # not checking if fields are empty because these are optional like values for space infiltration are.
204
- new_outdoor_air_per_person = instance.setOutdoorAirFlowperPerson(instance.outdoorAirFlowperPerson - instance.outdoorAirFlowperPerson * design_spec_outdoor_air_reduction_percent * 0.01)
205
- new_outdoor_air_per_floor_area = instance.setOutdoorAirFlowperFloorArea(instance.outdoorAirFlowperFloorArea - instance.outdoorAirFlowperFloorArea * design_spec_outdoor_air_reduction_percent * 0.01)
206
- new_outdoor_air_ach = instance.setOutdoorAirFlowAirChangesperHour(instance.outdoorAirFlowAirChangesperHour - instance.outdoorAirFlowAirChangesperHour * design_spec_outdoor_air_reduction_percent * 0.01)
207
- new_outdoor_air_rate = instance.setOutdoorAirFlowRate(instance.outdoorAirFlowRate - instance.outdoorAirFlowRate * design_spec_outdoor_air_reduction_percent * 0.01)
204
+ new_outdoor_air_per_person = instance.setOutdoorAirFlowperPerson(instance.outdoorAirFlowperPerson - (instance.outdoorAirFlowperPerson * design_spec_outdoor_air_reduction_percent * 0.01))
205
+ new_outdoor_air_per_floor_area = instance.setOutdoorAirFlowperFloorArea(instance.outdoorAirFlowperFloorArea - (instance.outdoorAirFlowperFloorArea * design_spec_outdoor_air_reduction_percent * 0.01))
206
+ new_outdoor_air_ach = instance.setOutdoorAirFlowAirChangesperHour(instance.outdoorAirFlowAirChangesperHour - (instance.outdoorAirFlowAirChangesperHour * design_spec_outdoor_air_reduction_percent * 0.01))
207
+ new_outdoor_air_rate = instance.setOutdoorAirFlowRate(instance.outdoorAirFlowRate - (instance.outdoorAirFlowRate * design_spec_outdoor_air_reduction_percent * 0.01))
208
208
  end
209
209
 
210
210
  # array of instances to change
@@ -213,16 +213,15 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
213
213
  # loop through space types
214
214
  space_types.each do |space_type|
215
215
  next if space_type.spaces.size <= 0
216
+
216
217
  instances_array << space_type.designSpecificationOutdoorAir
217
218
  end
218
219
 
219
220
  # get spaces in model
220
221
  if apply_to_building
221
222
  spaces = model.getSpaces
222
- else
223
- if !space_type.spaces.empty?
224
- spaces = space_type.spaces # only run on a single space type
225
- end
223
+ elsif !space_type.spaces.empty?
224
+ spaces = space_type.spaces
226
225
  end
227
226
 
228
227
  spaces.each do |space|
@@ -233,10 +232,12 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
233
232
 
234
233
  instances_array.each do |instance|
235
234
  next if instance.empty?
235
+
236
236
  instance = instance.get
237
237
 
238
238
  # only continue if this instance has not been processed yet
239
239
  next if instance_processed.include? instance
240
+
240
241
  instance_processed << instance
241
242
 
242
243
  # call def to alter performance and life cycle costs
@@ -253,9 +254,11 @@ class ReduceVentilationByPercentage < OpenStudio::Measure::ModelMeasure
253
254
 
254
255
  # report final condition
255
256
  affected_area_ip = OpenStudio.convert(affected_area_si, 'm^2', 'ft^2').get
256
- runner.registerFinalCondition("#{altered_instances} design specification outdoor air objects in the model were altered affecting #{neat_numbers(affected_area_ip, 0)}(ft^2).")
257
+ runner.registerFinalCondition("#{altered_instances} design specification outdoor air objects in the model were altered affecting #{neat_numbers(
258
+ affected_area_ip, 0
259
+ )}(ft^2).")
257
260
 
258
- return true
261
+ true
259
262
  end
260
263
  end
261
264
 
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.1</schema_version>
4
4
  <name>reduce_ventilation_by_percentage</name>
5
5
  <uid>f0859a47-fddf-4962-9035-2f9fc9d6e283</uid>
6
- <version_id>2ab1bcb6-0d6d-4d00-8ccb-e0c1f9ec0179</version_id>
7
- <version_modified>2025-08-08T15:15:56Z</version_modified>
6
+ <version_id>7ed22a03-048f-434d-b7ad-23600275e8d8</version_id>
7
+ <version_modified>2025-09-25T15:33:42Z</version_modified>
8
8
  <xml_checksum>ECE70A70</xml_checksum>
9
9
  <class_name>ReduceVentilationByPercentage</class_name>
10
10
  <display_name>ReduceVentilationByPercentage</display_name>
@@ -17,10 +17,10 @@
17
17
  <type>Choice</type>
18
18
  <required>true</required>
19
19
  <model_dependent>false</model_dependent>
20
- <default_value>{a6e55f07-6997-4f72-af31-ce3fbcd38088}</default_value>
20
+ <default_value>{ae8a6595-172d-452d-8afc-2bfc8f03b75f}</default_value>
21
21
  <choices>
22
22
  <choice>
23
- <value>{a6e55f07-6997-4f72-af31-ce3fbcd38088}</value>
23
+ <value>{ae8a6595-172d-452d-8afc-2bfc8f03b75f}</value>
24
24
  <display_name>*Entire Building*</display_name>
25
25
  </choice>
26
26
  </choices>
@@ -79,7 +79,7 @@
79
79
  <filename>measure.rb</filename>
80
80
  <filetype>rb</filetype>
81
81
  <usage_type>script</usage_type>
82
- <checksum>9EE9A262</checksum>
82
+ <checksum>F3271DBA</checksum>
83
83
  </file>
84
84
  <file>
85
85
  <filename>EnvelopeAndLoadTestModel_01.osm</filename>
@@ -91,7 +91,7 @@
91
91
  <filename>ReduceVentilationByPercentage_Test.rb</filename>
92
92
  <filetype>rb</filetype>
93
93
  <usage_type>test</usage_type>
94
- <checksum>0439434E</checksum>
94
+ <checksum>10C306DB</checksum>
95
95
  </file>
96
96
  </files>
97
97
  </measure>
@@ -12,17 +12,17 @@
12
12
  class AddVariableSpeedRTUControlLogic < OpenStudio::Measure::EnergyPlusMeasure
13
13
  # human readable name
14
14
  def name
15
- return 'Add Variable Speed RTU Control Logic'
15
+ 'Add Variable Speed RTU Control Logic'
16
16
  end
17
17
 
18
18
  # human readable description
19
19
  def description
20
- return 'This measure adds control logic for a variable-speed RTU to the model. The control logic is responsible for staging the fan in response to the amount of heating/cooling required. It is meant to be paired specifically with the Create Variable Speed RTU OpenStudio measure. Users enter the fan flow rate fractions for up to nine different stages: ventilation, up to four cooling stages, and up to four heating stages. The measure examines the amount of heating/cooling required at each time step, identifies which heating/cooling stage is required to supply that amount of heating/cooling, and modifies the fan flow accordingly. This measure allows users to identify the impact of different fan flow control strategies.'
20
+ 'This measure adds control logic for a variable-speed RTU to the model. The control logic is responsible for staging the fan in response to the amount of heating/cooling required. It is meant to be paired specifically with the Create Variable Speed RTU OpenStudio measure. Users enter the fan flow rate fractions for up to nine different stages: ventilation, up to four cooling stages, and up to four heating stages. The measure examines the amount of heating/cooling required at each time step, identifies which heating/cooling stage is required to supply that amount of heating/cooling, and modifies the fan flow accordingly. This measure allows users to identify the impact of different fan flow control strategies.'
21
21
  end
22
22
 
23
23
  # human readable description of modeling approach
24
24
  def modeler_description
25
- return "This measure inserts EMS code for each airloop found to contain an AirLoopHVAC:UnitarySystem object. It is meant to be paired specifically with the Create Variable Speed RTU OpenStudio measure.
25
+ "This measure inserts EMS code for each airloop found to contain an AirLoopHVAC:UnitarySystem object. It is meant to be paired specifically with the Create Variable Speed RTU OpenStudio measure.
26
26
 
27
27
  Users can select the fan mass flow fractions for up to nine stages (ventilation, two or four cooling, and two or four heating). The default control logic is as follows:
28
28
  When the unit is ventilating (heating and cooling coil energy is zero), the fan flow rate is set to 40% of nominal.
@@ -35,7 +35,7 @@ The measure is set up so that a separate block of EMS code is inserted for each
35
35
  end
36
36
 
37
37
  # define the arguments that the user will input
38
- def arguments(workspace)
38
+ def arguments(_workspace)
39
39
  args = OpenStudio::Measure::OSArgumentVector.new
40
40
 
41
41
  # make an argument for ventilation fan speed fraction
@@ -45,54 +45,62 @@ The measure is set up so that a separate block of EMS code is inserted for each
45
45
  args << vent_fan_speed
46
46
 
47
47
  # make an argument for stage_one cooling fan speed fraction
48
- stage_one_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_one_cooling_fan_speed', false)
48
+ stage_one_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_one_cooling_fan_speed',
49
+ false)
49
50
  stage_one_cooling_fan_speed.setDisplayName('Fan speed fraction during stage one DX cooling.')
50
51
  stage_one_cooling_fan_speed.setDefaultValue(0.4)
51
52
  args << stage_one_cooling_fan_speed
52
53
 
53
54
  # make an argument for stage_two cooling fan speed fraction
54
- stage_two_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_two_cooling_fan_speed', false)
55
+ stage_two_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_two_cooling_fan_speed',
56
+ false)
55
57
  stage_two_cooling_fan_speed.setDisplayName('Fan speed fraction during stage two DX cooling.')
56
58
  stage_two_cooling_fan_speed.setDefaultValue(0.5)
57
59
  args << stage_two_cooling_fan_speed
58
60
 
59
61
  # make an argument for stage_three cooling fan speed fraction
60
- stage_three_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_three_cooling_fan_speed', false)
62
+ stage_three_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_three_cooling_fan_speed',
63
+ false)
61
64
  stage_three_cooling_fan_speed.setDisplayName('Fan speed fraction during stage three DX cooling. Not used for two-speed systems.')
62
65
  stage_three_cooling_fan_speed.setDefaultValue(0.75)
63
66
  args << stage_three_cooling_fan_speed
64
67
 
65
68
  # make an argument for stage_four cooling fan speed fraction
66
- stage_four_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_four_cooling_fan_speed', false)
69
+ stage_four_cooling_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_four_cooling_fan_speed',
70
+ false)
67
71
  stage_four_cooling_fan_speed.setDisplayName('Fan speed fraction during stage four DX cooling. Not used for two-speed systems.')
68
72
  stage_four_cooling_fan_speed.setDefaultValue(1.0)
69
73
  args << stage_four_cooling_fan_speed
70
74
 
71
75
  # make an argument for stage_one heating fan speed fraction
72
- stage_one_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_one_heating_fan_speed', false)
76
+ stage_one_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_one_heating_fan_speed',
77
+ false)
73
78
  stage_one_heating_fan_speed.setDisplayName('Fan speed fraction during stage one DX heating.')
74
79
  stage_one_heating_fan_speed.setDefaultValue(0.4)
75
80
  args << stage_one_heating_fan_speed
76
81
 
77
82
  # make an argument for stage_two heating fan speed fraction
78
- stage_two_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_two_heating_fan_speed', false)
83
+ stage_two_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_two_heating_fan_speed',
84
+ false)
79
85
  stage_two_heating_fan_speed.setDisplayName('Fan speed fraction during stage two DX heating.')
80
86
  stage_two_heating_fan_speed.setDefaultValue(0.5)
81
87
  args << stage_two_heating_fan_speed
82
88
 
83
89
  # make an argument for stage_three heating fan speed fraction
84
- stage_three_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_three_heating_fan_speed', false)
90
+ stage_three_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_three_heating_fan_speed',
91
+ false)
85
92
  stage_three_heating_fan_speed.setDisplayName('Fan speed fraction during stage three DX heating. Not used for two-speed systems.')
86
93
  stage_three_heating_fan_speed.setDefaultValue(0.75)
87
94
  args << stage_three_heating_fan_speed
88
95
 
89
96
  # make an argument for stage_four heating fan speed fraction
90
- stage_four_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_four_heating_fan_speed', false)
97
+ stage_four_heating_fan_speed = OpenStudio::Measure::OSArgument.makeDoubleArgument('stage_four_heating_fan_speed',
98
+ false)
91
99
  stage_four_heating_fan_speed.setDisplayName('Fan speed fraction during stage four DX heating. Not used for two-speed systems.')
92
100
  stage_four_heating_fan_speed.setDefaultValue(1.0)
93
101
  args << stage_four_heating_fan_speed
94
102
 
95
- return args
103
+ args
96
104
  end
97
105
 
98
106
  # define what happens when the measure is run
@@ -100,19 +108,19 @@ The measure is set up so that a separate block of EMS code is inserted for each
100
108
  super(workspace, runner, user_arguments)
101
109
 
102
110
  # use the built-in error checking
103
- if !runner.validateUserArguments(arguments(workspace), user_arguments)
104
- return false
105
- end
111
+ return false unless runner.validateUserArguments(arguments(workspace), user_arguments)
106
112
 
107
113
  # Assign the user inputs to variables
108
114
  vent_fan_speed = runner.getOptionalDoubleArgumentValue('vent_fan_speed', user_arguments)
109
115
  stage_one_cooling_fan_speed = runner.getOptionalDoubleArgumentValue('stage_one_cooling_fan_speed', user_arguments)
110
116
  stage_two_cooling_fan_speed = runner.getOptionalDoubleArgumentValue('stage_two_cooling_fan_speed', user_arguments)
111
- stage_three_cooling_fan_speed = runner.getOptionalDoubleArgumentValue('stage_three_cooling_fan_speed', user_arguments)
117
+ stage_three_cooling_fan_speed = runner.getOptionalDoubleArgumentValue('stage_three_cooling_fan_speed',
118
+ user_arguments)
112
119
  stage_four_cooling_fan_speed = runner.getOptionalDoubleArgumentValue('stage_four_cooling_fan_speed', user_arguments)
113
120
  stage_one_heating_fan_speed = runner.getOptionalDoubleArgumentValue('stage_one_heating_fan_speed', user_arguments)
114
121
  stage_two_heating_fan_speed = runner.getOptionalDoubleArgumentValue('stage_two_heating_fan_speed', user_arguments)
115
- stage_three_heating_fan_speed = runner.getOptionalDoubleArgumentValue('stage_three_heating_fan_speed', user_arguments)
122
+ stage_three_heating_fan_speed = runner.getOptionalDoubleArgumentValue('stage_three_heating_fan_speed',
123
+ user_arguments)
116
124
  stage_four_heating_fan_speed = runner.getOptionalDoubleArgumentValue('stage_four_heating_fan_speed', user_arguments)
117
125
 
118
126
  if vent_fan_speed.empty?
@@ -263,7 +271,7 @@ The measure is set up so that a separate block of EMS code is inserted for each
263
271
  selected_heating_coils = workspace.getObjectsByType(air_loop_heating_coil_type.to_s.to_IddObjectType)
264
272
  selected_heating_coils.each do |heating_coil|
265
273
  hc_name_test = heating_coil.getString(0, true).get
266
- puts hc_name_test.to_s
274
+ puts hc_name_test
267
275
  if "#{hc_name_test}.to_s" == "#{air_loop_heating_coil}.to_s"
268
276
  if air_loop_heating_coil_type.to_s == 'Coil:Heating:Gas'
269
277
  selected_heating_coil_outlet_node = heating_coil.getString(5, true).get
@@ -297,7 +305,7 @@ The measure is set up so that a separate block of EMS code is inserted for each
297
305
  selected_setpoint_manager.each do |setpoint_manager|
298
306
  setpoint_manager_setpoint_node_name = setpoint_manager.getString(7, true).get
299
307
  if selected_heating_coil_outlet_node.to_s == setpoint_manager_setpoint_node_name
300
- puts selected_heating_coil_outlet_node.to_s
308
+ puts selected_heating_coil_outlet_node
301
309
  setpoint_manager.setString(7, "#{revised_air_loop_name}_NodeList")
302
310
  end
303
311
  end
@@ -490,7 +498,7 @@ The measure is set up so that a separate block of EMS code is inserted for each
490
498
  SET #{revised_fan_name}_mass_flow_actuator = Timestep_Fan_Mass_Flow, !- Added for test of two actuator code
491
499
  ENDIF;
492
500
  "
493
- end
501
+ end
494
502
  end
495
503
 
496
504
  # Add EMS code to the model
@@ -519,8 +527,8 @@ The measure is set up so that a separate block of EMS code is inserted for each
519
527
  wsObject = workspace.addObject(object)
520
528
  end
521
529
 
522
- return true
523
- end # end the run method
530
+ true
531
+ end # end the run method
524
532
  end # end the measure
525
533
 
526
534
  # register the measure to be used by the application
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.1</schema_version>
4
4
  <name>add_variable_speed_rtu_control_logic</name>
5
5
  <uid>7d0aebdd-58c5-4e0e-9217-5dbdc82886fd</uid>
6
- <version_id>b13725eb-6a2f-4e6e-b32f-88ab5f59e0aa</version_id>
7
- <version_modified>2025-08-08T15:15:56Z</version_modified>
6
+ <version_id>8b199bc7-b1a0-4ec9-8255-a9086779973d</version_id>
7
+ <version_modified>2025-09-25T15:33:42Z</version_modified>
8
8
  <xml_checksum>A310923F</xml_checksum>
9
9
  <class_name>AddVariableSpeedRTUControlLogic</class_name>
10
10
  <display_name>Add Variable Speed RTU Control Logic</display_name>
@@ -153,13 +153,13 @@ The measure is set up so that a separate block of EMS code is inserted for each
153
153
  <filename>measure.rb</filename>
154
154
  <filetype>rb</filetype>
155
155
  <usage_type>script</usage_type>
156
- <checksum>DDAE53AF</checksum>
156
+ <checksum>5399B45F</checksum>
157
157
  </file>
158
158
  <file>
159
159
  <filename>add_variable_speed_rtu_control_logic_test.rb</filename>
160
160
  <filetype>rb</filetype>
161
161
  <usage_type>test</usage_type>
162
- <checksum>7BCFD2AF</checksum>
162
+ <checksum>FC202144</checksum>
163
163
  </file>
164
164
  </files>
165
165
  </measure>