urbanopt-reporting 0.2.1 → 0.3.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 +6 -0
- data/LICENSE.md +1 -1
- data/doc_templates/LICENSE.md +1 -1
- data/doc_templates/copyright_erb.txt +1 -1
- data/doc_templates/copyright_js.txt +1 -1
- data/doc_templates/copyright_ruby.txt +1 -1
- data/lib/measures/default_feature_reports/LICENSE.md +1 -1
- data/lib/measures/default_feature_reports/measure.rb +148 -56
- data/lib/measures/default_feature_reports/measure.xml +11 -11
- data/lib/urbanopt/reporting/default_reports/end_uses.rb +23 -9
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +28 -20
- data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +15 -0
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +20 -4
- data/lib/urbanopt/reporting/version.rb +1 -1
- data/urbanopt-reporting-gem.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a5d25f304c691b6de042fecc1b03cdbcda6e6cb175609532cf0926116dbce94
|
4
|
+
data.tar.gz: d805ec996625d83bcc9aff79f9d98edf0cc0618ec94b1c799ed8532f7ce47cf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a6cc2110c6ba387e9a9fb23b1dcd9d5bcd56cd342a6448097cce382003caa79aabd2bab83360896c764d888dd41408390c350b5eb25943209c8932f22790c52
|
7
|
+
data.tar.gz: 0c57334221a85295fde20dae7f7ae4ad23145c6baf82d17398c32efa4fc80acf71d5b2c6eb806780d67eba137a98e653a9e930cf5d4fb27ffd8f8bad40a5435f
|
data/CHANGELOG.md
CHANGED
data/LICENSE.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
URBANopt
|
1
|
+
URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
2
2
|
contributors. All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification,
|
data/doc_templates/LICENSE.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
URBANopt
|
1
|
+
URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
2
2
|
contributors. All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%
|
2
2
|
# *********************************************************************************
|
3
|
-
# URBANopt
|
3
|
+
# URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
4
4
|
# contributors. All rights reserved.
|
5
5
|
#
|
6
6
|
# Redistribution and use in source and binary forms, with or without modification,
|
@@ -1,4 +1,4 @@
|
|
1
1
|
/* @preserve
|
2
|
-
* URBANopt
|
2
|
+
* URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
|
3
3
|
* Use of this source code is governed by the BSD 3-Clause license.
|
4
4
|
*/
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
2
|
+
# URBANopt (tm), Copyright (c) 2019-2020, 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,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
URBANopt
|
1
|
+
URBANopt (tm), Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC, and other
|
2
2
|
contributors. All rights reserved.
|
3
3
|
|
4
4
|
Redistribution and use in source and binary forms, with or without modification,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# *********************************************************************************
|
2
|
-
# URBANopt
|
2
|
+
# URBANopt (tm), Copyright (c) 2019-2020, 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,
|
@@ -99,37 +99,39 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
99
99
|
|
100
100
|
# define fuel types
|
101
101
|
def fuel_types
|
102
|
-
fuel_types =
|
103
|
-
'Electricity',
|
104
|
-
'Gas',
|
105
|
-
'
|
106
|
-
'
|
107
|
-
'
|
108
|
-
'
|
109
|
-
|
102
|
+
fuel_types = {
|
103
|
+
'Electricity' => 'Electricity',
|
104
|
+
'Gas' => 'Natural Gas',
|
105
|
+
'FuelOil#2' => 'Fuel Oil #2',
|
106
|
+
'Propane' => 'Propane',
|
107
|
+
'AdditionalFuel' => 'Additional Fuel',
|
108
|
+
'DistrictCooling' => 'District Cooling',
|
109
|
+
'DistrictHeating' => 'District Heating',
|
110
|
+
'Water' => 'Water'
|
111
|
+
}
|
110
112
|
|
111
113
|
return fuel_types
|
112
114
|
end
|
113
115
|
|
114
116
|
# define enduses
|
115
117
|
def end_uses
|
116
|
-
end_uses =
|
117
|
-
'Heating',
|
118
|
-
'Cooling',
|
119
|
-
'InteriorLights',
|
120
|
-
'ExteriorLights',
|
121
|
-
'InteriorEquipment',
|
122
|
-
'ExteriorEquipment',
|
123
|
-
'Fans',
|
124
|
-
'Pumps',
|
125
|
-
'HeatRejection',
|
126
|
-
'Humidifier',
|
127
|
-
'HeatRecovery',
|
128
|
-
'WaterSystems',
|
129
|
-
'Refrigeration',
|
130
|
-
'Generators',
|
131
|
-
'Facility'
|
132
|
-
|
118
|
+
end_uses = {
|
119
|
+
'Heating' => 'Heating',
|
120
|
+
'Cooling' => 'Cooling',
|
121
|
+
'InteriorLights' => 'Interior Lighting',
|
122
|
+
'ExteriorLights' => 'Exterior Lighting',
|
123
|
+
'InteriorEquipment' => 'Interior Equipment',
|
124
|
+
'ExteriorEquipment' => 'Exterior Equipment',
|
125
|
+
'Fans' => 'Fans',
|
126
|
+
'Pumps' => 'Pumps',
|
127
|
+
'HeatRejection' => 'Heat Rejection',
|
128
|
+
'Humidifier' => 'Humidification',
|
129
|
+
'HeatRecovery' => 'Heat Recovery',
|
130
|
+
'WaterSystems' => 'Water Systems',
|
131
|
+
'Refrigeration' => 'Refrigeration',
|
132
|
+
'Generators' => 'Generators',
|
133
|
+
'Facility' => 'Facility'
|
134
|
+
}
|
133
135
|
|
134
136
|
return end_uses
|
135
137
|
end
|
@@ -163,7 +165,9 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
163
165
|
|
164
166
|
# Request the output for each end use/fuel type combination
|
165
167
|
end_uses.each do |end_use|
|
168
|
+
end_use, _ = end_use
|
166
169
|
fuel_types.each do |fuel_type|
|
170
|
+
fuel_type, _ = fuel_type
|
167
171
|
variable_name = if end_use == 'Facility'
|
168
172
|
"#{fuel_type}:#{end_use}"
|
169
173
|
else
|
@@ -173,6 +177,24 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
173
177
|
end
|
174
178
|
end
|
175
179
|
|
180
|
+
# OtherFuels
|
181
|
+
other_fuels = ["FuelOil#1", "Diesel", "Gasoline", "Coal", "Steam"]
|
182
|
+
other_fuel_uses = ["HeatRejection", "Heating", "WaterSystems", "InteriorEquipment"]
|
183
|
+
custom_meter_facility = "Meter:Custom,OtherFuels:Facility,OtherFuel1"
|
184
|
+
other_fuel_uses.each do |end_use|
|
185
|
+
custom_meter = "Meter:Custom,#{end_use}:OtherFuels,OtherFuel1"
|
186
|
+
other_fuels.each do |other_fuel|
|
187
|
+
result << OpenStudio::IdfObject.load("Output:Meter,#{end_use}:#{other_fuel},#{reporting_frequency};").get
|
188
|
+
custom_meter_facility += ",,#{end_use}:#{other_fuel}"
|
189
|
+
custom_meter += ",,#{end_use}:#{other_fuel}"
|
190
|
+
end
|
191
|
+
custom_meter += ";"
|
192
|
+
result << OpenStudio::IdfObject.load(custom_meter).get
|
193
|
+
result << OpenStudio::IdfObject.load("Output:Meter,#{end_use}:OtherFuels,#{reporting_frequency};").get
|
194
|
+
end
|
195
|
+
result << OpenStudio::IdfObject.load("#{custom_meter_facility};").get
|
196
|
+
result << OpenStudio::IdfObject.load("Output:Meter,OtherFuels:Facility,#{reporting_frequency};").get
|
197
|
+
|
176
198
|
# Request the output for each end use/fuel type combination
|
177
199
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Electricity:Facility,#{reporting_frequency};").get
|
178
200
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,ElectricityProduced:Facility,#{reporting_frequency};").get
|
@@ -228,11 +250,14 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
228
250
|
end
|
229
251
|
end
|
230
252
|
|
231
|
-
val
|
253
|
+
return val
|
232
254
|
end
|
233
255
|
|
234
256
|
# unit conversion method
|
235
257
|
def convert_units(value, from_units, to_units)
|
258
|
+
if value.nil?
|
259
|
+
return nil
|
260
|
+
end
|
236
261
|
# apply unit conversion
|
237
262
|
value_converted = OpenStudio.convert(value, from_units, to_units)
|
238
263
|
if value_converted.is_initialized
|
@@ -572,17 +597,35 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
572
597
|
natural_gas = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Natural Gas'")
|
573
598
|
feature_report.reporting_periods[0].natural_gas_kwh = convert_units(natural_gas, 'GJ', 'kWh')
|
574
599
|
|
575
|
-
#
|
600
|
+
# propane
|
601
|
+
propane = sql_query(runner, sql_file, 'EnergyMeters', "TableName='Annual and Peak Values - Other' AND RowName='Propane:Facility' AND ColumnName='Annual Value'")
|
602
|
+
feature_report.reporting_periods[0].propane_kwh = 0.0
|
603
|
+
feature_report.reporting_periods[0].propane_kwh = convert_units(propane, 'GJ', 'kWh') unless propane.nil?
|
604
|
+
|
605
|
+
# fuel_oil
|
606
|
+
fuel_oil = sql_query(runner, sql_file, 'EnergyMeters', "TableName='Annual and Peak Values - Other' AND RowName='FuelOil#2:Facility' AND ColumnName='Annual Value'")
|
607
|
+
feature_report.reporting_periods[0].fuel_oil_kwh = 0.0
|
608
|
+
feature_report.reporting_periods[0].fuel_oil_kwh = convert_units(fuel_oil, 'GJ', 'kWh') unless fuel_oil.nil?
|
609
|
+
|
610
|
+
# other_fuels
|
576
611
|
additional_fuel = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Additional Fuel'")
|
577
|
-
feature_report.reporting_periods[0].
|
612
|
+
feature_report.reporting_periods[0].other_fuels_kwh = convert_units(additional_fuel, 'GJ', 'kWh')
|
613
|
+
feature_report.reporting_periods[0].other_fuels_kwh -= feature_report.reporting_periods[0].propane_kwh
|
614
|
+
feature_report.reporting_periods[0].other_fuels_kwh -= feature_report.reporting_periods[0].fuel_oil_kwh
|
578
615
|
|
579
616
|
# district_cooling
|
580
617
|
district_cooling = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='District Cooling'")
|
581
618
|
feature_report.reporting_periods[0].district_cooling_kwh = convert_units(district_cooling, 'GJ', 'kWh')
|
619
|
+
building_types.each do |i|
|
620
|
+
feature_report.reporting_periods[0].district_cooling_kwh = 0.0 if i[:building_type].include?('Single-Family Detached')
|
621
|
+
end
|
582
622
|
|
583
623
|
# district_heating
|
584
624
|
district_heating = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='District Heating'")
|
585
625
|
feature_report.reporting_periods[0].district_heating_kwh = convert_units(district_heating, 'GJ', 'kWh')
|
626
|
+
building_types.each do |i|
|
627
|
+
feature_report.reporting_periods[0].district_heating_kwh = 0.0 if i[:building_type].include?('Single-Family Detached')
|
628
|
+
end
|
586
629
|
|
587
630
|
# water
|
588
631
|
water = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='Total End Uses' AND ColumnName='Water'")
|
@@ -596,41 +639,62 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
596
639
|
## end_uses
|
597
640
|
|
598
641
|
# get fuel type as listed in the sql file
|
599
|
-
|
642
|
+
fueltypes = fuel_types.values
|
643
|
+
fueltypes.delete('Propane')
|
644
|
+
fueltypes.delete('Fuel Oil #2')
|
600
645
|
|
601
646
|
# get enduses as listed in the sql file
|
602
|
-
enduses =
|
603
|
-
|
647
|
+
enduses = end_uses.values
|
648
|
+
enduses.delete('Facility')
|
649
|
+
|
650
|
+
# propane / fuel_oil
|
651
|
+
['Propane', 'Fuel Oil #2'].each do |ft|
|
652
|
+
end_uses.keys.each do |eu|
|
653
|
+
next if eu == 'Facility'
|
654
|
+
|
655
|
+
sql_r = sql_query(runner, sql_file, 'EnergyMeters', "TableName='Annual and Peak Values - Other' AND RowName='#{eu}:#{ft.tr(' ', '')}' AND ColumnName='Annual Value'")
|
656
|
+
|
657
|
+
# report each query in its corresponding feature report obeject
|
658
|
+
x = ft.tr(' ', '_').downcase
|
659
|
+
x = x.gsub('_#2', '')
|
660
|
+
x_u = x + '_kwh'
|
661
|
+
m = feature_report.reporting_periods[0].end_uses.send(x_u)
|
662
|
+
|
663
|
+
y = end_uses[eu].tr(' ', '_').downcase
|
664
|
+
if sql_r.nil?
|
665
|
+
sql_r = 0.0
|
666
|
+
end
|
667
|
+
m.send("#{y}=", convert_units(sql_r, 'GJ', 'kWh'))
|
668
|
+
end
|
669
|
+
end
|
604
670
|
|
605
671
|
# loop through fuel types and enduses to fill in sql_query method
|
606
|
-
|
672
|
+
fueltypes.each do |ft|
|
607
673
|
enduses.each do |eu|
|
608
674
|
sql_r = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='End Uses' AND RowName='#{eu}' AND ColumnName='#{ft}'")
|
609
675
|
|
610
676
|
# report each query in its corresponding feature report obeject
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
x_u = x + '_qbft'
|
615
|
-
else
|
616
|
-
x_u = x + '_kwh'
|
617
|
-
end
|
618
|
-
m = feature_report.reporting_periods[0].end_uses.send(x_u)
|
677
|
+
x = ft.tr(' ', '_').downcase
|
678
|
+
if x.include? 'water'
|
679
|
+
x_u = x + '_qbft'
|
619
680
|
else
|
620
|
-
|
621
|
-
ft_u = ft + '_qbft'
|
622
|
-
else
|
623
|
-
ft_u = ft + '_kwh'
|
624
|
-
end
|
625
|
-
m = feature_report.reporting_periods[0].end_uses.send(ft_u.downcase)
|
681
|
+
x_u = x + '_kwh'
|
626
682
|
end
|
683
|
+
if x_u == 'additional_fuel_kwh'
|
684
|
+
x_u = 'other_fuels_kwh'
|
685
|
+
end
|
686
|
+
m = feature_report.reporting_periods[0].end_uses.send(x_u)
|
627
687
|
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
688
|
+
y = eu.tr(' ', '_').downcase
|
689
|
+
sql_r = convert_units(sql_r, 'GJ', 'kWh')
|
690
|
+
if x_u == 'other_fuels_kwh'
|
691
|
+
sql_r -= feature_report.reporting_periods[0].end_uses.propane_kwh.send(y)
|
692
|
+
sql_r -= feature_report.reporting_periods[0].end_uses.fuel_oil_kwh.send(y)
|
633
693
|
end
|
694
|
+
building_types.each do |i|
|
695
|
+
sql_r = 0.0 if (i[:building_type].include?('Single-Family Detached') && x_u.include?('district'))
|
696
|
+
end
|
697
|
+
m.send("#{y}=", sql_r)
|
634
698
|
end
|
635
699
|
end
|
636
700
|
|
@@ -689,6 +753,9 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
689
753
|
'Electricity:Facility',
|
690
754
|
'ElectricityProduced:Facility',
|
691
755
|
'Gas:Facility',
|
756
|
+
'Propane:Facility',
|
757
|
+
'FuelOil#2:Facility',
|
758
|
+
'OtherFuels:Facility',
|
692
759
|
'Cooling:Electricity',
|
693
760
|
'Heating:Electricity',
|
694
761
|
'InteriorLights:Electricity',
|
@@ -702,6 +769,18 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
702
769
|
'Heating:Gas',
|
703
770
|
'WaterSystems:Gas',
|
704
771
|
'InteriorEquipment:Gas',
|
772
|
+
'HeatRejection:Propane',
|
773
|
+
'Heating:Propane',
|
774
|
+
'WaterSystems:Propane',
|
775
|
+
'InteriorEquipment:Propane',
|
776
|
+
'HeatRejection:FuelOil#2',
|
777
|
+
'Heating:FuelOil#2',
|
778
|
+
'WaterSystems:FuelOil#2',
|
779
|
+
'InteriorEquipment:FuelOil#2',
|
780
|
+
'HeatRejection:OtherFuels',
|
781
|
+
'Heating:OtherFuels',
|
782
|
+
'WaterSystems:OtherFuels',
|
783
|
+
'InteriorEquipment:OtherFuels',
|
705
784
|
'DistrictCooling:Facility',
|
706
785
|
'DistrictHeating:Facility',
|
707
786
|
'District Cooling Chilled Water Rate',
|
@@ -765,8 +844,12 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
765
844
|
puts " *********timeseries_name = #{timeseries_name}******************"
|
766
845
|
runner.registerInfo("TIMESERIES: #{timeseries_name}")
|
767
846
|
|
768
|
-
# get all the key values that this timeseries can be reported for (e.g. if PMV is requested for each zone)
|
769
|
-
|
847
|
+
# get all the key values that this timeseries can be reported for (e.g. if PMV is requested for each zone)
|
848
|
+
if timeseries_name.include?('OtherFuels')
|
849
|
+
key_values = sql_file.availableKeyValues('RUN PERIOD 1', 'Zone Timestep', timeseries_name.upcase)
|
850
|
+
else
|
851
|
+
key_values = sql_file.availableKeyValues('RUN PERIOD 1', 'Zone Timestep', timeseries_name)
|
852
|
+
end
|
770
853
|
runner.registerInfo("KEY VALUES: #{key_values}")
|
771
854
|
if key_values.empty?
|
772
855
|
key_values = ['']
|
@@ -810,7 +893,11 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
810
893
|
# final_timeseries_names << new_timeseries_name
|
811
894
|
|
812
895
|
# get the actual timeseries
|
813
|
-
|
896
|
+
if timeseries_name.include?('OtherFuels')
|
897
|
+
ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, timeseries_name.upcase, key_value)
|
898
|
+
else
|
899
|
+
ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, timeseries_name, key_value)
|
900
|
+
end
|
814
901
|
|
815
902
|
if n.nil?
|
816
903
|
# first timeseries should always be set
|
@@ -825,10 +912,15 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
825
912
|
values[key_cnt] = Array.new(n, 0)
|
826
913
|
end
|
827
914
|
|
915
|
+
# residential considerations
|
916
|
+
building_types.each do |i|
|
917
|
+
values[key_cnt] = Array.new(n, 0) if ['DistrictCooling:Facility', 'DistrictHeating:Facility'].include?(timeseries_name) && i[:building_type].include?('Single-Family Detached')
|
918
|
+
end
|
919
|
+
|
828
920
|
# unit conversion
|
829
921
|
old_unit = ts.get.units if ts.is_initialized
|
830
922
|
|
831
|
-
if timeseries_name.include?
|
923
|
+
if timeseries_name.include?('Gas') || timeseries_name.include?('Propane') || timeseries_name.include?('FuelOil#2') || timeseries_name.include?('OtherFuels')
|
832
924
|
new_unit = 'kBtu'
|
833
925
|
else
|
834
926
|
new_unit = case old_unit.to_s
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<schema_version>3.0</schema_version>
|
4
4
|
<name>default_feature_reports</name>
|
5
5
|
<uid>9ee3135a-8070-4408-bfa1-b75fecf9dd4f</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>f9af7bd8-e9ce-41b4-b892-df29f235a9bd</version_id>
|
7
|
+
<version_modified>20201201T173130Z</version_modified>
|
8
8
|
<xml_checksum>FB304155</xml_checksum>
|
9
9
|
<class_name>DefaultFeatureReports</class_name>
|
10
10
|
<display_name>DefaultFeatureReports</display_name>
|
@@ -126,17 +126,23 @@
|
|
126
126
|
<usage_type>test</usage_type>
|
127
127
|
<checksum>CC4BFFAF</checksum>
|
128
128
|
</file>
|
129
|
+
<file>
|
130
|
+
<filename>README.md</filename>
|
131
|
+
<filetype>md</filetype>
|
132
|
+
<usage_type>readme</usage_type>
|
133
|
+
<checksum>0B68E96D</checksum>
|
134
|
+
</file>
|
129
135
|
<file>
|
130
136
|
<filename>LICENSE.md</filename>
|
131
137
|
<filetype>md</filetype>
|
132
138
|
<usage_type>license</usage_type>
|
133
|
-
<checksum>
|
139
|
+
<checksum>BBD19F47</checksum>
|
134
140
|
</file>
|
135
141
|
<file>
|
136
142
|
<filename>default_feature_reports_test.rb</filename>
|
137
143
|
<filetype>rb</filetype>
|
138
144
|
<usage_type>test</usage_type>
|
139
|
-
<checksum>
|
145
|
+
<checksum>19681175</checksum>
|
140
146
|
</file>
|
141
147
|
<file>
|
142
148
|
<version>
|
@@ -147,13 +153,7 @@
|
|
147
153
|
<filename>measure.rb</filename>
|
148
154
|
<filetype>rb</filetype>
|
149
155
|
<usage_type>script</usage_type>
|
150
|
-
<checksum>
|
151
|
-
</file>
|
152
|
-
<file>
|
153
|
-
<filename>README.md</filename>
|
154
|
-
<filetype>md</filetype>
|
155
|
-
<usage_type>readme</usage_type>
|
156
|
-
<checksum>0B68E96D</checksum>
|
156
|
+
<checksum>B1E43E26</checksum>
|
157
157
|
</file>
|
158
158
|
</files>
|
159
159
|
</measure>
|
@@ -39,9 +39,9 @@ module URBANopt
|
|
39
39
|
# Enduses class inlclude results for each fuel type.
|
40
40
|
##
|
41
41
|
class EndUses
|
42
|
-
attr_accessor :electricity_kwh, :natural_gas_kwh, :
|
42
|
+
attr_accessor :electricity_kwh, :natural_gas_kwh, :propane_kwh, :fuel_oil_kwh, :other_fuels_kwh, :district_cooling_kwh, :district_heating_kwh, :water_qbft # :nodoc:
|
43
43
|
##
|
44
|
-
# EndUses class intialize end_uses(fuel type) attributes: +:electricity_kwh+ , +:natural_gas_kwh+ , +:
|
44
|
+
# EndUses class intialize end_uses(fuel type) attributes: +:electricity_kwh+ , +:natural_gas_kwh+ , +:propane_kwh+ , +:fuel_oil_kwh+ , +:other_fuels_kwh+ ,
|
45
45
|
# +:district_cooling_kwh+ , +:district_heating_kwh+ , +:water_qbft+
|
46
46
|
##
|
47
47
|
# [parameters:]
|
@@ -53,7 +53,9 @@ module URBANopt
|
|
53
53
|
|
54
54
|
@electricity_kwh = EndUse.new(hash[:electricity_kwh])
|
55
55
|
@natural_gas_kwh = EndUse.new(hash[:natural_gas_kwh])
|
56
|
-
@
|
56
|
+
@propane_kwh = EndUse.new(hash[:propane_kwh])
|
57
|
+
@fuel_oil_kwh = EndUse.new(hash[:fuel_oil_kwh])
|
58
|
+
@other_fuels_kwh = EndUse.new(hash[:other_fuels_kwh])
|
57
59
|
@district_cooling_kwh = EndUse.new(hash[:district_cooling_kwh])
|
58
60
|
@district_heating_kwh = EndUse.new(hash[:district_heating_kwh])
|
59
61
|
@water_qbft = EndUse.new(hash[:water_qbft])
|
@@ -72,7 +74,7 @@ module URBANopt
|
|
72
74
|
def to_hash
|
73
75
|
result = {}
|
74
76
|
|
75
|
-
electricity_kwh_hash = @electricity_kwh.to_hash if @electricity_kwh
|
77
|
+
electricity_kwh_hash = @electricity_kwh.to_hash if @electricity_kwh
|
76
78
|
electricity_kwh_hash.delete_if { |k, v| v.nil? }
|
77
79
|
result[:electricity_kwh] = electricity_kwh_hash if @electricity_kwh
|
78
80
|
|
@@ -80,9 +82,17 @@ module URBANopt
|
|
80
82
|
natural_gas_kwh_hash.delete_if { |k, v| v.nil? }
|
81
83
|
result[:natural_gas_kwh] = natural_gas_kwh_hash if @natural_gas_kwh
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
-
result[:
|
85
|
+
propane_kwh_hash = @propane_kwh.to_hash if @propane_kwh
|
86
|
+
propane_kwh_hash.delete_if { |k, v| v.nil? }
|
87
|
+
result[:propane_kwh] = propane_kwh_hash if @propane_kwh
|
88
|
+
|
89
|
+
fuel_oil_kwh_hash = @fuel_oil_kwh.to_hash if @fuel_oil_kwh
|
90
|
+
fuel_oil_kwh_hash.delete_if { |k, v| v.nil? }
|
91
|
+
result[:fuel_oil_kwh] = fuel_oil_kwh_hash if @fuel_oil_kwh
|
92
|
+
|
93
|
+
other_fuels_kwh_hash = @other_fuels_kwh.to_hash if @other_fuels_kwh
|
94
|
+
other_fuels_kwh_hash.delete_if { |k, v| v.nil? }
|
95
|
+
result[:other_fuels_kwh] = other_fuels_kwh_hash if @other_fuels_kwh
|
86
96
|
|
87
97
|
district_cooling_kwh_hash = @district_cooling_kwh.to_hash if @district_cooling_kwh
|
88
98
|
district_cooling_kwh_hash.delete_if { |k, v| v.nil? }
|
@@ -111,7 +121,9 @@ module URBANopt
|
|
111
121
|
hash = {}
|
112
122
|
hash[:electricity_kwh] = EndUse.new.to_hash
|
113
123
|
hash[:natural_gas_kwh] = EndUse.new.to_hash
|
114
|
-
hash[:
|
124
|
+
hash[:propane_kwh] = EndUse.new.to_hash
|
125
|
+
hash[:fuel_oil_kwh] = EndUse.new.to_hash
|
126
|
+
hash[:other_fuels_kwh] = EndUse.new.to_hash
|
115
127
|
hash[:district_cooling_kwh] = EndUse.new.to_hash
|
116
128
|
hash[:district_heating_kwh] = EndUse.new.to_hash
|
117
129
|
hash[:water_qbft] = EndUse.new.to_hash
|
@@ -129,7 +141,9 @@ module URBANopt
|
|
129
141
|
# modify the existing_period by summing up the results ; # sum results only if they exist
|
130
142
|
@electricity_kwh.merge_end_use!(new_end_uses.electricity_kwh)
|
131
143
|
@natural_gas_kwh.merge_end_use!(new_end_uses.natural_gas_kwh)
|
132
|
-
@
|
144
|
+
@propane_kwh.merge_end_use!(new_end_uses.propane_kwh)
|
145
|
+
@fuel_oil_kwh.merge_end_use!(new_end_uses.fuel_oil_kwh)
|
146
|
+
@other_fuels_kwh.merge_end_use!(new_end_uses.other_fuels_kwh)
|
133
147
|
@district_cooling_kwh.merge_end_use!(new_end_uses.district_cooling_kwh)
|
134
148
|
@district_heating_kwh.merge_end_use!(new_end_uses.district_heating_kwh)
|
135
149
|
return self
|
@@ -44,13 +44,13 @@ module URBANopt
|
|
44
44
|
##
|
45
45
|
class ReportingPeriod
|
46
46
|
attr_accessor :id, :name, :multiplier, :start_date, :end_date, :month, :day_of_month, :year, :total_site_energy_kwh, :total_source_energy_kwh,
|
47
|
-
:net_site_energy_kwh, :net_source_energy_kwh, :total_utility_cost_dollar, :net_utility_cost_dollar, :utility_costs_dollar, :electricity_kwh, :natural_gas_kwh, :
|
47
|
+
:net_site_energy_kwh, :net_source_energy_kwh, :total_utility_cost_dollar, :net_utility_cost_dollar, :utility_costs_dollar, :electricity_kwh, :natural_gas_kwh, :propane_kwh, :fuel_oil_kwh, :other_fuels_kwh, :district_cooling_kwh,
|
48
48
|
:district_heating_kwh, :water_qbft, :electricity_produced_kwh, :end_uses, :energy_production_kwh, :photovoltaic,
|
49
49
|
:fuel_type, :total_cost_dollar, :usage_cost_dollar, :demand_cost_dollar, :comfort_result, :time_setpoint_not_met_during_occupied_cooling,
|
50
50
|
:time_setpoint_not_met_during_occupied_heating, :time_setpoint_not_met_during_occupied_hours, :hours_out_of_comfort_bounds_PMV, :hours_out_of_comfort_bounds_PPD #:nodoc:
|
51
51
|
# ReportingPeriod class initializes the reporting period attributes:
|
52
52
|
# +:id+ , +:name+ , +:multiplier+ , +:start_date+ , +:end_date+ , +:month+ , +:day_of_month+ , +:year+ , +:total_site_energy_kwh+ , +:total_source_energy_kwh+ ,
|
53
|
-
# +:net_site_energy_kwh+ , +:net_source_energy_kwh+ , +:total_utility_cost_dollar , +:net_utility_cost_dollar+ , +:utility_costs_dollar+ , +:electricity_kwh+ , +:natural_gas_kwh+ , +:
|
53
|
+
# +:net_site_energy_kwh+ , +:net_source_energy_kwh+ , +:total_utility_cost_dollar , +:net_utility_cost_dollar+ , +:utility_costs_dollar+ , +:electricity_kwh+ , +:natural_gas_kwh+ , +:propane_kwh+ , +:fuel_oil_kwh+ , +:other_fuels_kwh+ , +:district_cooling_kwh+ ,
|
54
54
|
# +:district_heating_kwh+ , +:water_qbft+ , +:electricity_produced_kwh+ , +:end_uses+ , +:energy_production_kwh+ , +:photovoltaic_kwh+ ,
|
55
55
|
# +:fuel_type+ , +:total_cost_dollar+ , +:usage_cost_dollar+ , +:demand_cost_dollar+ , +:comfort_result+ , +:time_setpoint_not_met_during_occupied_cooling+ ,
|
56
56
|
# +:time_setpoint_not_met_during_occupied_heating+ , +:time_setpoint_not_met_during_occupied_hours+
|
@@ -70,14 +70,16 @@ module URBANopt
|
|
70
70
|
|
71
71
|
@total_site_energy_kwh = hash[:total_site_energy_kwh]
|
72
72
|
@total_source_energy_kwh = hash[:total_source_energy_kwh]
|
73
|
-
@net_site_energy_kwh = hash
|
74
|
-
@net_source_energy_kwh = hash
|
75
|
-
@net_utility_cost_dollar = hash
|
76
|
-
@total_utility_cost_dollar = hash
|
77
|
-
@electricity_kwh = hash
|
78
|
-
@natural_gas_kwh = hash
|
79
|
-
@
|
80
|
-
@
|
73
|
+
@net_site_energy_kwh = hash[:net_site_energy_kwh]
|
74
|
+
@net_source_energy_kwh = hash[:net_source_energy_kwh]
|
75
|
+
@net_utility_cost_dollar = hash[:net_utility_cost_dollar]
|
76
|
+
@total_utility_cost_dollar = hash[:total_utility_cost_dollar]
|
77
|
+
@electricity_kwh = hash[:electricity_kwh]
|
78
|
+
@natural_gas_kwh = hash[:natural_gas_kwh]
|
79
|
+
@propane_kwh = hash[:propane_kwh]
|
80
|
+
@fuel_oil_kwh = hash[:fuel_oil_kwh]
|
81
|
+
@other_fuels_kwh = hash[:other_fuels_kwh]
|
82
|
+
@district_cooling_kwh = hash[:district_cooling_kwh]
|
81
83
|
@district_heating_kwh = hash[:district_heating_kwh]
|
82
84
|
@water_qbft = hash[:water_qbft]
|
83
85
|
@electricity_produced_kwh = hash[:electricity_produced_kwh]
|
@@ -108,14 +110,16 @@ module URBANopt
|
|
108
110
|
|
109
111
|
hash[:total_site_energy_kwh] = nil
|
110
112
|
hash[:total_source_energy_kwh] = nil
|
111
|
-
hash
|
112
|
-
hash
|
113
|
-
hash
|
114
|
-
hash
|
115
|
-
hash
|
116
|
-
hash
|
117
|
-
hash
|
118
|
-
hash
|
113
|
+
hash[:net_site_energy_kwh] = nil
|
114
|
+
hash[:net_source_energy_kwh] = nil
|
115
|
+
hash[:net_utility_cost_dollar] = nil
|
116
|
+
hash[:total_utility_cost_dollar] = nil
|
117
|
+
hash[:electricity_kwh] = nil
|
118
|
+
hash[:natural_gas_kwh] = nil
|
119
|
+
hash[:propane_kwh] = nil
|
120
|
+
hash[:fuel_oil_kwh] = nil
|
121
|
+
hash[:other_fuels_kwh] = nil
|
122
|
+
hash[:district_cooling_kwh] = nil
|
119
123
|
hash[:district_heating_kwh] = nil
|
120
124
|
|
121
125
|
hash[:electricity_produced_kwh] = nil
|
@@ -150,7 +154,9 @@ module URBANopt
|
|
150
154
|
result[:total_utility_cost_dollar] = @total_utility_cost_dollar if @total_utility_cost_dollar
|
151
155
|
result[:electricity_kwh] = @electricity_kwh if @electricity_kwh
|
152
156
|
result[:natural_gas_kwh] = @natural_gas_kwh if @natural_gas_kwh
|
153
|
-
result[:
|
157
|
+
result[:propane_kwh] = @propane_kwh if @propane_kwh
|
158
|
+
result[:fuel_oil_kwh] = @fuel_oil_kwh if @fuel_oil_kwh
|
159
|
+
result[:other_fuels_kwh] = @other_fuels_kwh if @other_fuels_kwh
|
154
160
|
result[:district_cooling_kwh] = @district_cooling_kwh if @district_cooling_kwh
|
155
161
|
result[:district_heating_kwh] = @district_heating_kwh if @district_heating_kwh
|
156
162
|
result[:water_qbft] = @water_qbft if @water_qbft
|
@@ -218,7 +224,9 @@ module URBANopt
|
|
218
224
|
existing_period.total_utility_cost_dollar = add_values(existing_period.total_utility_cost_dollar, new_period.total_utility_cost_dollar)
|
219
225
|
existing_period.electricity_kwh = add_values(existing_period.electricity_kwh, new_period.electricity_kwh)
|
220
226
|
existing_period.natural_gas_kwh = add_values(existing_period.natural_gas_kwh, new_period.natural_gas_kwh)
|
221
|
-
existing_period.
|
227
|
+
existing_period.propane_kwh = add_values(existing_period.propane_kwh, new_period.propane_kwh)
|
228
|
+
existing_period.fuel_oil_kwh = add_values(existing_period.fuel_oil_kwh, new_period.fuel_oil_kwh)
|
229
|
+
existing_period.other_fuels_kwh = add_values(existing_period.other_fuels_kwh, new_period.other_fuels_kwh)
|
222
230
|
existing_period.district_cooling_kwh = add_values(existing_period.district_cooling_kwh, new_period.district_cooling_kwh)
|
223
231
|
existing_period.district_heating_kwh = add_values(existing_period.district_heating_kwh, new_period.district_heating_kwh)
|
224
232
|
existing_period.water_qbft = add_values(existing_period.water_qbft, new_period.water_qbft)
|
@@ -2,6 +2,9 @@ Datetime
|
|
2
2
|
Electricity:Facility
|
3
3
|
ElectricityProduced:Facility
|
4
4
|
Gas:Facility
|
5
|
+
Propane:Facility
|
6
|
+
FuelOil#2:Facility
|
7
|
+
OtherFuels:Facility
|
5
8
|
Cooling:Electricity
|
6
9
|
Heating:Electricity
|
7
10
|
InteriorLights:Electricity
|
@@ -15,6 +18,18 @@ HeatRejection:Gas
|
|
15
18
|
Heating:Gas
|
16
19
|
WaterSystems:Gas
|
17
20
|
InteriorEquipment:Gas
|
21
|
+
HeatRejection:Propane
|
22
|
+
Heating:Propane
|
23
|
+
WaterSystems:Propane
|
24
|
+
InteriorEquipment:Propane
|
25
|
+
HeatRejection:FuelOil#2
|
26
|
+
Heating:FuelOil#2
|
27
|
+
WaterSystems:FuelOil#2
|
28
|
+
InteriorEquipment:FuelOil#2
|
29
|
+
HeatRejection:OtherFuels
|
30
|
+
Heating:OtherFuels
|
31
|
+
WaterSystems:OtherFuels
|
32
|
+
InteriorEquipment:OtherFuels
|
18
33
|
DistrictCooling:Facility
|
19
34
|
DistrictHeating:Facility
|
20
35
|
District Cooling Chilled Water Rate
|
@@ -301,8 +301,16 @@
|
|
301
301
|
"description": "Sum of all natural gas end uses consumption (kWh)",
|
302
302
|
"type": "number"
|
303
303
|
},
|
304
|
-
|
305
|
-
"description": "Sum of all
|
304
|
+
"propane_kwh": {
|
305
|
+
"description": "Sum of all propane end uses consumption (kWh)",
|
306
|
+
"type": "number"
|
307
|
+
},
|
308
|
+
"fuel_oil_kwh": {
|
309
|
+
"description": "Sum of all fuel oil #2 end uses consumption (kWh)",
|
310
|
+
"type": "number"
|
311
|
+
},
|
312
|
+
"other_fuels_kwh": {
|
313
|
+
"description": "Sum of all other (fuel oil #1, diesel, gasoline, coal, steam) fuel end uses consumption (kWh)",
|
306
314
|
"type": "number"
|
307
315
|
},
|
308
316
|
"district_cooling_kwh": {
|
@@ -371,7 +379,13 @@
|
|
371
379
|
"natural_gas_kwh": {
|
372
380
|
"$ref": "#/definitions/EndUse"
|
373
381
|
},
|
374
|
-
|
382
|
+
"propane_kwh": {
|
383
|
+
"$ref": "#/definitions/EndUse"
|
384
|
+
},
|
385
|
+
"fuel_oil_kwh": {
|
386
|
+
"$ref": "#/definitions/EndUse"
|
387
|
+
},
|
388
|
+
"other_fuels_kwh": {
|
375
389
|
"$ref": "#/definitions/EndUse"
|
376
390
|
},
|
377
391
|
"district_cooling_kwh": {
|
@@ -522,9 +536,11 @@
|
|
522
536
|
"enum": [
|
523
537
|
"Electricity",
|
524
538
|
"Natural Gas",
|
539
|
+
"Propane",
|
540
|
+
"Fuel Oil",
|
525
541
|
"District Cooling",
|
526
542
|
"District Heating",
|
527
|
-
"
|
543
|
+
"Other Fuels",
|
528
544
|
"Water"
|
529
545
|
]
|
530
546
|
},
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.add_development_dependency 'rspec', '~> 3.7'
|
30
30
|
spec.add_runtime_dependency 'json-schema', '~> 2.8'
|
31
31
|
spec.add_runtime_dependency 'json_pure', '~> 2.3'
|
32
|
-
spec.add_runtime_dependency 'openstudio-extension', '~> 0.
|
32
|
+
spec.add_runtime_dependency 'openstudio-extension', '~> 0.3.1'
|
33
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: urbanopt-reporting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rawad El Kontar
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -87,14 +87,14 @@ dependencies:
|
|
87
87
|
requirements:
|
88
88
|
- - "~>"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
90
|
+
version: 0.3.1
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
95
|
- - "~>"
|
96
96
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
97
|
+
version: 0.3.1
|
98
98
|
description: Library include scenario default reporting measure and scenario defaults
|
99
99
|
reports schema and classes
|
100
100
|
email:
|