openstudio-common-measures 0.4.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +3 -1
  4. data/CHANGELOG.md +25 -0
  5. data/README.md +21 -2
  6. data/doc_templates/copyright_erb.txt +1 -1
  7. data/lib/measures/AddCostPerFloorAreaUnusedToLights/measure.xml +2 -8
  8. data/lib/measures/AddCostToSupplySideHVACComponentByAirLoop/measure.xml +9 -3
  9. data/lib/measures/AddSimplePvToShadingSurfacesByType/measure.xml +2 -2
  10. data/lib/measures/RemoveUnusedDefaultProfiles/measure.xml +2 -2
  11. data/lib/measures/ReportModelChanges/measure.xml +2 -2
  12. data/lib/measures/SetCOPforSingleSpeedDXCoolingUnits/measure.xml +4 -4
  13. data/lib/measures/SetCOPforTwoSpeedDXCoolingUnits/measure.xml +4 -4
  14. data/lib/measures/SetGasBurnerEfficiency/measure.xml +4 -4
  15. data/lib/measures/ShiftScheduleProfileTime/measure.xml +4 -4
  16. data/lib/measures/SwapLightsDefinition/measure.xml +3 -5
  17. data/lib/measures/add_ems_emissions_reporting/LICENSE.MD.txt +15 -0
  18. data/lib/measures/add_ems_emissions_reporting/LICENSE.md +27 -0
  19. data/lib/measures/add_ems_emissions_reporting/README.md +17 -0
  20. data/lib/measures/add_ems_emissions_reporting/measure.rb +474 -0
  21. data/lib/measures/add_ems_emissions_reporting/measure.xml +599 -0
  22. data/lib/measures/add_ems_emissions_reporting/resources/future_annual_co2e.csv +17 -0
  23. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2020.csv +8761 -0
  24. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2022.csv +8761 -0
  25. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2024.csv +8761 -0
  26. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2026.csv +8761 -0
  27. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2028.csv +8761 -0
  28. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2030.csv +8761 -0
  29. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2032.csv +8761 -0
  30. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2034.csv +8761 -0
  31. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2036.csv +8761 -0
  32. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2038.csv +8761 -0
  33. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2040.csv +8761 -0
  34. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2042.csv +8761 -0
  35. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2044.csv +8761 -0
  36. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2046.csv +8761 -0
  37. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2048.csv +8761 -0
  38. data/lib/measures/add_ems_emissions_reporting/resources/future_hourly_co2e_2050.csv +8761 -0
  39. data/lib/measures/add_ems_emissions_reporting/resources/historical_annual_co2e.csv +9 -0
  40. data/lib/measures/add_ems_emissions_reporting/resources/historical_hourly_co2e_2019.csv +8761 -0
  41. data/lib/measures/add_ev_load/measure.rb +51 -8
  42. data/lib/measures/add_ev_load/measure.xml +23 -5
  43. data/lib/measures/envelope_and_internal_load_breakdown/measure.xml +3 -3
  44. data/lib/measures/envelope_and_internal_load_breakdown/resources/report.html.erb +6 -1
  45. data/lib/measures/example_report/measure.xml +3 -3
  46. data/lib/measures/example_report/resources/report.html.erb +6 -1
  47. data/lib/measures/generic_qaqc/README.md +19 -4
  48. data/lib/measures/generic_qaqc/README.md.erb +7 -1
  49. data/lib/measures/generic_qaqc/docs/generic_qaqc_detailed.jpg +0 -0
  50. data/lib/measures/generic_qaqc/docs/generic_qaqc_summary.jpg +0 -0
  51. data/lib/measures/generic_qaqc/measure.rb +34 -29
  52. data/lib/measures/generic_qaqc/measure.xml +181 -82
  53. data/lib/measures/generic_qaqc/resources/check_cond_zns.rb +3 -1
  54. data/lib/measures/generic_qaqc/resources/check_domestic_hot_water.rb +13 -8
  55. data/lib/measures/generic_qaqc/resources/check_envelope_conductance.rb +330 -231
  56. data/lib/measures/generic_qaqc/resources/check_eui_by_end_use.rb +59 -20
  57. data/lib/measures/generic_qaqc/resources/check_eui_reasonableness.rb +58 -20
  58. data/lib/measures/generic_qaqc/resources/check_internal_loads.rb +57 -56
  59. data/lib/measures/generic_qaqc/resources/check_mech_sys_capacity.rb +4 -1
  60. data/lib/measures/generic_qaqc/resources/check_mech_sys_efficiency.rb +27 -22
  61. data/lib/measures/generic_qaqc/resources/check_mech_sys_part_load_eff.rb +4 -1
  62. data/lib/measures/generic_qaqc/resources/check_mech_sys_type.rb +3 -3
  63. data/lib/measures/generic_qaqc/resources/check_schedules.rb +65 -101
  64. data/lib/measures/generic_qaqc/resources/check_simultaneous_heating_and_cooling.rb +3 -1
  65. data/lib/measures/generic_qaqc/resources/check_supply_air_and_thermostat_temp_difference.rb +3 -1
  66. data/lib/measures/generic_qaqc/resources/os_lib_reporting_qaqc.rb +49 -15
  67. data/lib/measures/generic_qaqc/resources/report.html.erb +6 -1
  68. data/lib/measures/hvac_psychrometric_chart/measure.xml +4 -3
  69. data/lib/measures/hvac_psychrometric_chart/resources/report.html.erb +6 -1
  70. data/lib/measures/openstudio_results/measure.xml +3 -3
  71. data/lib/measures/openstudio_results/resources/report.html.erb +6 -1
  72. data/lib/measures/set_run_period/measure.xml +2 -2
  73. data/lib/measures/view_data/measure.xml +9 -9
  74. data/lib/measures/view_data/resources/report.html.in +1336 -973
  75. data/lib/measures/view_data/resources/va3c.rb +1 -0
  76. data/lib/measures/view_model/measure.xml +33 -64
  77. data/lib/measures/view_model/resources/report.html.in +1339 -976
  78. data/lib/measures/view_model/resources/va3c.rb +1 -0
  79. data/lib/openstudio/common_measures/version.rb +1 -1
  80. data/openstudio-common-measures.gemspec +2 -2
  81. metadata +33 -7
@@ -98,10 +98,16 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
98
98
  # Make an argument for the % of vehicles parked at the building that are EVs.
99
99
  ev_percent = OpenStudio::Measure::OSArgument.makeDoubleArgument('ev_percent', true)
100
100
  ev_percent.setDisplayName('Percent of Vehicles Parked at Building That Are EVs')
101
- ev_percent.setDefaultValue(1.0)
101
+ ev_percent.setDefaultValue(100)
102
102
  ev_percent.setDescription('Denotes percentage of vehicles between 0 to 100 that are electric on site.')
103
103
  args << ev_percent
104
104
 
105
+ # Make an argument for using occupancy from OpenStudio Model.
106
+ ev_use_model_occupancy = OpenStudio::Measure::OSArgument.makeBoolArgument('ev_use_model_occupancy', true)
107
+ ev_use_model_occupancy.setDisplayName('Use occupancy from OpenStudio Model to determine number of electric vehicles')
108
+ ev_use_model_occupancy.setDefaultValue(true)
109
+ args << ev_use_model_occupancy
110
+
105
111
  return args
106
112
  end
107
113
 
@@ -114,6 +120,7 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
114
120
  charge_behavior = runner.getStringArgumentValue('charge_behavior', user_arguments)
115
121
  chg_station_type = runner.getStringArgumentValue('chg_station_type', user_arguments)
116
122
  ev_percent = runner.getDoubleArgumentValue('ev_percent', user_arguments)
123
+ ev_use_model_occupancy = runner.getBoolArgumentValue('ev_use_model_occupancy', user_arguments)
117
124
 
118
125
  # use the built-in error checking
119
126
  if !runner.validateUserArguments(arguments(model), user_arguments)
@@ -155,13 +162,24 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
155
162
  # Sets key based on charging station type, for general charging load profiles. Will use this to average columns appropriately.
156
163
  if chg_station_type == 'Typical Home'
157
164
  chg_station_key = 1
165
+ runner.registerInfo("charge station type = #{chg_station_type}")
158
166
  runner.registerInfo("charge station key = #{chg_station_key}")
167
+ # Assumed occupancy density is the typical occupancy density for charging station type determined by using a weighted
168
+ # average of building type and associated occupancy density
169
+ assumed_occupancy_density = 0.003
170
+ runner.registerInfo("assumed occupancy = #{assumed_occupancy_density}")
159
171
  elsif chg_station_type == 'Typical Work'
160
172
  chg_station_key = 2
173
+ runner.registerInfo("charge station type = #{chg_station_type}")
161
174
  runner.registerInfo("charge station key = #{chg_station_key}")
175
+ assumed_occupancy_density = 0.005
176
+ runner.registerInfo("assumed occupancy = #{assumed_occupancy_density}")
162
177
  elsif chg_station_type == 'Typical Public'
163
178
  chg_station_key = 3
179
+ runner.registerInfo("charge station type = #{chg_station_type}")
164
180
  runner.registerInfo("charge station key = #{chg_station_key}")
181
+ assumed_occupancy_density = 0.0226
182
+ runner.registerInfo("assumed occupancy = #{assumed_occupancy_density}")
165
183
  end
166
184
 
167
185
  # Creating a schedule:ruleset
@@ -210,13 +228,26 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
210
228
  indices = public_indices
211
229
  end
212
230
 
213
- # Popualte the average weekday load for non PSN case. The load profiles used in this case are averaged based on the selected charging station type,(given the selected charging flexibility option and charging behavior option), and scaled for the percent of vehicles that are EVs.
231
+ space_type = model.getSpaceTypes[0]
232
+ model_occupancy = space_type.people.size
233
+ floor_area = space_type.floorArea
234
+ model_occupancy_density = space_type.getPeoplePerFloorArea(floor_area)
235
+ model_occupancy_density = model_occupancy_density/10.76 # Convert to people per ft2
236
+
237
+ # Populate the average weekday load for non PSN case. The load profiles used in this case are averaged based on the selected charging station type,(given the selected charging flexibility option and charging behavior option), and scaled for the percent of vehicles that are EVs.
214
238
  if chg_station_type != 'Pena Station Next Analysis' && chg_station_type != 'Pena Station Next Analysis--DC Fast Charger'
215
239
  wkday_load_sel = wkday_load.values_at(*indices)
216
240
  avg_load_wkday = []
217
241
  wkday_load_sel = wkday_load_sel.transpose
218
- for i in 0..wkday_load[0].length - 1
219
- avg_load_wkday[i] = (wkday_load_sel[i].reduce(0, :+) / wkday_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
242
+ if ev_use_model_occupancy
243
+ runner.registerInfo("model occupancy density = #{model_occupancy_density}")
244
+ for i in 0..wkday_load[0].length - 1
245
+ avg_load_wkday[i] = ((wkday_load_sel[i].reduce(0, :+) / wkday_load_sel[i].length) * ev_percent/assumed_percent) * (model_occupancy_density/assumed_occupancy_density) # Scale profiles generated from 50% EV scenario by occupancy of OpenStudio model (number of vehicles is assumed to be the same as occupancy of the building).
246
+ end
247
+ else
248
+ for i in 0..wkday_load[0].length - 1
249
+ avg_load_wkday[i] = (wkday_load_sel[i].reduce(0, :+) / wkday_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
250
+ end
220
251
  end
221
252
 
222
253
  wkday_max_load = avg_load_wkday.max
@@ -225,8 +256,14 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
225
256
  sat_load_sel = sat_load.values_at(*indices)
226
257
  avg_load_sat = []
227
258
  sat_load_sel = sat_load_sel.transpose
228
- for i in 0..sat_load[0].length - 1
229
- avg_load_sat[i] = (sat_load_sel[i].reduce(0, :+) / sat_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
259
+ if ev_use_model_occupancy
260
+ for i in 0..sat_load[0].length - 1
261
+ avg_load_sat[i] = ((sat_load_sel[i].reduce(0, :+) / sat_load_sel[i].length) * ev_percent / assumed_percent) * (model_occupancy_density/assumed_occupancy_density) # Scale profiles generated from 50% EV scenario by occupancy of OpenStudio model and apply ev_percent (number of vehicles is assumed to be the same as occupancy of the building).
262
+ end
263
+ else
264
+ for i in 0..sat_load[0].length - 1
265
+ avg_load_sat[i] = (sat_load_sel[i].reduce(0, :+) / sat_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
266
+ end
230
267
  end
231
268
 
232
269
  sat_max_load = avg_load_sat.max
@@ -235,8 +272,14 @@ class AddEVLoad < OpenStudio::Measure::ModelMeasure
235
272
  sun_load_sel = sun_load.values_at(*indices)
236
273
  avg_load_sun = []
237
274
  sun_load_sel = sun_load_sel.transpose
238
- for i in 0..sun_load[0].length - 1
239
- avg_load_sun[i] = (sun_load_sel[i].reduce(0, :+) / sun_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
275
+ if ev_use_model_occupancy
276
+ for i in 0..sun_load[0].length - 1
277
+ avg_load_sun[i] = ((sun_load_sel[i].reduce(0, :+) / sun_load_sel[i].length) * ev_percent / assumed_percent) * (model_occupancy_density/assumed_occupancy_density) # Scale profiles generated from 50% EV scenario by occupancy of OpenStudio model and apply ev_percent (number of vehicles is assumed to be the same as occupancy of the building).
278
+ end
279
+ else
280
+ for i in 0..sun_load[0].length - 1
281
+ avg_load_sun[i] = (sun_load_sel[i].reduce(0, :+) / sun_load_sel[i].length) * ev_percent / assumed_percent # Scale profiles generated from 50% EV scenario by % of vehicles that are EVs.
282
+ end
240
283
  end
241
284
 
242
285
  sun_max_load = avg_load_sun.max
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>add_ev_load</name>
5
5
  <uid>a23e0493-7357-48ca-b089-4d902efd6b50</uid>
6
- <version_id>90476d7d-d880-4ce4-ada0-5dad10a82954</version_id>
7
- <version_modified>20210406T224047Z</version_modified>
6
+ <version_id>5ef19868-80da-424d-9907-00e8bbd9919a</version_id>
7
+ <version_modified>20220505T194724Z</version_modified>
8
8
  <xml_checksum>9A202986</xml_checksum>
9
9
  <class_name>AddEVLoad</class_name>
10
10
  <display_name>Add_EV_Load</display_name>
@@ -86,7 +86,25 @@
86
86
  <type>Double</type>
87
87
  <required>true</required>
88
88
  <model_dependent>false</model_dependent>
89
- <default_value>1</default_value>
89
+ <default_value>100</default_value>
90
+ </argument>
91
+ <argument>
92
+ <name>ev_use_model_occupancy</name>
93
+ <display_name>Use occupancy from OpenStudio Model to determine number of electric vehicles</display_name>
94
+ <type>Boolean</type>
95
+ <required>true</required>
96
+ <model_dependent>false</model_dependent>
97
+ <default_value>true</default_value>
98
+ <choices>
99
+ <choice>
100
+ <value>true</value>
101
+ <display_name>true</display_name>
102
+ </choice>
103
+ <choice>
104
+ <value>false</value>
105
+ <display_name>false</display_name>
106
+ </choice>
107
+ </choices>
90
108
  </argument>
91
109
  </arguments>
92
110
  <outputs />
@@ -331,7 +349,7 @@
331
349
  <filename>add_ev_load_test.rb</filename>
332
350
  <filetype>rb</filetype>
333
351
  <usage_type>test</usage_type>
334
- <checksum>5E255354</checksum>
352
+ <checksum>54550A66</checksum>
335
353
  </file>
336
354
  <file>
337
355
  <version>
@@ -342,7 +360,7 @@
342
360
  <filename>measure.rb</filename>
343
361
  <filetype>rb</filetype>
344
362
  <usage_type>script</usage_type>
345
- <checksum>93A1C055</checksum>
363
+ <checksum>0F479CB4</checksum>
346
364
  </file>
347
365
  </files>
348
366
  </measure>
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>envelope_and_internal_load_breakdown</name>
5
5
  <uid>8f0e1fbb-8bc6-46e5-b6e4-db59177e2c02</uid>
6
- <version_id>682db2ce-3ce6-4536-92ed-d38b7f310919</version_id>
7
- <version_modified>20210423T144509Z</version_modified>
6
+ <version_id>2ff096f8-c72d-444a-a56e-f0633fba2013</version_id>
7
+ <version_modified>20220622T165903Z</version_modified>
8
8
  <xml_checksum>69BA4D91</xml_checksum>
9
9
  <class_name>EnvelopeAndInternalLoadBreakdown</class_name>
10
10
  <display_name>Envelope and Internal Load Breakdown</display_name>
@@ -139,7 +139,7 @@
139
139
  <filename>report.html.erb</filename>
140
140
  <filetype>erb</filetype>
141
141
  <usage_type>resource</usage_type>
142
- <checksum>177CA671</checksum>
142
+ <checksum>6F54D1FE</checksum>
143
143
  </file>
144
144
  </files>
145
145
  </measure>
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  # *******************************************************************************
3
- # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
+ # OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
4
4
  # All rights reserved.
5
5
  # Redistribution and use in source and binary forms, with or without
6
6
  # modification, are permitted provided that the following conditions are met:
@@ -41,6 +41,11 @@
41
41
 
42
42
 
43
43
 
44
+
45
+
46
+
47
+
48
+
44
49
  <!DOCTYPE html>
45
50
  <html lang="en">
46
51
  <head>
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>example_report</name>
5
5
  <uid>174a6f71-3e8c-4f99-9e7a-b64f2e7535d4</uid>
6
- <version_id>1d1f4225-bfba-4673-b81d-0ed9e7e769c5</version_id>
7
- <version_modified>20210423T144518Z</version_modified>
6
+ <version_id>69180469-2020-4295-b159-80a548ad4c5c</version_id>
7
+ <version_modified>20220622T165857Z</version_modified>
8
8
  <xml_checksum>557BF06F</xml_checksum>
9
9
  <class_name>ExampleReport</class_name>
10
10
  <display_name>Example Report</display_name>
@@ -167,7 +167,7 @@
167
167
  <filename>report.html.erb</filename>
168
168
  <filetype>erb</filetype>
169
169
  <usage_type>resource</usage_type>
170
- <checksum>612E9631</checksum>
170
+ <checksum>1C5120F7</checksum>
171
171
  </file>
172
172
  </files>
173
173
  </measure>
@@ -1,6 +1,6 @@
1
1
  <%
2
2
  # *******************************************************************************
3
- # OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC.
3
+ # OpenStudio(R), Copyright (c) 2008-2022, Alliance for Sustainable Energy, LLC.
4
4
  # All rights reserved.
5
5
  # Redistribution and use in source and binary forms, with or without
6
6
  # modification, are permitted provided that the following conditions are met:
@@ -42,6 +42,11 @@
42
42
 
43
43
 
44
44
 
45
+
46
+
47
+
48
+
49
+
45
50
  <!DOCTYPE html>
46
51
  <html lang="en">
47
52
  <head>
@@ -28,7 +28,7 @@ This used to set the target standard for most checks.
28
28
  **Model Dependent:** false
29
29
 
30
30
  ### EUI Reasonableness (General)
31
- Check EUI for model against selected ASHRAE standard DOE prototype buildings.
31
+ Check model EUI against selected ASHRAE standard DOE prototype building.
32
32
  **Name:** check_eui_reasonableness,
33
33
  **Type:** Boolean,
34
34
  **Units:** ,
@@ -44,7 +44,7 @@ Check EUI for model against selected ASHRAE standard DOE prototype buildings.
44
44
  **Model Dependent:** false
45
45
 
46
46
  ### End Use by Category (General)
47
- Check end use by category against selected ASHRAE standard DOE prototype buildings.
47
+ Check model consumption by end use against selected ASHRAE standard DOE prototype building.
48
48
  **Name:** check_eui_by_end_use,
49
49
  **Type:** Boolean,
50
50
  **Units:** ,
@@ -100,7 +100,7 @@ Check for simultaneous heating and cooling by looping through all Single Duct VA
100
100
  **Model Dependent:** false
101
101
 
102
102
  ### Internal Loads (Baseline)
103
- Check LPD, ventilation rates, occupant density, plug loads, and equipment loads against selected ASHRAE standard and DOE Prototype buildings.
103
+ Check LPD, ventilation rates, occupant density, plug loads, and equipment loads against selected ASHRAE standard DOE Prototype buildings.
104
104
  **Name:** check_internal_loads,
105
105
  **Type:** Boolean,
106
106
  **Units:** ,
@@ -179,7 +179,7 @@ Check against selected ASHRAE standard for the following component types: Chille
179
179
  **Required:** true,
180
180
  **Model Dependent:** false
181
181
 
182
- ### Mechanical System Type (Baseline)
182
+ ### Baseline Mechanical System Type (Baseline)
183
183
  Check against ASHRAE 90.1. Infers the baseline system type based on the equipment serving the zone and their heating/cooling fuels. Only does a high-level inference; does not look for the presence/absence of required controls, etc.
184
184
  **Name:** check_mech_sys_type,
185
185
  **Type:** Boolean,
@@ -203,6 +203,21 @@ Check if fans modeled to ASHRAE 90.1 2013 Section G3.1.2.9 requirements. Compare
203
203
  **Required:** true,
204
204
  **Model Dependent:** false
205
205
 
206
+ ### Use Upstream Argument Values
207
+ When true this will look for arguments or registerValues in upstream measures that match arguments from this measure, and will use the value from the upstream measure in place of what is entered for this measure.
208
+ **Name:** use_upstream_args,
209
+ **Type:** Boolean,
210
+ **Units:** ,
211
+ **Required:** true,
212
+ **Model Dependent:** false
213
+
214
+
215
+
216
+
206
217
 
207
218
 
219
+ ## Screenshot of Sample Summary Table
220
+ ![Summary Table](./docs/generic_qaqc_summary.jpg?raw=true)
208
221
 
222
+ ## Screenshot of Sample Detailed Table
223
+ ![Detailed Table](./docs/generic_qaqc_detailed.jpg?raw=true)
@@ -39,4 +39,10 @@
39
39
  <% output_names << output[:display_name] %>
40
40
  <% end %>
41
41
  <%= output_names.join(", ") %>
42
- <% end %>
42
+ <% end %>
43
+
44
+ ## Screenshot of Sample Summary Table
45
+ ![Summary Table](./docs/generic_qaqc_summary.jpg?raw=true)
46
+
47
+ ## Screenshot of Sample Detailed Table
48
+ ![Detailed Table](./docs/generic_qaqc_detailed.jpg?raw=true)
@@ -41,6 +41,7 @@ require 'openstudio-standards'
41
41
  require 'openstudio-extension'
42
42
  require 'openstudio/extension/core/os_lib_schedules'
43
43
  require 'openstudio/extension/core/os_lib_helper_methods'
44
+ require 'openstudio/extension/core/os_lib_model_generation.rb'
44
45
 
45
46
  # require all .rb files in resources folder
46
47
  Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }
@@ -49,6 +50,9 @@ Dir[File.dirname(__FILE__) + '/resources/*.rb'].each { |file| require file }
49
50
  class GenericQAQC < OpenStudio::Measure::ReportingMeasure
50
51
  # all QAQC checks should be in OsLib_QAQC module
51
52
  include OsLib_QAQC
53
+ include OsLib_HelperMethods
54
+ include OsLib_ModelGeneration
55
+
52
56
  # OsLib_CreateResults is needed for utility EDA programs but not the generic QAQC measure
53
57
  # include OsLib_CreateResults
54
58
 
@@ -89,6 +93,7 @@ class GenericQAQC < OpenStudio::Measure::ReportingMeasure
89
93
 
90
94
  # gather inputs for check_mech_sys_capacity. Each option has a target value, min and max fractional tolerance, and units
91
95
  # in the future climate zone specific targets may be in standards
96
+ # todo - expose these tollerances as user arguments
92
97
  options_check_mech_sys_capacity = {}
93
98
  options_check_mech_sys_capacity['chiller_max_flow_rate'] = { 'target' => 2.4, 'min' => 0.1, 'max' => 0.1, 'units' => 'gal/ton*min' }
94
99
  options_check_mech_sys_capacity['air_loop_max_flow_rate'] = { 'target' => 1.0, 'min' => 0.1, 'max' => 0.1, 'units' => 'cfm/ft^2' }
@@ -117,14 +122,7 @@ class GenericQAQC < OpenStudio::Measure::ReportingMeasure
117
122
  args = OpenStudio::Measure::OSArgumentVector.new
118
123
 
119
124
  # Make an argument for the template
120
- template_chs = OpenStudio::StringVector.new
121
- template_chs << 'DOE Ref Pre-1980'
122
- template_chs << 'DOE Ref 1980-2004'
123
- template_chs << '90.1-2004'
124
- template_chs << '90.1-2007'
125
- template_chs << '90.1-2010'
126
- template_chs << '90.1-2013'
127
- template = OpenStudio::Measure::OSArgument.makeChoiceArgument('template', template_chs, true)
125
+ template = OpenStudio::Measure::OSArgument.makeChoiceArgument('template', get_doe_templates(false), true)
128
126
  template.setDisplayName('Target ASHRAE Standard')
129
127
  template.setDescription('This used to set the target standard for most checks.')
130
128
  template.setDefaultValue('90.1-2013') # there is override variable in run method for this
@@ -184,6 +182,13 @@ class GenericQAQC < OpenStudio::Measure::ReportingMeasure
184
182
  end
185
183
  end
186
184
 
185
+ # make an argument for use_upstream_args
186
+ use_upstream_args = OpenStudio::Measure::OSArgument.makeBoolArgument('use_upstream_args', true)
187
+ use_upstream_args.setDisplayName('Use Upstream Argument Values')
188
+ use_upstream_args.setDescription('When true this will look for arguments or registerValues in upstream measures that match arguments from this measure, and will use the value from the upstream measure in place of what is entered for this measure.')
189
+ use_upstream_args.setDefaultValue(true)
190
+ args << use_upstream_args
191
+
187
192
  return args
188
193
  end # end the arguments method
189
194
 
@@ -267,32 +272,32 @@ class GenericQAQC < OpenStudio::Measure::ReportingMeasure
267
272
  # used for edapt programs to populate xml file with extra data
268
273
  # report_elems << create_results
269
274
 
270
- # utility name to to used by some qaqc checks
271
- @utility_name = nil # for utility QAQC string is passed in
272
- default_target_standard = args['template'] # for utility QAQC this is hard coded, for generic it is user argument
273
-
274
- # for large scale analysis may want to infer this from building name so it will be in sync with template variables from earlier measures
275
- override_template_arg = false
276
- if override_template_arg
277
- template_chs = []
278
- template_chs << 'DOE Ref Pre-1980'
279
- template_chs << 'DOE Ref 1980-2004'
280
- template_chs << '90.1-2004'
281
- template_chs << '90.1-2007'
282
- template_chs << '90.1-2010'
283
- template_chs << '90.1-2013'
284
- # map standard
285
- template_chs.each do |template_ch|
286
- if @model.getBuilding.name.to_s.include?(template_ch)
287
- default_target_standard = template_ch
288
- if template_ch != args['template']
289
- runner.registerInfo("override_template_arg is true. Ignoring user argument of #{args['template']} and instead using #{template_ch}.")
275
+ # lookup and replace argument values from upstream measures
276
+ if args['use_upstream_args'] == true
277
+ args.each do |arg, value|
278
+ next if arg == 'use_upstream_args' # this argument should not be changed
279
+ value_from_osw = OsLib_HelperMethods.check_upstream_measure_for_arg(runner, arg)
280
+ if !value_from_osw.empty?
281
+ runner.registerInfo("Replacing argument named #{arg} from current measure with a value of #{value_from_osw[:value]} from #{value_from_osw[:measure_name]}.")
282
+ new_val = value_from_osw[:value]
283
+ # TODO: - make code to handle non strings more robust. check_upstream_measure_for_arg coudl pass bakc the argument type
284
+ if arg == 'total_bldg_floor_area'
285
+ args[arg] = new_val.to_f
286
+ elsif arg == 'num_stories_above_grade'
287
+ args[arg] = new_val.to_f
288
+ elsif arg == 'zipcode'
289
+ args[arg] = new_val.to_i
290
+ else
291
+ args[arg] = new_val
290
292
  end
291
- break
292
293
  end
293
294
  end
294
295
  end
295
296
 
297
+ # utility name to to used by some qaqc checks
298
+ @utility_name = nil # for utility QAQC string is passed in
299
+ default_target_standard = args['template'] # for utility QAQC this is hard coded, for generic it is user argument
300
+
296
301
  # get building type, different standards path if multifamily
297
302
  building_type = ''
298
303
  if @model.getBuilding.standardsBuildingType.is_initialized