openstudio-calibration 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +1 -1
  4. data/Jenkinsfile +1 -1
  5. data/Rakefile +3 -0
  6. data/lib/measures/AddMonthlyJSONUtilityData/measure.rb +3 -3
  7. data/lib/measures/AddMonthlyJSONUtilityData/measure.xml +3 -3
  8. data/lib/measures/AddMonthlyUtilityData/measure.xml +8 -8
  9. data/lib/measures/CalibrationReports/measure.rb +1 -3
  10. data/lib/measures/CalibrationReports/measure.xml +4 -4
  11. data/lib/measures/CalibrationReportsEnhanced/measure.rb +21 -22
  12. data/lib/measures/CalibrationReportsEnhanced/measure.xml +4 -4
  13. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.rb +12 -12
  14. data/lib/measures/CoilCoolingDXSingleSpeedMultiplier/measure.xml +5 -5
  15. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.rb +12 -12
  16. data/lib/measures/CoilCoolingDXSingleSpeedPercentChange/measure.xml +5 -5
  17. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.rb +21 -23
  18. data/lib/measures/CoilCoolingDXTwoSpeedMultiplier/measure.xml +5 -5
  19. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.rb +21 -23
  20. data/lib/measures/CoilCoolingDXTwoSpeedPercentChange/measure.xml +5 -5
  21. data/lib/measures/CoilCoolingWaterMultiplier/measure.rb +33 -43
  22. data/lib/measures/CoilCoolingWaterMultiplier/measure.xml +5 -5
  23. data/lib/measures/CoilCoolingWaterPercentChange/measure.rb +33 -43
  24. data/lib/measures/CoilCoolingWaterPercentChange/measure.xml +5 -5
  25. data/lib/measures/CoilHeatingElectricMultiplier/measure.rb +8 -8
  26. data/lib/measures/CoilHeatingElectricMultiplier/measure.xml +5 -5
  27. data/lib/measures/CoilHeatingElectricPercentChange/measure.rb +8 -8
  28. data/lib/measures/CoilHeatingElectricPercentChange/measure.xml +5 -5
  29. data/lib/measures/CoilHeatingGasMultiplier/measure.rb +8 -8
  30. data/lib/measures/CoilHeatingGasMultiplier/measure.xml +5 -5
  31. data/lib/measures/CoilHeatingGasPercentChange/measure.rb +8 -8
  32. data/lib/measures/CoilHeatingGasPercentChange/measure.xml +5 -5
  33. data/lib/measures/CoilHeatingWaterMultiplier/measure.rb +13 -15
  34. data/lib/measures/CoilHeatingWaterMultiplier/measure.xml +5 -5
  35. data/lib/measures/CoilHeatingWaterPercentChange/measure.rb +13 -15
  36. data/lib/measures/CoilHeatingWaterPercentChange/measure.xml +5 -5
  37. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.rb +4 -4
  38. data/lib/measures/ConstructionLayerZeroMaterialProperties/measure.xml +3 -3
  39. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.rb +8 -5
  40. data/lib/measures/ExteriorWallThermalPropertiesMultiplier/measure.xml +9 -9
  41. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.rb +8 -5
  42. data/lib/measures/ExteriorWallThermalPropertiesPercentChange/measure.xml +9 -9
  43. data/lib/measures/FansMultiplier/measure.rb +8 -8
  44. data/lib/measures/FansMultiplier/measure.xml +5 -5
  45. data/lib/measures/FansPercentChange/measure.rb +8 -8
  46. data/lib/measures/FansPercentChange/measure.xml +5 -5
  47. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.rb +2 -2
  48. data/lib/measures/GeneralCalibrationMeasureMultiplier/measure.xml +7 -7
  49. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.rb +2 -2
  50. data/lib/measures/GeneralCalibrationMeasurePercentChange/measure.xml +7 -7
  51. data/lib/measures/HardSizeHvac/measure.rb +2 -4
  52. data/lib/measures/HardSizeHvac/measure.xml +4 -4
  53. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.rb +7 -9
  54. data/lib/measures/RValueOfInsulationForConstructionMultiplier/measure.xml +3 -3
  55. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.rb +7 -9
  56. data/lib/measures/RValueOfInsulationForConstructionPercentageChange/measure.xml +3 -3
  57. data/lib/measures/RoofThermalPropertiesMultiplier/measure.rb +8 -5
  58. data/lib/measures/RoofThermalPropertiesMultiplier/measure.xml +9 -9
  59. data/lib/measures/RoofThermalPropertiesPercentChange/measure.rb +8 -5
  60. data/lib/measures/RoofThermalPropertiesPercentChange/measure.xml +9 -9
  61. data/lib/measures/TimeseriesObjectiveFunction/measure.rb +26 -23
  62. data/lib/measures/TimeseriesObjectiveFunction/measure.xml +10 -15
  63. data/lib/measures/TimeseriesObjectiveFunction/resources/report.html.erb +3 -0
  64. data/lib/measures/TimeseriesPlot/measure.rb +1 -3
  65. data/lib/measures/TimeseriesPlot/measure.xml +13 -13
  66. data/lib/measures/TimeseriesPlot/resources/report.html.erb +3 -0
  67. data/lib/measures/WaterHeaterMixedMultiplier/measure.rb +17 -22
  68. data/lib/measures/WaterHeaterMixedMultiplier/measure.xml +5 -5
  69. data/lib/measures/WaterHeaterMixedPercentChange/measure.rb +17 -22
  70. data/lib/measures/WaterHeaterMixedPercentChange/measure.xml +5 -5
  71. data/lib/measures/inspect_and_edit_parametric_schedules/measure.rb +13 -11
  72. data/lib/measures/inspect_and_edit_parametric_schedules/measure.xml +29 -29
  73. data/lib/measures/shift_hours_of_operation/measure.rb +31 -29
  74. data/lib/measures/shift_hours_of_operation/measure.xml +51 -37
  75. data/lib/openstudio/calibration/version.rb +1 -1
  76. data/openstudio-calibration.gemspec +13 -6
  77. metadata +69 -13
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>general_calibration_measure_multiplier</name>
5
5
  <uid>d622534e-a3c9-4ba5-b616-53dce2a18ac8</uid>
6
- <version_id>7f783168-2f37-45b3-bb47-2fe78d3f7931</version_id>
7
- <version_modified>20230602T154652Z</version_modified>
6
+ <version_id>acada3ad-5f82-494a-b8d2-1e68d12fe3a4</version_id>
7
+ <version_modified>20240428T231344Z</version_modified>
8
8
  <xml_checksum>DEC0D835</xml_checksum>
9
9
  <class_name>GeneralCalibrationMeasureMultiplier</class_name>
10
10
  <display_name>General Calibration Measure 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>{a10ec323-f081-4d58-83e3-f77b122d01ca}</default_value>
20
+ <default_value>{82deef47-52ff-4598-a6fe-6dbfaef5dd4d}</default_value>
21
21
  <choices>
22
22
  <choice>
23
- <value>{a10ec323-f081-4d58-83e3-f77b122d01ca}</value>
23
+ <value>{82deef47-52ff-4598-a6fe-6dbfaef5dd4d}</value>
24
24
  <display_name>*All SpaceTypes*</display_name>
25
25
  </choice>
26
26
  <choice>
@@ -35,10 +35,10 @@
35
35
  <type>Choice</type>
36
36
  <required>true</required>
37
37
  <model_dependent>false</model_dependent>
38
- <default_value>{a10ec323-f081-4d58-83e3-f77b122d01ca}</default_value>
38
+ <default_value>{82deef47-52ff-4598-a6fe-6dbfaef5dd4d}</default_value>
39
39
  <choices>
40
40
  <choice>
41
- <value>{a10ec323-f081-4d58-83e3-f77b122d01ca}</value>
41
+ <value>{82deef47-52ff-4598-a6fe-6dbfaef5dd4d}</value>
42
42
  <display_name>*All Spaces*</display_name>
43
43
  </choice>
44
44
  <choice>
@@ -225,7 +225,7 @@
225
225
  <filename>measure.rb</filename>
226
226
  <filetype>rb</filetype>
227
227
  <usage_type>script</usage_type>
228
- <checksum>675FC9D6</checksum>
228
+ <checksum>D8F7D718</checksum>
229
229
  </file>
230
230
  </files>
231
231
  </measure>
@@ -464,7 +464,7 @@ class GeneralCalibrationMeasurePercentChange < OpenStudio::Measure::ModelMeasure
464
464
  runner.registerInfo("Skipping change to #{internalmass_def.name.get}")
465
465
  end
466
466
  end
467
- end # end space_type loop
467
+ end
468
468
 
469
469
  runner.registerInfo("altered_lights_definitions: #{altered_lights_definitions}")
470
470
  runner.registerInfo("altered_luminaires_definitions: #{altered_luminaires_definitions}")
@@ -697,7 +697,7 @@ class GeneralCalibrationMeasurePercentChange < OpenStudio::Measure::ModelMeasure
697
697
  runner.registerInfo("Skipping change to #{internalmass_def.name.get}")
698
698
  end
699
699
  end
700
- end # end spaces loop
700
+ end
701
701
 
702
702
  runner.registerInfo("altered_lights_definitions: #{altered_lights_definitions}")
703
703
  runner.registerInfo("altered_luminaires_definitions: #{altered_luminaires_definitions}")
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>general_calibration_measure_percent_change</name>
5
5
  <uid>0f583ac1-fa7e-48bc-9f80-12ed17180669</uid>
6
- <version_id>7cbf215b-1a4f-4952-97bd-30770b745a89</version_id>
7
- <version_modified>20230602T154653Z</version_modified>
6
+ <version_id>eba32481-a76a-4dba-a375-95a3156d4fe1</version_id>
7
+ <version_modified>20240428T231345Z</version_modified>
8
8
  <xml_checksum>DEC0D835</xml_checksum>
9
9
  <class_name>GeneralCalibrationMeasurePercentChange</class_name>
10
10
  <display_name>General Calibration Measure 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>{f0b412eb-06c7-48a3-931e-97d4b4f7d09b}</default_value>
20
+ <default_value>{7b2b167b-35c5-4a11-b8fb-e8b5d4fe21e5}</default_value>
21
21
  <choices>
22
22
  <choice>
23
- <value>{f0b412eb-06c7-48a3-931e-97d4b4f7d09b}</value>
23
+ <value>{7b2b167b-35c5-4a11-b8fb-e8b5d4fe21e5}</value>
24
24
  <display_name>*All SpaceTypes*</display_name>
25
25
  </choice>
26
26
  <choice>
@@ -35,10 +35,10 @@
35
35
  <type>Choice</type>
36
36
  <required>true</required>
37
37
  <model_dependent>false</model_dependent>
38
- <default_value>{f0b412eb-06c7-48a3-931e-97d4b4f7d09b}</default_value>
38
+ <default_value>{7b2b167b-35c5-4a11-b8fb-e8b5d4fe21e5}</default_value>
39
39
  <choices>
40
40
  <choice>
41
- <value>{f0b412eb-06c7-48a3-931e-97d4b4f7d09b}</value>
41
+ <value>{7b2b167b-35c5-4a11-b8fb-e8b5d4fe21e5}</value>
42
42
  <display_name>*All Spaces*</display_name>
43
43
  </choice>
44
44
  <choice>
@@ -224,7 +224,7 @@
224
224
  <filename>measure.rb</filename>
225
225
  <filetype>rb</filetype>
226
226
  <usage_type>script</usage_type>
227
- <checksum>81C8F498</checksum>
227
+ <checksum>5EAD059F</checksum>
228
228
  </file>
229
229
  </files>
230
230
  </measure>
@@ -27,9 +27,7 @@ class HardSizeHVAC < OpenStudio::Measure::ModelMeasure
27
27
 
28
28
  # define the arguments that the user will input
29
29
  def arguments(_model)
30
- args = OpenStudio::Measure::OSArgumentVector.new
31
-
32
- args
30
+ OpenStudio::Measure::OSArgumentVector.new
33
31
  end
34
32
 
35
33
  # define what happens when the measure is run
@@ -40,7 +38,7 @@ class HardSizeHVAC < OpenStudio::Measure::ModelMeasure
40
38
  standard = Standard.build('90.1-2004') # template choice doesn't matter
41
39
 
42
40
  # Perform a sizing run (2.5.1 and later)
43
- sizing_run_path = OpenStudio::Path.new(File.dirname(__FILE__) + '/output/SR1').to_s
41
+ sizing_run_path = OpenStudio::Path.new("#{File.dirname(__FILE__)}/output/SR1").to_s
44
42
  runner.registerInfo("Performing sizing run at #{sizing_run_path}.")
45
43
  if standard.model_run_sizing_run(model, sizing_run_path) == false
46
44
  return false
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>hard_size_hvac</name>
5
5
  <uid>d7da749f-6318-4077-b502-25994a713b27</uid>
6
- <version_id>896c932e-915e-4c05-bc05-ca990ce88a0c</version_id>
7
- <version_modified>20230602T154657Z</version_modified>
6
+ <version_id>3a26969f-2d60-4448-bc4a-60c4619078e9</version_id>
7
+ <version_modified>20240428T231349Z</version_modified>
8
8
  <xml_checksum>2B526343</xml_checksum>
9
9
  <class_name>HardSizeHVAC</class_name>
10
10
  <display_name>Hard Size HVAC</display_name>
@@ -82,13 +82,13 @@
82
82
  <filename>measure.rb</filename>
83
83
  <filetype>rb</filetype>
84
84
  <usage_type>script</usage_type>
85
- <checksum>F0528E19</checksum>
85
+ <checksum>56DF50B7</checksum>
86
86
  </file>
87
87
  <file>
88
88
  <filename>hard_size_hvac_test.rb</filename>
89
89
  <filetype>rb</filetype>
90
90
  <usage_type>test</usage_type>
91
- <checksum>5C7F03AC</checksum>
91
+ <checksum>4A195AEA</checksum>
92
92
  </file>
93
93
  </files>
94
94
  </measure>
@@ -63,7 +63,7 @@ class RValueOfInsulationForConstructionMultiplier < OpenStudio::Measure::ModelMe
63
63
  args << r_value_multplier
64
64
 
65
65
  args
66
- end # end the arguments method
66
+ end
67
67
 
68
68
  # define what happens when the measure is run
69
69
  def run(model, runner, user_arguments)
@@ -94,7 +94,7 @@ class RValueOfInsulationForConstructionMultiplier < OpenStudio::Measure::ModelMe
94
94
  runner.registerError('Script Error - argument not showing up as construction.')
95
95
  return false
96
96
  end
97
- end # end of if construction.empty?
97
+ end
98
98
 
99
99
  # set limit for minimum insulation. This is used to limit input and for inferring insulation layer in construction.
100
100
  min_expected_r_value_multplier_ip = 1 # ip units
@@ -114,11 +114,9 @@ class RValueOfInsulationForConstructionMultiplier < OpenStudio::Measure::ModelMe
114
114
  # loop through construction layers and infer insulation layer/material
115
115
  construction_layers.each do |construction_layer|
116
116
  construction_layer_r_value = construction_layer.to_OpaqueMaterial.get.thermalResistance
117
- unless thermal_resistance_values.empty?
118
- if construction_layer_r_value > thermal_resistance_values.max
119
- max_thermal_resistance_material = construction_layer
120
- max_thermal_resistance_material_index = counter
121
- end
117
+ if !thermal_resistance_values.empty? && (construction_layer_r_value > thermal_resistance_values.max)
118
+ max_thermal_resistance_material = construction_layer
119
+ max_thermal_resistance_material_index = counter
122
120
  end
123
121
  thermal_resistance_values << construction_layer_r_value
124
122
  counter += 1
@@ -159,8 +157,8 @@ class RValueOfInsulationForConstructionMultiplier < OpenStudio::Measure::ModelMe
159
157
  runner.registerFinalCondition("The Final R-value of #{construction.name} is #{final_r_value_ip} (ft^2*h*R/Btu).")
160
158
  runner.registerValue('final_r_value_ip', final_r_value_ip.to_f, 'ft^2*h*R/Btu')
161
159
  true
162
- end # end the run method
163
- end # end the measure
160
+ end
161
+ end
164
162
 
165
163
  # this allows the measure to be used by the application
166
164
  RValueOfInsulationForConstructionMultiplier.new.registerWithApplication
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>r_value_of_insulation_for_construction_multiplier</name>
5
5
  <uid>3c7a6751-bb54-4600-9410-8f042e1a513b</uid>
6
- <version_id>5534f7d5-e91a-4f72-929f-70683a291538</version_id>
7
- <version_modified>20230602T154652Z</version_modified>
6
+ <version_id>55c500d1-80a4-4f4b-a09f-6a9a473c8b3a</version_id>
7
+ <version_modified>20240428T231344Z</version_modified>
8
8
  <xml_checksum>0BF71A3E</xml_checksum>
9
9
  <class_name>RValueOfInsulationForConstructionMultiplier</class_name>
10
10
  <display_name>Change R-value of Insulation Layer for Construction By a Multiplier</display_name>
@@ -127,7 +127,7 @@
127
127
  <filename>measure.rb</filename>
128
128
  <filetype>rb</filetype>
129
129
  <usage_type>script</usage_type>
130
- <checksum>EB2C3AE0</checksum>
130
+ <checksum>2C93B86A</checksum>
131
131
  </file>
132
132
  </files>
133
133
  </measure>
@@ -56,7 +56,7 @@ class RValueOfInsulationForConstructionPercentageChange < OpenStudio::Measure::M
56
56
  args << r_value_prct_inc
57
57
 
58
58
  args
59
- end # end the arguments method
59
+ end
60
60
 
61
61
  # define what happens when the measure is run
62
62
  def run(model, runner, user_arguments)
@@ -87,7 +87,7 @@ class RValueOfInsulationForConstructionPercentageChange < OpenStudio::Measure::M
87
87
  runner.registerError('Script Error - argument not showing up as construction.')
88
88
  return false
89
89
  end
90
- end # end of if construction.empty?
90
+ end
91
91
 
92
92
  # set limit for minimum insulation. This is used to limit input and for inferring insulation layer in construction.
93
93
  min_expected_r_value_prct_inc_ip = 1 # ip units
@@ -107,11 +107,9 @@ class RValueOfInsulationForConstructionPercentageChange < OpenStudio::Measure::M
107
107
  # loop through construction layers and infer insulation layer/material
108
108
  construction_layers.each do |construction_layer|
109
109
  construction_layer_r_value = construction_layer.to_OpaqueMaterial.get.thermalResistance
110
- unless thermal_resistance_values.empty?
111
- if construction_layer_r_value > thermal_resistance_values.max
112
- max_thermal_resistance_material = construction_layer
113
- max_thermal_resistance_material_index = counter
114
- end
110
+ if !thermal_resistance_values.empty? && (construction_layer_r_value > thermal_resistance_values.max)
111
+ max_thermal_resistance_material = construction_layer
112
+ max_thermal_resistance_material_index = counter
115
113
  end
116
114
  thermal_resistance_values << construction_layer_r_value
117
115
  counter += 1
@@ -152,8 +150,8 @@ class RValueOfInsulationForConstructionPercentageChange < OpenStudio::Measure::M
152
150
  runner.registerFinalCondition("The Final R-value of #{construction.name} is #{final_r_value_ip} (ft^2*h*R/Btu).")
153
151
  runner.registerValue('final_r_value_ip', final_r_value_ip.to_f, 'ft^2*h*R/Btu')
154
152
  true
155
- end # end the run method
156
- end # end the measure
153
+ end
154
+ end
157
155
 
158
156
  # this allows the measure to be used by the application
159
157
  RValueOfInsulationForConstructionPercentageChange.new.registerWithApplication
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>r_value_of_insulation_for_construction_percentage_change</name>
5
5
  <uid>7ee248fd-052a-48d6-a8eb-b1fc6a0dc348</uid>
6
- <version_id>c6595746-84ca-408a-8066-d1325e2604ed</version_id>
7
- <version_modified>20230602T154656Z</version_modified>
6
+ <version_id>af995773-d9c9-470c-9566-59b4951952e7</version_id>
7
+ <version_modified>20240428T231348Z</version_modified>
8
8
  <xml_checksum>0BF71A3E</xml_checksum>
9
9
  <class_name>RValueOfInsulationForConstructionPercentageChange</class_name>
10
10
  <display_name>Change R-value of Insulation Layer for Construction By a Specified Percentage</display_name>
@@ -127,7 +127,7 @@
127
127
  <filename>measure.rb</filename>
128
128
  <filetype>rb</filetype>
129
129
  <usage_type>script</usage_type>
130
- <checksum>2E8E54BE</checksum>
130
+ <checksum>ED427A87</checksum>
131
131
  </file>
132
132
  </files>
133
133
  </measure>
@@ -21,7 +21,8 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
21
21
  end
22
22
 
23
23
  # short def to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure
24
- def neat_numbers(number, roundto = 2) # round to 0 or 2)
24
+ # round to 0 or 2)
25
+ def neat_numbers(number, roundto = 2)
25
26
  number = if roundto == 2
26
27
  format '%.2f', number
27
28
  else
@@ -29,7 +30,7 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
29
30
  end
30
31
  # regex to add commas
31
32
  number.to_s.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\1,').reverse
32
- end # end def neat_numbers
33
+ end
33
34
 
34
35
  # helper to make it easier to do unit conversions on the fly
35
36
  def unit_helper(number, from_unit_string, to_unit_string)
@@ -64,7 +65,7 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
64
65
  args << thermal_mass_mult
65
66
 
66
67
  args
67
- end # end the arguments method
68
+ end
68
69
 
69
70
  # define what happens when the measure is run
70
71
  def run(model, runner, user_arguments)
@@ -89,6 +90,7 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
89
90
  roof_surface_constructions = []
90
91
  surfaces.each do |surface|
91
92
  next unless surface.outsideBoundaryCondition == 'Outdoors' && surface.surfaceType == 'RoofCeiling'
93
+
92
94
  roof_surfaces << surface
93
95
  roof_surface_const = surface.construction.get
94
96
  # only add construction if it hasn't been added yet
@@ -155,6 +157,7 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
155
157
  end
156
158
  initial_sol_abs.each_index do |index1|
157
159
  next unless initial_sol_abs[index1]
160
+
158
161
  desired_sol_abs[index1] = initial_sol_abs[index1] * solar_abs_mult
159
162
  if desired_sol_abs[index1] > 1
160
163
  desired_sol_abs[index1] = 1
@@ -226,8 +229,8 @@ class RoofThermalPropertiesMultiplier < OpenStudio::Measure::ModelMeasure
226
229
  runner.registerFinalCondition("Applied R #{r_value_mult.round(1)}x Solar #{solar_abs_mult.round(1)}x Therm #{thermal_mass_mult.round(1)}x change")
227
230
 
228
231
  true
229
- end # end the run method
230
- end # end the measure
232
+ end
233
+ end
231
234
 
232
235
  # this allows the measure to be used by the application
233
236
  RoofThermalPropertiesMultiplier.new.registerWithApplication
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>roof_thermal_properties_multiplier</name>
5
5
  <uid>6c4eb22b-770f-456c-bcd1-084cfad89eeb</uid>
6
- <version_id>2bb4add5-d936-4469-8a46-d458142e98dd</version_id>
7
- <version_modified>20230602T154657Z</version_modified>
6
+ <version_id>1087cde3-4f8c-48fb-b877-556c37bfca77</version_id>
7
+ <version_modified>20240428T231349Z</version_modified>
8
8
  <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>RoofThermalPropertiesMultiplier</class_name>
10
10
  <display_name>Roof Thermal Properties Multiplier</display_name>
@@ -88,6 +88,12 @@
88
88
  <usage_type>license</usage_type>
89
89
  <checksum>BFFB1AA6</checksum>
90
90
  </file>
91
+ <file>
92
+ <filename>RoofThermalPropertiesMultiplier_test.rb</filename>
93
+ <filetype>rb</filetype>
94
+ <usage_type>test</usage_type>
95
+ <checksum>7197D29B</checksum>
96
+ </file>
91
97
  <file>
92
98
  <version>
93
99
  <software_program>OpenStudio</software_program>
@@ -97,13 +103,7 @@
97
103
  <filename>measure.rb</filename>
98
104
  <filetype>rb</filetype>
99
105
  <usage_type>script</usage_type>
100
- <checksum>7C6B77F6</checksum>
101
- </file>
102
- <file>
103
- <filename>RoofThermalPropertiesMultiplier_test.rb</filename>
104
- <filetype>rb</filetype>
105
- <usage_type>test</usage_type>
106
- <checksum>7197D29B</checksum>
106
+ <checksum>1E5855C1</checksum>
107
107
  </file>
108
108
  </files>
109
109
  </measure>
@@ -21,7 +21,8 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
21
21
  end
22
22
 
23
23
  # short def to make numbers pretty (converts 4125001.25641 to 4,125,001.26 or 4,125,001). The definition be called through this measure
24
- def neat_numbers(number, roundto = 2) # round to 0 or 2)
24
+ # round to 0 or 2)
25
+ def neat_numbers(number, roundto = 2)
25
26
  number = if roundto == 2
26
27
  format '%.2f', number
27
28
  else
@@ -29,7 +30,7 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
29
30
  end
30
31
  # regex to add commas
31
32
  number.to_s.reverse.gsub(/([0-9]{3}(?=([0-9])))/, '\\1,').reverse
32
- end # end def neat_numbers
33
+ end
33
34
 
34
35
  # helper to make it easier to do unit conversions on the fly
35
36
  def unit_helper(number, from_unit_string, to_unit_string)
@@ -57,7 +58,7 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
57
58
  args << thermal_mass_perc_change
58
59
 
59
60
  args
60
- end # end the arguments method
61
+ end
61
62
 
62
63
  # define what happens when the measure is run
63
64
  def run(model, runner, user_arguments)
@@ -79,6 +80,7 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
79
80
  roof_surface_constructions = []
80
81
  surfaces.each do |surface|
81
82
  next unless surface.outsideBoundaryCondition == 'Outdoors' && surface.surfaceType == 'RoofCeiling'
83
+
82
84
  roof_surfaces << surface
83
85
  roof_surface_const = surface.construction.get
84
86
  # only add construction if it hasn't been added yet
@@ -145,6 +147,7 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
145
147
  end
146
148
  initial_sol_abs.each_index do |index1|
147
149
  next unless initial_sol_abs[index1]
150
+
148
151
  desired_sol_abs[index1] = initial_sol_abs[index1] + initial_sol_abs[index1] * solar_abs_perc_change * 0.01
149
152
  if desired_sol_abs[index1] > 1
150
153
  desired_sol_abs[index1] = 1
@@ -216,8 +219,8 @@ class RoofThermalPropertiesPercentChange < OpenStudio::Measure::ModelMeasure
216
219
  runner.registerFinalCondition("Applied R #{r_value_perc_change.round(1)} Solar #{solar_abs_perc_change.round(1)} Therm #{thermal_mass_perc_change.round(1)} Percent change")
217
220
 
218
221
  true
219
- end # end the run method
220
- end # end the measure
222
+ end
223
+ end
221
224
 
222
225
  # this allows the measure to be used by the application
223
226
  RoofThermalPropertiesPercentChange.new.registerWithApplication
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>roof_thermal_properties_percent_change</name>
5
5
  <uid>07516685-60fd-4da8-9872-1154a995047d</uid>
6
- <version_id>db469840-e1ca-40ba-a628-58855984662f</version_id>
7
- <version_modified>20230602T154656Z</version_modified>
6
+ <version_id>6c9d8dec-0134-4f58-924b-b12ba6ecb8cb</version_id>
7
+ <version_modified>20240428T231348Z</version_modified>
8
8
  <xml_checksum>EB1A0C08</xml_checksum>
9
9
  <class_name>RoofThermalPropertiesPercentChange</class_name>
10
10
  <display_name>Roof Thermal Properties Percent Change</display_name>
@@ -88,6 +88,12 @@
88
88
  <usage_type>license</usage_type>
89
89
  <checksum>BFFB1AA6</checksum>
90
90
  </file>
91
+ <file>
92
+ <filename>RoofThermalPropertiesMultiplier_test.rb</filename>
93
+ <filetype>rb</filetype>
94
+ <usage_type>test</usage_type>
95
+ <checksum>3F4E0142</checksum>
96
+ </file>
91
97
  <file>
92
98
  <version>
93
99
  <software_program>OpenStudio</software_program>
@@ -97,13 +103,7 @@
97
103
  <filename>measure.rb</filename>
98
104
  <filetype>rb</filetype>
99
105
  <usage_type>script</usage_type>
100
- <checksum>3A4BB94C</checksum>
101
- </file>
102
- <file>
103
- <filename>RoofThermalPropertiesMultiplier_test.rb</filename>
104
- <filetype>rb</filetype>
105
- <usage_type>test</usage_type>
106
- <checksum>3F4E0142</checksum>
106
+ <checksum>D0AD2402</checksum>
107
107
  </file>
108
108
  </files>
109
109
  </measure>
@@ -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 = js_time.gsub('Dec', '12')
294
-
295
- js_time
293
+ js_time.gsub('Dec', '12')
296
294
  end
297
295
 
298
296
  # setup convert
299
- if convert_data == 'F to C'
297
+ case convert_data
298
+ when 'F to C'
300
299
  convert = 0.5556
301
- elsif convert_data == 'WH to J'
300
+ when 'WH to J'
302
301
  convert = 3600
303
- elsif convert_data == 'CFM to m3/s'
302
+ when 'CFM to m3/s'
304
303
  convert = 0.00047
305
- elsif convert_data == 'PSI to Pa'
304
+ when 'PSI to Pa'
306
305
  convert = 6894.76
307
- else convert_data == 'None'
308
- convert = 1
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
- end
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
- end
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 = if norm == 1
585
+ dif = case norm
586
+ when 1
583
587
  scale.to_f * (mtr.to_f - sim.to_f).abs
584
- elsif norm == 2
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
- if File.basename(File.expand_path(File.join(Dir.pwd, '../../../'))).split('_')[0] == 'analysis'
659
- runner.registerInfo("Copying timeseries_#{csv_var}.json to downloads directory")
660
- directory_name = File.expand_path(File.join(Dir.pwd, '../../../downloads'))
661
- Dir.mkdir(directory_name) unless File.exist?(directory_name)
662
- FileUtils.cp("timeseries_#{csv_var}.json", directory_name)
663
- FileUtils.cp("allseries_#{csv_var}.json", directory_name)
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