urbanopt-reporting 0.5.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/nightly_build.yml +41 -0
  3. data/CHANGELOG.md +22 -1
  4. data/LICENSE.md +17 -17
  5. data/README.md +4 -2
  6. data/doc_templates/LICENSE.md +17 -17
  7. data/doc_templates/copyright_erb.txt +2 -2
  8. data/doc_templates/copyright_js.txt +2 -2
  9. data/doc_templates/copyright_ruby.txt +1 -1
  10. data/docs/package-lock.json +15720 -1410
  11. data/lib/measures/.rubocop.yml +4 -2
  12. data/lib/measures/default_feature_reports/measure.rb +221 -16
  13. data/lib/measures/export_modelica_loads/measure.rb +1 -1
  14. data/lib/measures/export_time_series_modelica/measure.rb +1 -1
  15. data/lib/measures/export_time_series_modelica/resources/os_lib_helper_methods.rb +1 -1
  16. data/lib/urbanopt/reporting/default_reports/construction_cost.rb +1 -1
  17. data/lib/urbanopt/reporting/default_reports/date.rb +1 -1
  18. data/lib/urbanopt/reporting/default_reports/distributed_generation.rb +20 -2
  19. data/lib/urbanopt/reporting/default_reports/end_use.rb +1 -1
  20. data/lib/urbanopt/reporting/default_reports/end_uses.rb +1 -1
  21. data/lib/urbanopt/reporting/default_reports/extension.rb +1 -1
  22. data/lib/urbanopt/reporting/default_reports/feature_report.rb +2 -2
  23. data/lib/urbanopt/reporting/default_reports/generator.rb +1 -2
  24. data/lib/urbanopt/reporting/default_reports/location.rb +1 -1
  25. data/lib/urbanopt/reporting/default_reports/logger.rb +1 -1
  26. data/lib/urbanopt/reporting/default_reports/power_distribution.rb +21 -6
  27. data/lib/urbanopt/reporting/default_reports/program.rb +1 -1
  28. data/lib/urbanopt/reporting/default_reports/reporting_period.rb +44 -3
  29. data/lib/urbanopt/reporting/default_reports/scenario_power_distribution.rb +148 -0
  30. data/lib/urbanopt/reporting/default_reports/scenario_report.rb +7 -3
  31. data/lib/urbanopt/reporting/default_reports/schema/scenario_csv_columns.txt +24 -0
  32. data/lib/urbanopt/reporting/default_reports/schema/scenario_schema.json +265 -6
  33. data/lib/urbanopt/reporting/default_reports/solar_pv.rb +42 -3
  34. data/lib/urbanopt/reporting/default_reports/storage.rb +1 -1
  35. data/lib/urbanopt/reporting/default_reports/thermal_storage.rb +1 -1
  36. data/lib/urbanopt/reporting/default_reports/timeseries_csv.rb +1 -1
  37. data/lib/urbanopt/reporting/default_reports/validator.rb +1 -1
  38. data/lib/urbanopt/reporting/default_reports/wind.rb +11 -2
  39. data/lib/urbanopt/reporting/default_reports.rb +1 -1
  40. data/lib/urbanopt/reporting/derived_extension.rb +1 -1
  41. data/lib/urbanopt/reporting/version.rb +2 -2
  42. data/lib/urbanopt/reporting.rb +1 -1
  43. data/urbanopt-reporting-gem.gemspec +3 -0
  44. metadata +32 -2
@@ -1,5 +1,7 @@
1
1
  AllCops:
2
2
  Exclude:
3
- - 'spec/test_measures/**/*'
3
+ - gems/**/*
4
+ require: rubocop-performance
5
+
4
6
  inherit_from:
5
- - http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml
7
+ - http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v4.yml
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -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,7 +251,15 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
240
251
 
241
252
  ev_timeseries_data = ['Exterior Equipment:Electric Vehicles']
242
253
 
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
+
260
+
243
261
  timeseries_data += tes_timeseries_data
262
+ timeseries_data += emissions_timeseries_data
244
263
 
245
264
  timeseries_data.each do |ts|
246
265
  result << OpenStudio::IdfObject.load("Output:Variable,*,#{ts},#{reporting_frequency};").get
@@ -344,6 +363,20 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
344
363
  sql_file = sql_file.get
345
364
  model.setSqlFile(sql_file)
346
365
 
366
+ # Get the weather file run period (as opposed to design day run period)
367
+ ann_env_pd = nil
368
+ sql_file.availableEnvPeriods.each do |env_pd|
369
+ env_type = sql_file.environmentType(env_pd)
370
+ if env_type.is_initialized && (env_type.get == OpenStudio::EnvironmentType.new('WeatherRunPeriod'))
371
+ ann_env_pd = env_pd
372
+ end
373
+ end
374
+
375
+ if ann_env_pd == false
376
+ runner.registerError("Can't find a weather runperiod, make sure you ran an annual simulation, not just the design days.")
377
+ return false
378
+ end
379
+
347
380
  # get building from model
348
381
  building = model.getBuilding
349
382
 
@@ -801,22 +834,64 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
801
834
  time_setpoint_not_met_during_occupied_hours = time_setpoint_not_met_during_occupied_heating + time_setpoint_not_met_during_occupied_cooling
802
835
  feature_report.reporting_periods[0].comfort_result[:time_setpoint_not_met_during_occupied_hours] = time_setpoint_not_met_during_occupied_hours
803
836
 
804
- ######################################## Reporting TImeseries Results FOR CSV File ######################################
837
+ # electricity emissions
838
+ begin
805
839
 
806
- # Get the weather file run period (as opposed to design day run period)
807
- ann_env_pd = nil
808
- sql_file.availableEnvPeriods.each do |env_pd|
809
- env_type = sql_file.environmentType(env_pd)
810
- if env_type.is_initialized && (env_type.get == OpenStudio::EnvironmentType.new('WeatherRunPeriod'))
811
- ann_env_pd = env_pd
812
- end
813
- end
840
+ # future_annual_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
814
843
 
815
- if ann_env_pd == false
816
- runner.registerError("Can't find a weather runperiod, make sure you ran an annual simulation, not just the design days.")
817
- return false
844
+ # future_hourly_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
847
+
848
+ # historical_annual_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
851
+
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
855
+
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
859
+
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
863
+
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
871
+
872
+ rescue StandardError
873
+ @@logger.info('Emissions are not reported for this feature')
818
874
  end
819
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
+ ##########################################################################################################################
893
+ ######################################## Reporting TImeseries Results FOR CSV File #######################################
894
+
820
895
  # timeseries we want to report
821
896
  requested_timeseries_names = [
822
897
  'Electricity:Facility',
@@ -862,7 +937,31 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
862
937
  'District Heating Inlet Temperature',
863
938
  'District Heating Outlet Temperature',
864
939
  'Cooling Coil Total Cooling Rate',
865
- 'Heating Coil Heating Rate'
940
+ 'Heating Coil Heating Rate',
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',
955
+ 'Curtailed EV Power',
956
+ 'Daily EV Charge Energy Capacity',
957
+ 'EV Charge Ratio',
958
+ 'Total Charged EV Energy',
959
+ 'Total Curtailed EV Energy',
960
+ 'Total Scheduled EV Energy',
961
+ 'Emission Intensity Schedule Output',
962
+ 'EV Charging Effective Schedule',
963
+ 'EV Charging Original Schedule',
964
+ 'EV Charging Original Load'
866
965
  ]
867
966
 
868
967
  # add thermal comfort timeseries
@@ -881,7 +980,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
881
980
  runner.registerInfo("All timeseries: #{requested_timeseries_names}")
882
981
 
883
982
  # timeseries variables to keep to calculate power
884
- tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility']
983
+ tsToKeep = ['Electricity:Facility', 'ElectricityProduced:Facility','Propane:Facility', 'NaturalGas:Facility', 'FuelOilNo2:Facility', 'FuelOilNo1:Facility']
885
984
  tsToKeepIndexes = {}
886
985
 
887
986
  ### powerFactor ###
@@ -1002,6 +1101,12 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
1002
1101
  'm3'
1003
1102
  when 'W'
1004
1103
  'W'
1104
+ when 'kg'
1105
+ 'kg'
1106
+ when 'MT'
1107
+ 'MT'
1108
+ when 'KG/FT2'
1109
+ 'KG/FT2'
1005
1110
  end
1006
1111
  end
1007
1112
 
@@ -1022,6 +1127,103 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
1022
1127
  tsToKeepIndexes[timeseries_name] = key_cnt
1023
1128
  end
1024
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
+
1025
1227
  # special processing: power
1026
1228
  if powerTimeseries.include? timeseries_name
1027
1229
  # special case: net series (subtract generation from load)
@@ -1078,7 +1280,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
1078
1280
  end
1079
1281
  end
1080
1282
  end
1081
- end
1283
+ end
1284
+
1082
1285
 
1083
1286
  # append units to headers
1084
1287
  new_timeseries_name += "(#{new_unit})"
@@ -1211,6 +1414,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
1211
1414
  end
1212
1415
  end
1213
1416
 
1417
+ puts "values = #{values}"
1418
+
1214
1419
  # closing the sql file
1215
1420
  sql_file.close
1216
1421
 
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -192,6 +192,15 @@ module URBANopt
192
192
  #
193
193
  attr_accessor :probs_of_surviving_by_hour_of_the_day
194
194
 
195
+ ##
196
+ # _String_ - Filepath of reopt assumptions file used, if known
197
+ attr_accessor :reopt_assumptions_file_path
198
+
199
+ ##
200
+ # _Float_ - Annual percentage of electricity supplied by renewable sources
201
+ #
202
+ attr_accessor :annual_renewable_electricity_pct
203
+
195
204
  ##
196
205
  # Initialize distributed generation system design and financial metrics.
197
206
  #
@@ -206,6 +215,7 @@ module URBANopt
206
215
  def initialize(hash = {})
207
216
  hash.delete_if { |k, v| v.nil? }
208
217
 
218
+ @annual_renewable_electricity_pct = hash[:annual_renewable_electricity_pct]
209
219
  @lcc_us_dollars = hash[:lcc_us_dollars]
210
220
  @lcc_bau_us_dollars = hash[:lcc_bau_us_dollars]
211
221
  @npv_us_dollars = hash[:npv_us_dollars]
@@ -227,6 +237,12 @@ module URBANopt
227
237
  @probs_of_surviving_by_month = hash[:probs_of_surviving_by_month]
228
238
  @probs_of_surviving_by_hour_of_the_day = hash[:probs_of_surviving_by_hour_of_the_day]
229
239
 
240
+ # optional
241
+ @reopt_assumptions_file_path = nil
242
+ if hash[:reopt_assumptions_file_path]
243
+ @reopt_assumptions_file_path = hash[:reopt_assumptions_file_path]
244
+ end
245
+
230
246
  @total_solar_pv_kw = nil
231
247
  @total_wind_kw = nil
232
248
  @total_generator_kw = nil
@@ -363,7 +379,8 @@ module URBANopt
363
379
  ##
364
380
  def to_hash
365
381
  result = {}
366
-
382
+ result[:reopt_assumptions_file_path] = @reopt_assumptions_file_path if @reopt_assumptions_file_path
383
+ result[:annual_renewable_electricity_pct] = @annual_renewable_electricity_pct if @annual_renewable_electricity_pct
367
384
  result[:lcc_us_dollars] = @lcc_us_dollars if @lcc_us_dollars
368
385
  result[:lcc_bau_us_dollars] = @lcc_bau_us_dollars if @lcc_bau_us_dollars
369
386
  result[:npv_us_dollars] = @npv_us_dollars if @npv_us_dollars
@@ -433,6 +450,7 @@ module URBANopt
433
450
  # Merge a distributed generation system with a new system
434
451
  ##
435
452
  def self.merge_distributed_generation(existing_dgen, new_dgen)
453
+ existing_dgen.annual_renewable_electricity_pct = add_values(existing_dgen.annual_renewable_electricity_pct, new_dgen.annual_renewable_electricity_pct)
436
454
  existing_dgen.lcc_us_dollars = add_values(existing_dgen.lcc_us_dollars, new_dgen.lcc_us_dollars)
437
455
  existing_dgen.lcc_bau_us_dollars = add_values(existing_dgen.lcc_bau_us_dollars, new_dgen.lcc_bau_us_dollars)
438
456
  existing_dgen.npv_us_dollars = add_values(existing_dgen.npv_us_dollars, new_dgen.npv_us_dollars)
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -259,7 +259,7 @@ module URBANopt
259
259
  FileUtils.mkdir_p File.dirname(@timeseries_csv.path)
260
260
  @timeseries_csv.save_data
261
261
 
262
- ## save json rport
262
+ ## save json report
263
263
  # feature_hash
264
264
  feature_hash = to_hash
265
265
 
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -80,7 +80,6 @@ module URBANopt
80
80
  result = {}
81
81
 
82
82
  result[:size_kw] = @size_kw if @size_kw
83
-
84
83
  return result
85
84
  end
86
85
 
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,
@@ -50,11 +50,12 @@ module URBANopt
50
50
  # power_distributio include eletrical power distribution systems information.
51
51
  ##
52
52
  class PowerDistribution
53
- attr_accessor :under_voltage_hours, :over_voltage_hours # :nodoc:
53
+ attr_accessor :under_voltage_hours, :over_voltage_hours, :nominal_capacity,
54
+ :reactance_resistance_ratio, :nominal_voltage, :max_power_kw, :max_reactive_power_kvar # :nodoc:
54
55
 
55
56
  ##
56
- # PowerDistrinution class intialize all power_distribution attributes:
57
- # +:under_voltage_hours+ , +:over_voltage_hours+
57
+ # PowerDistribution class initialize all power_distribution attributes:
58
+ # +:under_voltage_hours+ , +:over_voltage_hours+, +:nominal_capacity+, +:reactance_resistance_ratio+
58
59
  ##
59
60
  # [parameters:]
60
61
  # +hash+ - _Hash_ - A hash which may contain a deserialized power_distribution.
@@ -65,7 +66,11 @@ module URBANopt
65
66
 
66
67
  @under_voltage_hours = hash[:under_voltage_hours]
67
68
  @over_voltage_hours = hash[:over_voltage_hours]
68
-
69
+ @nominal_capacity = hash[:nominal_capacity]
70
+ @reactance_resistance_ratio = hash[:reactance_resistance_ratio]
71
+ @nominal_voltage = hash[:nominal_voltage] # in V
72
+ @max_power_kw = hash[:max_power_kw]
73
+ @max_reactive_power_kvar = hash[:max_reactive_power_kvar]
69
74
  # initialize class variables @@validator and @@schema
70
75
  @@validator ||= Validator.new
71
76
  @@schema ||= @@validator.schema
@@ -78,6 +83,11 @@ module URBANopt
78
83
  hash = {}
79
84
  hash[:under_voltage_hours] = nil
80
85
  hash[:over_voltage_hours] = nil
86
+ hash[:nominal_capacity] = nil
87
+ hash[:reactance_resistance_ratio] = nil
88
+ hash[:nominal_voltage] = nil
89
+ hash[:max_power_kw] = nil
90
+ hash[:max_reactive_power_kvar] = nil
81
91
 
82
92
  return hash
83
93
  end
@@ -92,6 +102,11 @@ module URBANopt
92
102
  result = {}
93
103
  result[:under_voltage_hours] = @under_voltage_hours if @under_voltage_hours
94
104
  result[:over_voltage_hours] = @over_voltage_hours if @over_voltage_hours
105
+ result[:nominal_capacity] = @nominal_capacity if @nominal_capacity
106
+ result[:reactance_resistance_ratio] = @reactance_resistance_ratio if @reactance_resistance_ratio
107
+ result[:nominal_voltage] = @nominal_voltage if @nominal_voltage
108
+ result[:max_power_kw] = @max_power_kw if @max_power_kw
109
+ result[:max_reactive_power_kvar] = @max_reactive_power_kvar if @max_reactive_power_kvar
95
110
 
96
111
  # validate power_distribution properties against schema
97
112
  if @@validator.validate(@@schema[:definitions][:PowerDistribution][:properties], result).any?
@@ -105,7 +120,7 @@ module URBANopt
105
120
  # Merges muliple power distribution results together.
106
121
  ##
107
122
  # +new_costs+ - _Array_ - An array of ConstructionCost objects.
108
- def merge_power_distribition
123
+ def merge_power_distribution
109
124
  # method to be developed for any attributes to be aggregated or merged
110
125
  end
111
126
  end
@@ -1,5 +1,5 @@
1
1
  # *********************************************************************************
2
- # URBANopt™, Copyright (c) 2019-2021, Alliance for Sustainable Energy, LLC, and other
2
+ # URBANopt™, Copyright (c) 2019-2022, 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,