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
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>ventilation_qaqc</name>
5
5
  <uid>cb13be0e-88f6-494c-b3b1-dc748b42e205</uid>
6
- <version_id>b2ac0143-5938-4a75-b97d-8a846324c93a</version_id>
7
- <version_modified>20200509T041912Z</version_modified>
6
+ <version_id>b97442fd-7920-4a03-95b2-d4e3e7006d5a</version_id>
7
+ <version_modified>20200817T202906Z</version_modified>
8
8
  <xml_checksum>2C8A3EEF</xml_checksum>
9
9
  <class_name>VentilationQAQC</class_name>
10
10
  <display_name>Ventilation Report</display_name>
@@ -14,9 +14,7 @@
14
14
  <argument>
15
15
  <name>measure_zone</name>
16
16
  <display_name>Pick a Zone (or all Zones)</display_name>
17
- <description></description>
18
17
  <type>Choice</type>
19
- <units></units>
20
18
  <required>true</required>
21
19
  <model_dependent>false</model_dependent>
22
20
  <default_value>All Zones</default_value>
@@ -26,8 +24,6 @@
26
24
  <display_name>All Zones</display_name>
27
25
  </choice>
28
26
  </choices>
29
- <min_value></min_value>
30
- <max_value></max_value>
31
27
  </argument>
32
28
  </arguments>
33
29
  <outputs />
@@ -48,18 +44,6 @@
48
44
  </attribute>
49
45
  </attributes>
50
46
  <files>
51
- <file>
52
- <filename>ExampleModel.osm</filename>
53
- <filetype>osm</filetype>
54
- <usage_type>test</usage_type>
55
- <checksum>4E11CF11</checksum>
56
- </file>
57
- <file>
58
- <filename>report.html.in</filename>
59
- <filetype>in</filetype>
60
- <usage_type>resource</usage_type>
61
- <checksum>E5A4911E</checksum>
62
- </file>
63
47
  <file>
64
48
  <filename>USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw</filename>
65
49
  <filetype>epw</filetype>
@@ -78,6 +62,24 @@
78
62
  <usage_type>license</usage_type>
79
63
  <checksum>E0468DD6</checksum>
80
64
  </file>
65
+ <file>
66
+ <filename>README.md</filename>
67
+ <filetype>md</filetype>
68
+ <usage_type>readme</usage_type>
69
+ <checksum>7A7F2C94</checksum>
70
+ </file>
71
+ <file>
72
+ <filename>small_office.osm</filename>
73
+ <filetype>osm</filetype>
74
+ <usage_type>test</usage_type>
75
+ <checksum>358253AE</checksum>
76
+ </file>
77
+ <file>
78
+ <filename>ventilation_qaqc_test.rb</filename>
79
+ <filetype>rb</filetype>
80
+ <usage_type>test</usage_type>
81
+ <checksum>8B2F9EC2</checksum>
82
+ </file>
81
83
  <file>
82
84
  <version>
83
85
  <software_program>OpenStudio</software_program>
@@ -87,20 +89,13 @@
87
89
  <filename>measure.rb</filename>
88
90
  <filetype>rb</filetype>
89
91
  <usage_type>script</usage_type>
90
- <checksum>318C6E15</checksum>
92
+ <checksum>42120CDD</checksum>
91
93
  </file>
92
94
  <file>
93
- <filename>VentilationQAQC_Test.rb</filename>
94
- <filetype>rb</filetype>
95
- <usage_type>test</usage_type>
96
- <checksum>B2AE57AC</checksum>
97
- </file>
98
- <file>
99
- <filename>README.md</filename>
100
- <filetype>md</filetype>
101
- <usage_type>readme</usage_type>
102
- <checksum>0B68E96D</checksum>
95
+ <filename>report.html.in</filename>
96
+ <filetype>in</filetype>
97
+ <usage_type>resource</usage_type>
98
+ <checksum>E5A4911E</checksum>
103
99
  </file>
104
100
  </files>
105
101
  </measure>
106
- <error>wrong number of arguments (given 1, expected 0)</error>
@@ -2,7 +2,7 @@
2
2
 
3
3
  ###### (Automatically generated documentation)
4
4
 
5
- #
5
+ # Zone Report
6
6
 
7
7
  ## Description
8
8
 
@@ -11,7 +11,7 @@
11
11
 
12
12
 
13
13
  ## Measure Type
14
- ModelMeasure
14
+ ReportingMeasure
15
15
 
16
16
  ## Taxonomy
17
17
 
@@ -46,7 +46,7 @@ class ZoneReport < OpenStudio::Measure::ReportingMeasure
46
46
  end
47
47
 
48
48
  # define the arguments that the user will input
49
- def arguments
49
+ def arguments(model = nil)
50
50
  args = OpenStudio::Measure::OSArgumentVector.new
51
51
  return args
52
52
  end
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>zone_report</name>
5
5
  <uid>81ac119f-4841-434c-9e11-824310fe1cb7</uid>
6
- <version_id>2b729b0e-abb0-4257-a616-e13f920af649</version_id>
7
- <version_modified>20200509T041912Z</version_modified>
6
+ <version_id>dc0d67d0-ee03-4459-acd8-a0dcf61c83ac</version_id>
7
+ <version_modified>20200605T175858Z</version_modified>
8
8
  <xml_checksum>2C8A3EEF</xml_checksum>
9
9
  <class_name>ZoneReport</class_name>
10
10
  <display_name>Zone Report</display_name>
@@ -59,6 +59,12 @@
59
59
  <usage_type>license</usage_type>
60
60
  <checksum>E0468DD6</checksum>
61
61
  </file>
62
+ <file>
63
+ <filename>ZoneReport_Test.rb</filename>
64
+ <filetype>rb</filetype>
65
+ <usage_type>test</usage_type>
66
+ <checksum>23FA651F</checksum>
67
+ </file>
62
68
  <file>
63
69
  <version>
64
70
  <software_program>OpenStudio</software_program>
@@ -68,20 +74,13 @@
68
74
  <filename>measure.rb</filename>
69
75
  <filetype>rb</filetype>
70
76
  <usage_type>script</usage_type>
71
- <checksum>67AA9EB6</checksum>
77
+ <checksum>BB90DAAC</checksum>
72
78
  </file>
73
79
  <file>
74
80
  <filename>README.md</filename>
75
81
  <filetype>md</filetype>
76
82
  <usage_type>readme</usage_type>
77
- <checksum>0B68E96D</checksum>
78
- </file>
79
- <file>
80
- <filename>ZoneReport_Test.rb</filename>
81
- <filetype>rb</filetype>
82
- <usage_type>test</usage_type>
83
- <checksum>23FA651F</checksum>
83
+ <checksum>C013AECE</checksum>
84
84
  </file>
85
85
  </files>
86
86
  </measure>
87
- <error>wrong number of arguments (given 1, expected 0)</error>
@@ -0,0 +1,15 @@
1
+
2
+
3
+ OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC. All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
6
+
7
+ (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
8
+
9
+ (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
10
+
11
+ (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission from the respective party.
12
+
13
+ (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior written permission from Alliance for Sustainable Energy, LLC.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER, THE UNITED STATES GOVERNMENT, OR ANY CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,29 @@
1
+ ---
2
+ title: "ReadMe"
3
+ author: "Amy Allen"
4
+ date: "8/18/2020"
5
+ output:
6
+ pdf_document: default
7
+ html_document: default
8
+ ---
9
+
10
+ ```{r setup, include=FALSE}
11
+ knitr::opts_chunk$set(echo = TRUE)
12
+ ```
13
+
14
+
15
+ ## Add EMS to Control EV Charging Load
16
+ ## Description
17
+ This measure uses EnergyPlus' EnergyManagementSystem objects to control an electric vehicle charging load to better align the charging power draw with expected solar PV power production. If the need for load shifting passes, and, in any case, by late afternoon, the load shifting will be ended, and the EV load be charged at a higher rate in order to compensate for the earlier curtailment. Curtailment will be compensated for such that vehicles being charged are charged to at least 95% of the level that they would have been otherwise.
18
+
19
+ ## Modeler Description
20
+ This measure is intended for use at a 15-minute timestep.This measure requires than an electric vehicle charging load (with a schedule containing the strings "EV" or "V(v)ehicle" in the name) is already present in the model. This can be accomplished through first applying the Add EV Load measure. Note that this measure can result in increasing the peak load associated with EV charging, during the periods in which curtailment is compensated. This measure is structured around the assumption of an office building occupancy schedule, with occupants requiring vehicles to be charged by 7pm. Load shifting events are characterized by declining levels of solar radiation, which is used as a proxy for diminishing power output from on-site solar PV. Load shifting occurs only on weekdays, when commercial buildings would typically have higher EV charging loads.
21
+
22
+ ## Measure Type
23
+ EnergyPlusMeasure
24
+
25
+ ## Arguments
26
+ ## Curtailment Fraction
27
+ Name: Curtailment Frac, Type: Double, Units: Percent , Required: true, Model Dependent: false. This argument sets the fraction by which EV charging will be curtailed during a load-shifting event. This value defaults to 50%.
28
+
29
+
@@ -0,0 +1,288 @@
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
+ require 'openstudio-extension'
38
+ require 'openstudio/extension/core/os_lib_helper_methods'
39
+ class AddEMSToControlEVCharging < OpenStudio::Measure::ModelMeasure
40
+ # human readable name
41
+ def name
42
+ return 'Add EMS to Control EV Charging'
43
+ end
44
+
45
+ # human readable description
46
+ def description
47
+ return 'This measure implements a control system to curtail an electric vehicle (EV) charging load to better align EV charging with expected energy production from a solar PV system.'
48
+ end
49
+
50
+ # human readable description of modeling approach
51
+ def modeler_description
52
+ return "This measure uses EnergyPlus' Energy Management System to control an electric vehicle (EV) charging load to better align charging power draw with expected energy production from solar PV. There must already be an EV charging load present in the model when this measure is applied, and the measure is configured based on the assumption of a typical office operating schedule."
53
+ end
54
+
55
+ # define the arguments that the user will input
56
+ def arguments(model)
57
+ args = OpenStudio::Measure::OSArgumentVector.new
58
+ curtailment_frac = OpenStudio::Measure::OSArgument.makeDoubleArgument('curtailment_frac', true)
59
+ curtailment_frac.setDisplayName('Fraction by Which to Curtail EV Charging During Load Shifting Events')
60
+ curtailment_frac.setDefaultValue(0.5)
61
+ args << curtailment_frac
62
+
63
+ return args
64
+ end
65
+
66
+ # define what happens when the measure is run
67
+ def run(model, runner, user_arguments)
68
+ super(model, runner, user_arguments)
69
+
70
+ # use the built-in error checking
71
+ if !runner.validateUserArguments(arguments(model), user_arguments)
72
+ return false
73
+ end
74
+
75
+ curtailment_frac = runner.getDoubleArgumentValue('curtailment_frac', user_arguments)
76
+ if curtailment_frac < 0 || curtailment_frac > 1
77
+ runner.registerError('Curtailment fraction must be between 0 and 1')
78
+ return false
79
+ end
80
+
81
+ # Initialize handles
82
+ bldg_handle = nil
83
+ bldg_handle = model.getBuilding.handle
84
+
85
+ # Create object for end-of-year-date.
86
+ eoy = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(12), 31, 2006)
87
+
88
+ # Find the EV charger object, which will be passed in to the actuator.
89
+ ext_fuel_equip = model.getFacility.exteriorFuelEquipments
90
+ ext_equip_sched = []
91
+ ext_fuel_equip.each do |equip|
92
+ if equip.exteriorFuelEquipmentDefinition.name.to_s.include?('EV') || equip.exteriorFuelEquipmentDefinition.name.to_s.include?('vehicle') || equip.exteriorFuelEquipmentDefinition.name.to_s.include?('Vehicle')
93
+ ext_equip_sched << equip.schedule
94
+ end
95
+ end
96
+ ev_sched = ext_equip_sched [0]
97
+ if ext_equip_sched.empty?
98
+ runner.registerError('No EV charging schedule found. Schedule must include the string "EV", "vehicle", or "Vehicle" in its name.')
99
+ return false
100
+ end
101
+ if ext_equip_sched.length > 1
102
+ runner.registerError('More than one EV charging schedule found. Currently, this measure is capable of handling only one EV charging schedule.')
103
+ return false
104
+ end
105
+ ev_sched_copy = ext_equip_sched [0].clone
106
+ ev_sched_copy.setName('EV Charging Power Draw Copy')
107
+
108
+ equip_sched_day = ext_equip_sched [0].to_ScheduleRuleset.get.defaultDaySchedule
109
+ puts(ext_equip_sched [0].to_ScheduleRuleset.get)
110
+ equip_sched_day_default_val = equip_sched_day.values
111
+ puts equip_sched_day_default_val
112
+
113
+ # Create a new schedule, scaled by the curtailment fraction
114
+ ev_curtailed_sch = OpenStudio::Model::ScheduleRuleset.new(model)
115
+ ev_curtailed_sch.setName('EV Charging Curtailed Schedule')
116
+
117
+ # Default day (use this for weekdays)
118
+ ev_curtailed_sch.defaultDaySchedule.setName('EV Charging Curtailed Default')
119
+ # Loop through all the values and add to schedule
120
+ equip_sched_day_default_val.each_with_index do |value, i|
121
+ time = OpenStudio::Time.new(0, 0, (i + 1) * 15, 0)
122
+ ev_curtailed_sch.defaultDaySchedule.addValue(time, (value * curtailment_frac))
123
+ end
124
+ # Create needed sensors.
125
+ site_solar_rad_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Site Direct Solar Radiation Rate per Area')
126
+ site_solar_rad_sensor.setName('Direct_Solar_Radiation_Rate')
127
+
128
+ ev_load_curtailed_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Schedule Value')
129
+ ev_load_curtailed_sensor.setKeyName('EV Charging Curtailed Schedule')
130
+ ev_load_curtailed_sensor.setName('EV_Load_Curtailed_Sensor')
131
+
132
+ ev_load_sched_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Schedule Value')
133
+ ev_load_sched_sensor.setKeyName('EV Charging Power Draw Copy')
134
+ ev_load_sched_sensor.setName('EV_reg_sched_power')
135
+
136
+ # Make the needed actuator.
137
+ ev_schedule_actuator = OpenStudio::Model::EnergyManagementSystemActuator.new(ev_sched, 'Schedule:Year', 'Schedule Value')
138
+ ev_schedule_actuator.setName('EVChargeSchedule_Actuator')
139
+ ev_schedule_actuator_handle = ev_schedule_actuator.handle
140
+
141
+ # Make the global variables.
142
+ solar_trend = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'solartrend')
143
+ arg_dr_state = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'argdrstate')
144
+ curtailed_energy_sum = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'curtailed_energy_sum')
145
+ curtail_frac = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'curtail_frac')
146
+ ev_charge_energy = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'EV_charge_energy')
147
+ ev_sched_charge_energy = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(model, 'EV_sched_charge_energy')
148
+
149
+ # Make the trend variables.
150
+ solar_rad_trend = OpenStudio::Model::EnergyManagementSystemTrendVariable.new(model, site_solar_rad_sensor)
151
+ solar_rad_trend.setName('Solar_Radiation_Trend')
152
+ solar_rad_trend.setEMSVariableName(site_solar_rad_sensor.name.to_s)
153
+ solar_rad_trend.setNumberOfTimestepsToBeLogged(144)
154
+
155
+ dr_state_trend = OpenStudio::Model::EnergyManagementSystemTrendVariable.new(model, arg_dr_state)
156
+ dr_state_trend.setName('DR_State_Trend')
157
+ dr_state_trend.setEMSVariableName(arg_dr_state.name.to_s)
158
+
159
+ solar_rad_slope_trend = OpenStudio::Model::EnergyManagementSystemTrendVariable.new(model, solar_trend)
160
+ solar_rad_slope_trend.setName('Solar_Radiation_Slope_Trend')
161
+ solar_rad_slope_trend.setEMSVariableName(solar_trend.name.to_s)
162
+
163
+ # Make the needed output variables. Below is using the model and an acutator, or the model and a global variable, which is allowable.
164
+ ev_charge_eff_sched = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, ev_schedule_actuator)
165
+ ev_charge_eff_sched.setName('EV Charging Effective Schedule')
166
+ ev_charge_eff_sched.setEMSVariableName(ev_schedule_actuator.name.to_s)
167
+
168
+ ev_sched_load = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, ev_load_sched_sensor)
169
+ ev_sched_load.setName('EV Charging Regularly Sched Load')
170
+ ev_sched_load.setEMSVariableName(ev_load_sched_sensor.name.to_s)
171
+
172
+ dr_state = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, arg_dr_state)
173
+ dr_state.setName('dr_state')
174
+ dr_state.setEMSVariableName(arg_dr_state.name.to_s)
175
+
176
+ solar_rad_slope = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, solar_trend)
177
+ solar_rad_slope.setName('solar_radiation_slope_trend')
178
+ solar_rad_slope.setEMSVariableName(solar_trend.name.to_s)
179
+
180
+ curtailed_energy_total = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, curtailed_energy_sum)
181
+ curtailed_energy_total.setName('EV Curtailed Energy Total')
182
+ curtailed_energy_total.setEMSVariableName(curtailed_energy_sum.name.to_s)
183
+
184
+ ev_charge_energy_output = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, ev_charge_energy)
185
+ ev_charge_energy_output.setName('EV Charging Energy')
186
+ ev_charge_energy_output.setEMSVariableName(ev_charge_energy.name.to_s)
187
+
188
+ ev_sched_charge_energy_output = OpenStudio::Model::EnergyManagementSystemOutputVariable.new(model, ev_sched_charge_energy)
189
+ ev_sched_charge_energy_output.setName('Scheduled EV Charging Energy')
190
+ ev_sched_charge_energy_output.setEMSVariableName(ev_sched_charge_energy.name.to_s)
191
+
192
+ # Make sub-routines.
193
+ # Reset the counter of curtailed energy.
194
+ reset_curtailment_subroutine = OpenStudio::Model::EnergyManagementSystemSubroutine.new(model)
195
+ reset_curtailment_subroutine.setName('Initalize_EV_Curtailment')
196
+ reset_curtailment_subroutine.addLine('SET curtailed_energy_sum=0') # Reset this counter to zero.
197
+
198
+ # Set the actuator for curtailment.
199
+ curtail_ev_sched_subroutine = OpenStudio::Model::EnergyManagementSystemSubroutine.new(model)
200
+ curtail_ev_sched_subroutine.setName('Set_EV_Sched_Curtailed_Value')
201
+ curtail_ev_sched_subroutine.addLine('SET EVChargeSchedule_Actuator =EV_Load_Curtailed_Sensor')
202
+ curtail_ev_sched_subroutine.addLine('SET argdrstate = 1')
203
+ curtail_ev_sched_subroutine.addLine('SET curtailed_energy_sum=curtailed_energy_sum + (EV_reg_sched_power-EV_Load_Curtailed_Sensor)')
204
+ curtail_ev_sched_subroutine.addLine('SET ev_charge_energy=ev_charge_energy + EV_Load_Curtailed_Sensor*SystemTimeStep')
205
+ curtail_ev_sched_subroutine.addLine('SET ev_sched_charge_energy=ev_sched_charge_energy + EV_reg_sched_power*SystemTimeStep')
206
+
207
+ # Make program.
208
+ execute_ev_curtailment_prgrm = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
209
+ execute_ev_curtailment_prgrm.setName('Execute_EV_Curtailment')
210
+ execute_ev_curtailment_prgrm.addLine('IF (CurrentTime==1)')
211
+ execute_ev_curtailment_prgrm.addLine('SET ev_charge_energy=0')
212
+ execute_ev_curtailment_prgrm.addLine('SET ev_sched_charge_energy=0')
213
+ execute_ev_curtailment_prgrm.addLine('ELSEIF (solartrend <0 ) && (CurrentTime<=16) && (CurrentTime>=6) &&(DayofWeek<>1) && (DayofWeek<>7)')
214
+ # execute_ev_curtailment_prgrm.addLine('RUN Initalize_EV_Curtailment')
215
+ execute_ev_curtailment_prgrm.addLine('RUN Set_EV_Sched_Curtailed_Value')
216
+ execute_ev_curtailment_prgrm.addLine('ELSEIF (CurrentTime>16) && (CurrentTime<18.50) && (DayofWeek<>1) && (DayofWeek<>7) ')
217
+ execute_ev_curtailment_prgrm.addLine('SET EVChargeSchedule_Actuator =EV_reg_sched_power + curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep)')
218
+ execute_ev_curtailment_prgrm.addLine('SET curtailed_energy_sum =curtailed_energy_sum- curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep)')
219
+ execute_ev_curtailment_prgrm.addLine('SET ev_charge_energy =ev_charge_energy + (EV_reg_sched_power + curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep))*SystemTimeStep')
220
+ execute_ev_curtailment_prgrm.addLine('SET ev_sched_charge_energy =ev_sched_charge_energy + EV_reg_sched_power*SystemTimeStep')
221
+ execute_ev_curtailment_prgrm.addLine('SET argdrstate = 0')
222
+ execute_ev_curtailment_prgrm.addLine('ELSEIF (CurrentTime==18.50)')
223
+ execute_ev_curtailment_prgrm.addLine('SET curtailed_energy_sum=0')
224
+ execute_ev_curtailment_prgrm.addLine('SET ev_charge_energy =ev_charge_energy + EV_reg_sched_power*SystemTimeStep')
225
+ execute_ev_curtailment_prgrm.addLine('SET ev_sched_charge_energy =ev_sched_charge_energy + EV_reg_sched_power*SystemTimeStep')
226
+ execute_ev_curtailment_prgrm.addLine('ELSEIF (solartrend>=0) && (CurrentTime<18.75)')
227
+ execute_ev_curtailment_prgrm.addLine('SET EVChargeSchedule_Actuator =EV_reg_sched_power + curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep)') # Compensate for curtailment
228
+ execute_ev_curtailment_prgrm.addLine('SET curtailed_energy_sum =curtailed_energy_sum- curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep)') # Update curtailment counter
229
+ execute_ev_curtailment_prgrm.addLine('SET ev_charge_energy =ev_charge_energy + (EV_reg_sched_power + curtailed_energy_sum/((18.75-CurrentTime-SystemTimeStep)/SystemTimeStep))*SystemTimeStep')
230
+ execute_ev_curtailment_prgrm.addLine('SET ev_sched_charge_energy =ev_sched_charge_energy + EV_reg_sched_power*SystemTimeStep')
231
+ execute_ev_curtailment_prgrm.addLine('SET argdrstate = 0')
232
+ execute_ev_curtailment_prgrm.addLine('ELSE')
233
+ execute_ev_curtailment_prgrm.addLine('SET EVChargeSchedule_Actuator = Null')
234
+ execute_ev_curtailment_prgrm.addLine('SET ev_sched_charge_energy =ev_sched_charge_energy + EV_reg_sched_power*SystemTimeStep')
235
+ execute_ev_curtailment_prgrm.addLine('SET ev_charge_energy =ev_charge_energy + EV_reg_sched_power*SystemTimeStep')
236
+ execute_ev_curtailment_prgrm.addLine('SET argdrstate = 0')
237
+ execute_ev_curtailment_prgrm.addLine('ENDIF')
238
+
239
+ solar_trend_prgrm = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
240
+ solar_trend_prgrm.setName('Set_Solar_Trend')
241
+ solar_trend_prgrm.addLine('SET solartrend =@TrendDirection Solar_Radiation_Trend 2')
242
+
243
+ set_demand_threshold_prgrm = OpenStudio::Model::EnergyManagementSystemProgram.new(model)
244
+ set_demand_threshold_prgrm.setName('Set_Demand_Threshold')
245
+ set_demand_threshold_prgrm.addLine('SET curtailed_energy_sum =0')
246
+ set_demand_threshold_prgrm.addLine('SET ev_charge_energy =0')
247
+ set_demand_threshold_prgrm.addLine('SET ev_sched_charge_energy =0')
248
+
249
+ # Add program calling managers.
250
+ ev_curtailment_main_calling_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(model)
251
+ ev_curtailment_main_calling_mgr.setName('EV_Curtailment')
252
+ ev_curtailment_main_calling_mgr.setCallingPoint('BeginTimestepBeforePredictor')
253
+
254
+ ev_curtailment_main_calling_mgr.setProgram(solar_trend_prgrm, 0)
255
+ ev_curtailment_main_calling_mgr.setProgram(execute_ev_curtailment_prgrm, 1)
256
+
257
+ set_input_vars_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(model)
258
+ set_input_vars_mgr.setName('Set_input_vars')
259
+ set_input_vars_mgr.setCallingPoint('BeginNewEnvironment')
260
+ set_input_vars_mgr.setProgram(set_demand_threshold_prgrm, 0)
261
+
262
+ # Add output variables
263
+ outputVariable = OpenStudio::Model::OutputVariable.new('dr_state', model)
264
+ outputVariable.setReportingFrequency('timestep')
265
+
266
+ outputVariable = OpenStudio::Model::OutputVariable.new('Schedule Value', model)
267
+ outputVariable.setReportingFrequency('timestep')
268
+ outputVariable.setKeyValue('EV Charging Power Draw')
269
+
270
+ outputVariable = OpenStudio::Model::OutputVariable.new('Schedule Value', model)
271
+ outputVariable.setReportingFrequency('timestep')
272
+ outputVariable.setKeyValue('EV Charging Power Draw Copy')
273
+
274
+ outputVariable = OpenStudio::Model::OutputVariable.new('EV Curtailed Energy Total', model)
275
+ outputVariable.setReportingFrequency('timestep')
276
+
277
+ outputVariable = OpenStudio::Model::OutputVariable.new('Scheduled EV Charging Energy', model)
278
+ outputVariable.setReportingFrequency('timestep')
279
+
280
+ outputVariable = OpenStudio::Model::OutputVariable.new('EV Charging Energy', model)
281
+ outputVariable.setReportingFrequency('timestep')
282
+
283
+ return true
284
+ end
285
+ end
286
+
287
+ # register the measure to be used by the application
288
+ AddEMSToControlEVCharging.new.registerWithApplication