urbanopt-reporting 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +36 -0
- data/Rakefile +16 -6
- data/doc_templates/copyright_ruby.txt +17 -7
- data/lib/measures/default_feature_reports/measure.rb +121 -97
- data/lib/measures/default_feature_reports/measure.xml +11 -11
- data/lib/measures/export_modelica_loads/LICENSE.md +23 -23
- data/lib/measures/export_modelica_loads/measure.rb +93 -96
- data/lib/measures/export_modelica_loads/measure.xml +21 -21
- data/lib/measures/export_time_series_modelica/LICENSE.md +27 -1
- data/lib/measures/export_time_series_modelica/measure.rb +165 -163
- data/lib/measures/export_time_series_modelica/measure.xml +18 -18
- data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +40 -35
- data/lib/urbanopt/reporting.rb +16 -6
- data/lib/urbanopt/reporting/default_reports.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/construction_cost.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/date.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/end_use.rb +54 -23
- data/lib/urbanopt/reporting/default_reports/end_uses.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/extension.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/feature_report.rb +21 -7
- data/lib/urbanopt/reporting/default_reports/generator.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/location.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/logger.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/power_distribution.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/program.rb +17 -7
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/scenario_report.rb +25 -13
- data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +11 -10
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +4 -1
- data/lib/urbanopt/reporting/default_reports/solar_pv.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/storage.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +17 -7
- data/lib/urbanopt/reporting/default_reports/validator.rb +16 -6
- data/lib/urbanopt/reporting/default_reports/wind.rb +16 -6
- data/lib/urbanopt/reporting/derived_extension.rb +16 -6
- data/lib/urbanopt/reporting/version.rb +17 -7
- data/urbanopt-reporting-gem.gemspec +3 -3
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b054eb35c606b016c477af8a6ef130f3ea17272ebce7b7c6ba0baf7654052842
|
4
|
+
data.tar.gz: c113ced6a3818b22f73254f9374068de1f0365da03b4e0e7e2c503d08cf9e184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a0234e8a7192d06723ef03c93e1d575f9f8a49600a1c1dd8108a52dc7b6f43267265b4b58c174b72f6ddb691b032fb16134939dcc1b86019cf8092cebdce256
|
7
|
+
data.tar.gz: d01b29f21b8bfe8b2600d0146d401cbdeebaeb011d953bf87d94649112e610b38a4a48634a2b747785be65434171617ff09c92ae7e1a04776dffca613e745178
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,41 @@
|
|
1
1
|
# URBANopt Reporting Gem
|
2
2
|
|
3
|
+
## Version 0.4.0
|
4
|
+
|
5
|
+
Date Range: 03/27/21 - 04/26/21
|
6
|
+
|
7
|
+
- Update dependencies for OpenStudio 3.2.0 and Ruby 2.7
|
8
|
+
|
9
|
+
## Version 0.3.7
|
10
|
+
|
11
|
+
Date Range: 02/12/21 - 03/26/21
|
12
|
+
|
13
|
+
- Fixed [#47]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/47 ), Default features report bugfixes and updates
|
14
|
+
- Fixed [#67]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/67 ), Update copyrights for 2021
|
15
|
+
- Fixed [#70]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/70 ), feature report bug fix
|
16
|
+
|
17
|
+
## Version 0.3.6
|
18
|
+
|
19
|
+
Date Range: 02/05/21 - 02/11/21
|
20
|
+
|
21
|
+
- Fixed [#64]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/64 ), EnergyPlus changed output fuel names in version 9.4
|
22
|
+
|
23
|
+
## Version 0.3.5
|
24
|
+
|
25
|
+
Date Range: 01/16/21 - 02/04/21
|
26
|
+
|
27
|
+
- Fixed [#58]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/58 ), Feature report saving bug fix.
|
28
|
+
- Fixed [#60]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/60 ), Added EV/ ExteriorEquipment results to csv and json reports
|
29
|
+
- Fixed [#61]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/61 ), Enhance the aggregation of enduses.
|
30
|
+
|
31
|
+
|
32
|
+
## Version 0.3.4
|
33
|
+
|
34
|
+
Date Range: 01/14/21 - 01/15/21
|
35
|
+
|
36
|
+
- Fixed [#53]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/53 ), Make subfolders in feature saving if necessary
|
37
|
+
- Fixed [#55]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/55 ), Fix new measures
|
38
|
+
|
3
39
|
## Version 0.3.3
|
4
40
|
|
5
41
|
Date Range: 12/09/20 - 01/13/21
|
data/Rakefile
CHANGED
@@ -1,21 +1,31 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
2
|
+
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
|
3
3
|
# contributors. All rights reserved.
|
4
|
-
|
4
|
+
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification,
|
6
6
|
# are permitted provided that the following conditions are met:
|
7
|
-
|
7
|
+
|
8
8
|
# Redistributions of source code must retain the above copyright notice, this list
|
9
9
|
# of conditions and the following disclaimer.
|
10
|
-
|
10
|
+
|
11
11
|
# Redistributions in binary form must reproduce the above copyright notice, this
|
12
12
|
# list of conditions and the following disclaimer in the documentation and/or other
|
13
13
|
# materials provided with the distribution.
|
14
|
-
|
14
|
+
|
15
15
|
# Neither the name of the copyright holder nor the names of its contributors may be
|
16
16
|
# used to endorse or promote products derived from this software without specific
|
17
17
|
# prior written permission.
|
18
|
-
|
18
|
+
|
19
|
+
# Redistribution of this software, without modification, must refer to the software
|
20
|
+
# by the same designation. Redistribution of a modified version of this software
|
21
|
+
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
+
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
+
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
+
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
+
# refer to any modified version of this software or any modified version of the
|
26
|
+
# underlying software originally provided by Alliance without the prior written
|
27
|
+
# consent of Alliance.
|
28
|
+
|
19
29
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
20
30
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
21
31
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
@@ -1,21 +1,31 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
2
|
+
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
|
3
3
|
# contributors. All rights reserved.
|
4
|
-
|
4
|
+
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification,
|
6
6
|
# are permitted provided that the following conditions are met:
|
7
|
-
|
7
|
+
|
8
8
|
# Redistributions of source code must retain the above copyright notice, this list
|
9
9
|
# of conditions and the following disclaimer.
|
10
|
-
|
10
|
+
|
11
11
|
# Redistributions in binary form must reproduce the above copyright notice, this
|
12
12
|
# list of conditions and the following disclaimer in the documentation and/or other
|
13
13
|
# materials provided with the distribution.
|
14
|
-
|
14
|
+
|
15
15
|
# Neither the name of the copyright holder nor the names of its contributors may be
|
16
16
|
# used to endorse or promote products derived from this software without specific
|
17
17
|
# prior written permission.
|
18
|
-
|
18
|
+
|
19
|
+
# Redistribution of this software, without modification, must refer to the software
|
20
|
+
# by the same designation. Redistribution of a modified version of this software
|
21
|
+
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
+
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
+
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
+
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
+
# refer to any modified version of this software or any modified version of the
|
26
|
+
# underlying software originally provided by Alliance without the prior written
|
27
|
+
# consent of Alliance.
|
28
|
+
|
19
29
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
20
30
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
21
31
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
@@ -26,4 +36,4 @@
|
|
26
36
|
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
27
37
|
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
28
38
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
# *********************************************************************************
|
39
|
+
# *********************************************************************************
|
@@ -1,21 +1,31 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
2
|
+
# URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
|
3
3
|
# contributors. All rights reserved.
|
4
|
-
|
4
|
+
|
5
5
|
# Redistribution and use in source and binary forms, with or without modification,
|
6
6
|
# are permitted provided that the following conditions are met:
|
7
|
-
|
7
|
+
|
8
8
|
# Redistributions of source code must retain the above copyright notice, this list
|
9
9
|
# of conditions and the following disclaimer.
|
10
|
-
|
10
|
+
|
11
11
|
# Redistributions in binary form must reproduce the above copyright notice, this
|
12
12
|
# list of conditions and the following disclaimer in the documentation and/or other
|
13
13
|
# materials provided with the distribution.
|
14
|
-
|
14
|
+
|
15
15
|
# Neither the name of the copyright holder nor the names of its contributors may be
|
16
16
|
# used to endorse or promote products derived from this software without specific
|
17
17
|
# prior written permission.
|
18
|
-
|
18
|
+
|
19
|
+
# Redistribution of this software, without modification, must refer to the software
|
20
|
+
# by the same designation. Redistribution of a modified version of this software
|
21
|
+
# (i) may not refer to the modified version by the same designation, or by any
|
22
|
+
# confusingly similar designation, and (ii) must refer to the underlying software
|
23
|
+
# originally provided by Alliance as “URBANopt”. Except to comply with the foregoing,
|
24
|
+
# the term “URBANopt”, or any confusingly similar designation may not be used to
|
25
|
+
# refer to any modified version of this software or any modified version of the
|
26
|
+
# underlying software originally provided by Alliance without the prior written
|
27
|
+
# consent of Alliance.
|
28
|
+
|
19
29
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
20
30
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
21
31
|
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
@@ -101,10 +111,9 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
101
111
|
def fuel_types
|
102
112
|
fuel_types = {
|
103
113
|
'Electricity' => 'Electricity',
|
104
|
-
'
|
105
|
-
'
|
114
|
+
'NaturalGas' => 'Natural Gas',
|
115
|
+
'FuelOilNo2' => 'Fuel Oil #2',
|
106
116
|
'Propane' => 'Propane',
|
107
|
-
'AdditionalFuel' => 'Additional Fuel',
|
108
117
|
'DistrictCooling' => 'District Cooling',
|
109
118
|
'DistrictHeating' => 'District Heating',
|
110
119
|
'Water' => 'Water'
|
@@ -113,6 +122,11 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
113
122
|
return fuel_types
|
114
123
|
end
|
115
124
|
|
125
|
+
# define other fuel types
|
126
|
+
def other_fuels
|
127
|
+
return ['Gasoline', 'Diesel', 'Coal', 'Fuel Oil No 1', 'Other Fuel 1', 'Steam']
|
128
|
+
end
|
129
|
+
|
116
130
|
# define enduses
|
117
131
|
def end_uses
|
118
132
|
end_uses = {
|
@@ -177,13 +191,13 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
177
191
|
end
|
178
192
|
end
|
179
193
|
|
180
|
-
# OtherFuels
|
181
|
-
other_fuels = ['FuelOil#1', 'Diesel', 'Gasoline', 'Coal', 'Steam']
|
194
|
+
# Create a custom meter for OtherFuels
|
182
195
|
other_fuel_uses = ['HeatRejection', 'Heating', 'WaterSystems', 'InteriorEquipment']
|
183
|
-
custom_meter_facility = 'Meter:Custom,OtherFuels:Facility,
|
196
|
+
custom_meter_facility = 'Meter:Custom,OtherFuels:Facility,OtherFuel2'
|
184
197
|
other_fuel_uses.each do |end_use|
|
185
|
-
custom_meter = "Meter:Custom,#{end_use}:OtherFuels,
|
198
|
+
custom_meter = "Meter:Custom,#{end_use}:OtherFuels,OtherFuel2"
|
186
199
|
other_fuels.each do |other_fuel|
|
200
|
+
other_fuel = other_fuel.gsub(' ', '')
|
187
201
|
result << OpenStudio::IdfObject.load("Output:Meter,#{end_use}:#{other_fuel},#{reporting_frequency};").get
|
188
202
|
custom_meter_facility += ",,#{end_use}:#{other_fuel}"
|
189
203
|
custom_meter += ",,#{end_use}:#{other_fuel}"
|
@@ -198,9 +212,10 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
198
212
|
# Request the output for each end use/fuel type combination
|
199
213
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Electricity:Facility,#{reporting_frequency};").get
|
200
214
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,ElectricityProduced:Facility,#{reporting_frequency};").get
|
201
|
-
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,
|
215
|
+
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,NaturalGas:Facility,#{reporting_frequency};").get
|
202
216
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictCooling:Facility,#{reporting_frequency};").get
|
203
217
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictHeating:Facility,#{reporting_frequency};").get
|
218
|
+
|
204
219
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Cooling:Electricity,#{reporting_frequency};").get
|
205
220
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:Electricity,#{reporting_frequency};").get
|
206
221
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorLights:Electricity,#{reporting_frequency};").get
|
@@ -209,18 +224,22 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
209
224
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Fans:Electricity,#{reporting_frequency};").get
|
210
225
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Pumps:Electricity,#{reporting_frequency};").get
|
211
226
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,WaterSystems:Electricity,#{reporting_frequency};").get
|
212
|
-
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:
|
213
|
-
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,WaterSystems:
|
214
|
-
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorEquipment:
|
227
|
+
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:NaturalGas,#{reporting_frequency};").get
|
228
|
+
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,WaterSystems:NaturalGas,#{reporting_frequency};").get
|
229
|
+
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorEquipment:NaturalGas,#{reporting_frequency};").get
|
215
230
|
result << OpenStudio::IdfObject.load('Output:Variable,*,Heating Coil Heating Rate,hourly; !- HVAC Average [W];').get
|
231
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Exterior Equipment:Electric Vehicles,#{reporting_frequency};").get
|
216
232
|
|
217
233
|
timeseries_data = ['District Cooling Chilled Water Rate', 'District Cooling Mass Flow Rate',
|
218
234
|
'District Cooling Inlet Temperature', 'District Cooling Outlet Temperature',
|
219
235
|
'District Heating Hot Water Rate', 'District Heating Mass Flow Rate',
|
220
236
|
'District Heating Inlet Temperature', 'District Heating Outlet Temperature', 'Cooling Coil Total Cooling Rate',
|
221
|
-
'Heating Coil Heating Rate']
|
237
|
+
'Heating Coil Heating Rate', 'ExteriorEquipment:Electricity']
|
222
238
|
|
223
239
|
tes_timeseries_data = ['Ice Thermal Storage End Fraction', 'Cooling coil Ice Thermal Storage End Fraction']
|
240
|
+
|
241
|
+
ev_timeseries_data = ['Exterior Equipment:Electric Vehicles']
|
242
|
+
|
224
243
|
timeseries_data += tes_timeseries_data
|
225
244
|
|
226
245
|
timeseries_data.each do |ts|
|
@@ -389,27 +408,34 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
389
408
|
# unconditioned_area
|
390
409
|
unconditioned_area = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='Building Area' AND RowName='Unconditioned Building Area' AND ColumnName='Area'")
|
391
410
|
feature_report.program.unconditioned_area_sqft = convert_units(unconditioned_area, 'm^2', 'ft^2')
|
392
|
-
|
393
|
-
|
394
|
-
|
411
|
+
if building.standardsBuildingType.is_initialized
|
412
|
+
floor_area -= unconditioned_area if ['Residential'].include?(building.standardsBuildingType.get) # conditioned floor area only
|
413
|
+
end
|
395
414
|
|
396
415
|
# maximum_number_of_stories
|
397
416
|
number_of_stories = building.standardsNumberOfStories.get if building.standardsNumberOfStories.is_initialized
|
398
417
|
number_of_stories ||= 1
|
399
418
|
feature_report.program.maximum_number_of_stories = number_of_stories
|
400
419
|
|
401
|
-
# maximum_roof_height
|
402
|
-
floor_to_floor_height = building.nominalFloortoFloorHeight.to_f
|
403
|
-
maximum_roof_height = number_of_stories * floor_to_floor_height
|
404
|
-
feature_report.program.maximum_roof_height_ft = maximum_roof_height
|
405
|
-
|
406
420
|
# maximum_number_of_stories_above_ground
|
407
421
|
number_of_stories_above_ground = building.standardsNumberOfAboveGroundStories.get if building.standardsNumberOfAboveGroundStories.is_initialized
|
408
422
|
number_of_stories_above_ground ||= 1
|
409
423
|
feature_report.program.maximum_number_of_stories_above_ground = number_of_stories_above_ground
|
410
424
|
|
425
|
+
# maximum_roof_height
|
426
|
+
floor_to_floor_height = building.nominalFloortoFloorHeight.get if building.nominalFloortoFloorHeight.is_initialized
|
427
|
+
floor_to_floor_height ||= 8
|
428
|
+
feature_report.program.maximum_roof_height_ft = feature_report.program.maximum_number_of_stories_above_ground * floor_to_floor_height
|
429
|
+
|
430
|
+
# footprint_area
|
431
|
+
if not ['Residential'].include?(building.standardsBuildingType.get)
|
432
|
+
feature_report.program.footprint_area_sqft = feature_report.program.floor_area_sqft / number_of_stories
|
433
|
+
else
|
434
|
+
feature_report.program.footprint_area_sqft = convert_units(floor_area, 'm^2', 'ft^2') / building.additionalProperties.getFeatureAsInteger('NumberOfConditionedStories').get
|
435
|
+
end
|
436
|
+
|
411
437
|
# number_of_residential_units
|
412
|
-
number_of_living_units = building.standardsNumberOfLivingUnits.
|
438
|
+
number_of_living_units = building.standardsNumberOfLivingUnits.get if building.standardsNumberOfLivingUnits.is_initialized
|
413
439
|
number_of_living_units ||= 1
|
414
440
|
feature_report.program.number_of_residential_units = number_of_living_units
|
415
441
|
|
@@ -430,6 +456,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
430
456
|
else
|
431
457
|
building_type = building_type.get
|
432
458
|
end
|
459
|
+
next if ['Residential'].include?(building_type) # space types with empty building type fields will inherit from the building object
|
433
460
|
space_type_areas[building_type] = 0 if space_type_areas[building_type].nil?
|
434
461
|
space_type_areas[building_type] += convert_units(space_type.floorArea, 'm^2', 'ft^2')
|
435
462
|
end
|
@@ -505,18 +532,17 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
505
532
|
feature_report.program.roof_area_sqft[:total_roof_area_sqft] = total_roof_area_sqft
|
506
533
|
|
507
534
|
# available_roof_area_sqft
|
508
|
-
# RK: a more robust method should be implemented to find the available_roof_area
|
535
|
+
# RK: a more robust method should be implemented to find the available_roof_area
|
509
536
|
# assign available roof area to be a percentage of the total roof area
|
510
537
|
|
511
538
|
if building_types[0][:building_type].include? 'Single-Family Detached'
|
512
539
|
feature_report.program.roof_area_sqft[:available_roof_area_sqft] = 0.45 * total_roof_area_sqft
|
513
|
-
else
|
540
|
+
else
|
514
541
|
feature_report.program.roof_area_sqft[:available_roof_area_sqft] = 0.75 * total_roof_area_sqft
|
515
542
|
end
|
516
543
|
|
517
544
|
# RK: Temporary solution: assign available roof area to be equal to total roof area
|
518
|
-
#feature_report.program.roof_area_sqft[:available_roof_area_sqft] = total_roof_area_sqft
|
519
|
-
|
545
|
+
# feature_report.program.roof_area_sqft[:available_roof_area_sqft] = total_roof_area_sqft
|
520
546
|
|
521
547
|
# orientation
|
522
548
|
# RK: a more robust method should be implemented to find orientation(finding main axis of the building using aspect ratio)
|
@@ -606,13 +632,13 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
606
632
|
if begin_month == 1 && begin_day_of_month == 1 && end_month == 12 && end_day_of_month == 31
|
607
633
|
# calculate site EUI
|
608
634
|
site_EUI_kwh_per_m2 = feature_report.reporting_periods[0].total_site_energy_kwh / floor_area
|
609
|
-
site_EUI_kbtu_per_ft2 = convert_units(total_site_energy, 'GJ', 'kBtu') /
|
635
|
+
site_EUI_kbtu_per_ft2 = convert_units(total_site_energy, 'GJ', 'kBtu') / convert_units(floor_area, 'm^2', 'ft^2')
|
610
636
|
# add site EUI to feature report
|
611
637
|
feature_report.reporting_periods[0].site_EUI_kwh_per_m2 = site_EUI_kwh_per_m2
|
612
638
|
feature_report.reporting_periods[0].site_EUI_kbtu_per_ft2 = site_EUI_kbtu_per_ft2
|
613
639
|
# calculate source EUI
|
614
640
|
source_EUI_kwh_per_m2 = feature_report.reporting_periods[0].total_source_energy_kwh / floor_area
|
615
|
-
source_EUI_kbtu_per_ft2 = convert_units(total_source_energy, 'GJ', 'kBtu') /
|
641
|
+
source_EUI_kbtu_per_ft2 = convert_units(total_source_energy, 'GJ', 'kBtu') / convert_units(floor_area, 'm^2', 'ft^2')
|
616
642
|
# add source EUI to feature report
|
617
643
|
feature_report.reporting_periods[0].source_EUI_kwh_per_m2 = source_EUI_kwh_per_m2
|
618
644
|
feature_report.reporting_periods[0].source_EUI_kbtu_per_ft2 = source_EUI_kbtu_per_ft2
|
@@ -635,40 +661,45 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
635
661
|
feature_report.reporting_periods[0].natural_gas_kwh = convert_units(natural_gas, 'GJ', 'kWh')
|
636
662
|
|
637
663
|
# propane
|
638
|
-
propane = sql_query(runner, sql_file, '
|
639
|
-
feature_report.reporting_periods[0].propane_kwh =
|
640
|
-
feature_report.reporting_periods[0].propane_kwh = convert_units(propane, 'GJ', 'kWh') unless propane.nil?
|
664
|
+
propane = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Propane'")
|
665
|
+
feature_report.reporting_periods[0].propane_kwh = convert_units(propane, 'GJ', 'kWh')
|
641
666
|
|
642
667
|
# fuel_oil
|
643
|
-
fuel_oil = sql_query(runner, sql_file, '
|
644
|
-
feature_report.reporting_periods[0].fuel_oil_kwh =
|
645
|
-
feature_report.reporting_periods[0].fuel_oil_kwh = convert_units(fuel_oil, 'GJ', 'kWh') unless fuel_oil.nil?
|
668
|
+
fuel_oil = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Fuel Oil No 2'")
|
669
|
+
feature_report.reporting_periods[0].fuel_oil_kwh = convert_units(fuel_oil, 'GJ', 'kWh')
|
646
670
|
|
647
671
|
# other_fuels
|
648
|
-
|
649
|
-
|
672
|
+
gasoline = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Gasoline'")
|
673
|
+
diesel = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Diesel'")
|
674
|
+
coal = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Coal'")
|
675
|
+
fueloilno1 = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Fuel Oil No 1'")
|
676
|
+
otherfuel1 = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Other Fuel 1'")
|
677
|
+
steam = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Steam'")
|
678
|
+
# ensure not nil
|
650
679
|
feature_report.reporting_periods[0].other_fuels_kwh = 0.0
|
651
|
-
feature_report.reporting_periods[0].other_fuels_kwh
|
652
|
-
feature_report.reporting_periods[0].other_fuels_kwh
|
653
|
-
feature_report.reporting_periods[0].other_fuels_kwh
|
680
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(gasoline, 'GJ', 'kWh') unless gasoline.nil?
|
681
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(diesel, 'GJ', 'kWh') unless diesel.nil?
|
682
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(coal, 'GJ', 'kWh') unless coal.nil?
|
683
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(fueloilno1, 'GJ', 'kWh') unless fueloilno1.nil?
|
684
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(otherfuel1, 'GJ', 'kWh') unless otherfuel1.nil?
|
685
|
+
feature_report.reporting_periods[0].other_fuels_kwh += convert_units(steam, 'GJ', 'kWh') unless steam.nil?
|
654
686
|
|
655
687
|
# district_cooling
|
656
688
|
district_cooling = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='District Cooling'")
|
657
689
|
feature_report.reporting_periods[0].district_cooling_kwh = convert_units(district_cooling, 'GJ', 'kWh')
|
658
|
-
|
659
|
-
feature_report.reporting_periods[0].district_cooling_kwh = 0.0 if
|
690
|
+
if building.standardsBuildingType.is_initialized
|
691
|
+
feature_report.reporting_periods[0].district_cooling_kwh = 0.0 if ['Residential'].include?(building.standardsBuildingType.get)
|
660
692
|
end
|
661
693
|
|
662
694
|
# district_heating
|
663
695
|
district_heating = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='District Heating'")
|
664
696
|
feature_report.reporting_periods[0].district_heating_kwh = convert_units(district_heating, 'GJ', 'kWh')
|
665
|
-
|
666
|
-
feature_report.reporting_periods[0].district_heating_kwh = 0.0 if
|
697
|
+
if building.standardsBuildingType.is_initialized
|
698
|
+
feature_report.reporting_periods[0].district_heating_kwh = 0.0 if ['Residential'].include?(building.standardsBuildingType.get)
|
667
699
|
end
|
668
700
|
|
669
701
|
# water
|
670
702
|
water = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Water'")
|
671
|
-
# feature_report.reporting_periods[0].water = convert_units(water, 'm3', 'ft3')
|
672
703
|
feature_report.reporting_periods[0].water_qbft = water
|
673
704
|
|
674
705
|
# electricity_produced
|
@@ -679,34 +710,11 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
679
710
|
|
680
711
|
# get fuel type as listed in the sql file
|
681
712
|
fueltypes = fuel_types.values
|
682
|
-
fueltypes.delete('Propane')
|
683
|
-
fueltypes.delete('Fuel Oil #2')
|
684
713
|
|
685
714
|
# get enduses as listed in the sql file
|
686
715
|
enduses = end_uses.values
|
687
716
|
enduses.delete('Facility')
|
688
717
|
|
689
|
-
# propane / fuel_oil
|
690
|
-
['Propane', 'Fuel Oil #2'].each do |ft|
|
691
|
-
end_uses.keys.each do |eu|
|
692
|
-
next if eu == 'Facility'
|
693
|
-
|
694
|
-
sql_r = sql_query(runner, sql_file, 'EnergyMeters', "TableName='Annual and Peak Values - Other' AND RowName='#{eu}:#{ft.tr(' ', '')}' AND ColumnName='Annual Value'")
|
695
|
-
|
696
|
-
# report each query in its corresponding feature report obeject
|
697
|
-
x = ft.tr(' ', '_').downcase
|
698
|
-
x = x.gsub('_#2', '')
|
699
|
-
x_u = x + '_kwh'
|
700
|
-
m = feature_report.reporting_periods[0].end_uses.send(x_u)
|
701
|
-
|
702
|
-
y = end_uses[eu].tr(' ', '_').downcase
|
703
|
-
if sql_r.nil?
|
704
|
-
sql_r = 0.0
|
705
|
-
end
|
706
|
-
m.send("#{y}=", convert_units(sql_r, 'GJ', 'kWh'))
|
707
|
-
end
|
708
|
-
end
|
709
|
-
|
710
718
|
# loop through fuel types and enduses to fill in sql_query method
|
711
719
|
fueltypes.each do |ft|
|
712
720
|
enduses.each do |eu|
|
@@ -716,12 +724,10 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
716
724
|
x = ft.tr(' ', '_').downcase
|
717
725
|
if x.include? 'water'
|
718
726
|
x_u = x + '_qbft'
|
719
|
-
else
|
727
|
+
else
|
728
|
+
x = x.gsub('_#2', '')
|
720
729
|
x_u = x + '_kwh'
|
721
730
|
end
|
722
|
-
if x_u == 'additional_fuel_kwh'
|
723
|
-
x_u = 'other_fuels_kwh'
|
724
|
-
end
|
725
731
|
m = feature_report.reporting_periods[0].end_uses.send(x_u)
|
726
732
|
|
727
733
|
y = eu.tr(' ', '_').downcase
|
@@ -730,17 +736,34 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
730
736
|
sql_r = 0.0
|
731
737
|
end
|
732
738
|
sql_r = convert_units(sql_r, 'GJ', 'kWh')
|
733
|
-
|
734
|
-
|
735
|
-
sql_r
|
736
|
-
end
|
737
|
-
building_types.each do |i|
|
738
|
-
sql_r = 0.0 if i[:building_type].include?('Single-Family Detached') && x_u.include?('district')
|
739
|
+
|
740
|
+
if building.standardsBuildingType.is_initialized
|
741
|
+
sql_r = 0.0 if ['Residential'].include?(building.standardsBuildingType.get) && x_u.include?('district')
|
739
742
|
end
|
740
743
|
m.send("#{y}=", sql_r)
|
741
744
|
end
|
742
745
|
end
|
743
746
|
|
747
|
+
# other fuels
|
748
|
+
m = feature_report.reporting_periods[0].end_uses.send('other_fuels_kwh')
|
749
|
+
enduses.each do |eu|
|
750
|
+
y = eu.tr(' ', '_').downcase
|
751
|
+
sql_r = 0.0
|
752
|
+
other_fuels.each do |ft|
|
753
|
+
sql = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='#{eu}' AND ColumnName='#{ft}'")
|
754
|
+
|
755
|
+
# ensure not nil so the equations below don't error out
|
756
|
+
if not sql.nil?
|
757
|
+
sql_r += convert_units(sql, 'GJ', 'kWh')
|
758
|
+
end
|
759
|
+
end
|
760
|
+
m.send("#{y}=", sql_r)
|
761
|
+
end
|
762
|
+
|
763
|
+
# add enduses subcategories
|
764
|
+
electric_vehicles = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses By Subcategory' AND RowName='Exterior Equipment:Electric Vehicles' AND ColumnName='Electricity'")
|
765
|
+
feature_report.reporting_periods[0].end_uses.electricity_kwh.electric_vehicles = convert_units(electric_vehicles, 'GJ', 'kWh')
|
766
|
+
|
744
767
|
### energy_production
|
745
768
|
## electricity_produced
|
746
769
|
# photovoltaic
|
@@ -757,7 +780,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
757
780
|
feature_report.reporting_periods[0].utility_costs_dollar[0][:fuel_type] = 'Electricity'
|
758
781
|
feature_report.reporting_periods[0].utility_costs_dollar[0][:total_cost] = elec_utility_cost
|
759
782
|
# gas utility cost
|
760
|
-
gas_utility_cost = sql_query(runner, sql_file, 'Economics Results Summary Report', "TableName='Annual Cost' AND RowName='Cost' AND ColumnName='Gas'")
|
783
|
+
gas_utility_cost = sql_query(runner, sql_file, 'Economics Results Summary Report', "TableName='Annual Cost' AND RowName='Cost' AND ColumnName='Natural Gas'")
|
761
784
|
feature_report.reporting_periods[0].utility_costs_dollar << { fuel_type: 'Natural Gas', total_cost: gas_utility_cost }
|
762
785
|
|
763
786
|
## comfort_result
|
@@ -795,31 +818,32 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
795
818
|
requested_timeseries_names = [
|
796
819
|
'Electricity:Facility',
|
797
820
|
'ElectricityProduced:Facility',
|
798
|
-
'
|
821
|
+
'NaturalGas:Facility',
|
799
822
|
'Propane:Facility',
|
800
|
-
'
|
823
|
+
'FuelOilNo2:Facility',
|
801
824
|
'OtherFuels:Facility',
|
802
825
|
'Cooling:Electricity',
|
803
826
|
'Heating:Electricity',
|
804
827
|
'InteriorLights:Electricity',
|
805
828
|
'ExteriorLights:Electricity',
|
806
829
|
'InteriorEquipment:Electricity',
|
830
|
+
'ExteriorEquipment:Electricity',
|
807
831
|
'Fans:Electricity',
|
808
832
|
'Pumps:Electricity',
|
809
833
|
'WaterSystems:Electricity',
|
810
834
|
'HeatRejection:Electricity',
|
811
|
-
'HeatRejection:
|
812
|
-
'Heating:
|
813
|
-
'WaterSystems:
|
814
|
-
'InteriorEquipment:
|
835
|
+
'HeatRejection:NaturalGas',
|
836
|
+
'Heating:NaturalGas',
|
837
|
+
'WaterSystems:NaturalGas',
|
838
|
+
'InteriorEquipment:NaturalGas',
|
815
839
|
'HeatRejection:Propane',
|
816
840
|
'Heating:Propane',
|
817
841
|
'WaterSystems:Propane',
|
818
842
|
'InteriorEquipment:Propane',
|
819
|
-
'HeatRejection:
|
820
|
-
'Heating:
|
821
|
-
'WaterSystems:
|
822
|
-
'InteriorEquipment:
|
843
|
+
'HeatRejection:FuelOilNo2',
|
844
|
+
'Heating:FuelOilNo2',
|
845
|
+
'WaterSystems:FuelOilNo2',
|
846
|
+
'InteriorEquipment:FuelOilNo2',
|
823
847
|
'HeatRejection:OtherFuels',
|
824
848
|
'Heating:OtherFuels',
|
825
849
|
'WaterSystems:OtherFuels',
|
@@ -956,14 +980,14 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
956
980
|
end
|
957
981
|
|
958
982
|
# residential considerations
|
959
|
-
|
960
|
-
values[key_cnt] = Array.new(n, 0) if ['DistrictCooling:Facility', 'DistrictHeating:Facility'].include?(timeseries_name) &&
|
983
|
+
if building.standardsBuildingType.is_initialized
|
984
|
+
values[key_cnt] = Array.new(n, 0) if ['DistrictCooling:Facility', 'DistrictHeating:Facility'].include?(timeseries_name) && ['Residential'].include?(building.standardsBuildingType.get)
|
961
985
|
end
|
962
986
|
|
963
987
|
# unit conversion
|
964
988
|
old_unit = ts.get.units if ts.is_initialized
|
965
989
|
|
966
|
-
if timeseries_name.include?('
|
990
|
+
if timeseries_name.include?('NaturalGas') || timeseries_name.include?('Propane') || timeseries_name.include?('FuelOilNo2') || timeseries_name.include?('OtherFuels')
|
967
991
|
new_unit = 'kBtu'
|
968
992
|
else
|
969
993
|
new_unit = case old_unit.to_s
|
@@ -1152,7 +1176,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1152
1176
|
# get the timeseries for any of available timeseries
|
1153
1177
|
# RK: code enhancement needed
|
1154
1178
|
ts_d_e = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Electricity:Facility', '')
|
1155
|
-
ts_d_g = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
1179
|
+
ts_d_g = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'NaturalGas:Facility', '')
|
1156
1180
|
|
1157
1181
|
if ts_d_e.is_initialized
|
1158
1182
|
timeseries_d = ts_d_e.get
|