openstudio-calibration 0.9.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Jenkinsfile +1 -1
- data/LICENSE.md +1 -1
- data/README.md +2 -0
- data/Rakefile +3 -0
- data/lib/measures/AddMonthlyJSONUtilityData/LICENSE.md +1 -1
- data/lib/measures/AddMonthlyJSONUtilityData/measure.rb +3 -3
- data/lib/measures/AddMonthlyJSONUtilityData/measure.xml +12 -12
- data/lib/measures/AddMonthlyUtilityData/LICENSE.md +1 -1
- data/lib/measures/AddMonthlyUtilityData/measure.xml +29 -29
- data/lib/measures/CalibrationReports/LICENSE.md +1 -1
- data/lib/measures/CalibrationReports/README.md +2 -2
- data/lib/measures/CalibrationReports/measure.rb +1 -3
- data/lib/measures/CalibrationReports/measure.xml +41 -42
- data/lib/measures/CalibrationReportsEnhanced/LICENSE.md +1 -1
- data/lib/measures/CalibrationReportsEnhanced/measure.rb +21 -22
- data/lib/measures/CalibrationReportsEnhanced/measure.xml +41 -41
- data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.rb +12 -12
- data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.xml +14 -14
- data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.rb +12 -12
- data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.xml +14 -14
- data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.rb +21 -23
- data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.xml +14 -14
- data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.rb +21 -23
- data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.xml +14 -14
- data/lib/measures/CoilCoolingWaterMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingWaterMultiplier/measure.rb +33 -43
- data/lib/measures/CoilCoolingWaterMultiplier/measure.xml +14 -14
- data/lib/measures/CoilCoolingWaterPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilCoolingWaterPercentChange/measure.rb +33 -43
- data/lib/measures/CoilCoolingWaterPercentChange/measure.xml +14 -14
- data/lib/measures/CoilHeatingElectricMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingElectricMultiplier/measure.rb +8 -8
- data/lib/measures/CoilHeatingElectricMultiplier/measure.xml +14 -14
- data/lib/measures/CoilHeatingElectricPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingElectricPercentChange/measure.rb +8 -8
- data/lib/measures/CoilHeatingElectricPercentChange/measure.xml +14 -14
- data/lib/measures/CoilHeatingGasMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingGasMultiplier/measure.rb +8 -8
- data/lib/measures/CoilHeatingGasMultiplier/measure.xml +14 -14
- data/lib/measures/CoilHeatingGasPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingGasPercentChange/measure.rb +8 -8
- data/lib/measures/CoilHeatingGasPercentChange/measure.xml +14 -14
- data/lib/measures/CoilHeatingWaterMultiplier/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingWaterMultiplier/measure.rb +13 -15
- data/lib/measures/CoilHeatingWaterMultiplier/measure.xml +14 -14
- data/lib/measures/CoilHeatingWaterPercentChange/LICENSE.md +1 -1
- data/lib/measures/CoilHeatingWaterPercentChange/measure.rb +13 -15
- data/lib/measures/CoilHeatingWaterPercentChange/measure.xml +14 -14
- data/lib/measures/ConstructionLayerZeroMaterialProperties/LICENSE.md +1 -1
- data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.rb +4 -4
- data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.xml +12 -12
- data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/LICENSE.md +1 -1
- data/lib/measures/ElectricBaseboardEfficiencyAndCapacity/measure.xml +11 -11
- data/lib/measures/ExteriorWallThermalPropertiesMultiplier/LICENSE.md +1 -1
- data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.rb +8 -5
- data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.xml +18 -18
- data/lib/measures/ExteriorWallThermalPropertiesPercentChange/LICENSE.md +1 -1
- data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.rb +8 -5
- data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.xml +18 -18
- data/lib/measures/FansMultiplier/LICENSE.md +1 -1
- data/lib/measures/FansMultiplier/measure.rb +8 -8
- data/lib/measures/FansMultiplier/measure.xml +14 -14
- data/lib/measures/FansPercentChange/LICENSE.md +1 -1
- data/lib/measures/FansPercentChange/measure.rb +8 -8
- data/lib/measures/FansPercentChange/measure.xml +14 -14
- data/lib/measures/GeneralCalibrationMeasureMultiplier/LICENSE.md +1 -1
- data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.rb +2 -2
- data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.xml +16 -16
- data/lib/measures/GeneralCalibrationMeasurePercentChange/LICENSE.md +1 -1
- data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.rb +2 -2
- data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.xml +16 -16
- data/lib/measures/HardSizeHvac/LICENSE.md +1 -1
- data/lib/measures/HardSizeHvac/measure.rb +2 -4
- data/lib/measures/HardSizeHvac/measure.xml +19 -19
- data/lib/measures/RValueOfInsulationForConstructionMultiplier/LICENSE.md +1 -1
- data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.rb +7 -9
- data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.xml +12 -12
- data/lib/measures/RValueOfInsulationForConstructionPercentageChange/LICENSE.md +1 -1
- data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.rb +7 -9
- data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.xml +12 -12
- data/lib/measures/RoofThermalPropertiesMultiplier/LICENSE.md +1 -1
- data/lib/measures/RoofThermalPropertiesMultiplier/measure.rb +8 -5
- data/lib/measures/RoofThermalPropertiesMultiplier/measure.xml +18 -18
- data/lib/measures/RoofThermalPropertiesPercentChange/LICENSE.md +1 -1
- data/lib/measures/RoofThermalPropertiesPercentChange/measure.rb +8 -5
- data/lib/measures/RoofThermalPropertiesPercentChange/measure.xml +18 -18
- data/lib/measures/TimeseriesObjectiveFunction/LICENSE.md +1 -1
- data/lib/measures/TimeseriesObjectiveFunction/measure.rb +26 -23
- data/lib/measures/TimeseriesObjectiveFunction/measure.xml +11 -16
- data/lib/measures/TimeseriesObjectiveFunction/resources/report.html.erb +3 -0
- data/lib/measures/TimeseriesPlot/LICENSE.md +1 -1
- data/lib/measures/TimeseriesPlot/measure.rb +1 -3
- data/lib/measures/TimeseriesPlot/measure.xml +13 -13
- data/lib/measures/TimeseriesPlot/resources/report.html.erb +3 -0
- data/lib/measures/WaterHeaterMixedMultiplier/LICENSE.md +1 -1
- data/lib/measures/WaterHeaterMixedMultiplier/measure.rb +17 -22
- data/lib/measures/WaterHeaterMixedMultiplier/measure.xml +14 -14
- data/lib/measures/WaterHeaterMixedPercentChange/LICENSE.md +1 -1
- data/lib/measures/WaterHeaterMixedPercentChange/measure.rb +17 -22
- data/lib/measures/WaterHeaterMixedPercentChange/measure.xml +14 -14
- data/lib/measures/inspect_and_edit_parametric_schedules/LICENSE.md +1 -1
- data/lib/measures/inspect_and_edit_parametric_schedules/measure.rb +13 -11
- data/lib/measures/inspect_and_edit_parametric_schedules/measure.xml +29 -29
- data/lib/measures/shift_hours_of_operation/LICENSE.md +1 -1
- data/lib/measures/shift_hours_of_operation/measure.rb +31 -29
- data/lib/measures/shift_hours_of_operation/measure.xml +51 -37
- data/lib/openstudio/calibration/version.rb +1 -1
- data/openstudio-calibration.gemspec +12 -6
- metadata +55 -13
@@ -290,22 +290,22 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
290
290
|
js_time = js_time.gsub('Sep', '09')
|
291
291
|
js_time = js_time.gsub('Oct', '10')
|
292
292
|
js_time = js_time.gsub('Nov', '11')
|
293
|
-
js_time
|
294
|
-
|
295
|
-
js_time
|
293
|
+
js_time.gsub('Dec', '12')
|
296
294
|
end
|
297
295
|
|
298
296
|
# setup convert
|
299
|
-
|
297
|
+
case convert_data
|
298
|
+
when 'F to C'
|
300
299
|
convert = 0.5556
|
301
|
-
|
300
|
+
when 'WH to J'
|
302
301
|
convert = 3600
|
303
|
-
|
302
|
+
when 'CFM to m3/s'
|
304
303
|
convert = 0.00047
|
305
|
-
|
304
|
+
when 'PSI to Pa'
|
306
305
|
convert = 6894.76
|
307
|
-
else
|
308
|
-
|
306
|
+
else
|
307
|
+
convert_data == 'None'
|
308
|
+
convert = 1
|
309
309
|
end
|
310
310
|
|
311
311
|
diff = 0.0
|
@@ -428,13 +428,13 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
428
428
|
"+0#{tzs.to_i}:00"
|
429
429
|
else # two digit
|
430
430
|
"+#{tzs.to_i}:00"
|
431
|
-
|
431
|
+
end
|
432
432
|
else # negative number
|
433
433
|
if tzs.to_i * -1 < 10 # one digit
|
434
434
|
"-0#{tzs.to_i * -1}:00"
|
435
435
|
else # two digit
|
436
436
|
"-#{tzs.to_i * -1}:00"
|
437
|
-
|
437
|
+
end
|
438
438
|
end
|
439
439
|
runner.registerInfo("timezone = #{tz}")
|
440
440
|
# export for plotting
|
@@ -501,6 +501,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
501
501
|
|
502
502
|
csv.each_index do |row|
|
503
503
|
next unless row > 0
|
504
|
+
|
504
505
|
if csv[row][0].nil?
|
505
506
|
if warning_messages
|
506
507
|
runner.registerWarning("empty csv row number #{row}")
|
@@ -516,7 +517,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
516
517
|
if year.nil?
|
517
518
|
dat = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(cal[mon]), day)
|
518
519
|
else
|
519
|
-
dat = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(cal[mon]),day,year)
|
520
|
+
dat = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(cal[mon]), day, year)
|
520
521
|
end
|
521
522
|
tim = if sec.nil?
|
522
523
|
OpenStudio::Time.new(0, hou, min, 0)
|
@@ -550,6 +551,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
550
551
|
runner.registerInfo("dtm: #{dtm}") if verbose_messages
|
551
552
|
csv[row].each_index do |col|
|
552
553
|
next unless col > 0
|
554
|
+
|
553
555
|
mtr = csv[row][col].to_s
|
554
556
|
# try converting
|
555
557
|
if convert == 0.5556 # this is a temperature
|
@@ -568,6 +570,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
568
570
|
end
|
569
571
|
end
|
570
572
|
next unless csv[0][col] == hdr
|
573
|
+
|
571
574
|
sim = ser.value(dtm)
|
572
575
|
# store timeseries for plotting
|
573
576
|
point = {}
|
@@ -579,9 +582,10 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
579
582
|
point2['time'] = to_JSTime(dtm)
|
580
583
|
data2 << point2
|
581
584
|
|
582
|
-
dif =
|
585
|
+
dif = case norm
|
586
|
+
when 1
|
583
587
|
scale.to_f * (mtr.to_f - sim.to_f).abs
|
584
|
-
|
588
|
+
when 2
|
585
589
|
(scale.to_f * (mtr.to_f - sim.to_f))**2
|
586
590
|
else
|
587
591
|
scale.to_f * (mtr.to_f - sim.to_f)
|
@@ -606,6 +610,7 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
606
610
|
end
|
607
611
|
# add 0 for plotting
|
608
612
|
next unless last_zero
|
613
|
+
|
609
614
|
runner.registerInfo("add last_zero: #{last_date + delta}")
|
610
615
|
point = {}
|
611
616
|
point['y'] = 0.0
|
@@ -654,15 +659,13 @@ class TimeseriesObjectiveFunction < OpenStudio::Measure::ReportingMeasure
|
|
654
659
|
FileUtils.mkdir_p(File.dirname("allseries_#{csv_var}.json")) unless Dir.exist?(File.dirname("allseries_#{csv_var}.json"))
|
655
660
|
File.open("allseries_#{csv_var}.json", 'wb') { |f| f << JSON.pretty_generate(all_series) }
|
656
661
|
# check if analysis directory exists on server
|
657
|
-
if algorithm_download
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
FileUtils.cp("timeseries_#{plot_name}.csv", directory_name)
|
665
|
-
end
|
662
|
+
if algorithm_download && (File.basename(File.expand_path(File.join(Dir.pwd, '../../../'))).split('_')[0] == 'analysis')
|
663
|
+
runner.registerInfo("Copying timeseries_#{csv_var}.json to downloads directory")
|
664
|
+
directory_name = File.expand_path(File.join(Dir.pwd, '../../../downloads'))
|
665
|
+
Dir.mkdir(directory_name) unless File.exist?(directory_name)
|
666
|
+
FileUtils.cp("timeseries_#{csv_var}.json", directory_name)
|
667
|
+
FileUtils.cp("allseries_#{csv_var}.json", directory_name)
|
668
|
+
FileUtils.cp("timeseries_#{plot_name}.csv", directory_name)
|
666
669
|
end
|
667
670
|
diff = Math.sqrt(diff) if norm == 2
|
668
671
|
|
@@ -3,8 +3,8 @@
|
|
3
3
|
<schema_version>3.1</schema_version>
|
4
4
|
<name>timeseries_objective_function</name>
|
5
5
|
<uid>6804217d-4737-45f3-82df-b81393c29ce4</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>6073bda9-1d2d-4b87-8117-1f763eec41b4</version_id>
|
7
|
+
<version_modified>2024-11-16T23:44:47Z</version_modified>
|
8
8
|
<xml_checksum>FFE04372</xml_checksum>
|
9
9
|
<class_name>TimeseriesObjectiveFunction</class_name>
|
10
10
|
<display_name>TimeSeries Objective Function</display_name>
|
@@ -118,12 +118,12 @@
|
|
118
118
|
</argument>
|
119
119
|
<argument>
|
120
120
|
<name>key_value</name>
|
121
|
-
<display_name>SQL key value</display_name>
|
121
|
+
<display_name>SQL key value. use no_key if there is no key, i.e. Electricity:Facility</display_name>
|
122
122
|
<description>SQL key value for the SQL query to find the variable in the SQL file</description>
|
123
123
|
<type>String</type>
|
124
124
|
<required>true</required>
|
125
125
|
<model_dependent>false</model_dependent>
|
126
|
-
<default_value
|
126
|
+
<default_value>no_key</default_value>
|
127
127
|
</argument>
|
128
128
|
<argument>
|
129
129
|
<name>timeseries_name</name>
|
@@ -141,14 +141,15 @@
|
|
141
141
|
<type>Choice</type>
|
142
142
|
<required>true</required>
|
143
143
|
<model_dependent>false</model_dependent>
|
144
|
+
<default_value>Zone Timestep</default_value>
|
144
145
|
<choices>
|
145
146
|
<choice>
|
146
147
|
<value>Detailed</value>
|
147
148
|
<display_name>Detailed</display_name>
|
148
149
|
</choice>
|
149
150
|
<choice>
|
150
|
-
<value>Timestep</value>
|
151
|
-
<display_name>Timestep</display_name>
|
151
|
+
<value>Zone Timestep</value>
|
152
|
+
<display_name>Zone Timestep</display_name>
|
152
153
|
</choice>
|
153
154
|
<choice>
|
154
155
|
<value>Hourly</value>
|
@@ -401,19 +402,13 @@
|
|
401
402
|
<filename>LICENSE.md</filename>
|
402
403
|
<filetype>md</filetype>
|
403
404
|
<usage_type>license</usage_type>
|
404
|
-
<checksum>
|
405
|
+
<checksum>8696A072</checksum>
|
405
406
|
</file>
|
406
407
|
<file>
|
407
408
|
<filename>README.md</filename>
|
408
409
|
<filetype>md</filetype>
|
409
410
|
<usage_type>readme</usage_type>
|
410
|
-
<checksum>
|
411
|
-
</file>
|
412
|
-
<file>
|
413
|
-
<filename>README.md.erb</filename>
|
414
|
-
<filetype>erb</filetype>
|
415
|
-
<usage_type>readmeerb</usage_type>
|
416
|
-
<checksum>703C9964</checksum>
|
411
|
+
<checksum>B22335D9</checksum>
|
417
412
|
</file>
|
418
413
|
<file>
|
419
414
|
<version>
|
@@ -424,13 +419,13 @@
|
|
424
419
|
<filename>measure.rb</filename>
|
425
420
|
<filetype>rb</filetype>
|
426
421
|
<usage_type>script</usage_type>
|
427
|
-
<checksum>
|
422
|
+
<checksum>27254D71</checksum>
|
428
423
|
</file>
|
429
424
|
<file>
|
430
425
|
<filename>report.html.erb</filename>
|
431
426
|
<filetype>erb</filetype>
|
432
427
|
<usage_type>resource</usage_type>
|
433
|
-
<checksum>
|
428
|
+
<checksum>8FAA542D</checksum>
|
434
429
|
</file>
|
435
430
|
<file>
|
436
431
|
<filename>timeseries_data.csv</filename>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008,
|
1
|
+
OpenStudio(R), Copyright (c) 2008, 2024 Alliance for Sustainable Energy, LLC.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
4
|
|
@@ -156,9 +156,7 @@ class TimeseriesPlot < OpenStudio::Measure::ReportingMeasure
|
|
156
156
|
js_time = js_time.gsub('Sep', '09')
|
157
157
|
js_time = js_time.gsub('Oct', '10')
|
158
158
|
js_time = js_time.gsub('Nov', '11')
|
159
|
-
js_time
|
160
|
-
|
161
|
-
js_time
|
159
|
+
js_time.gsub('Dec', '12')
|
162
160
|
end
|
163
161
|
|
164
162
|
# Create an array of arrays of variables
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<?xml version="1.0"?>
|
2
2
|
<measure>
|
3
|
-
<schema_version>3.
|
3
|
+
<schema_version>3.1</schema_version>
|
4
4
|
<name>timeseries_plot</name>
|
5
5
|
<uid>6804217d-4737-45f3-82df-b81393c29ce7</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>c9abd4ba-0c57-4ed2-85b7-966551ab80ad</version_id>
|
7
|
+
<version_modified>2024-11-16T23:44:47Z</version_modified>
|
8
8
|
<xml_checksum>FFE04372</xml_checksum>
|
9
9
|
<class_name>TimeseriesPlot</class_name>
|
10
10
|
<display_name>Timeseries Plot</display_name>
|
@@ -100,10 +100,10 @@
|
|
100
100
|
</attributes>
|
101
101
|
<files>
|
102
102
|
<file>
|
103
|
-
<filename>
|
104
|
-
<filetype>
|
105
|
-
<usage_type>
|
106
|
-
<checksum>
|
103
|
+
<filename>LICENSE.md</filename>
|
104
|
+
<filetype>md</filetype>
|
105
|
+
<usage_type>license</usage_type>
|
106
|
+
<checksum>8696A072</checksum>
|
107
107
|
</file>
|
108
108
|
<file>
|
109
109
|
<filename>README.md</filename>
|
@@ -112,10 +112,10 @@
|
|
112
112
|
<checksum>A3A04D6D</checksum>
|
113
113
|
</file>
|
114
114
|
<file>
|
115
|
-
<filename>
|
116
|
-
<filetype>
|
117
|
-
<usage_type>
|
118
|
-
<checksum>
|
115
|
+
<filename>README.md.erb</filename>
|
116
|
+
<filetype>erb</filetype>
|
117
|
+
<usage_type>readmeerb</usage_type>
|
118
|
+
<checksum>703C9964</checksum>
|
119
119
|
</file>
|
120
120
|
<file>
|
121
121
|
<version>
|
@@ -126,13 +126,13 @@
|
|
126
126
|
<filename>measure.rb</filename>
|
127
127
|
<filetype>rb</filetype>
|
128
128
|
<usage_type>script</usage_type>
|
129
|
-
<checksum>
|
129
|
+
<checksum>63FBC662</checksum>
|
130
130
|
</file>
|
131
131
|
<file>
|
132
132
|
<filename>report.html.erb</filename>
|
133
133
|
<filetype>erb</filetype>
|
134
134
|
<usage_type>resource</usage_type>
|
135
|
-
<checksum>
|
135
|
+
<checksum>A8E90964</checksum>
|
136
136
|
</file>
|
137
137
|
</files>
|
138
138
|
</measure>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008,
|
1
|
+
OpenStudio(R), Copyright (c) 2008, 2024 Alliance for Sustainable Energy, LLC.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
4
|
|
@@ -166,33 +166,27 @@ class WaterHeaterMixedMultiplier < OpenStudio::Measure::ModelMeasure
|
|
166
166
|
water_heaters.each do |water_heater|
|
167
167
|
altered_heater = false
|
168
168
|
# modify maximum_capacity_multiplier
|
169
|
-
if maximum_capacity_multiplier != 1.0
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
altered_heater = true
|
175
|
-
end
|
169
|
+
if maximum_capacity_multiplier != 1.0 && water_heater.heaterMaximumCapacity.is_initialized
|
170
|
+
runner.registerInfo("Applying #{maximum_capacity_multiplier}x maximum capacity multiplier to #{water_heater.name.get}.")
|
171
|
+
water_heater.setHeaterMaximumCapacity(water_heater.heaterMaximumCapacity.get * maximum_capacity_multiplier)
|
172
|
+
altered_max_cap << water_heater.handle.to_s
|
173
|
+
altered_heater = true
|
176
174
|
end
|
177
175
|
|
178
176
|
# modify minimum_capacity_multiplier
|
179
|
-
if minimum_capacity_multiplier != 1.0
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
altered_heater = true
|
185
|
-
end
|
177
|
+
if minimum_capacity_multiplier != 1.0 && water_heater.heaterMinimumCapacity.is_initialized
|
178
|
+
runner.registerInfo("Applying #{minimum_capacity_multiplier}x minimum capacity multiplier to #{water_heater.name.get}.")
|
179
|
+
water_heater.setHeaterMaximumCapacity(water_heater.heaterMinimumCapacity.get * minimum_capacity_multiplier)
|
180
|
+
altered_min_cap << water_heater.handle.to_s
|
181
|
+
altered_heater = true
|
186
182
|
end
|
187
183
|
|
188
184
|
# modify thermal_efficiency_multiplier
|
189
|
-
if thermal_efficiency_multiplier != 1.0
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
altered_heater = true
|
195
|
-
end
|
185
|
+
if thermal_efficiency_multiplier != 1.0 && water_heater.heaterThermalEfficiency.is_initialized
|
186
|
+
runner.registerInfo("Applying #{thermal_efficiency_multiplier}x thermal efficiency multiplier to #{water_heater.name.get}.")
|
187
|
+
water_heater.setHeaterThermalEfficiency(water_heater.heaterThermalEfficiency.get * thermal_efficiency_multiplier)
|
188
|
+
altered_thermalefficiency << water_heater.handle.to_s
|
189
|
+
altered_heater = true
|
196
190
|
end
|
197
191
|
|
198
192
|
orig_fuel_type = water_heater.heaterFuelType
|
@@ -203,10 +197,11 @@ class WaterHeaterMixedMultiplier < OpenStudio::Measure::ModelMeasure
|
|
203
197
|
end
|
204
198
|
|
205
199
|
next unless altered_heater
|
200
|
+
|
206
201
|
altered_heaters << water_heater.handle.to_s
|
207
202
|
change_name(water_heater, maximum_capacity_multiplier, minimum_capacity_multiplier, thermal_efficiency_multiplier, fuel_type, orig_fuel_type)
|
208
203
|
runner.registerInfo("WaterHeater name changed to: #{water_heater.name.get}")
|
209
|
-
end
|
204
|
+
end
|
210
205
|
|
211
206
|
# na if nothing in model to look at
|
212
207
|
if altered_heaters.empty?
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<?xml version="1.0"?>
|
2
2
|
<measure>
|
3
|
-
<schema_version>3.
|
3
|
+
<schema_version>3.1</schema_version>
|
4
4
|
<name>water_heater_mixed_multiplier</name>
|
5
5
|
<uid>1e4d5053-d2c1-400d-9192-7a470e5a7b5c</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>0375b022-c462-4d57-a7e8-e8b6d4dfc981</version_id>
|
7
|
+
<version_modified>2024-11-16T23:44:47Z</version_modified>
|
8
8
|
<xml_checksum>D28BCE9C</xml_checksum>
|
9
9
|
<class_name>WaterHeaterMixedMultiplier</class_name>
|
10
10
|
<display_name>Water Heater Mixed Multiplier</display_name>
|
@@ -17,10 +17,10 @@
|
|
17
17
|
<type>Choice</type>
|
18
18
|
<required>true</required>
|
19
19
|
<model_dependent>false</model_dependent>
|
20
|
-
<default_value>{
|
20
|
+
<default_value>{2bf3b8d6-35ac-4c06-8a3b-fc00fb3573e3}</default_value>
|
21
21
|
<choices>
|
22
22
|
<choice>
|
23
|
-
<value>{
|
23
|
+
<value>{2bf3b8d6-35ac-4c06-8a3b-fc00fb3573e3}</value>
|
24
24
|
<display_name>*All WaterHeaterMixeds*</display_name>
|
25
25
|
</choice>
|
26
26
|
<choice>
|
@@ -150,10 +150,10 @@
|
|
150
150
|
</attributes>
|
151
151
|
<files>
|
152
152
|
<file>
|
153
|
-
<filename>
|
154
|
-
<filetype>
|
155
|
-
<usage_type>
|
156
|
-
<checksum>
|
153
|
+
<filename>LICENSE.md</filename>
|
154
|
+
<filetype>md</filetype>
|
155
|
+
<usage_type>license</usage_type>
|
156
|
+
<checksum>8696A072</checksum>
|
157
157
|
</file>
|
158
158
|
<file>
|
159
159
|
<filename>README.md</filename>
|
@@ -162,10 +162,10 @@
|
|
162
162
|
<checksum>1626F8CE</checksum>
|
163
163
|
</file>
|
164
164
|
<file>
|
165
|
-
<filename>
|
166
|
-
<filetype>
|
167
|
-
<usage_type>
|
168
|
-
<checksum>
|
165
|
+
<filename>README.md.erb</filename>
|
166
|
+
<filetype>erb</filetype>
|
167
|
+
<usage_type>readmeerb</usage_type>
|
168
|
+
<checksum>703C9964</checksum>
|
169
169
|
</file>
|
170
170
|
<file>
|
171
171
|
<version>
|
@@ -176,7 +176,7 @@
|
|
176
176
|
<filename>measure.rb</filename>
|
177
177
|
<filetype>rb</filetype>
|
178
178
|
<usage_type>script</usage_type>
|
179
|
-
<checksum>
|
179
|
+
<checksum>70B22ACC</checksum>
|
180
180
|
</file>
|
181
181
|
</files>
|
182
182
|
</measure>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008,
|
1
|
+
OpenStudio(R), Copyright (c) 2008, 2024 Alliance for Sustainable Energy, LLC.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
4
|
|
@@ -156,33 +156,27 @@ class WaterHeaterMixedPercentChange < OpenStudio::Measure::ModelMeasure
|
|
156
156
|
water_heaters.each do |water_heater|
|
157
157
|
altered_heater = false
|
158
158
|
# modify maximum_capacity_multiplier
|
159
|
-
if maximum_capacity_multiplier != 0.0
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
altered_heater = true
|
165
|
-
end
|
159
|
+
if maximum_capacity_multiplier != 0.0 && water_heater.heaterMaximumCapacity.is_initialized
|
160
|
+
runner.registerInfo("Applying #{maximum_capacity_multiplier}x maximum capacity Percent Change to #{water_heater.name.get}.")
|
161
|
+
water_heater.setHeaterMaximumCapacity(water_heater.heaterMaximumCapacity.get + water_heater.heaterMaximumCapacity.get * maximum_capacity_multiplier * 0.01)
|
162
|
+
altered_max_cap << water_heater.handle.to_s
|
163
|
+
altered_heater = true
|
166
164
|
end
|
167
165
|
|
168
166
|
# modify minimum_capacity_multiplier
|
169
|
-
if minimum_capacity_multiplier != 0.0
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
altered_heater = true
|
175
|
-
end
|
167
|
+
if minimum_capacity_multiplier != 0.0 && water_heater.heaterMinimumCapacity.is_initialized
|
168
|
+
runner.registerInfo("Applying #{minimum_capacity_multiplier}x minimum capacity Percent Change to #{water_heater.name.get}.")
|
169
|
+
water_heater.setHeaterMaximumCapacity(water_heater.heaterMinimumCapacity.get + water_heater.heaterMinimumCapacity.get * minimum_capacity_multiplier * 0.01)
|
170
|
+
altered_min_cap << water_heater.handle.to_s
|
171
|
+
altered_heater = true
|
176
172
|
end
|
177
173
|
|
178
174
|
# modify thermal_efficiency_multiplier
|
179
|
-
if thermal_efficiency_multiplier != 0.0
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
altered_heater = true
|
185
|
-
end
|
175
|
+
if thermal_efficiency_multiplier != 0.0 && water_heater.heaterThermalEfficiency.is_initialized
|
176
|
+
runner.registerInfo("Applying #{thermal_efficiency_multiplier}x thermal efficiency Percent Change to #{water_heater.name.get}.")
|
177
|
+
water_heater.setHeaterThermalEfficiency(water_heater.heaterThermalEfficiency.get + water_heater.heaterThermalEfficiency.get * thermal_efficiency_multiplier * 0.01)
|
178
|
+
altered_thermalefficiency << water_heater.handle.to_s
|
179
|
+
altered_heater = true
|
186
180
|
end
|
187
181
|
|
188
182
|
orig_fuel_type = water_heater.heaterFuelType
|
@@ -193,10 +187,11 @@ class WaterHeaterMixedPercentChange < OpenStudio::Measure::ModelMeasure
|
|
193
187
|
end
|
194
188
|
|
195
189
|
next unless altered_heater
|
190
|
+
|
196
191
|
altered_heaters << water_heater.handle.to_s
|
197
192
|
change_name(water_heater, maximum_capacity_multiplier, minimum_capacity_multiplier, thermal_efficiency_multiplier, fuel_type, orig_fuel_type)
|
198
193
|
runner.registerInfo("WaterHeater name changed to: #{water_heater.name.get}")
|
199
|
-
end
|
194
|
+
end
|
200
195
|
|
201
196
|
# na if nothing in model to look at
|
202
197
|
if altered_heaters.empty?
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<?xml version="1.0"?>
|
2
2
|
<measure>
|
3
|
-
<schema_version>3.
|
3
|
+
<schema_version>3.1</schema_version>
|
4
4
|
<name>water_heater_mixed_percent_change</name>
|
5
5
|
<uid>c42bf4e7-2bbb-44c6-ab91-e6ddb53e050d</uid>
|
6
|
-
<version_id>
|
7
|
-
<version_modified>
|
6
|
+
<version_id>f87b5fda-5921-4e18-9fd4-d2be490d114a</version_id>
|
7
|
+
<version_modified>2024-11-16T23:44:49Z</version_modified>
|
8
8
|
<xml_checksum>D28BCE9C</xml_checksum>
|
9
9
|
<class_name>WaterHeaterMixedPercentChange</class_name>
|
10
10
|
<display_name>Water Heater Mixed Percent Change</display_name>
|
@@ -17,10 +17,10 @@
|
|
17
17
|
<type>Choice</type>
|
18
18
|
<required>true</required>
|
19
19
|
<model_dependent>false</model_dependent>
|
20
|
-
<default_value>{
|
20
|
+
<default_value>{6fbcfefd-4896-4443-ae11-ee5cbf866e6e}</default_value>
|
21
21
|
<choices>
|
22
22
|
<choice>
|
23
|
-
<value>{
|
23
|
+
<value>{6fbcfefd-4896-4443-ae11-ee5cbf866e6e}</value>
|
24
24
|
<display_name>*All WaterHeaterMixeds*</display_name>
|
25
25
|
</choice>
|
26
26
|
<choice>
|
@@ -150,10 +150,10 @@
|
|
150
150
|
</attributes>
|
151
151
|
<files>
|
152
152
|
<file>
|
153
|
-
<filename>
|
154
|
-
<filetype>
|
155
|
-
<usage_type>
|
156
|
-
<checksum>
|
153
|
+
<filename>LICENSE.md</filename>
|
154
|
+
<filetype>md</filetype>
|
155
|
+
<usage_type>license</usage_type>
|
156
|
+
<checksum>8696A072</checksum>
|
157
157
|
</file>
|
158
158
|
<file>
|
159
159
|
<filename>README.md</filename>
|
@@ -162,10 +162,10 @@
|
|
162
162
|
<checksum>04987893</checksum>
|
163
163
|
</file>
|
164
164
|
<file>
|
165
|
-
<filename>
|
166
|
-
<filetype>
|
167
|
-
<usage_type>
|
168
|
-
<checksum>
|
165
|
+
<filename>README.md.erb</filename>
|
166
|
+
<filetype>erb</filetype>
|
167
|
+
<usage_type>readmeerb</usage_type>
|
168
|
+
<checksum>703C9964</checksum>
|
169
169
|
</file>
|
170
170
|
<file>
|
171
171
|
<version>
|
@@ -176,7 +176,7 @@
|
|
176
176
|
<filename>measure.rb</filename>
|
177
177
|
<filetype>rb</filetype>
|
178
178
|
<usage_type>script</usage_type>
|
179
|
-
<checksum>
|
179
|
+
<checksum>CE10E4B6</checksum>
|
180
180
|
</file>
|
181
181
|
</files>
|
182
182
|
</measure>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
OpenStudio(R), Copyright (c) 2008,
|
1
|
+
OpenStudio(R), Copyright (c) 2008, 2024 Alliance for Sustainable Energy, LLC.
|
2
2
|
|
3
3
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
4
4
|
|
@@ -10,10 +10,6 @@
|
|
10
10
|
|
11
11
|
require 'openstudio-standards'
|
12
12
|
|
13
|
-
# load OpenStudio measure libraries from openstudio-extension gem
|
14
|
-
require 'openstudio-extension'
|
15
|
-
require 'openstudio/extension/core/os_lib_helper_methods'
|
16
|
-
|
17
13
|
# start the measure
|
18
14
|
class InspectAndEditParametricSchedules < OpenStudio::Measure::ModelMeasure
|
19
15
|
# human readable name
|
@@ -120,11 +116,15 @@ class InspectAndEditParametricSchedules < OpenStudio::Measure::ModelMeasure
|
|
120
116
|
super(model, runner, user_arguments)
|
121
117
|
|
122
118
|
# assign the user inputs to variables
|
123
|
-
args =
|
119
|
+
args = runner.getArgumentValues(arguments(model), user_arguments)
|
120
|
+
args = Hash[args.collect{ |k, v| [k.to_s, v] }]
|
124
121
|
if !args then return false end
|
122
|
+
|
123
|
+
# open channel to log messages
|
124
|
+
reset_log
|
125
125
|
|
126
|
-
#
|
127
|
-
|
126
|
+
# Turn debugging output on/off
|
127
|
+
debug = false
|
128
128
|
|
129
129
|
# load standards
|
130
130
|
standard = Standard.build('90.1-2004') # selected template doesn't matter
|
@@ -174,17 +174,19 @@ class InspectAndEditParametricSchedules < OpenStudio::Measure::ModelMeasure
|
|
174
174
|
# report initial condition of model
|
175
175
|
runner.registerInitialCondition("The building started with #{counter_parametric_schedules.uniq.size.size} parametric schedules.")
|
176
176
|
|
177
|
-
#
|
177
|
+
# if requested re-generate schedules
|
178
178
|
if args['apply_parametric_sch']
|
179
|
-
parametric_schedules =
|
179
|
+
parametric_schedules = OpenstudioStandards::Schedules.model_apply_parametric_schedules(model, ramp_frequency: nil, infer_hoo_for_non_assigned_objects: true, error_on_out_of_order: true)
|
180
180
|
runner.registerInfo("Applying #{parametric_schedules.size} parametric schedules.")
|
181
181
|
end
|
182
182
|
|
183
183
|
# report final condition of model
|
184
184
|
runner.registerFinalCondition("The building finished with #{parametric_schedules.size} parametric schedules.")
|
185
185
|
|
186
|
-
#
|
187
|
-
|
186
|
+
# gather log
|
187
|
+
log_messages_to_runner(runner, debug)
|
188
|
+
reset_log
|
189
|
+
|
188
190
|
|
189
191
|
return true
|
190
192
|
end
|