urbanopt-reporting 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt (tm), Copyright (c) 2019-2024, 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,
@@ -2,16 +2,16 @@
2
2
 
3
3
  ###### (Automatically generated documentation)
4
4
 
5
- #
5
+ # DefaultFeatureReports
6
6
 
7
7
  ## Description
8
-
8
+ Writes default_feature_reports.json and default_feature_reports.csv files used by URBANopt Scenario Default Post Processor
9
9
 
10
10
  ## Modeler Description
11
-
11
+ This measure only allows for one feature_report per simulation. If multiple features are simulated in a single simulation, a new measure must be written to disaggregate simulation results to multiple features.
12
12
 
13
13
  ## Measure Type
14
- ModelMeasure
14
+ ReportingMeasure
15
15
 
16
16
  ## Taxonomy
17
17
 
@@ -19,8 +19,46 @@ ModelMeasure
19
19
  ## Arguments
20
20
 
21
21
 
22
+ ### Feature unique identifier
23
+
24
+ **Name:** feature_id,
25
+ **Type:** String,
26
+ **Units:** ,
27
+ **Required:** false,
28
+ **Model Dependent:** false
29
+
30
+ ### Feature scenario specific name
31
+
32
+ **Name:** feature_name,
33
+ **Type:** String,
34
+ **Units:** ,
35
+ **Required:** false,
36
+ **Model Dependent:** false
37
+
38
+ ### URBANopt Feature Type
39
+
40
+ **Name:** feature_type,
41
+ **Type:** String,
42
+ **Units:** ,
43
+ **Required:** false,
44
+ **Model Dependent:** false
45
+
46
+ ### URBANopt Feature Location
47
+
48
+ **Name:** feature_location,
49
+ **Type:** String,
50
+ **Units:** ,
51
+ **Required:** false,
52
+ **Model Dependent:** false
53
+
54
+ ### Reporting Frequency
55
+ The frequency at which to report timeseries output data.
56
+ **Name:** reporting_frequency,
57
+ **Type:** Choice,
58
+ **Units:** ,
59
+ **Required:** true,
60
+ **Model Dependent:** false
22
61
 
23
62
 
24
- This measure does not have any user arguments
25
63
 
26
64
 
@@ -1,11 +1,10 @@
1
1
  <?xml version="1.0"?>
2
2
  <measure>
3
3
  <schema_version>3.1</schema_version>
4
- <error>wrong number of arguments (given 1, expected 0)</error>
5
4
  <name>default_feature_reports</name>
6
5
  <uid>9ee3135a-8070-4408-bfa1-b75fecf9dd4f</uid>
7
- <version_id>50d54c60-5f7e-4948-9fb0-1567e1335148</version_id>
8
- <version_modified>2023-07-06T16:04:16Z</version_modified>
6
+ <version_id>0d079df4-5b14-465d-9b3c-d00e30b3def2</version_id>
7
+ <version_modified>2024-01-08T22:54:10Z</version_modified>
9
8
  <xml_checksum>FB304155</xml_checksum>
10
9
  <class_name>DefaultFeatureReports</class_name>
11
10
  <display_name>DefaultFeatureReports</display_name>
@@ -39,12 +38,10 @@
39
38
  <argument>
40
39
  <name>feature_location</name>
41
40
  <display_name>URBANopt Feature Location</display_name>
42
- <descrption>Writes default_feature_reports.json and default_feature_reports.csv files used by URBANopt Scenario Default Post Processor</descrption>
43
41
  <type>String</type>
44
- <units></units>
45
- <required>true</required>
42
+ <required>false</required>
46
43
  <model_dependent>false</model_dependent>
47
- <default_value>1</default_value>
44
+ <default_value>0</default_value>
48
45
  </argument>
49
46
  <argument>
50
47
  <name>reporting_frequency</name>
@@ -108,13 +105,13 @@
108
105
  <filename>LICENSE.md</filename>
109
106
  <filetype>md</filetype>
110
107
  <usage_type>license</usage_type>
111
- <checksum>016C4035</checksum>
108
+ <checksum>7247B202</checksum>
112
109
  </file>
113
110
  <file>
114
111
  <filename>README.md</filename>
115
112
  <filetype>md</filetype>
116
113
  <usage_type>readme</usage_type>
117
- <checksum>0B68E96D</checksum>
114
+ <checksum>D4DA366E</checksum>
118
115
  </file>
119
116
  <file>
120
117
  <filename>README.md.erb</filename>
@@ -1,4 +1,4 @@
1
- URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt (tm), Copyright (c) 2019-2024, 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,
@@ -56,7 +56,7 @@ class ExportModelicaLoads < OpenStudio::Measure::ReportingMeasure
56
56
  result << OpenStudio::IdfObject.load('Output:Meter,WaterSystems:EnergyTransfer,timestep;').get # Joules
57
57
  # these variables are used for the modelica export.
58
58
  result << OpenStudio::IdfObject.load('Output:Variable,*,Zone Predicted Sensible Load to Setpoint Heat Transfer Rate,timestep;').get # watts according to e+
59
- result << OpenStudio::IdfObject.load('Output:Variable,*,Water Heater Total Demand Heat Transfer Rate,timestep;').get # Watts
59
+ result << OpenStudio::IdfObject.load('Output:Variable,,Water Heater Total Demand Heat Transfer Rate,timestep;').get # Watts
60
60
 
61
61
  return result
62
62
  end
@@ -97,7 +97,7 @@ class ExportModelicaLoads < OpenStudio::Measure::ReportingMeasure
97
97
  quick_proc[-1] = quick_proc[-1].delete(')')
98
98
  column += quick_proc
99
99
 
100
- log "Took #{Time.now - start} to iterate"
100
+ # log "Took #{Time.now - start} to iterate"
101
101
  end
102
102
 
103
103
  log 'Appending column to data'
@@ -227,21 +227,21 @@ class ExportModelicaLoads < OpenStudio::Measure::ReportingMeasure
227
227
  extract_timeseries_into_matrix(sql_file, rows, 'Electricity:Facility', nil, 0, timestep)
228
228
  extract_timeseries_into_matrix(sql_file, rows, 'Gas:Facility', nil, 0, timestep)
229
229
  extract_timeseries_into_matrix(sql_file, rows, 'Heating:EnergyTransfer', nil, 0, timestep)
230
- extract_timeseries_into_matrix(sql_file, rows, 'WaterSystems:EnergyTransfer', nil, 0, timestep)
230
+ extract_timeseries_into_matrix(sql_file, rows, 'Water Heater Total Demand Heat Transfer Rate', nil, 0, timestep)
231
231
 
232
232
  # get all zones and save the names for later use in aggregation.
233
233
  tz_names = []
234
234
  model.getThermalZones.each do |tz|
235
235
  tz_names << tz.name.get if tz.name.is_initialized
236
236
  extract_timeseries_into_matrix(sql_file, rows, 'Zone Predicted Sensible Load to Setpoint Heat Transfer Rate', tz_names.last, 0, timestep)
237
- extract_timeseries_into_matrix(sql_file, rows, 'Water Heater Heating Rate', tz_names.last, 0, timestep)
237
+ # extract_timeseries_into_matrix(sql_file, rows, 'Water Heater Heating Rate', tz_names.last, 0, timestep)
238
238
  end
239
239
 
240
240
  # sum up a couple of the columns and create a new columns
241
241
  create_new_variable_sum(rows, 'TotalSensibleLoad', 'ZonePredictedSensibleLoadtoSetpointHeatTransferRate')
242
242
  create_new_variable_sum(rows, 'TotalCoolingSensibleLoad', 'ZonePredictedSensibleLoadtoSetpointHeatTransferRate', negative_only: true)
243
243
  create_new_variable_sum(rows, 'TotalHeatingSensibleLoad', 'ZonePredictedSensibleLoadtoSetpointHeatTransferRate', positive_only: true)
244
- create_new_variable_sum(rows, 'TotalWaterHeating', 'WaterHeaterHeatingRate')
244
+ create_new_variable_sum(rows, 'TotalWaterHeating', 'WaterHeaterTotalDemandHeatTransferRate')
245
245
 
246
246
  # convert this to CSV object
247
247
  File.open('./building_loads.csv', 'w') do |f|
@@ -284,17 +284,13 @@ class ExportModelicaLoads < OpenStudio::Measure::ReportingMeasure
284
284
 
285
285
  File.open('./modelica.mos', 'w') do |f|
286
286
  f << "#1\n"
287
- f << "#Heating and Cooling Model loads from OpenStudio Prototype Buildings\n"
288
- f << "# Building Type: {{BUILDINGTYPE}}\n"
289
- f << "# Climate Zone: {{CLIMATEZONE}}\n"
290
- f << "# Vintage: {{VINTAGE}}\n"
291
- f << "# Simulation ID (for debugging): {{SIMID}}\n"
292
- f << "# URL: https://github.com/urbanopt/openstudio-prototype-loads\n"
287
+ f << "#Exported loads from OpenStudio Reporting Measure\n"
288
+ f << "# Measure location: https://github.com/urbanopt/urbanopt-reporting-gem/tree/develop/lib/measures/export_modelica_loads\n"
293
289
  f << "\n"
294
290
  f << "#First column: Seconds in the year (loads are hourly)\n"
295
291
  f << "#Second column: cooling loads in Watts (as negative numbers).\n"
296
292
  f << "#Third column: space heating loads in Watts\n"
297
- f << "#Fourth column: water heating in Watts\n"
293
+ f << "#Fourth column: water heating loads in Watts\n"
298
294
  f << "\n"
299
295
  f << "#Peak space cooling load = #{peak_cooling} Watts\n"
300
296
  f << "#Peak space heating load = #{peak_heating} Watts\n"
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.1</schema_version>
4
4
  <name>export_modelica_loads</name>
5
5
  <uid>7051db01-2e55-4223-b5b5-fee615b68dd0</uid>
6
- <version_id>5ecb1fdb-fab0-4da7-a2f4-e67e9b3f94a0</version_id>
7
- <version_modified>2023-07-06T16:04:16Z</version_modified>
6
+ <version_id>e682f518-4785-4917-802e-600023816cc3</version_id>
7
+ <version_modified>2024-01-08T22:54:10Z</version_modified>
8
8
  <xml_checksum>2C8A3EEF</xml_checksum>
9
9
  <class_name>ExportModelicaLoads</class_name>
10
10
  <display_name>Export Modelica Loads</display_name>
@@ -33,7 +33,7 @@
33
33
  <filename>LICENSE.md</filename>
34
34
  <filetype>md</filetype>
35
35
  <usage_type>license</usage_type>
36
- <checksum>016C4035</checksum>
36
+ <checksum>7247B202</checksum>
37
37
  </file>
38
38
  <file>
39
39
  <filename>README.md</filename>
@@ -62,7 +62,7 @@
62
62
  <filename>measure.rb</filename>
63
63
  <filetype>rb</filetype>
64
64
  <usage_type>script</usage_type>
65
- <checksum>6CE65AC0</checksum>
65
+ <checksum>B130AAF4</checksum>
66
66
  </file>
67
67
  <file>
68
68
  <filename>report.html.in</filename>
@@ -1,4 +1,4 @@
1
- URBANopt (tm), Copyright (c) 2019-2023, Alliance for Sustainable Energy, LLC, and other
1
+ URBANopt (tm), Copyright (c) 2019-2024, 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,
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.1</schema_version>
4
4
  <name>export_time_series_loads_csv</name>
5
5
  <uid>9fcf6116-c2eb-43d6-93f0-e1bdd822f768</uid>
6
- <version_id>562d7da7-5edf-46b5-8231-0cb55e4a78bd</version_id>
7
- <version_modified>2023-07-20T19:21:47Z</version_modified>
6
+ <version_id>0b134568-d3a8-4ede-bf22-2010a173ea97</version_id>
7
+ <version_modified>2024-01-08T22:54:07Z</version_modified>
8
8
  <xml_checksum>9BF1E6AC</xml_checksum>
9
9
  <class_name>ExportTimeSeriesLoadsCSV</class_name>
10
10
  <display_name>ExportTimeSeriesLoadsCSV</display_name>
@@ -76,7 +76,7 @@
76
76
  <filename>LICENSE.md</filename>
77
77
  <filetype>md</filetype>
78
78
  <usage_type>license</usage_type>
79
- <checksum>016C4035</checksum>
79
+ <checksum>7247B202</checksum>
80
80
  </file>
81
81
  <file>
82
82
  <filename>README.md</filename>
@@ -16,7 +16,8 @@ module URBANopt
16
16
  ##
17
17
  class PowerDistribution
18
18
  attr_accessor :under_voltage_hours, :over_voltage_hours, :nominal_capacity,
19
- :reactance_resistance_ratio, :nominal_voltage, :max_power_kw, :max_reactive_power_kvar # :nodoc:
19
+ :reactance_resistance_ratio, :nominal_voltage, :max_power_kw, :max_reactive_power_kvar,
20
+ :tx_incoming_voltage, :tx_outgoing_voltage # :nodoc:
20
21
 
21
22
  ##
22
23
  # PowerDistribution class initialize all power_distribution attributes:
@@ -36,6 +37,8 @@ module URBANopt
36
37
  @nominal_voltage = hash[:nominal_voltage] # in V
37
38
  @max_power_kw = hash[:max_power_kw]
38
39
  @max_reactive_power_kvar = hash[:max_reactive_power_kvar]
40
+ @tx_incoming_voltage = hash[:tx_incoming_voltage]
41
+ @tx_outgoing_voltage = hash[:tx_outgoing_voltage]
39
42
  # initialize class variables @@validator and @@schema
40
43
  @@validator ||= Validator.new
41
44
  @@schema ||= @@validator.schema
@@ -53,6 +56,8 @@ module URBANopt
53
56
  hash[:nominal_voltage] = nil
54
57
  hash[:max_power_kw] = nil
55
58
  hash[:max_reactive_power_kvar] = nil
59
+ hash[:tx_incoming_voltage] = nil
60
+ hash[:tx_outgoing_voltage] = nil
56
61
 
57
62
  return hash
58
63
  end
@@ -72,6 +77,8 @@ module URBANopt
72
77
  result[:nominal_voltage] = @nominal_voltage if @nominal_voltage
73
78
  result[:max_power_kw] = @max_power_kw if @max_power_kw
74
79
  result[:max_reactive_power_kvar] = @max_reactive_power_kvar if @max_reactive_power_kvar
80
+ result[:tx_incoming_voltage] = @tx_incoming_voltage if @tx_incoming_voltage
81
+ result[:tx_outgoing_voltage] = @tx_outgoing_voltage if @tx_outgoing_voltage
75
82
 
76
83
  # validate power_distribution properties against schema
77
84
  if @@validator.validate(@@schema[:definitions][:PowerDistribution][:properties], result).any?