openstudio-common-measures 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +44 -0
  3. data/Rakefile +3 -0
  4. data/lib/measures/ChangeBuildingLocation/measure.xml +11 -11
  5. data/lib/measures/ExportScheduleCSV/measure.rb +1 -1
  6. data/lib/measures/ExportScheduleCSV/measure.xml +16 -15
  7. data/lib/measures/ImportEnvelopeAndInternalLoadsFromIdf/measure.xml +7 -6
  8. data/lib/measures/MeterFlodPlot/measure.rb +1 -1
  9. data/lib/measures/MeterFlodPlot/measure.xml +16 -15
  10. data/lib/measures/ReportModelChanges/measure.xml +2 -2
  11. data/lib/measures/RunPeriodMultiple/measure.xml +12 -11
  12. data/lib/measures/ServerDirectoryCleanup/README.md +97 -3
  13. data/lib/measures/ServerDirectoryCleanup/measure.rb +1 -1
  14. data/lib/measures/ServerDirectoryCleanup/measure.xml +10 -59
  15. data/lib/measures/UnmetLoadHoursTroubleshooting/README.md +9 -3
  16. data/lib/measures/UnmetLoadHoursTroubleshooting/measure.rb +1 -1
  17. data/lib/measures/UnmetLoadHoursTroubleshooting/measure.xml +66 -17
  18. data/lib/measures/VentilationQAQC/README.md +9 -3
  19. data/lib/measures/VentilationQAQC/measure.rb +52 -45
  20. data/lib/measures/VentilationQAQC/measure.xml +25 -30
  21. data/lib/measures/ZoneReport/README.md +2 -2
  22. data/lib/measures/ZoneReport/measure.rb +1 -1
  23. data/lib/measures/ZoneReport/measure.xml +10 -11
  24. data/lib/measures/add_ems_to_control_ev_charging/LICENSE.MD.txt +15 -0
  25. data/lib/measures/{AddDaylightSensors → add_ems_to_control_ev_charging}/LICENSE.md +0 -0
  26. data/lib/measures/add_ems_to_control_ev_charging/ReadMe.MD +29 -0
  27. data/lib/measures/add_ems_to_control_ev_charging/measure.rb +288 -0
  28. data/lib/measures/add_ems_to_control_ev_charging/measure.xml +87 -0
  29. data/lib/measures/add_ev_load/LICENSE.MD.txt +15 -0
  30. data/lib/measures/{EnableDemandControlledVentilation → add_ev_load}/LICENSE.md +0 -0
  31. data/lib/measures/add_ev_load/ReadMe.MD +34 -0
  32. data/lib/measures/add_ev_load/measure.rb +328 -0
  33. data/lib/measures/add_ev_load/measure.xml +153 -0
  34. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/PSN_BuildingKey.csv +104 -0
  35. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/PSN_BuildingKey_v2.csv +104 -0
  36. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow1_flex1.csv +96 -0
  37. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow1_flex2.csv +96 -0
  38. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow1_flex3.csv +96 -0
  39. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow2_flex1.csv +96 -0
  40. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow2_flex2.csv +96 -0
  41. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow2_flex3.csv +96 -0
  42. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow3_flex1.csv +96 -0
  43. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow3_flex2.csv +96 -0
  44. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg1_dow3_flex3.csv +96 -0
  45. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow1_flex1.csv +96 -0
  46. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow1_flex2.csv +96 -0
  47. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow1_flex3.csv +96 -0
  48. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow2_flex1.csv +96 -0
  49. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow2_flex2.csv +96 -0
  50. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow2_flex3.csv +96 -0
  51. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow3_flex1.csv +96 -0
  52. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow3_flex2.csv +96 -0
  53. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg2_dow3_flex3.csv +96 -0
  54. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow1_flex1.csv +96 -0
  55. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow1_flex2.csv +96 -0
  56. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow1_flex3.csv +96 -0
  57. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow2_flex1.csv +96 -0
  58. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow2_flex2.csv +96 -0
  59. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow2_flex3.csv +96 -0
  60. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow3_flex1.csv +96 -0
  61. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow3_flex2.csv +96 -0
  62. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/chg3_dow3_flex3.csv +96 -0
  63. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/fast_charge_15min_Saturday.csv +96 -0
  64. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/fast_charge_15min_Sunday.csv +96 -0
  65. data/lib/measures/add_ev_load/resources/EV_Load_Profiles/fast_charge_15min_Weekday.csv +96 -0
  66. data/lib/measures/envelope_and_internal_load_breakdown/README.md +4 -3
  67. data/lib/measures/envelope_and_internal_load_breakdown/measure.rb +7 -4
  68. data/lib/measures/envelope_and_internal_load_breakdown/measure.xml +16 -17
  69. data/lib/measures/envelope_and_internal_load_breakdown/resources/report.html.erb +1 -0
  70. data/lib/measures/example_report/README.md +27 -5
  71. data/lib/measures/example_report/measure.rb +7 -4
  72. data/lib/measures/example_report/measure.xml +16 -29
  73. data/lib/measures/example_report/resources/report.html.erb +1 -0
  74. data/lib/measures/gem_env_report/measure.xml +1 -1
  75. data/lib/measures/generic_qaqc/README.md +187 -5
  76. data/lib/measures/generic_qaqc/measure.rb +1 -1
  77. data/lib/measures/generic_qaqc/measure.xml +15 -85
  78. data/lib/measures/generic_qaqc/resources/report.html.erb +1 -0
  79. data/lib/measures/hvac_psychrometric_chart/README.md +11 -5
  80. data/lib/measures/hvac_psychrometric_chart/measure.rb +1 -1
  81. data/lib/measures/hvac_psychrometric_chart/measure.xml +13 -18
  82. data/lib/measures/hvac_psychrometric_chart/resources/report.html.erb +1 -0
  83. data/lib/measures/inject_idf_objects/measure.xml +25 -24
  84. data/lib/measures/openstudio_results/README.md +195 -5
  85. data/lib/measures/openstudio_results/measure.rb +2 -2
  86. data/lib/measures/openstudio_results/measure.xml +30 -154
  87. data/lib/measures/openstudio_results/resources/report.html.erb +1 -0
  88. data/lib/measures/set_run_period/measure.xml +2 -2
  89. data/lib/measures/{EnableEconomizerControl → view_data}/LICENSE.md +0 -0
  90. data/lib/measures/view_data/README.md +64 -0
  91. data/lib/measures/{AddDaylightSensors → view_data}/README.md.erb +0 -0
  92. data/lib/measures/view_data/measure.rb +454 -0
  93. data/lib/measures/view_data/measure.xml +159 -0
  94. data/lib/measures/view_data/resources/report.html.in +2881 -0
  95. data/lib/measures/view_data/resources/va3c.rb +1021 -0
  96. data/lib/measures/{ImproveFanBeltEfficiency → view_model}/LICENSE.md +0 -0
  97. data/lib/measures/view_model/README.md +26 -0
  98. data/lib/measures/{EnableDemandControlledVentilation → view_model}/README.md.erb +0 -0
  99. data/lib/measures/view_model/measure.rb +146 -0
  100. data/lib/measures/view_model/measure.xml +98 -0
  101. data/lib/measures/view_model/resources/report.html.in +2881 -0
  102. data/lib/measures/view_model/resources/va3c.rb +1021 -0
  103. data/lib/openstudio/common_measures/version.rb +1 -1
  104. data/openstudio-common-measures.gemspec +1 -1
  105. metadata +61 -71
  106. data/lib/measures/AddDaylightSensors/README.md +0 -136
  107. data/lib/measures/AddDaylightSensors/measure.rb +0 -521
  108. data/lib/measures/AddDaylightSensors/measure.xml +0 -233
  109. data/lib/measures/EnableDemandControlledVentilation/README.md +0 -32
  110. data/lib/measures/EnableDemandControlledVentilation/measure.rb +0 -154
  111. data/lib/measures/EnableDemandControlledVentilation/measure.xml +0 -99
  112. data/lib/measures/EnableEconomizerControl/README.md +0 -48
  113. data/lib/measures/EnableEconomizerControl/README.md.erb +0 -42
  114. data/lib/measures/EnableEconomizerControl/measure.rb +0 -172
  115. data/lib/measures/EnableEconomizerControl/measure.xml +0 -124
  116. data/lib/measures/ImproveFanBeltEfficiency/README.md +0 -104
  117. data/lib/measures/ImproveFanBeltEfficiency/README.md.erb +0 -42
  118. data/lib/measures/ImproveFanBeltEfficiency/measure.rb +0 -366
  119. data/lib/measures/ImproveFanBeltEfficiency/measure.xml +0 -185
  120. data/lib/measures/ImproveMotorEfficiency/LICENSE.md +0 -27
  121. data/lib/measures/ImproveMotorEfficiency/README.md +0 -104
  122. data/lib/measures/ImproveMotorEfficiency/README.md.erb +0 -42
  123. data/lib/measures/ImproveMotorEfficiency/measure.rb +0 -365
  124. data/lib/measures/ImproveMotorEfficiency/measure.xml +0 -182
  125. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/LICENSE.md +0 -27
  126. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/README.md +0 -64
  127. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/README.md.erb +0 -42
  128. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.rb +0 -422
  129. data/lib/measures/IncreaseInsulationRValueForExteriorWalls/measure.xml +0 -150
  130. data/lib/measures/IncreaseInsulationRValueForRoofs/LICENSE.md +0 -27
  131. data/lib/measures/IncreaseInsulationRValueForRoofs/README.md +0 -64
  132. data/lib/measures/IncreaseInsulationRValueForRoofs/README.md.erb +0 -42
  133. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.rb +0 -422
  134. data/lib/measures/IncreaseInsulationRValueForRoofs/measure.xml +0 -143
  135. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/LICENSE.md +0 -27
  136. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/README.md +0 -97
  137. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/README.md.erb +0 -42
  138. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.rb +0 -450
  139. data/lib/measures/ReduceElectricEquipmentLoadsByPercentage/measure.xml +0 -186
  140. data/lib/measures/ReduceLightingLoadsByPercentage/LICENSE.md +0 -27
  141. data/lib/measures/ReduceLightingLoadsByPercentage/README.md +0 -96
  142. data/lib/measures/ReduceLightingLoadsByPercentage/README.md.erb +0 -42
  143. data/lib/measures/ReduceLightingLoadsByPercentage/measure.rb +0 -513
  144. data/lib/measures/ReduceLightingLoadsByPercentage/measure.xml +0 -191
  145. data/lib/measures/ReduceSpaceInfiltrationByPercentage/LICENSE.md +0 -27
  146. data/lib/measures/ReduceSpaceInfiltrationByPercentage/README.md +0 -104
  147. data/lib/measures/ReduceSpaceInfiltrationByPercentage/README.md.erb +0 -42
  148. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.rb +0 -349
  149. data/lib/measures/ReduceSpaceInfiltrationByPercentage/measure.xml +0 -181
  150. data/lib/measures/ReduceVentilationByPercentage/LICENSE.md +0 -27
  151. data/lib/measures/ReduceVentilationByPercentage/README.md +0 -40
  152. data/lib/measures/ReduceVentilationByPercentage/README.md.erb +0 -42
  153. data/lib/measures/ReduceVentilationByPercentage/measure.rb +0 -291
  154. data/lib/measures/ReduceVentilationByPercentage/measure.xml +0 -96
  155. data/lib/measures/VentilationQAQC/ExampleModel.osm +0 -28468
  156. data/lib/measures/create_variable_speed_rtu/LICENSE.md +0 -27
  157. data/lib/measures/create_variable_speed_rtu/README.md +0 -120
  158. data/lib/measures/create_variable_speed_rtu/README.md.erb +0 -42
  159. data/lib/measures/create_variable_speed_rtu/measure.rb +0 -539
  160. data/lib/measures/create_variable_speed_rtu/measure.xml +0 -207
  161. data/lib/measures/radiant_slab_with_doas/LICENSE.md +0 -27
  162. data/lib/measures/radiant_slab_with_doas/README.md +0 -156
  163. data/lib/measures/radiant_slab_with_doas/README.md.erb +0 -42
  164. data/lib/measures/radiant_slab_with_doas/measure.rb +0 -403
  165. data/lib/measures/radiant_slab_with_doas/measure.xml +0 -345
@@ -1,27 +0,0 @@
1
- OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without modification, are permitted
4
- provided that the following conditions are met:
5
-
6
- (1) Redistributions of source code must retain the above copyright notice, this list of conditions
7
- and the following disclaimer.
8
-
9
- (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions
10
- and the following disclaimer in the documentation and/or other materials provided with the distribution.
11
-
12
- (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse
13
- or promote products derived from this software without specific prior written permission from the
14
- respective party.
15
-
16
- (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other
17
- derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar
18
- designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
21
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22
- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT,
23
- OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
25
- OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26
- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,104 +0,0 @@
1
-
2
-
3
- ###### (Automatically generated documentation)
4
-
5
- # Improve Motor Efficiency in Selected Fans and Pumps
6
-
7
- ## Description
8
-
9
-
10
- ## Modeler Description
11
-
12
-
13
- ## Measure Type
14
- ModelMeasure
15
-
16
- ## Taxonomy
17
-
18
-
19
- ## Arguments
20
-
21
-
22
- ### Choose a Plant or Air Loop to Alter.
23
-
24
- **Name:** object,
25
- **Type:** Choice,
26
- **Units:** ,
27
- **Required:** true,
28
- **Model Dependent:** false
29
-
30
- ### Set Motor Efficiency(%).
31
-
32
- **Name:** motor_eff,
33
- **Type:** Double,
34
- **Units:** ,
35
- **Required:** true,
36
- **Model Dependent:** false
37
-
38
- ### Remove Baseline Costs From Effected Fans and Pumps?
39
-
40
- **Name:** remove_costs,
41
- **Type:** Boolean,
42
- **Units:** ,
43
- **Required:** true,
44
- **Model Dependent:** false
45
-
46
- ### Material and Installation Costs per Motor ($).
47
-
48
- **Name:** material_cost,
49
- **Type:** Double,
50
- **Units:** ,
51
- **Required:** true,
52
- **Model Dependent:** false
53
-
54
- ### Demolition Costs per Motor ($).
55
-
56
- **Name:** demolition_cost,
57
- **Type:** Double,
58
- **Units:** ,
59
- **Required:** true,
60
- **Model Dependent:** false
61
-
62
- ### Years Until Costs Start (whole years).
63
-
64
- **Name:** years_until_costs_start,
65
- **Type:** Integer,
66
- **Units:** ,
67
- **Required:** true,
68
- **Model Dependent:** false
69
-
70
- ### Demolition Costs Occur During Initial Construction?
71
-
72
- **Name:** demo_cost_initial_const,
73
- **Type:** Boolean,
74
- **Units:** ,
75
- **Required:** true,
76
- **Model Dependent:** false
77
-
78
- ### Expected Life (whole years).
79
-
80
- **Name:** expected_life,
81
- **Type:** Integer,
82
- **Units:** ,
83
- **Required:** true,
84
- **Model Dependent:** false
85
-
86
- ### O & M Costs per Motor ($).
87
-
88
- **Name:** om_cost,
89
- **Type:** Double,
90
- **Units:** ,
91
- **Required:** true,
92
- **Model Dependent:** false
93
-
94
- ### O & M Frequency (whole years).
95
-
96
- **Name:** om_frequency,
97
- **Type:** Integer,
98
- **Units:** ,
99
- **Required:** true,
100
- **Model Dependent:** false
101
-
102
-
103
-
104
-
@@ -1,42 +0,0 @@
1
- <%#= README.md.erb is used to auto-generate README.md. %>
2
- <%#= To manually maintain README.md throw away README.md.erb and manually edit README.md %>
3
- ###### (Automatically generated documentation)
4
-
5
- # <%= name %>
6
-
7
- ## Description
8
- <%= description %>
9
-
10
- ## Modeler Description
11
- <%= modelerDescription %>
12
-
13
- ## Measure Type
14
- <%= measureType %>
15
-
16
- ## Taxonomy
17
- <%= taxonomy %>
18
-
19
- ## Arguments
20
-
21
- <% arguments.each do |argument| %>
22
- ### <%= argument[:display_name] %>
23
- <%= argument[:description] %>
24
- **Name:** <%= argument[:name] %>,
25
- **Type:** <%= argument[:type] %>,
26
- **Units:** <%= argument[:units] %>,
27
- **Required:** <%= argument[:required] %>,
28
- **Model Dependent:** <%= argument[:model_dependent] %>
29
- <% end %>
30
-
31
- <% if arguments.size == 0 %>
32
- <%= "This measure does not have any user arguments" %>
33
- <% end %>
34
-
35
- <% if outputs.size > 0 %>
36
- ## Outputs
37
- <% output_names = [] %>
38
- <% outputs.each do |output| %>
39
- <% output_names << output[:display_name] %>
40
- <% end %>
41
- <%= output_names.join(", ") %>
42
- <% end %>
@@ -1,365 +0,0 @@
1
- # *******************************************************************************
2
- # OpenStudio(R), Copyright (c) 2008-2020, 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
- # start the measure
37
- class ImproveMotorEfficiency < OpenStudio::Measure::ModelMeasure
38
- # define the name that a user will see, this method may be deprecated as
39
- # the display name in PAT comes from the name field in measure.xml
40
- def name
41
- return 'Improve Motor Efficiency in Selected Fans and Pumps'
42
- end
43
-
44
- # define the arguments that the user will input
45
- def arguments(model)
46
- args = OpenStudio::Measure::OSArgumentVector.new
47
-
48
- # populate choice argument for constructions that are applied to surfaces in the model
49
- loop_handles = OpenStudio::StringVector.new
50
- loop_display_names = OpenStudio::StringVector.new
51
-
52
- # putting loops and names into hash
53
- loop_args = model.getLoops
54
- loop_args_hash = {}
55
- loop_args.each do |loop_arg|
56
- loop_args_hash[loop_arg.name.to_s] = loop_arg
57
- end
58
-
59
- # looping through sorted hash of air loops
60
- loop_args_hash.sort.map do |key, value|
61
- show_loop = false
62
- components = value.supplyComponents
63
- components.each do |component|
64
- if !component.to_FanConstantVolume.empty?
65
- show_loop = true
66
- end
67
- if !component.to_FanVariableVolume.empty?
68
- show_loop = true
69
- end
70
- if !component.to_FanOnOff.empty?
71
- show_loop = true
72
- end
73
- if !component.to_PumpConstantSpeed.empty?
74
- show_loop = true
75
- end
76
- if !component.to_PumpVariableSpeed.empty?
77
- show_loop = true
78
- end
79
- end
80
-
81
- # if loop as object of correct type then add to hash.
82
- if show_loop == true
83
- loop_handles << value.handle.to_s
84
- loop_display_names << key
85
- end
86
- end
87
-
88
- # add building to string vector with air loops
89
- building = model.getBuilding
90
- loop_handles << building.handle.to_s
91
- loop_display_names << '*All Plant and Air Loops*'
92
-
93
- # make an argument for air loops
94
- object = OpenStudio::Measure::OSArgument.makeChoiceArgument('object', loop_handles, loop_display_names, true)
95
- object.setDisplayName('Choose a Plant or Air Loop to Alter.')
96
- object.setDefaultValue('*All Plant and Air Loops*') # if no loop is chosen this will run on all air loops
97
- args << object
98
-
99
- # make an argument to add new space true/false
100
- motor_eff = OpenStudio::Measure::OSArgument.makeDoubleArgument('motor_eff', true)
101
- motor_eff.setDisplayName('Set Motor Efficiency(%).')
102
- motor_eff.setDefaultValue(96.0)
103
- args << motor_eff
104
-
105
- # bool argument to remove existing costs
106
- remove_costs = OpenStudio::Measure::OSArgument.makeBoolArgument('remove_costs', true)
107
- remove_costs.setDisplayName('Remove Baseline Costs From Effected Fans and Pumps?')
108
- remove_costs.setDefaultValue(false)
109
- args << remove_costs
110
-
111
- # make an argument for material and installation cost
112
- material_cost = OpenStudio::Measure::OSArgument.makeDoubleArgument('material_cost', true)
113
- material_cost.setDisplayName('Material and Installation Costs per Motor ($).')
114
- material_cost.setDefaultValue(0.0)
115
- args << material_cost
116
-
117
- # make an argument for demolition cost
118
- demolition_cost = OpenStudio::Measure::OSArgument.makeDoubleArgument('demolition_cost', true)
119
- demolition_cost.setDisplayName('Demolition Costs per Motor ($).')
120
- demolition_cost.setDefaultValue(0.0)
121
- args << demolition_cost
122
-
123
- # make an argument for duration in years until costs start
124
- years_until_costs_start = OpenStudio::Measure::OSArgument.makeIntegerArgument('years_until_costs_start', true)
125
- years_until_costs_start.setDisplayName('Years Until Costs Start (whole years).')
126
- years_until_costs_start.setDefaultValue(0)
127
- args << years_until_costs_start
128
-
129
- # make an argument to determine if demolition costs should be included in initial construction
130
- demo_cost_initial_const = OpenStudio::Measure::OSArgument.makeBoolArgument('demo_cost_initial_const', true)
131
- demo_cost_initial_const.setDisplayName('Demolition Costs Occur During Initial Construction?')
132
- demo_cost_initial_const.setDefaultValue(false)
133
- args << demo_cost_initial_const
134
-
135
- # make an argument for expected life
136
- expected_life = OpenStudio::Measure::OSArgument.makeIntegerArgument('expected_life', true)
137
- expected_life.setDisplayName('Expected Life (whole years).')
138
- expected_life.setDefaultValue(20)
139
- args << expected_life
140
-
141
- # make an argument for o&m cost
142
- om_cost = OpenStudio::Measure::OSArgument.makeDoubleArgument('om_cost', true)
143
- om_cost.setDisplayName('O & M Costs per Motor ($).')
144
- om_cost.setDefaultValue(0.0)
145
- args << om_cost
146
-
147
- # make an argument for o&m frequency
148
- om_frequency = OpenStudio::Measure::OSArgument.makeIntegerArgument('om_frequency', true)
149
- om_frequency.setDisplayName('O & M Frequency (whole years).')
150
- om_frequency.setDefaultValue(1)
151
- args << om_frequency
152
-
153
- return args
154
- end
155
-
156
- # define what happens when the measure is cop
157
- def run(model, runner, user_arguments)
158
- super(model, runner, user_arguments)
159
-
160
- # use the built-in error checking
161
- if !runner.validateUserArguments(arguments(model), user_arguments)
162
- return false
163
- end
164
-
165
- # assign the user inputs to variables
166
- object = runner.getOptionalWorkspaceObjectChoiceValue('object', user_arguments, model) # model is passed in because of argument type
167
- motor_eff = runner.getDoubleArgumentValue('motor_eff', user_arguments)
168
- remove_costs = runner.getBoolArgumentValue('remove_costs', user_arguments)
169
- material_cost = runner.getDoubleArgumentValue('material_cost', user_arguments)
170
- demolition_cost = runner.getDoubleArgumentValue('demolition_cost', user_arguments)
171
- years_until_costs_start = runner.getIntegerArgumentValue('years_until_costs_start', user_arguments)
172
- demo_cost_initial_const = runner.getBoolArgumentValue('demo_cost_initial_const', user_arguments)
173
- expected_life = runner.getIntegerArgumentValue('expected_life', user_arguments)
174
- om_cost = runner.getDoubleArgumentValue('om_cost', user_arguments)
175
- om_frequency = runner.getIntegerArgumentValue('om_frequency', user_arguments)
176
-
177
- # check the loop for reasonableness
178
- apply_to_all_loops = false
179
- loop = nil
180
- if object.empty?
181
- handle = runner.getStringArgumentValue('loop', user_arguments)
182
- if handle.empty?
183
- runner.registerError('No loop was chosen.')
184
- else
185
- runner.registerError("The selected loop with handle '#{handle}' was not found in the model. It may have been removed by another measure.")
186
- end
187
- return false
188
- else
189
- if !object.get.to_Loop.empty?
190
- loop = object.get.to_Loop.get
191
- elsif !object.get.to_Building.empty?
192
- apply_to_all_loops = true
193
- else
194
- runner.registerError('Script Error - argument not showing up as loop.')
195
- return false
196
- end
197
- end
198
-
199
- # check the user_name for reasonableness
200
- if (motor_eff <= 0) || (motor_eff >= 100)
201
- runner.registerError('Please enter a number between 0 and 100 for motor efficiency percentage.')
202
- return false
203
- end
204
-
205
- # set flags to use later
206
- costs_requested = false
207
-
208
- # set values to use later
209
- yr0_capital_totalCosts_baseline = 0
210
- yr0_capital_totalCosts_proposed = 0
211
-
212
- # If demo_cost_initial_const is true then will be applied once in the lifecycle. Future replacements use the demo cost of the new construction.
213
- demo_costs_of_baseline_objects = 0
214
-
215
- # check costs for reasonableness
216
- if material_cost.abs + demolition_cost.abs + om_cost.abs == 0
217
- runner.registerInfo('No costs were requested for motors improvements.')
218
- else
219
- costs_requested = true
220
- end
221
-
222
- # check lifecycle arguments for reasonableness
223
- if (years_until_costs_start < 0) && (years_until_costs_start > expected_life)
224
- runner.registerError('Years until costs start should be a non-negative integer less than Expected Life.')
225
- end
226
- if (expected_life < 1) && (expected_life > 100)
227
- runner.registerError('Choose an integer greater than 0 and less than or equal to 100 for Expected Life.')
228
- end
229
- if om_frequency < 1
230
- runner.registerError('Choose an integer greater than 0 for O & M Frequency.')
231
- end
232
-
233
- # short def to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure
234
- def neat_numbers(number, roundto = 2) # round to 0 or 2)
235
- if roundto == 2
236
- number = format '%.2f', number
237
- else
238
- number = number.round
239
- end
240
- # regex to add commas
241
- number.to_s.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\1,').reverse
242
- end
243
-
244
- # helper that loops through lifecycle costs getting total costs under "Construction" or "Salvage" category and add to counter if occurs during year 0
245
- def get_total_costs_for_objects(objects)
246
- counter = 0
247
- objects.each do |object|
248
- object_LCCs = object.lifeCycleCosts
249
- object_LCCs.each do |object_LCC|
250
- if (object_LCC.category == 'Construction') || (object_LCC.category == 'Salvage')
251
- if object_LCC.yearsFromStart == 0
252
- counter += object_LCC.totalCost
253
- end
254
- end
255
- end
256
- end
257
- return counter
258
- end
259
-
260
- # get loops for measure
261
- if apply_to_all_loops
262
- loops = model.getLoops
263
- else
264
- loops = []
265
- loops << loop # only run on a single space type
266
- end
267
-
268
- # get cop values
269
- initial_motor_efficiency_values = []
270
- missing_initial_motor_efficiency = 0
271
-
272
- # loop through air loops
273
- loops.each do |loop|
274
- supply_components = loop.supplyComponents
275
-
276
- # find fans and pumps on loop
277
- supply_components.each do |supply_component|
278
- hVACComponent = supply_component.to_FanConstantVolume
279
- if hVACComponent.empty?
280
- hVACComponent = supply_component.to_FanVariableVolume
281
- end
282
- if hVACComponent.empty?
283
- hVACComponent = supply_component.to_FanOnOff
284
- end
285
- if hVACComponent.empty?
286
- hVACComponent = supply_component.to_PumpConstantSpeed
287
- end
288
- if hVACComponent.empty?
289
- hVACComponent = supply_component.to_PumpVariableSpeed
290
- end
291
-
292
- # alter components of correct type
293
- if !hVACComponent.empty?
294
- hVACComponent = hVACComponent.get
295
-
296
- # change and report changes to fans and motors
297
- initial_motor_efficiency = hVACComponent.motorEfficiency
298
- runner.registerInfo("Changing the motor efficiency from #{initial_motor_efficiency * 100}% to #{motor_eff}% for '#{hVACComponent.name}' onloop '#{loop.name}.'")
299
- initial_motor_efficiency_values << initial_motor_efficiency
300
- hVACComponent.setMotorEfficiency(motor_eff * 0.01)
301
-
302
- # get initial year 0 cost
303
- yr0_capital_totalCosts_baseline += get_total_costs_for_objects([hVACComponent])
304
-
305
- # demo value of baseline costs associated with unit
306
- demo_LCCs = hVACComponent.lifeCycleCosts
307
- demo_LCCs.each do |demo_LCC|
308
- if demo_LCC.category == 'Salvage'
309
- demo_costs_of_baseline_objects += demo_LCC.totalCost
310
- end
311
- end
312
-
313
- # remove all old costs
314
- if !hVACComponent.lifeCycleCosts.empty? && (remove_costs == true)
315
- runner.registerInfo("Removing existing lifecycle cost objects associated with #{hVACComponent.name}")
316
- removed_costs = hVACComponent.removeLifeCycleCosts
317
- end
318
-
319
- # add new costs
320
- if costs_requested == true
321
-
322
- # adding new cost items
323
- lcc_mat = OpenStudio::Model::LifeCycleCost.createLifeCycleCost("LCC_Mat - #{hVACComponent.name}", hVACComponent, material_cost, 'CostPerEach', 'Construction', expected_life, years_until_costs_start)
324
- # cost for if demo_initial_Construction == true is added at the end of the measure
325
- lcc_demo = OpenStudio::Model::LifeCycleCost.createLifeCycleCost("LCC_Demo - #{hVACComponent.name}", hVACComponent, demolition_cost, 'CostPerEach', 'Salvage', expected_life, years_until_costs_start + expected_life)
326
- lcc_om = OpenStudio::Model::LifeCycleCost.createLifeCycleCost("LCC_OM - #{hVACComponent.name}", hVACComponent, om_cost, 'CostPerEach', 'Maintenance', om_frequency, 0)
327
-
328
- # get final year 0 cost
329
- yr0_capital_totalCosts_proposed += get_total_costs_for_objects([hVACComponent])
330
-
331
- end
332
-
333
- end
334
- end
335
- end
336
-
337
- # add one time demo cost of removed windows if appropriate
338
- if demo_cost_initial_const == true
339
- building = model.getBuilding
340
- lcc_baseline_demo = OpenStudio::Model::LifeCycleCost.createLifeCycleCost('LCC_baseline_demo', building, demo_costs_of_baseline_objects, 'CostPerEach', 'Salvage', 0, years_until_costs_start).get # using 0 for repeat period since one time cost.
341
- runner.registerInfo("Adding one time cost of $#{neat_numbers(lcc_baseline_demo.totalCost, 0)} related to demolition of baseline objects.")
342
-
343
- # if demo occurs on year 0 then add to initial capital cost counter
344
- if lcc_baseline_demo.yearsFromStart == 0
345
- yr0_capital_totalCosts_proposed += lcc_baseline_demo.totalCost
346
- end
347
- end
348
-
349
- if initial_motor_efficiency_values.size + missing_initial_motor_efficiency == 0
350
- runner.registerAsNotApplicable('The affected loop(s) does not contain any fans or pumps, the model will not be altered.')
351
- return true
352
- end
353
-
354
- # reporting initial condition of model
355
- runner.registerInitialCondition("The starting motor efficiency values in affected loop(s) range from #{initial_motor_efficiency_values.min * 100}% to #{initial_motor_efficiency_values.max * 100}%. Initial year 0 capital costs for affected fans or pumps is $#{neat_numbers(yr0_capital_totalCosts_baseline, 0)}.")
356
-
357
- # reporting final condition of model
358
- runner.registerFinalCondition("#{initial_motor_efficiency_values.size + missing_initial_motor_efficiency} fans or pumps had motor efficiency values set to #{motor_eff}%. Final year 0 capital costs for affected fans and pumps is $#{neat_numbers(yr0_capital_totalCosts_proposed, 0)}.")
359
-
360
- return true
361
- end
362
- end
363
-
364
- # this allows the measure to be used by the application
365
- ImproveMotorEfficiency.new.registerWithApplication