urbanopt-reporting 0.6.0 → 0.6.1
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 +5 -0
- data/docs/package-lock.json +6 -6
- data/lib/measures/default_feature_reports/measure.rb +175 -34
- data/lib/urbanopt/reporting/default_reports/reporting_period.rb +34 -17
- data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +14 -8
- data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +34 -9
- data/lib/urbanopt/reporting/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88fd3280248540278799a2b19f5d970ad199bf75acab0efe08bd3c4c11d7ec75
|
4
|
+
data.tar.gz: 32acb1d1523bcbd7bbcf86c8eeec200f4c03bd86ee12ccefd4f936888a3bdb4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5520b1958d1037868b5daf041d618bf0be93673235bf65d21ccb8e7f5354ea52ac12e1b4b0d39bb9f6dcf09c6f648c8eeb53136365162bfd0f31858f826a9822
|
7
|
+
data.tar.gz: f0b2ddc2128321e99b3590924db5b2ac29c7deb9f31f326f2639ff9efcaf44aa86e223e1b56801ba24e05333e38d5cd4be80983f48d997e61f2451f1617a6ee9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# URBANopt Reporting Gem
|
2
2
|
|
3
|
+
## Version 0.6.1
|
4
|
+
Date Range: 05/10-22 - 06/27/22:
|
5
|
+
|
6
|
+
- Fixed [#114]( https://github.com/urbanopt/urbanopt-reporting-gem/pull/114 ), added natural gas, propane and fuel oil emissions reporting
|
7
|
+
|
3
8
|
## Version 0.6.0
|
4
9
|
Date Range: 11/22/21 - 05/09/22:
|
5
10
|
|
data/docs/package-lock.json
CHANGED
@@ -2828,9 +2828,9 @@
|
|
2828
2828
|
}
|
2829
2829
|
},
|
2830
2830
|
"node_modules/async": {
|
2831
|
-
"version": "2.6.
|
2832
|
-
"resolved": "https://registry.npmjs.org/async/-/async-2.6.
|
2833
|
-
"integrity": "sha512-
|
2831
|
+
"version": "2.6.4",
|
2832
|
+
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
2833
|
+
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
2834
2834
|
"dependencies": {
|
2835
2835
|
"lodash": "^4.17.14"
|
2836
2836
|
}
|
@@ -15790,9 +15790,9 @@
|
|
15790
15790
|
"integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c="
|
15791
15791
|
},
|
15792
15792
|
"async": {
|
15793
|
-
"version": "2.6.
|
15794
|
-
"resolved": "https://registry.npmjs.org/async/-/async-2.6.
|
15795
|
-
"integrity": "sha512-
|
15793
|
+
"version": "2.6.4",
|
15794
|
+
"resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz",
|
15795
|
+
"integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==",
|
15796
15796
|
"requires": {
|
15797
15797
|
"lodash": "^4.17.14"
|
15798
15798
|
}
|
@@ -215,6 +215,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
215
215
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,NaturalGas:Facility,#{reporting_frequency};").get
|
216
216
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictCooling:Facility,#{reporting_frequency};").get
|
217
217
|
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,DistrictHeating:Facility,#{reporting_frequency};").get
|
218
|
+
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Propane:Facility,#{reporting_frequency};").get
|
219
|
+
result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,FuelOilNo2:Facility,#{reporting_frequency};").get
|
218
220
|
|
219
221
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Cooling:Electricity,#{reporting_frequency};").get
|
220
222
|
# result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:Electricity,#{reporting_frequency};").get
|
@@ -230,6 +232,15 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
230
232
|
result << OpenStudio::IdfObject.load('Output:Variable,*,Heating Coil Heating Rate,hourly; !- HVAC Average [W];').get
|
231
233
|
# result << OpenStudio::IdfObject.load("Output:Variable,*,Exterior Equipment:Electric Vehicles,#{reporting_frequency};").get
|
232
234
|
|
235
|
+
## add environmental factor outputs
|
236
|
+
#result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Output:EnvironmentalImpactFactors,#{reporting_frequency};").get
|
237
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total N2O Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
238
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total CH4 Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
239
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact Total CO2 Emissions Carbon Equivalent Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
240
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact NaturalGas CO2 Emissions Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
241
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact NaturalGas CH4 Emissions Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
242
|
+
# result << OpenStudio::IdfObject.load("Output:Variable,*,Environmental Impact NaturalGas N2O Emissions Mass,#{reporting_frequency}; !- HVAC Sum [kg];").get
|
243
|
+
|
233
244
|
timeseries_data = ['District Cooling Chilled Water Rate', 'District Cooling Mass Flow Rate',
|
234
245
|
'District Cooling Inlet Temperature', 'District Cooling Outlet Temperature',
|
235
246
|
'District Heating Hot Water Rate', 'District Heating Mass Flow Rate',
|
@@ -240,8 +251,12 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
240
251
|
|
241
252
|
ev_timeseries_data = ['Exterior Equipment:Electric Vehicles']
|
242
253
|
|
243
|
-
emissions_timeseries_data = ['
|
244
|
-
|
254
|
+
emissions_timeseries_data = ['Future_Annual_Electricity_Emissions', 'Future_Hourly_Electricity_Emissions',
|
255
|
+
'Historical_Annual_Electricity_Emissions', 'Historical_Hourly_Electricity_Emissions',
|
256
|
+
'Future_Annual_Electricity_Emissions_Intensity', 'Future_Hourly_Electricity_Emissions_Intensity',
|
257
|
+
'Historical_Annual_Electricity_Emissions_Intensity', 'Historical_Hourly_Electricity_Emissions_Intensity']
|
258
|
+
|
259
|
+
|
245
260
|
|
246
261
|
timeseries_data += tes_timeseries_data
|
247
262
|
timeseries_data += emissions_timeseries_data
|
@@ -819,42 +834,62 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
819
834
|
time_setpoint_not_met_during_occupied_hours = time_setpoint_not_met_during_occupied_heating + time_setpoint_not_met_during_occupied_cooling
|
820
835
|
feature_report.reporting_periods[0].comfort_result[:time_setpoint_not_met_during_occupied_hours] = time_setpoint_not_met_during_occupied_hours
|
821
836
|
|
822
|
-
#
|
837
|
+
# electricity emissions
|
823
838
|
begin
|
839
|
+
|
824
840
|
# future_annual_emissions
|
825
|
-
future_annual_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
826
|
-
feature_report.reporting_periods[0].emissions[:
|
841
|
+
future_annual_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Future_Annual_Electricity_Emissions', 'EMS')
|
842
|
+
feature_report.reporting_periods[0].emissions[:future_annual_electricity_emissions_mt] = future_annual_emissions_ts.get.values.sum
|
827
843
|
|
828
844
|
# future_hourly_emissions
|
829
|
-
future_hourly_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
830
|
-
feature_report.reporting_periods[0].emissions[:
|
845
|
+
future_hourly_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Future_Hourly_Electricity_Emissions', 'EMS')
|
846
|
+
feature_report.reporting_periods[0].emissions[:future_hourly_electricity_emissions_mt] = future_hourly_emissions_ts.get.values.sum
|
831
847
|
|
832
848
|
# historical_annual_emissions
|
833
|
-
historical_annual_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
834
|
-
feature_report.reporting_periods[0].emissions[:
|
849
|
+
historical_annual_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Annual_Electricity_Emissions', 'EMS')
|
850
|
+
feature_report.reporting_periods[0].emissions[:historical_annual_electricity_emissions_mt] = historical_annual_emissions_ts.get.values.sum
|
835
851
|
|
836
|
-
#
|
837
|
-
historical_hourly_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
838
|
-
feature_report.reporting_periods[0].emissions[:
|
852
|
+
# historical_hourly_emissions
|
853
|
+
historical_hourly_emissions_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Hourly_Electricity_Emissions', 'EMS')
|
854
|
+
feature_report.reporting_periods[0].emissions[:historical_hourly_electricity_emissions_mt] = historical_hourly_emissions_ts.get.values.sum
|
839
855
|
|
840
|
-
#
|
841
|
-
future_annual_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
842
|
-
feature_report.reporting_periods[0].emissions[:
|
856
|
+
# future_annual_emissions_intensity
|
857
|
+
future_annual_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Future_Annual_Electricity_Emissions_Intensity', 'EMS')
|
858
|
+
feature_report.reporting_periods[0].emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2] = future_annual_emissions_intensity_ts.get.values.sum
|
843
859
|
|
844
|
-
#
|
845
|
-
future_hourly_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
846
|
-
feature_report.reporting_periods[0].emissions[:
|
860
|
+
# future_hourly_emissions_intensity
|
861
|
+
future_hourly_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Future_Hourly_Electricity_Emissions_Intensity', 'EMS')
|
862
|
+
feature_report.reporting_periods[0].emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2] = future_hourly_emissions_intensity_ts.get.values.sum
|
847
863
|
|
848
|
-
#
|
849
|
-
historical_annual_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, '
|
850
|
-
feature_report.reporting_periods[0].emissions[:
|
864
|
+
# historical_annual_emissions_intensity
|
865
|
+
historical_annual_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Annual_Electricity_Emissions_Intensity', 'EMS')
|
866
|
+
feature_report.reporting_periods[0].emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2] = historical_annual_emissions_intensity_ts.get.values.sum
|
867
|
+
|
868
|
+
# historical_hourly_emissions_intensity
|
869
|
+
historical_hourly_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Hourly_Electricity_Emissions_Intensity', 'EMS')
|
870
|
+
feature_report.reporting_periods[0].emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2] = historical_hourly_emissions_intensity_ts.get.values.sum
|
851
871
|
|
852
|
-
# historical_annual_emissions
|
853
|
-
historical_hourly_emissions_intensity_ts = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Historical_Hourly_Emissions_Intensity_Var', 'EMS')
|
854
|
-
feature_report.reporting_periods[0].emissions[:historical_hourly_emissions_intensity_kg_per_ft2] = historical_hourly_emissions_intensity_ts.get.values.sum
|
855
872
|
rescue StandardError
|
856
873
|
@@logger.info('Emissions are not reported for this feature')
|
857
874
|
end
|
875
|
+
|
876
|
+
##########################################################################################################################
|
877
|
+
# set conversion variables
|
878
|
+
conv_J_mwh = 1000000 * 60 * 60 # J to MWh (1000000J/MJ * 60hr/min * 60 min/sec)
|
879
|
+
conv_kg_mt = 0.001 # kg to metric ton
|
880
|
+
conv_kbtu_J = 1054852.32 # KBtu to J (1kBtu = 1054852.32 J)
|
881
|
+
|
882
|
+
##### Emisison factors for natural gas, propane, and fuel oil based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1
|
883
|
+
## natural gas : 277.358126 KG/MWH
|
884
|
+
## propane : 323.896704 KG/MWH
|
885
|
+
## Fuel oil : 294.962046 KG/MWH
|
886
|
+
nat_gas_val = 277.358126
|
887
|
+
lpg_val = 323.896704
|
888
|
+
fo1_val = 294.962046
|
889
|
+
fo2_val = 294.962046
|
890
|
+
|
891
|
+
|
892
|
+
##########################################################################################################################
|
858
893
|
######################################## Reporting TImeseries Results FOR CSV File #######################################
|
859
894
|
|
860
895
|
# timeseries we want to report
|
@@ -903,14 +938,20 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
903
938
|
'District Heating Outlet Temperature',
|
904
939
|
'Cooling Coil Total Cooling Rate',
|
905
940
|
'Heating Coil Heating Rate',
|
906
|
-
'
|
907
|
-
'
|
908
|
-
'
|
909
|
-
'
|
910
|
-
'
|
911
|
-
'
|
912
|
-
'
|
913
|
-
'
|
941
|
+
'Future_Annual_Electricity_Emissions',
|
942
|
+
'Future_Hourly_Electricity_Emissions',
|
943
|
+
'Historical_Annual_Electricity_Emissions',
|
944
|
+
'Historical_Hourly_Electricity_Emissions',
|
945
|
+
'Future_Annual_Electricity_Emissions_Intensity',
|
946
|
+
'Future_Hourly_Electricity_Emissions_Intensity',
|
947
|
+
'Historical_Annual_Electricity_Emissions_Intensity',
|
948
|
+
'Historical_Hourly_Electricity_Emissions_Intensity',
|
949
|
+
'Natural_Gas_Emissions',
|
950
|
+
'Natural_Gas_Emissions_Intensity',
|
951
|
+
'Propane_Emissions',
|
952
|
+
'Propane_Emissions_Intensity',
|
953
|
+
'FuelOilNo2_Emissions',
|
954
|
+
'FuelOilNo2_Emissions_Intensity',
|
914
955
|
'Curtailed EV Power',
|
915
956
|
'Daily EV Charge Energy Capacity',
|
916
957
|
'EV Charge Ratio',
|
@@ -939,7 +980,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
939
980
|
runner.registerInfo("All timeseries: #{requested_timeseries_names}")
|
940
981
|
|
941
982
|
# timeseries variables to keep to calculate power
|
942
|
-
tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility']
|
983
|
+
tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility','Propane:Facility', 'NaturalGas:Facility', 'FuelOilNo2:Facility', 'FuelOilNo1:Facility']
|
943
984
|
tsToKeepIndexes = {}
|
944
985
|
|
945
986
|
### powerFactor ###
|
@@ -1086,6 +1127,103 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1086
1127
|
tsToKeepIndexes[timeseries_name] = key_cnt
|
1087
1128
|
end
|
1088
1129
|
|
1130
|
+
### add emissions for natural gas, propane and fuel oil
|
1131
|
+
# # set conversion variables
|
1132
|
+
# conv_J_mwh = 1000000 * 60 * 60 # J to MWh (1000000J/MJ * 60hr/min * 60 min/sec)
|
1133
|
+
# conv_kg_mt = 0.001 # kg to metric ton
|
1134
|
+
# conv_kbtu_J = 1054852.32 # KBtu to J (1kBtu = 1054852.32 J)
|
1135
|
+
|
1136
|
+
# ##### Emisison factors for natural gas, propane, and fuel oil based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1
|
1137
|
+
# ## natural gas : 277.358126 KG/MWH
|
1138
|
+
# ## propane : 323.896704 KG/MWH
|
1139
|
+
# ## Fuel oil : 294.962046 KG/MWH
|
1140
|
+
# nat_gas_val = 277.358126
|
1141
|
+
# lpg_val = 323.896704
|
1142
|
+
# fo1_val = 294.962046
|
1143
|
+
# fo2_val = 294.962046
|
1144
|
+
|
1145
|
+
if timeseries_name == 'Natural_Gas_Emissions'
|
1146
|
+
newVals = Array.new(n, 0)
|
1147
|
+
(0..n - 1).each do |j|
|
1148
|
+
newVals[j] = (nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f
|
1149
|
+
j += 1
|
1150
|
+
end
|
1151
|
+
new_unit = 'MT'
|
1152
|
+
values[key_cnt] = newVals
|
1153
|
+
|
1154
|
+
# add emissions sum to feature report
|
1155
|
+
feature_report.reporting_periods[0].emissions[:natural_gas_emissions_mt] = newVals.sum
|
1156
|
+
end
|
1157
|
+
|
1158
|
+
if timeseries_name == 'Propane_Emissions'
|
1159
|
+
newVals = Array.new(n, 0)
|
1160
|
+
(0..n - 1).each do |j|
|
1161
|
+
newVals[j] = (lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f
|
1162
|
+
j += 1
|
1163
|
+
end
|
1164
|
+
new_unit = 'MT'
|
1165
|
+
values[key_cnt] = newVals
|
1166
|
+
|
1167
|
+
# add emissions sum to feature report
|
1168
|
+
feature_report.reporting_periods[0].emissions[:propane_emissions_mt] = newVals.sum
|
1169
|
+
end
|
1170
|
+
|
1171
|
+
if timeseries_name == 'FuelOilNo2_Emissions'
|
1172
|
+
newVals = Array.new(n, 0)
|
1173
|
+
(0..n - 1).each do |j|
|
1174
|
+
newVals[j] = (fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f
|
1175
|
+
j += 1
|
1176
|
+
end
|
1177
|
+
new_unit = 'MT'
|
1178
|
+
values[key_cnt] = newVals
|
1179
|
+
|
1180
|
+
# add emissions sum to feature report
|
1181
|
+
feature_report.reporting_periods[0].emissions[:fueloil_no2_emissions_mt] = newVals.sum
|
1182
|
+
end
|
1183
|
+
|
1184
|
+
### calculate emissions intensity metric
|
1185
|
+
# get flr_area
|
1186
|
+
flr_area = building.floorArea * 10.764 #change from m2 to ft2
|
1187
|
+
|
1188
|
+
if timeseries_name == 'Natural_Gas_Emissions_Intensity'
|
1189
|
+
newVals = Array.new(n, 0)
|
1190
|
+
(0..n - 1).each do |j|
|
1191
|
+
newVals[j] = (((nat_gas_val * (values[tsToKeepIndexes['NaturalGas:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f ) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1192
|
+
j += 1
|
1193
|
+
end
|
1194
|
+
new_unit = 'KG/FT2'
|
1195
|
+
values[key_cnt] = newVals
|
1196
|
+
|
1197
|
+
# add emissions sum to feature report
|
1198
|
+
feature_report.reporting_periods[0].emissions[:natural_gas_emissions_intensity_kg_per_ft2] = newVals.sum
|
1199
|
+
end
|
1200
|
+
|
1201
|
+
if timeseries_name == 'Propane_Emissions_Intensity'
|
1202
|
+
newVals = Array.new(n, 0)
|
1203
|
+
(0..n - 1).each do |j|
|
1204
|
+
newVals[j] = (((lpg_val * (values[tsToKeepIndexes['Propane:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f ) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1205
|
+
j += 1
|
1206
|
+
end
|
1207
|
+
new_unit = 'KG/FT2'
|
1208
|
+
values[key_cnt] = newVals
|
1209
|
+
|
1210
|
+
# add emissions sum to feature report
|
1211
|
+
feature_report.reporting_periods[0].emissions[:propane_emissions_intensity_kg_per_ft2] = newVals.sum
|
1212
|
+
end
|
1213
|
+
|
1214
|
+
if timeseries_name == 'FuelOilNo2_Emissions_Intensity'
|
1215
|
+
newVals = Array.new(n, 0)
|
1216
|
+
(0..n - 1).each do |j|
|
1217
|
+
newVals[j] = (((fo2_val * (values[tsToKeepIndexes['FuelOilNo2:Facility']][j].to_f * conv_kbtu_J.to_f) / conv_J_mwh.to_f ) * conv_kg_mt.to_f ) * 1000 / flr_area) # unit: kg/ft2 - changed mt to kg
|
1218
|
+
j += 1
|
1219
|
+
end
|
1220
|
+
new_unit = 'KG/FT2'
|
1221
|
+
values[key_cnt] = newVals
|
1222
|
+
|
1223
|
+
# add emissions sum to feature report
|
1224
|
+
feature_report.reporting_periods[0].emissions[:fueloil_no2_emissions_intensity_kg_per_ft2] = newVals.sum
|
1225
|
+
end
|
1226
|
+
|
1089
1227
|
# special processing: power
|
1090
1228
|
if powerTimeseries.include? timeseries_name
|
1091
1229
|
# special case: net series (subtract generation from load)
|
@@ -1142,7 +1280,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1142
1280
|
end
|
1143
1281
|
end
|
1144
1282
|
end
|
1145
|
-
end
|
1283
|
+
end
|
1284
|
+
|
1146
1285
|
|
1147
1286
|
# append units to headers
|
1148
1287
|
new_timeseries_name += "(#{new_unit})"
|
@@ -1275,6 +1414,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
|
|
1275
1414
|
end
|
1276
1415
|
end
|
1277
1416
|
|
1417
|
+
puts "values = #{values}"
|
1418
|
+
|
1278
1419
|
# closing the sql file
|
1279
1420
|
sql_file.close
|
1280
1421
|
|
@@ -58,17 +58,21 @@ module URBANopt
|
|
58
58
|
:district_heating_kwh, :water_qbft, :electricity_produced_kwh, :end_uses, :energy_production_kwh, :photovoltaic,
|
59
59
|
:fuel_type, :total_cost_dollar, :usage_cost_dollar, :demand_cost_dollar, :comfort_result, :time_setpoint_not_met_during_occupied_cooling,
|
60
60
|
: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,
|
61
|
-
:emissions, :
|
62
|
-
:
|
61
|
+
:emissions, :future_annual_electricity_emissions_mt, :future_hourly_electricity_emissions_mt, :historical_annual_electricity_emissions_mt, :historical_hourly_electricity_emissions_mt,
|
62
|
+
:future_annual_electricity_emissions_intensity_kg_per_ft2, :future_hourly_electricity_emissions_intensity_kg_per_ft2, :historical_annual_electricity_emissions_intensity_kg_per_ft2, :historical_hourly_electricity_emissions_intensity_kg_per_ft2 ,
|
63
|
+
:natural_gas_emissions_mt, :natural_gas_emissions_intensity_kg_per_ft2, :propane_emissions_mt, :propane_emissions_intensity_kg_per_ft2,
|
64
|
+
:fueloil_no2_emissions_mt, :fueloil_no2_emissions_intensity_kg_per_ft2 #:nodoc:
|
63
65
|
|
64
66
|
# ReportingPeriod class initializes the reporting period attributes:
|
65
67
|
# +:id+ , +:name+ , +:multiplier+ , +:start_date+ , +:end_date+ , +:month+ , +:day_of_month+ , +:year+ , +:total_site_energy_kwh+ , +:total_source_energy_kwh+ , +:site_EUI_kwh_per_m2+, +:site_EUI_kbtu_per_ft2+, +:source_EUI_kwh_per_m2+, +:source_EUI_kbtu_per_ft2+,
|
66
68
|
# +: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+ ,
|
67
69
|
# +:district_heating_kwh+ , +:water_qbft+ , +:electricity_produced_kwh+ , +:end_uses+ , +:energy_production_kwh+ , +:photovoltaic_kwh+ ,
|
68
70
|
# +:fuel_type+ , +:total_cost_dollar+ , +:usage_cost_dollar+ , +:demand_cost_dollar+ , +:comfort_result+ , +:time_setpoint_not_met_during_occupied_cooling+ ,
|
69
|
-
# +: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 ,
|
70
|
-
# +:emissions, +:
|
71
|
-
# +:
|
71
|
+
# +: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+ ,
|
72
|
+
# +:emissions, +:future_annual_electricity_emissions_mt+, +:future_hourly_electricity_emissions_mt+, +:historical_annual_electricity_emissions_mt+, +:historical_hourly_electricity_emissions_mt+,
|
73
|
+
# +:future_annual_electricity_emissions_intensity_kg_per_ft2+, +:future_hourly_electricity_emissions_intensity_kg_per_ft2+, +:historical_annual_electricity_emissions_intensity_kg_per_ft2+, +:historical_hourly_electricity_emissions_intensity_kg_per_ft2+,
|
74
|
+
# +:natural_gas_emissions_mt+, +:natural_gas_emissions_intensity_kg_per_ft2+, +:propane_emissions_mt+, +:propane_emissions_intensity_kg_per_ft2+,
|
75
|
+
# +:fueloil_no2_emissions_mt+, +:fueloil_no2_emissions_intensity_kg_per_ft2+
|
72
76
|
##
|
73
77
|
# [parameters:]
|
74
78
|
# +hash+ - _Hash_ - A hash which may contain a deserialized reporting_period.
|
@@ -153,8 +157,12 @@ module URBANopt
|
|
153
157
|
hash[:utility_costs_dollar] = [{ fuel_type: nil, total_cost_dollar: nil, usage_cost_dollar: nil, demand_cost_dollar: nil }]
|
154
158
|
hash[:comfort_result] = { time_setpoint_not_met_during_occupied_cooling: nil, time_setpoint_not_met_during_occupied_heating: nil,
|
155
159
|
time_setpoint_not_met_during_occupied_hours: nil, hours_out_of_comfort_bounds_PMV: nil, hours_out_of_comfort_bounds_PPD: nil }
|
156
|
-
hash[:emissions] = {
|
157
|
-
|
160
|
+
hash[:emissions] = { future_annual_electricity_emissions_mt: nil, future_hourly_electricity_emissions_mt: nil, historical_annual_electricity_emissions_mt: nil,
|
161
|
+
historical_hourly_electricity_emissions_mt: nil, future_annual_electricity_emissions_intensity_kg_per_ft2: nil,
|
162
|
+
future_hourly_electricity_emissions_intensity_kg_per_ft2: nil, historical_annual_electricity_emissions_intensity_kg_per_ft2: nil,
|
163
|
+
historical_hourly_electricity_emissions_intensity_kg_per_ft2: nil, natural_gas_emissions_mt: nil,
|
164
|
+
natural_gas_emissions_intensity_kg_per_ft2: nil, propane_emissions_mt: nil, propane_emissions_intensity_kg_per_ft2: nil,
|
165
|
+
fueloil_no2_emissions_mt: nil, fueloil_no2_emissions_intensity_kg_per_ft2: nil }
|
158
166
|
|
159
167
|
return hash
|
160
168
|
end
|
@@ -214,7 +222,7 @@ module URBANopt
|
|
214
222
|
result[:comfort_result] = comfort_result_hash if @comfort_result
|
215
223
|
|
216
224
|
emissions_hash = @emissions if @emissions
|
217
|
-
emissions_hash.delete_if { |k, v| v.nil? }
|
225
|
+
#emissions_hash.delete_if { |k, v| v.nil? }
|
218
226
|
result[:emissions] = emissions_hash if @emissions
|
219
227
|
|
220
228
|
# validates +reporting_period+ properties against schema for reporting period.
|
@@ -291,15 +299,24 @@ module URBANopt
|
|
291
299
|
end
|
292
300
|
|
293
301
|
if existing_period.emissions
|
294
|
-
existing_period.emissions[:
|
295
|
-
existing_period.emissions[:
|
296
|
-
existing_period.emissions[:
|
297
|
-
existing_period.emissions[:
|
298
|
-
|
299
|
-
existing_period.emissions[:
|
300
|
-
existing_period.emissions[:
|
301
|
-
existing_period.emissions[:
|
302
|
-
|
302
|
+
existing_period.emissions[:future_annual_electricity_emissions_mt] = add_values(existing_period.emissions[:future_annual_electricity_emissions_mt], new_period.emissions[:future_annual_electricity_emissions_mt])
|
303
|
+
existing_period.emissions[:future_hourly_electricity_emissions_mt] = add_values(existing_period.emissions[:future_hourly_electricity_emissions_mt], new_period.emissions[:future_hourly_electricity_emissions_mt])
|
304
|
+
existing_period.emissions[:historical_annual_electricity_emissions_mt] = add_values(existing_period.emissions[:historical_annual_electricity_emissions_mt], new_period.emissions[:historical_annual_electricity_emissions_mt])
|
305
|
+
existing_period.emissions[:historical_hourly_electricity_emissions_mt] = add_values(existing_period.emissions[:historical_hourly_electricity_emissions_mt], new_period.emissions[:historical_hourly_electricity_emissions_mt])
|
306
|
+
|
307
|
+
existing_period.emissions[:natural_gas_emissions_mt] = add_values(existing_period.emissions[:natural_gas_emissions_mt], new_period.emissions[:natural_gas_emissions_mt])
|
308
|
+
existing_period.emissions[:propane_emissions_mt] = add_values(existing_period.emissions[:propane_emissions_mt], new_period.emissions[:propane_emissions_mt])
|
309
|
+
existing_period.emissions[:fueloil_no2_emissions_mt] = add_values(existing_period.emissions[:fueloil_no2_emissions_mt], new_period.emissions[:fueloil_no2_emissions_mt])
|
310
|
+
|
311
|
+
existing_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:future_annual_electricity_emissions_intensity_kg_per_ft2])
|
312
|
+
existing_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:future_hourly_electricity_emissions_intensity_kg_per_ft2])
|
313
|
+
existing_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_annual_electricity_emissions_intensity_kg_per_ft2])
|
314
|
+
existing_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2], new_period.emissions[:historical_hourly_electricity_emissions_intensity_kg_per_ft2])
|
315
|
+
|
316
|
+
existing_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2], new_period.emissions[:natural_gas_emissions_intensity_kg_per_ft2])
|
317
|
+
existing_period.emissions[:propane_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:propane_emissions_intensity_kg_per_ft2], new_period.emissions[:propane_emissions_intensity_kg_per_ft2])
|
318
|
+
existing_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2] = add_values(existing_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2], new_period.emissions[:fueloil_no2_emissions_intensity_kg_per_ft2])
|
319
|
+
|
303
320
|
end
|
304
321
|
|
305
322
|
return existing_period
|
@@ -50,14 +50,20 @@ Net Power
|
|
50
50
|
Net Apparent Power
|
51
51
|
Ice Thermal Storage End Fraction
|
52
52
|
Cooling Coil Ice Thermal Storage End Fraction
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
53
|
+
Future_Annual_Electricity_Emissions
|
54
|
+
Future_Hourly_Electricity_Emissions
|
55
|
+
Historical_Annual_Electricity_Emissions
|
56
|
+
Historical_Hourly_Electricity_Emissions
|
57
|
+
Future_Annual_Electricity_Emissions_Intensity
|
58
|
+
Future_Hourly_Electricity_Emissions_Intensity
|
59
|
+
Historical_Annual_Electricity_Emissions_Intensity
|
60
|
+
Historical_Hourly_Electricity_Emissions_Intensity
|
61
|
+
Natural_Gas_Emissions
|
62
|
+
Natural_Gas_Emissions_Intensity
|
63
|
+
Propane_Emissions
|
64
|
+
Propane_Emissions_Intensity
|
65
|
+
FuelOilNo2_Emissions
|
66
|
+
FuelOilNo2_Emissions_Intensity
|
61
67
|
Curtailed EV Power
|
62
68
|
Daily EV Charge Energy Capacity
|
63
69
|
EV Charge Ratio
|
@@ -572,38 +572,63 @@
|
|
572
572
|
"emissions": {
|
573
573
|
"type": "object",
|
574
574
|
"properties": {
|
575
|
-
"
|
575
|
+
"future_annual_electricity_emissions_mt": {
|
576
576
|
"description": "Future emissions in metric ton (mt) calculated based on an annual emission factor value for the selected future year",
|
577
577
|
"type": "number"
|
578
578
|
},
|
579
|
-
"
|
579
|
+
"future_hourly_electricity_emissions_mt": {
|
580
580
|
"description": "Future emissions in metric ton (mt) calculated based on hourly emission factor values for the selected future year",
|
581
581
|
"type": "number"
|
582
582
|
},
|
583
|
-
"
|
583
|
+
"historical_annual_electricity_emissions_mt": {
|
584
584
|
"description": "Historical emissions in metric ton (mt) calculated based on an annual emission factor value for the selected historical year",
|
585
585
|
"type": "number"
|
586
586
|
},
|
587
|
-
"
|
587
|
+
"historical_hourly_electricity_emissions_mt": {
|
588
588
|
"description": "Historical emissions in metric ton (mt) calculated based on hourly emission factor values for the selected historical year",
|
589
589
|
"type": "number"
|
590
590
|
},
|
591
|
-
"
|
591
|
+
"future_annual_electricity_emissions_intensity_kg_per_ft2": {
|
592
592
|
"description": "Future emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected future year",
|
593
593
|
"type": "number"
|
594
594
|
},
|
595
|
-
"
|
595
|
+
"future_hourly_electricity_emissions_intensity_kg_per_ft2": {
|
596
596
|
"description": "Future emissions intensity in kg/ft2 calculated based on hourly emission factor values for the selected future year",
|
597
597
|
"type": "number"
|
598
598
|
},
|
599
|
-
"
|
599
|
+
"historical_annual_electricity_emissions_intensity_kg_per_ft2": {
|
600
600
|
"description": "Historical emissions intensity in kg/ft2 calculated based on an annual emission factor value for the selected historical year",
|
601
601
|
"type": "number"
|
602
602
|
},
|
603
|
-
"
|
604
|
-
"description": "Historical emissions intensity in kg
|
603
|
+
"historical_hourly_electricity_emissions_intensity_kg_per_ft2": {
|
604
|
+
"description": "Historical emissions intensity in kg/ft2 calculated based on hourly emission factor values for the selected historical year",
|
605
|
+
"type": "number"
|
606
|
+
},
|
607
|
+
"natural_gas_emissions_mt": {
|
608
|
+
"description": "Natural Gas emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
609
|
+
"type": "number"
|
610
|
+
},
|
611
|
+
"natural_gas_emissions_intensity_kg_per_ft2": {
|
612
|
+
"description": "Natural Gas emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
613
|
+
"type": "number"
|
614
|
+
},
|
615
|
+
"propane_emissions_mt": {
|
616
|
+
"description": "Propane emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
617
|
+
"type": "number"
|
618
|
+
},
|
619
|
+
"propane_emissions_intensity_kg_per_ft2": {
|
620
|
+
"description": "Propane emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
621
|
+
"type": "number"
|
622
|
+
},
|
623
|
+
"fueloil_no2_emissions_mt": {
|
624
|
+
"description": "FuelOilNo2 emissions in mt calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
625
|
+
"type": "number"
|
626
|
+
},
|
627
|
+
"fueloil_no2_emissions_intensity_kg_per_ft2": {
|
628
|
+
"description": "FuelOilNo2 emissions intensity in kg/ft2 calculated based on EPA eGRID data and calculated using 20-year GWP horizon based on ASHRAE 189.1",
|
605
629
|
"type": "number"
|
606
630
|
}
|
631
|
+
|
607
632
|
}
|
608
633
|
}
|
609
634
|
},
|
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.6.
|
4
|
+
version: 0.6.1
|
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: 2022-
|
12
|
+
date: 2022-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|