openstudio-ee 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/CHANGELOG.md +7 -0
  4. data/Rakefile +0 -2
  5. data/lib/measures/GLHEProExportLoadsforGroundHeatExchangerSizing/measure.rb +1 -1
  6. data/lib/measures/GLHEProExportLoadsforGroundHeatExchangerSizing/measure.xml +3 -4
  7. data/lib/measures/nze_hvac/measure.rb +8 -6
  8. data/lib/measures/nze_hvac/measure.xml +9 -9
  9. data/lib/openstudio/ee_measures/version.rb +1 -1
  10. data/openstudio-ee.gemspec +6 -8
  11. metadata +11 -50
  12. data/lib/measures/ImproveFanTotalEfficiencybyPercentage/measure.rb +0 -333
  13. data/lib/measures/ImproveFanTotalEfficiencybyPercentage/measure.xml +0 -150
  14. data/lib/measures/ReplaceFanTotalEfficiency/measure.rb +0 -330
  15. data/lib/measures/ReplaceFanTotalEfficiency/measure.xml +0 -150
  16. data/lib/measures/add_apszhp_to_each_zone/measure.rb +0 -607
  17. data/lib/measures/add_apszhp_to_each_zone/measure.xml +0 -184
  18. data/lib/measures/add_energy_recovery_ventilator/measure.rb +0 -354
  19. data/lib/measures/add_energy_recovery_ventilator/measure.xml +0 -78
  20. data/lib/measures/improve_simple_glazing_by_percentage/measure.rb +0 -81
  21. data/lib/measures/improve_simple_glazing_by_percentage/measure.xml +0 -70
  22. data/lib/measures/reduce_water_use_by_percentage/measure.rb +0 -61
  23. data/lib/measures/reduce_water_use_by_percentage/measure.xml +0 -62
  24. data/lib/measures/replace_hvac_with_gshp_and_doas/measure.rb +0 -511
  25. data/lib/measures/replace_hvac_with_gshp_and_doas/measure.xml +0 -375
  26. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_AedgMeasures.rb +0 -454
  27. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_Constructions.rb +0 -221
  28. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_Geometry.rb +0 -41
  29. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_HVAC.rb +0 -1682
  30. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_HelperMethods.rb +0 -114
  31. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_LightingAndEquipment.rb +0 -99
  32. data/lib/measures/replace_hvac_with_gshp_and_doas/resources/OsLib_Schedules.rb +0 -142
  33. data/lib/measures/replace_simple_glazing/measure.rb +0 -86
  34. data/lib/measures/replace_simple_glazing/measure.xml +0 -78
  35. data/lib/measures/set_boiler_thermal_efficiency/measure.rb +0 -520
  36. data/lib/measures/set_boiler_thermal_efficiency/measure.xml +0 -78
  37. data/lib/measures/set_water_heater_efficiency_heat_lossand_peak_water_flow_rate/measure.rb +0 -207
  38. data/lib/measures/set_water_heater_efficiency_heat_lossand_peak_water_flow_rate/measure.xml +0 -78
  39. data/lib/measures/tenant_star_internal_loads/measure.rb +0 -134
  40. data/lib/measures/tenant_star_internal_loads/measure.xml +0 -67
  41. data/lib/measures/tenant_star_internal_loads/resources/os_lib_helper_methods.rb +0 -401
  42. data/lib/measures/vr_fwith_doas/measure.rb +0 -468
  43. data/lib/measures/vr_fwith_doas/measure.xml +0 -298
  44. data/lib/measures/vr_fwith_doas/resources/OsLib_AedgMeasures.rb +0 -454
  45. data/lib/measures/vr_fwith_doas/resources/OsLib_Constructions.rb +0 -221
  46. data/lib/measures/vr_fwith_doas/resources/OsLib_Geometry.rb +0 -41
  47. data/lib/measures/vr_fwith_doas/resources/OsLib_HVAC.rb +0 -1516
  48. data/lib/measures/vr_fwith_doas/resources/OsLib_HelperMethods.rb +0 -114
  49. data/lib/measures/vr_fwith_doas/resources/OsLib_LightingAndEquipment.rb +0 -99
  50. data/lib/measures/vr_fwith_doas/resources/OsLib_Schedules.rb +0 -142
@@ -1,78 +0,0 @@
1
- <measure>
2
- <schema_version>3.0</schema_version>
3
- <name>set_boiler_thermal_efficiency</name>
4
- <uid>467eb03a-8f18-4e91-a1b6-2f7eee9aac5b</uid>
5
- <version_id>fc86ee7c-650b-4af0-986d-1a8b4d12da97</version_id>
6
- <version_modified>20180123T182601Z</version_modified>
7
- <xml_checksum>3312C49F</xml_checksum>
8
- <class_name>SetBoilerThermalEfficiency</class_name>
9
- <display_name>SetBoilerThermalEfficiency</display_name>
10
- <description>Boiler thermal efficiency affects heating energy consumption. The measure offers two options to set the boiler thermal efficiency. Option 1 allows users to specify the efficiency inputs directly. Option 2 determines the boiler thermal efficiency based on the boiler type, the boiler capacity, the fuel type and the prescriptive requirement in ASHRAE Standard 90.1. Option 2 is only applicable to natural gas or oil fired boilers. </description>
11
- <modeler_description>The measure loops through the baseline model and identifies the OS:Boiler:HotWater and OS:Boiler:Steam objects. Users can choose one or all boilers from the drop down list to change their thermal efficiency settings. Then users need to select Option 1 or 2 using the check box. For Option 1, a boiler nominal thermal efficiency input is required and it is applied to the selected boilers. For Option 2, users need to specify the fuel type, boiler normal capacity, and the version of Standard 90.1. These inputs and the boiler type (hot water or steam) are used to identify the thermal efficiency requirement in the Standard 90.1, which is used to change the model. The initial and final values of the thermal efficiency are be reported during simulation. </modeler_description>
12
- <arguments>
13
- <argument>
14
- <name>info_widget</name>
15
- <display_name>!!!!*** This Measure is not Applicable to loaded Model. Read the description and choose an appropriate baseline model. ***!!!!</display_name>
16
- <type>Boolean</type>
17
- <required>true</required>
18
- <model_dependent>false</model_dependent>
19
- <default_value>true</default_value>
20
- <choices>
21
- <choice>
22
- <value>true</value>
23
- <display_name>true</display_name>
24
- </choice>
25
- <choice>
26
- <value>false</value>
27
- <display_name>false</display_name>
28
- </choice>
29
- </choices>
30
- </argument>
31
- </arguments>
32
- <outputs/>
33
- <provenances/>
34
- <tags>
35
- <tag>HVAC.Heating</tag>
36
- </tags>
37
- <attributes>
38
- <attribute>
39
- <name>Measure Function</name>
40
- <value>Measure</value>
41
- <datatype>string</datatype>
42
- </attribute>
43
- <attribute>
44
- <name>Requires EnergyPlus Results</name>
45
- <value>false</value>
46
- <datatype>boolean</datatype>
47
- </attribute>
48
- <attribute>
49
- <name>Uses SketchUp API</name>
50
- <value>false</value>
51
- <datatype>boolean</datatype>
52
- </attribute>
53
- <attribute>
54
- <name>Measure Type</name>
55
- <value>ModelMeasure</value>
56
- <datatype>string</datatype>
57
- </attribute>
58
- </attributes>
59
- <files>
60
- <file>
61
- <version>
62
- <software_program>OpenStudio</software_program>
63
- <identifier>1.0.0</identifier>
64
- <min_compatible>1.8.0</min_compatible>
65
- </version>
66
- <filename>measure.rb</filename>
67
- <filetype>rb</filetype>
68
- <usage_type>script</usage_type>
69
- <checksum>DB8CAB06</checksum>
70
- </file>
71
- <file>
72
- <filename>SetBoilerThermalEfficiency_Test.rb</filename>
73
- <filetype>rb</filetype>
74
- <usage_type>test</usage_type>
75
- <checksum>90DEF49F</checksum>
76
- </file>
77
- </files>
78
- </measure>
@@ -1,207 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # see the URL below for information on how to write OpenStudio measures
4
- # http://openstudio.nrel.gov/openstudio-measure-writing-guide
5
-
6
- # see the URL below for access to C++ documentation on model objects (click on "model" in the main window to view model objects)
7
- # http://openstudio.nrel.gov/sites/openstudio.nrel.gov/files/nv_data/cpp_documentation_it/model/html/namespaces.html
8
-
9
- # start the measure
10
- class SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate < OpenStudio::Ruleset::ModelUserScript
11
- # define the name that a user will see, this method may be deprecated as
12
- # the display name in PAT comes from the name field in measure.xml
13
- def name
14
- return 'SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate'
15
- end
16
-
17
- # define the arguments that the user will input
18
- def arguments(model)
19
- args = OpenStudio::Ruleset::OSArgumentVector.new
20
-
21
- # Determine how many air loops in model
22
- waterheater_handles = OpenStudio::StringVector.new
23
- waterheater_display_names = OpenStudio::StringVector.new
24
-
25
- # Get/show all airloop_hvac which has VAV terminal units from current loaded model.
26
- waterheater_handles << '0'
27
- waterheater_display_names << '*All service water heaters*'
28
-
29
- water_heaters = model.getWaterHeaterMixeds
30
- i_water_heater = 1
31
- water_heaters.each do |water_heater|
32
- waterheater_handles << i_water_heater.to_s
33
- waterheater_display_names << water_heater.name.to_s
34
-
35
- i_water_heater += 1
36
- end
37
-
38
- if i_water_heater == 1
39
- info_widget = OpenStudio::Ruleset::OSArgument.makeBoolArgument('info_widget', true)
40
- info_widget.setDisplayName('!!!!*** This Measure is not Applicable to loaded Model. Read the description and choose an appropriate baseline model. ***!!!!')
41
- info_widget.setDefaultValue(true)
42
- args << info_widget
43
- return args
44
- end
45
-
46
- waterheater_widget = OpenStudio::Ruleset::OSArgument.makeChoiceArgument('waterheater_widget', waterheater_handles, waterheater_display_names, true)
47
- waterheater_widget.setDisplayName('Apply the measure to')
48
- waterheater_widget.setDefaultValue(waterheater_display_names[0])
49
- args << waterheater_widget
50
-
51
- # make a choice argument for economizer control type
52
- heater_fuel_type_handles = OpenStudio::StringVector.new
53
- heater_fuel_type_display_names = OpenStudio::StringVector.new
54
-
55
- fuel_type_array = ['NaturalGas', 'Electricity', 'PropaneGas', 'FuelOil#1', 'FuelOil#2',\
56
- 'Coal', 'Diesel', 'Gasoline', 'OtherFuel1', 'OtherFuel2', 'Steam', 'DistrictHeating']
57
-
58
- for i in 0..fuel_type_array.size - 1
59
- heater_fuel_type_handles << i.to_s
60
- heater_fuel_type_display_names << fuel_type_array[i]
61
- end
62
-
63
- # make a choice argument for economizer control type
64
- heater_fuel_type_widget = OpenStudio::Ruleset::OSArgument.makeChoiceArgument('heater_fuel_type_widget', heater_fuel_type_handles, heater_fuel_type_display_names, true)
65
- heater_fuel_type_widget.setDisplayName('Fuel type')
66
- heater_fuel_type_widget.setDefaultValue(heater_fuel_type_display_names[0])
67
- args << heater_fuel_type_widget
68
-
69
- # make an argument for heater Thermal Efficiency (default of 0.8)
70
- heater_thermal_efficiency = OpenStudio::Ruleset::OSArgument.makeDoubleArgument('heater_thermal_efficiency', true)
71
- heater_thermal_efficiency.setDisplayName('Thermal efficiency [between 0 and 1]')
72
- heater_thermal_efficiency.setDefaultValue(0.8)
73
- args << heater_thermal_efficiency
74
-
75
- # make an argument for On/Off Cycle Loss Coefficient to Ambient Temperature [W/K] [W/K] (default of 0.0)
76
- onoff_cycle_loss_coefficient_to_ambient_temperature = OpenStudio::Ruleset::OSArgument.makeDoubleArgument('onoff_cycle_loss_coefficient_to_ambient_temperature', false)
77
- onoff_cycle_loss_coefficient_to_ambient_temperature.setDisplayName('Loss coefficient to ambient temperature [W/K] (optional input, baseline value will be used if empty)')
78
- onoff_cycle_loss_coefficient_to_ambient_temperature.setDefaultValue(0.0)
79
- args << onoff_cycle_loss_coefficient_to_ambient_temperature
80
-
81
- # make an argument for Peak Use Flow Rate [m3/s] (No default, thus to be blank)
82
- peak_use_flow_rate = OpenStudio::Ruleset::OSArgument.makeDoubleArgument('peak_use_flow_rate', false)
83
- peak_use_flow_rate.setDisplayName('Peak water use flow rate [m3/s] (optional input, baseline value will be used if empty)')
84
- peak_use_flow_rate.setDefaultValue(0.000379)
85
- args << peak_use_flow_rate
86
-
87
- return args
88
- end # end the arguments method
89
-
90
- # define what happens when the measure is run
91
- def run(model, runner, user_arguments)
92
- super(model, runner, user_arguments)
93
-
94
- # use the built-in error checking
95
- if !runner.validateUserArguments(arguments(model), user_arguments)
96
- return false
97
- end
98
-
99
- # Determine if the measure is applicable to the model, if not just return and no changes are made.
100
- info_widget = runner.getOptionalWorkspaceObjectChoiceValue('info_widget', user_arguments, model)
101
- if !(info_widget.nil? || info_widget.empty?)
102
- runner.registerInfo('This measure is not applicable.')
103
- return true
104
- end
105
-
106
- # assign the user inputs to variables
107
- waterheater_widget = runner.getOptionalWorkspaceObjectChoiceValue('waterheater_widget', user_arguments, model)
108
- heater_fuel_type_widget = runner.getOptionalWorkspaceObjectChoiceValue('heater_fuel_type_widget', user_arguments, model)
109
-
110
- handle = runner.getStringArgumentValue('waterheater_widget', user_arguments)
111
- waterheater_index = handle.to_i
112
-
113
- fuel_type_array = ['NaturalGas', 'Electricity', 'PropaneGas', 'FuelOil#1', 'FuelOil#2',\
114
- 'Coal', 'Diesel', 'Gasoline', 'OtherFuel1', 'OtherFuel2', 'Steam', 'DistrictHeating']
115
-
116
- handle = runner.getStringArgumentValue('heater_fuel_type_widget', user_arguments)
117
- heater_fuel_type = handle.to_i
118
- heater_fuel = fuel_type_array[heater_fuel_type]
119
-
120
- heater_thermal_efficiency = runner.getDoubleArgumentValue('heater_thermal_efficiency', user_arguments)
121
- onoff_cycle_loss_coefficient_to_ambient_temperature = runner.getDoubleArgumentValue('onoff_cycle_loss_coefficient_to_ambient_temperature', user_arguments)
122
-
123
- peak_use_flow_rate = runner.getDoubleArgumentValue('peak_use_flow_rate', user_arguments)
124
-
125
- if heater_thermal_efficiency <= 0
126
- runner.registerError("Enter a value greater than zero for the 'Heater Thermal Efficiency'.")
127
- elsif heater_thermal_efficiency > 1.0
128
- runner.registerError("Enter a value less than or equal to 1.0 for the 'HeaterThermal Efficiency'.")
129
- end
130
-
131
- # if not onoff_cycle_loss_coefficient_to_ambient_temperature.empty?
132
- # if onoff_cycle_loss_coefficient_to_ambient_temperature < 0
133
- # runner.registerError("Enter a value greater than or equal to zero for the 'On/Off Cycle Loss Coefficient to Ambient Temperature'.")
134
- # return false
135
- # elsif onoff_cycle_loss_coefficient_to_ambient_temperature == 0
136
- # runner.registerInfo("No heat loss was assumed.")
137
- # end
138
- # else
139
- # onoff_cycle_loss_coefficient_to_ambient_temperature = nil
140
- # end
141
- if onoff_cycle_loss_coefficient_to_ambient_temperature.is_a? Numeric
142
- if onoff_cycle_loss_coefficient_to_ambient_temperature < 0
143
- runner.registerError("Enter a value greater than or equal to zero for the 'On/Off Cycle Loss Coefficient to Ambient Temperature'.")
144
- return false
145
- elsif onoff_cycle_loss_coefficient_to_ambient_temperature == 0
146
- runner.registerInfo('No heat loss was assumed.')
147
- end
148
- else
149
- onoff_cycle_loss_coefficient_to_ambient_temperature = nil
150
- end
151
-
152
- if peak_use_flow_rate.is_a? Numeric
153
- if peak_use_flow_rate <= 0.0
154
- runner.registerError("Enter a value greater than zero for the 'Peak Use Flow Rate'.")
155
- end
156
- end
157
-
158
- i_water_heater = 0
159
- model.getWaterHeaterMixeds.each do |water_heater|
160
- i_water_heater += 1
161
-
162
- # check if AllAirloop is selected or not.
163
- if (waterheater_index != 0) && (waterheater_index != i_water_heater)
164
- next
165
- end
166
-
167
- if !water_heater.to_WaterHeaterMixed.empty?
168
- unit = water_heater.to_WaterHeaterMixed.get
169
-
170
- # get the original value for reporting
171
- heater_thermal_efficiency_old = unit.heaterThermalEfficiency
172
- oncycle_loss_coeff_old = unit.onCycleLossCoefficienttoAmbientTemperature
173
- offcycle_loss_coeff_old = unit.offCycleLossCoefficienttoAmbientTemperature
174
- peak_use_flow_old = unit.peakUseFlowRate
175
-
176
- runner.registerInfo("Initial: Heater Thermal Efficiency of '#{unit.name}' was #{heater_thermal_efficiency_old}.")
177
- runner.registerInfo("Initial: On Cycle Loss Coefficient to Ambient Temperature of '#{unit.name}' was #{oncycle_loss_coeff_old}.")
178
- runner.registerInfo("Initial: Off Cycle Loss Coefficient to Ambient Temperature'#{unit.name}' was #{offcycle_loss_coeff_old}.")
179
- if peak_use_flow_old.is_a? Numeric
180
- runner.registerInfo("Initial: Peak Use Flow Rate of '#{unit.name}' was #{peak_use_flow_old}.")
181
- end
182
-
183
- # now we have all user inputs, so set them to the new model
184
- unit.setHeaterFuelType(heater_fuel)
185
- unit.setHeaterThermalEfficiency(heater_thermal_efficiency)
186
- if !onoff_cycle_loss_coefficient_to_ambient_temperature.nil?
187
- unit.setOnCycleLossCoefficienttoAmbientTemperature(onoff_cycle_loss_coefficient_to_ambient_temperature)
188
- unit.setOffCycleLossCoefficienttoAmbientTemperature(onoff_cycle_loss_coefficient_to_ambient_temperature)
189
- runner.registerInfo("Final: On/Off Cycle Loss Coefficient to Ambient Temperature of '#{unit.name}' was set to be #{onoff_cycle_loss_coefficient_to_ambient_temperature}.")
190
- end
191
- if peak_use_flow_rate.is_a? Numeric
192
- unit.setPeakUseFlowRate(peak_use_flow_rate)
193
- end
194
-
195
- runner.registerInfo("Final: Heater Thermal Efficiency of '#{unit.name}' was set to be #{heater_thermal_efficiency}.")
196
- if peak_use_flow_rate.is_a? Numeric
197
- runner.registerInfo("Final: Peak Use Flow Rate of '#{unit.name}' was set to be #{peak_use_flow_rate}.")
198
- end
199
- end
200
- end
201
-
202
- return true
203
- end # end the run method
204
- end # end the measure
205
-
206
- # this allows the measure to be use by the application
207
- SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate.new.registerWithApplication
@@ -1,78 +0,0 @@
1
- <measure>
2
- <schema_version>3.0</schema_version>
3
- <name>set_water_heater_efficiency_heat_lossand_peak_water_flow_rate</name>
4
- <uid>dfcfc958-7afd-47e2-a978-f6d4315b7911</uid>
5
- <version_id>f257dbfb-9a15-4b41-a355-81ff06e66c8e</version_id>
6
- <version_modified>20180222T192106Z</version_modified>
7
- <xml_checksum>9365BC8B</xml_checksum>
8
- <class_name>SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate</class_name>
9
- <display_name>SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate</display_name>
10
- <description>High efficiency service water heaters with proper insulation save building energy consumption. This measure allows users to modify the water heater fuel type, thermal efficiency, heat loss coefficient to the ambient air temperature, and the peak hot water use flow rate. Note that the peak flow rate change only applies to standalone water heaters, not for those water heaters with plant loop connections.</description>
11
- <modeler_description>The measure loops through the baseline model and identifies the OS:WaterHeater:Mixed objects. Users can choose one or all water heaters from the drop down list to change the fuel type, thermal efficiency, heat loss coefficient to the ambient air temperature, and the peak hot water use flow rate. If these parameters are changed through the measure, their initial and final values are reported during simulation. </modeler_description>
12
- <arguments>
13
- <argument>
14
- <name>info_widget</name>
15
- <display_name>!!!!*** This Measure is not Applicable to loaded Model. Read the description and choose an appropriate baseline model. ***!!!!</display_name>
16
- <type>Boolean</type>
17
- <required>true</required>
18
- <model_dependent>false</model_dependent>
19
- <default_value>true</default_value>
20
- <choices>
21
- <choice>
22
- <value>true</value>
23
- <display_name>true</display_name>
24
- </choice>
25
- <choice>
26
- <value>false</value>
27
- <display_name>false</display_name>
28
- </choice>
29
- </choices>
30
- </argument>
31
- </arguments>
32
- <outputs/>
33
- <provenances/>
34
- <tags>
35
- <tag>Service Water Heating.Water Heating</tag>
36
- </tags>
37
- <attributes>
38
- <attribute>
39
- <name>Measure Function</name>
40
- <value>Measure</value>
41
- <datatype>string</datatype>
42
- </attribute>
43
- <attribute>
44
- <name>Requires EnergyPlus Results</name>
45
- <value>false</value>
46
- <datatype>boolean</datatype>
47
- </attribute>
48
- <attribute>
49
- <name>Uses SketchUp API</name>
50
- <value>false</value>
51
- <datatype>boolean</datatype>
52
- </attribute>
53
- <attribute>
54
- <name>Measure Type</name>
55
- <value>ModelMeasure</value>
56
- <datatype>string</datatype>
57
- </attribute>
58
- </attributes>
59
- <files>
60
- <file>
61
- <filename>SetWaterHeaterEfficiencyHeatLossandPeakWaterFlowRate_Test.rb</filename>
62
- <filetype>rb</filetype>
63
- <usage_type>test</usage_type>
64
- <checksum>4C80FA16</checksum>
65
- </file>
66
- <file>
67
- <version>
68
- <software_program>OpenStudio</software_program>
69
- <identifier>1.0.0</identifier>
70
- <min_compatible>1.8.0</min_compatible>
71
- </version>
72
- <filename>measure.rb</filename>
73
- <filetype>rb</filetype>
74
- <usage_type>script</usage_type>
75
- <checksum>A1CA6A60</checksum>
76
- </file>
77
- </files>
78
- </measure>
@@ -1,134 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # see the URL below for information on how to write OpenStudio measures
4
- # http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/
5
-
6
- # start the measure
7
- class TenantStarInternalLoads < OpenStudio::Ruleset::ModelUserScript
8
- require 'openstudio-standards'
9
-
10
- # require all .rb files in resources folder
11
- Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }
12
-
13
- # resource file modules
14
- include OsLib_HelperMethods
15
-
16
- # human readable name
17
- def name
18
- return 'Tenant Star Internal Loads'
19
- end
20
-
21
- # human readable description
22
- def description
23
- return 'Overrides existing model values for lightings, equipment, people, and infiltration.'
24
- end
25
-
26
- # human readable description of modeling approach
27
- def modeler_description
28
- return 'Lighting should be stacked value unless we add uncertainty. Equipment and people will vary based on information provided by tenant, and infiltration will be used for uncertainty. Schedules will be addressed in a separate measure that creates parametric schedules based on hours of operation.'
29
- end
30
-
31
- # define the arguments that the user will input
32
- def arguments(model)
33
- args = OpenStudio::Ruleset::OSArgumentVector.new
34
-
35
- # argument for lpd
36
- # note: the new consumption method is ontly setup to work on lights that are wattsperSpaceFloorArea and use ScheduleRulesets. It will fail with ruby error if that isn't the case, but for TenantStart this will be fine.
37
- # lpd = OpenStudio::Ruleset::OSArgument.makeDoubleArgument("lpd", true)
38
- # lpd.setDisplayName("Target Annual lighting power consumption")
39
- # lpd.setDefaultValue(5.0)
40
- # lpd.setUnits("kBtu/ft^2")
41
- # lpd.setDescription("This will be used to calculate an LPD by dividing annual consumption by annual_equivalent_full_load_hrs and floor area. Lighting schedules should not be changed after this measure has been run or consumpiton will not be as expected.")
42
- # args << lpd
43
-
44
- # argument for epd
45
- epd = OpenStudio::Ruleset::OSArgument.makeDoubleArgument('epd', true)
46
- epd.setDisplayName('Electric Equipment Power Density')
47
- epd.setDefaultValue(0.55) # 0.55 value came from 50% AEDG Table 4.7
48
- epd.setUnits('W/ft^2')
49
- epd.setDescription('Electric Power Density including servers.')
50
- args << epd
51
-
52
- # argument for people_per_floor_area
53
- # people_per_floor_area = OpenStudio::Ruleset::OSArgument.makeDoubleArgument("people_per_floor_area", true)
54
- # people_per_floor_area.setDisplayName("People per floor area")
55
- # people_per_floor_area.setDefaultValue(0.005) # default value based on medium office prototype
56
- # people_per_floor_area.setUnits("People/ft^2")
57
- # args << people_per_floor_area
58
-
59
- return args
60
- end
61
-
62
- # define what happens when the measure is run
63
- def run(model, runner, user_arguments)
64
- super(model, runner, user_arguments)
65
-
66
- # assign the user inputs to variables
67
- args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments(model))
68
- if !args then return false end
69
-
70
- # non_neg_args = ["lpd","epd","people_per_floor_area"]
71
- non_neg_args = ['epd']
72
- non_neg = OsLib_HelperMethods.checkDoubleAndIntegerArguments(runner, user_arguments, 'min' => 0.0, 'max' => nil, 'min_eq_bool' => true, 'max_eq_bool' => false, 'arg_array' => non_neg_args)
73
- if !non_neg then return false end
74
-
75
- # report initial condition of model
76
- # runner.registerInitialCondition("The building started with an installed LPD of #{ OpenStudio::convert(model.getBuilding.lightingPowerPerFloorArea,"W/m^2","W/ft^2").get} W/ft^2.")
77
-
78
- # calculate initial lighting consumtpion (assuming no daylight controls) to determine LPD adjustmnet multiplier)
79
- # initial_consumption = 0.0
80
- # model.getSpaceTypes.each do |space_type|
81
- # next if space_type.spaces.size == 0
82
- # space_type.lights.each do |light|
83
- # floor_area = space_type.floorArea
84
- # lpd = light.lightsDefinition.wattsperSpaceFloorArea.get
85
- # schedule = light.schedule.get
86
- # ann_equiv_hours = schedule.to_ScheduleRuleset.get.annual_equivalent_full_load_hrs
87
- # consumption = floor_area * lpd * ann_equiv_hours
88
- # runner.registerInfo("#{light.name} has #{ann_equiv_hours} annual equiv. hours with total consumption of #{consumption}.")
89
- # initial_consumption += consumption
90
- # end
91
- # end
92
-
93
- # calculate LPD multiplier
94
- # lpd_multiplier = OpenStudio::convert(model.getBuilding.floorArea,"m^2","ft^2").get * args['lpd']/OpenStudio::convert(initial_consumption,"Wh","kBtu").get
95
-
96
- # array of altered lighting defitinos (tracking so isn't altered twice)
97
- # altered_light_defs = []
98
-
99
- # loop through spae types altering loads
100
- # model.getSpaceTypes.each do |space_type|
101
- # next if space_type.spaces.size == 0
102
-
103
- # update lights
104
- # space_type.lights.each do |light|
105
- # light_def = light.lightsDefinition
106
- # if not altered_light_defs.include?(light_def)
107
- # light_def.setWattsperSpaceFloorArea(light_def.wattsperSpaceFloorArea.get * lpd_multiplier)
108
- # altered_light_defs << light_def
109
- # end
110
- # end
111
-
112
- # replace electric equipment
113
- model.getSpaceTypes.each do |space_type|
114
- epd_si = OpenStudio.convert(args['epd'], 'W/ft^2', 'W/m^2').get
115
- space_type.setElectricEquipmentPowerPerFloorArea(epd_si)
116
- runner.registerInfo("Changing EPD for plug loads for #{space_type.name} to #{args['epd']} (W/ft^2)")
117
- end
118
-
119
- # replace people
120
- # people_per_floor_area_si = OpenStudio::convert(args['people_per_floor_area'],"1/ft^2","1/m^2").get
121
- # space_type.setPeoplePerFloorArea(people_per_floor_area_si)
122
- # runner.registerInfo("Changing People per floor area for #{space_type.name} to #{args['people_per_floor_area']} (People/ft^2)")
123
-
124
- # end
125
-
126
- # report final condition of model
127
- # runner.registerFinalCondition("The building finished with an installed LPD of #{ OpenStudio::convert(model.getBuilding.lightingPowerPerFloorArea,"W/m^2","W/ft^2").get} W/ft^2.")
128
-
129
- return true
130
- end
131
- end
132
-
133
- # register the measure to be used by the application
134
- TenantStarInternalLoads.new.registerWithApplication