openstudio-standards 0.8.5 → 0.8.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. checksums.yaml +4 -4
  2. data/data/standards/test_performance_expected_dd_results.csv +90 -90
  3. data/lib/openstudio-standards/btap/activity.rb +858 -61
  4. data/lib/openstudio-standards/btap/attributes.rb +297 -103
  5. data/lib/openstudio-standards/btap/bridging.rb +1335 -593
  6. data/lib/openstudio-standards/btap/btap.rb +60 -181
  7. data/lib/openstudio-standards/btap/carbon/btap_carbon.rb +199 -142
  8. data/lib/openstudio-standards/btap/common/constructions.json +1275 -0
  9. data/lib/openstudio-standards/btap/common/costs.csv +1969 -0
  10. data/lib/openstudio-standards/btap/common/costs_local_factors.csv +2315 -0
  11. data/lib/openstudio-standards/btap/common/materials_glazing.csv +61 -0
  12. data/lib/openstudio-standards/btap/{common_resources → common}/materials_hvac.csv +1685 -1685
  13. data/lib/openstudio-standards/btap/{common_resources → common}/materials_lighting.csv +266 -266
  14. data/lib/openstudio-standards/btap/common/materials_opaque.csv +214 -0
  15. data/lib/openstudio-standards/btap/common/necb_building_types.csv +35 -0
  16. data/lib/openstudio-standards/btap/common/necb_space_types.csv +110 -0
  17. data/lib/openstudio-standards/btap/common/thermal_bridging.csv +73 -0
  18. data/lib/openstudio-standards/btap/costing/btap_costing.rb +346 -429
  19. data/lib/openstudio-standards/btap/costing/database.rb +104 -0
  20. data/lib/openstudio-standards/btap/costing/daylighting_sensor_control_costing.rb +356 -344
  21. data/lib/openstudio-standards/btap/costing/dcv_costing.rb +282 -296
  22. data/lib/openstudio-standards/btap/costing/envelope_costing.rb +179 -192
  23. data/lib/openstudio-standards/btap/costing/heating_cooling_costing.rb +2477 -2316
  24. data/lib/openstudio-standards/btap/costing/led_lighting_costing.rb +127 -142
  25. data/lib/openstudio-standards/btap/costing/lighting_costing.rb +216 -198
  26. data/lib/openstudio-standards/btap/costing/nv_costing.rb +522 -523
  27. data/lib/openstudio-standards/btap/costing/pv_ground_costing.rb +649 -649
  28. data/lib/openstudio-standards/btap/costing/shw_costing.rb +626 -625
  29. data/lib/openstudio-standards/btap/costing/thermal_bridging_costing.rb +72 -0
  30. data/lib/openstudio-standards/btap/costing/ventilation_costing.rb +2363 -2361
  31. data/lib/openstudio-standards/btap/deprecated.rb +1033 -0
  32. data/lib/openstudio-standards/btap/envelope.rb +313 -572
  33. data/lib/openstudio-standards/btap/fileio.rb +152 -1070
  34. data/lib/openstudio-standards/btap/geometry.rb +486 -766
  35. data/lib/openstudio-standards/btap/linear_regression.rb +130 -0
  36. data/lib/openstudio-standards/btap/paths.rb +46 -0
  37. data/lib/openstudio-standards/btap/qaqc/analysis.rb +163 -0
  38. data/lib/openstudio-standards/btap/qaqc/data.rb +2293 -0
  39. data/lib/openstudio-standards/btap/qaqc/datapoint.rb +641 -0
  40. data/lib/openstudio-standards/btap/schedules.rb +11 -611
  41. data/lib/openstudio-standards/btap/structure.rb +574 -189
  42. data/lib/openstudio-standards/constructions/materials/information.rb +1 -1
  43. data/lib/openstudio-standards/create_typical/create_typical.rb +1 -1
  44. data/lib/openstudio-standards/exterior_lighting/create.rb +135 -85
  45. data/lib/openstudio-standards/exterior_lighting/data/typical_exterior_lighting.json +20 -0
  46. data/lib/openstudio-standards/exterior_lighting/information.rb +23 -2
  47. data/lib/openstudio-standards/geometry/create.rb +7 -3
  48. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +3 -2
  49. data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +3 -2
  50. data/lib/openstudio-standards/prototypes/common/data/thermostat_schedule_lookup.json +84 -84
  51. data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +4 -4
  52. data/lib/openstudio-standards/refrigeration/create_walkin.rb +45 -5
  53. data/lib/openstudio-standards/refrigeration/data/refrigerated_walkins.csv +75 -75
  54. data/lib/openstudio-standards/schedules/parametric.rb +6 -0
  55. data/lib/openstudio-standards/service_water_heating/create_typical.rb +10 -3
  56. data/lib/openstudio-standards/service_water_heating/create_water_heating_loop.rb +30 -14
  57. data/lib/openstudio-standards/service_water_heating/information.rb +4 -1
  58. data/lib/openstudio-standards/sql_file/unmet_hours.rb +2 -1
  59. data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +3 -1
  60. data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +3 -1
  61. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.boilers.json +12 -0
  62. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.construction_properties.json +18432 -3072
  63. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.boilers.json +26 -0
  64. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.construction_properties.json +8532 -1422
  65. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.boilers.json +26 -0
  66. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.construction_properties.json +8532 -1422
  67. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.boilers.json +16 -0
  68. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.computer_room_acs.json +30 -30
  69. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.construction_properties.json +7560 -1260
  70. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.PumpVariableSpeed.rb +1 -2
  71. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.boilers.json +16 -0
  72. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.construction_properties.json +7560 -1260
  73. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.AirLoopHVAC.rb +3 -3
  74. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.PumpVariableSpeed.rb +1 -2
  75. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.boilers.json +22 -0
  76. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.construction_properties.json +7236 -1206
  77. data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.furnaces.json +223 -19
  78. data/lib/openstudio-standards/standards/ashrae_90_1/data/ashrae_90_1.schedules.json +37 -1
  79. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.boilers.json +3 -0
  80. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.construction_properties.json +6900 -1150
  81. data/lib/openstudio-standards/standards/cbes/data/cbes.schedules.json +1 -1
  82. data/lib/openstudio-standards/standards/deer/data/deer.schedules.json +1 -1
  83. data/lib/openstudio-standards/standards/necb/BTAP1980TO2010/data/surface_thermal_transmittance.json +76 -40
  84. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/data/surface_thermal_transmittance.json +76 -40
  85. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +6 -4
  86. data/lib/openstudio-standards/standards/necb/NECB2011/NECB2011_QAQC.json +2988 -0
  87. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +25 -3
  88. data/lib/openstudio-standards/standards/necb/NECB2011/building_envelope.rb +672 -534
  89. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Hospital.osm +1791 -1792
  90. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPMultiTower.osm +7 -1
  91. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPTownHouse.osm +7 -1
  92. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeHotel.osm +5 -6
  93. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeOffice.osm +8 -9
  94. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernEducation.osm +10 -4
  95. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernHealthCare.osm +14 -15
  96. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Outpatient.osm +7 -1
  97. data/lib/openstudio-standards/standards/necb/NECB2011/data/surface_thermal_transmittance.json +76 -40
  98. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +14 -6
  99. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +542 -130
  100. data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +30 -63
  101. data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +7 -2
  102. data/lib/openstudio-standards/standards/necb/NECB2015/data/surface_thermal_transmittance.json +90 -0
  103. data/lib/openstudio-standards/standards/necb/NECB2015/necb_2015.rb +8 -6
  104. data/lib/openstudio-standards/standards/necb/NECB2017/data/surface_thermal_transmittance.json +76 -40
  105. data/lib/openstudio-standards/standards/necb/NECB2017/necb_2017.rb +2 -1
  106. data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +0 -117
  107. data/lib/openstudio-standards/standards/necb/NECB2020/data/surface_thermal_transmittance.json +76 -45
  108. data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +218 -0
  109. data/lib/openstudio-standards/standards/necb/common/construction_defaults.osm +12 -7
  110. data/lib/openstudio-standards/standards/standard.rb +1 -1
  111. data/lib/openstudio-standards/version.rb +1 -1
  112. data/lib/openstudio-standards.rb +9 -4
  113. metadata +59 -66
  114. data/data/inventory/thermal_bridging.csv +0 -90
  115. data/data/standards/OpenStudio_Standards-ashrae_90_1-ALL-comstock(space_types).xlsx +0 -0
  116. data/data/standards/openstudio_standards_duplicates_log.csv +0 -7962
  117. data/lib/openstudio-standards/btap/NECB_building_types.csv +0 -35
  118. data/lib/openstudio-standards/btap/NECB_space_types.csv +0 -109
  119. data/lib/openstudio-standards/btap/WeatherData1.json +0 -2110
  120. data/lib/openstudio-standards/btap/WeatherData1.xlsx +0 -0
  121. data/lib/openstudio-standards/btap/btap_result.rb +0 -1144
  122. data/lib/openstudio-standards/btap/btap_test_helper.rb +0 -86
  123. data/lib/openstudio-standards/btap/common_paths.rb +0 -81
  124. data/lib/openstudio-standards/btap/common_resources/ConstructionProperties.csv +0 -52
  125. data/lib/openstudio-standards/btap/common_resources/Constructions.csv +0 -37
  126. data/lib/openstudio-standards/btap/common_resources/construction_sets.csv +0 -1270
  127. data/lib/openstudio-standards/btap/common_resources/constructions_glazing.csv +0 -121
  128. data/lib/openstudio-standards/btap/common_resources/constructions_opaque.csv +0 -2256
  129. data/lib/openstudio-standards/btap/common_resources/costs.csv +0 -1897
  130. data/lib/openstudio-standards/btap/common_resources/costs_local_factors.csv +0 -2315
  131. data/lib/openstudio-standards/btap/common_resources/materials_glazing.csv +0 -35
  132. data/lib/openstudio-standards/btap/common_resources/materials_opaque.csv +0 -164
  133. data/lib/openstudio-standards/btap/costing/btap_measure_helper.rb +0 -359
  134. data/lib/openstudio-standards/btap/costing/btap_workflow.rb +0 -117
  135. data/lib/openstudio-standards/btap/costing/copy_test_results_files_to_expected_results.rb +0 -11
  136. data/lib/openstudio-standards/btap/costing/cost_building_from_file.rb +0 -136
  137. data/lib/openstudio-standards/btap/costing/costing_database_wrapper.rb +0 -173
  138. data/lib/openstudio-standards/btap/costing/dummy.epw +0 -8768
  139. data/lib/openstudio-standards/btap/costing/dummy.osm +0 -5320
  140. data/lib/openstudio-standards/btap/costing/neb_end_use_prices.csv +0 -42
  141. data/lib/openstudio-standards/btap/costing/necb_2011_spacetype_info.csv +0 -225
  142. data/lib/openstudio-standards/btap/costing/necb_reference_runs.csv +0 -28705
  143. data/lib/openstudio-standards/btap/costing/parallel_tests.rb +0 -92
  144. data/lib/openstudio-standards/btap/costing/test_list.txt +0 -15
  145. data/lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb +0 -27
  146. data/lib/openstudio-standards/btap/costing/test_run_costing_tests.rb +0 -80
  147. data/lib/openstudio-standards/btap/necb_2011_spacetype_info.csv +0 -225
  148. data/lib/openstudio-standards/btap/utilities/Add_template_field_to_json.rb +0 -22
  149. data/lib/openstudio-standards/btap/utilities/convert_surfaces_to_adiabatic_necb_8426.rb +0 -204
  150. data/lib/openstudio-standards/btap/utilities/generate_space_types.rb +0 -8
  151. data/lib/openstudio-standards/btap/utilities/necb_to_epw_map.rb +0 -50
  152. data/lib/openstudio-standards/btap/utilities/os_sim_extract.rb +0 -48
  153. data/lib/openstudio-standards/btap/utilities/rename_surfaces.rb +0 -24
  154. data/lib/openstudio-standards/btap/utilities/round_surf_coords.rb +0 -32
  155. data/lib/openstudio-standards/btap/utilities/sched_create.rb +0 -145
  156. data/lib/openstudio-standards/btap/utilities/set_mult_to_adiabatic.rb +0 -53
  157. data/lib/openstudio-standards/btap/utilities/space_type.rb +0 -78
  158. data/lib/openstudio-standards/btap/utilities/weatherData1_xlsx_to_json.rb +0 -56
  159. data/lib/openstudio-standards/btap/vintagizer.rb +0 -161
  160. data/lib/openstudio-standards/btap/visualization.rb +0 -72
  161. data/lib/openstudio-standards/standards/necb/NECB2011/data/necb_2011_spacetype_info.csv +0 -225
  162. data/lib/openstudio-standards/standards/necb/common/btap_analysis.rb +0 -79
  163. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +0 -2656
  164. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +0 -653
  165. data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +0 -28705
  166. data/lib/openstudio-standards/standards/necb/common/utility_pricing_2025-02-20.csv +0 -92
  167. /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_frame.csv +0 -0
  168. /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_glazing.csv +0 -0
  169. /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_opaque.csv +0 -0
  170. /data/lib/openstudio-standards/btap/{common_resources → common}/hvac_vent_ahu.csv +0 -0
  171. /data/lib/openstudio-standards/btap/{common_resources → common}/lighting.csv +0 -0
  172. /data/lib/openstudio-standards/btap/{common_resources → common}/lighting_sets.csv +0 -0
  173. /data/lib/openstudio-standards/btap/{common_resources → common}/locations.csv +0 -0
  174. /data/lib/openstudio-standards/btap/{costing → common}/mech_sizing.json +0 -0
@@ -20,8 +20,11 @@
20
20
 
21
21
  require 'fileutils'
22
22
  require 'singleton'
23
- require 'find'
24
- require 'date'
23
+ require 'json'
24
+ require 'csv'
25
+ require 'tbd'
26
+ require_relative 'deprecated'
27
+ require_relative 'paths'
25
28
  require_relative 'attributes'
26
29
  require_relative 'fileio'
27
30
  require_relative 'activity'
@@ -30,26 +33,11 @@ require_relative 'geometry'
30
33
  require_relative 'envelope'
31
34
  require_relative 'bridging'
32
35
  require_relative 'schedules'
33
- require_relative 'btap_result'
36
+ require_relative 'linear_regression'
34
37
 
35
- # require_relative 'analysis'
36
- # require_relative 'simmanager'
37
- # require_relative 'mpc'
38
- # require_relative 'spaceloads'
39
- # require_relative 'spacetypes'
40
-
41
- # require_relative 'hvac'
42
- # require_relative 'economics'
43
- # require_relative 'measures'
44
- # require_relative 'utilities'
45
- # require_relative 'reporting'
46
- # require_relative 'equest'
47
- # require_relative 'btap_costing'
48
- #require_relative 'btap.space'
49
- #require_relative 'btap.model'
50
38
  class String
51
- #This method converts to Boolean.
52
- #@author phylroy.lopez@nrcan.gc.ca
39
+ # This method converts to Boolean.
40
+ # @author phylroy.lopez@nrcan.gc.ca
53
41
  def to_bool
54
42
  return true if self == true || self =~ (/^(true|t|yes|y|1)$/i)
55
43
  return false if self == false || self =~ (/^(false|f|no|n|0)$/i)
@@ -59,8 +47,8 @@ end
59
47
 
60
48
 
61
49
  class Integer
62
- #This method converts to Boolean.
63
- #@author phylroy.lopez@nrcan.gc.ca
50
+ # This method converts to Boolean.
51
+ # @author phylroy.lopez@nrcan.gc.ca
64
52
  def to_bool
65
53
  return true if self == 1
66
54
  return false if self == 0
@@ -69,57 +57,53 @@ class Integer
69
57
  end
70
58
 
71
59
  class TrueClass
72
- #This method converts to i.
73
- #@author phylroy.lopez@nrcan.gc.ca
60
+ # This method converts to i.
61
+ # @author phylroy.lopez@nrcan.gc.ca
74
62
  def to_i; 1; end
75
- #This method converts to Boolean.
76
- #@author phylroy.lopez@nrcan.gc.ca
63
+
64
+ # This method converts to Boolean.
65
+ # @author phylroy.lopez@nrcan.gc.ca
77
66
  def to_bool; self; end
78
67
  end
79
68
 
80
69
  class FalseClass
81
- #This method converts to i.
82
- #@author phylroy.lopez@nrcan.gc.ca
70
+ # This method converts to i.
71
+ # @author phylroy.lopez@nrcan.gc.ca
83
72
  def to_i; 0; end
84
- #This method converts to Boolean.
85
- #@author phylroy.lopez@nrcan.gc.ca
73
+
74
+ # This method converts to Boolean.
75
+ # @author phylroy.lopez@nrcan.gc.ca
86
76
  def to_bool; self; end
87
77
  end
88
78
 
89
79
  class NilClass
90
- #This method converts to Boolean.
91
- #@author phylroy.lopez@nrcan.gc.ca
80
+ # This method converts to Boolean.
81
+ # @author phylroy.lopez@nrcan.gc.ca
92
82
  def to_bool; false; end
93
83
  end
94
84
 
95
85
 
96
86
  # A set of methods developed by NRCan to simplify building model creation and
97
- # analysis. These methods are meant to compliment the OpenStudio classes and methods
98
- # For full access to the OpenStudio API please refer to the OpenStudio Website.
99
- # http://openstudio.nrel.gov/latest-c-sdk-documentation/model
87
+ # analysis. These methods are meant to compliment the OpenStudio classes and
88
+ # methods. For full access to the OpenStudio SDK please refer to the OpenStudio
89
+ # website: https://openstudio-sdk-documentation.s3.amazonaws.com/index.html
100
90
  module BTAP
101
- #EnergyPlus version
102
- ENERGY_PLUS_MAJOR_VERSION = 8
103
- ENERGY_PLUS_MINOR_VERSION = 3
104
-
105
- #Path constants
106
- OS_RUBY_PATH = File.expand_path("..\\..\\..", __FILE__)
107
- TESTING_FOLDER = "C:\\test"
108
91
 
109
- # A wrapper for outputing feedback to users and developers.
110
- # BTAP::runner_register("InitialCondition", "Your Information Message Here", runner)
111
- # BTAP::runner_register("Info", "Your Information Message Here", runner)
112
- # BTAP::runner_register("Warning", "Your Information Message Here", runner)
113
- # BTAP::runner_register("Error", "Your Information Message Here", runner)
114
- # BTAP::runner_register("Debug", "Your Information Message Here", runner)
92
+ # A wrapper for outputing feedback to users and developers. Examples:
93
+ # BTAP::runner_register("InitialCondition", "Your Information Message Here", runner)
94
+ # BTAP::runner_register("Info", "Your Information Message Here", runner)
95
+ # BTAP::runner_register("Warning", "Your Information Message Here", runner)
96
+ # BTAP::runner_register("Error", "Your Information Message Here", runner)
97
+ # BTAP::runner_register("Debug", "Your Information Message Here", runner)
115
98
  # BTAP::runner_register("FinalCondition", "Your Information Message Here", runner)
116
99
  # @params type [String]
117
100
  # @params runner [OpenStudio::Ruleset::OSRunner] # or a nil.
118
- def self.runner_register(type,text,runner = nil)
101
+ def self.runner_register(type, text, runner = nil)
119
102
 
120
- #dump to console.
103
+ # Dump to console.
121
104
  puts "#{type.upcase}: #{text}"
122
- #dump to runner.
105
+
106
+ # Dump to runner.
123
107
  if runner.is_a?(OpenStudio::Ruleset::OSRunner)
124
108
  case type.downcase
125
109
  when "info"
@@ -142,120 +126,17 @@ module BTAP
142
126
  end
143
127
  end
144
128
 
145
- def self.runner_register_value(name,value,runner = nil)
146
- if runner.is_a?(OpenStudio::Ruleset::OSRunner)
147
- runner.registerValue( name,value.to_s)
148
- BTAP::runner_register("Info", "#{name} = #{value} has been registered in the runner", runner)
149
- end
150
- end
151
-
152
- def self.gut_building(model)
153
- #clean up any remaining items that we don't need for NECB.
154
- puts "Removing casual loads."
155
- BTAP::Resources::SpaceLoads::remove_all_casual_loads(model)
156
- puts "Removing space loads."
157
- BTAP::Resources::SpaceLoads::remove_all_SpaceLoads(model)
158
- puts "Removing OA loads."
159
- BTAP::Resources::SpaceLoads::remove_all_DesignSpecificationOutdoorAir(model)
160
- puts "Removing Envelope"
161
- BTAP::Resources::Envelope::remove_all_envelope_information(model)
162
- puts "Removing Infiltration"
163
- BTAP::Resources::SpaceLoads::remove_all_SpaceInfiltrationDesignFlowRate(model)
164
- puts "Removing all Schedules"
165
- BTAP::Resources::Schedules::remove_all_schedules( model )
166
- puts "Removing HVAC"
167
- BTAP::Resources::HVAC.clear_all_hvac_from_model( model )
168
- end
169
-
170
-
171
- class OpenStudioLibrary
172
- include Singleton
173
- attr_accessor :library
174
- #This method initializes the library.
175
- #@author phylroy.lopez@nrcan.gc.ca
176
- def initialize()
177
- #path to openstudio library
178
- @lib_path = "C:\\Program Files (x86)\\OpenStudio 1.2.0\\share\\openstudio\\OSApp\\hvaclibrary\\hvac_library.osm"
179
- @library = BTAP::FileIO::load_osm(@lib_path, "OpenStudio_Library")
180
- end
181
- end
182
- module SimulationSettings
183
- #This sets the simulation period for the model. All arguments are integers.
184
- #@author Phylroy A. Lopez
185
- #@param model [OpenStudio::Model::Model] A model object {http://openstudio.nrel.gov/latest-c-sdk-documentation/model}
186
- #@param start_month [Integer] a list of output variables that you wish to report from the simulation.
187
- #@param start_day [Integer] a list of output variables that you wish to report from the simulation.
188
- #@param end_month [Integer] a list of output variables that you wish to report from the simulation.
189
- #@param end_day [Integer] a list of output variables that you wish to report from the simulation.
190
- #@param repeat [Integer = 1] Number of times the simulation period is run. 1 is default.
191
- #@return [OpenStudio::Model::Model] the OpenStudio model object (self reference).
192
- def self.set_run_period(model,start_month,start_day,end_month,end_day, repeat = 1)
193
- raise("Run Period is invalid") unless Date.valid_civil?(2001, start_month , start_day) and Date.valid_civil?(2001, end_month , end_day) and repeat > 0
194
- run_period = model.getRunPeriod
195
- run_period.setBeginMonth(start_month)
196
- run_period.setBeginDayOfMonth(start_day)
197
- run_period.setEndMonth(end_month)
198
- run_period.setEndDayOfMonth(end_day)
199
- run_period.setNumTimePeriodRepeats(repeat)
200
- return model
201
- end
202
- end
203
129
  module Reports
204
- #This method clears all the output variables to make simulations run faster or to
205
- #start fresh.
206
- #@author Phylroy A. Lopez
207
- #@param model [OpenStudio::Model::Model] A model object {http://openstudio.nrel.gov/latest-c-sdk-documentation/model}
208
- #@return [OpenStudio::Model::Model] the OpenStudio model object (self reference).
209
- def self.clear_output_variables(model)
210
- #remove existing outputs
211
- model.getOutputVariables.sort.each do |object|
212
- object.remove
213
- end
214
- return model
215
- end
216
-
217
- #This turns all output on. Warning: Long runtimes will result.
218
- #@author Phylroy A. Lopez
219
- #@param model [OpenStudio::Model::Model] A model object
220
- #@param frequency [Fixnum]
221
- #@return [OpenStudio::Model::Model] a copy of the OpenStudio model object (self reference).
222
- def self.all_output_variables(model,frequency)
223
- BTAP::Reports::set_output_variables(model, frequency, BTAP::Reports::get_possible_output_variables(model))
224
- return model
225
- end
226
-
227
- #This method returns a vector of the results that are available in the current
228
- #model.
229
- #@author Phylroy A. Lopez
230
- #@param model [OpenStudio::Model::Model] A model object
231
- #@return [Array<String>] a list of all the possible output variables.
232
- def self.get_possible_output_variables( model )
233
- #Run simulation
234
- copy = BTAP::FileIO::deep_copy(model)
235
- copy.building.get.setName("rdd_run")
236
- BTAP::SimulationSettings::set_run_period(copy, 1, 1, 1, 1)
237
- BTAP::SimManager::run_simulation(copy,"C:\\temp\\rdd_maker")
238
- rdd_file_path = ""
239
- Find.find("C:\\temp\\rdd_maker") do |path|
240
- rdd_file_path = path if path =~ /.*\.rdd$/
241
- end
242
- contents = File.read(rdd_file_path)
243
- output_variables = Array.new()
244
- contents.each do |line|
245
- match = line.match /^\s*Output:Variable,\*,(.*),(.*);(.*)/
246
- if match
247
- output_variables.push(match[1])
248
- end
249
- end
250
- return output_variables
251
- end
252
130
 
253
- #This method sets up some predetermined output variables. May take a while to run with these settings.
254
- #@author Phylroy A. Lopez
255
- #@param model [OpenStudio::Model::Model] A model object
256
- #@param frequency [Fixnum]
257
- #@param output_variable_array [Array<String>] a list of output variables that you wish to report from the simulation.
258
- #@return [OpenStudio::Model::Model] the OpenStudio model object (self reference).
131
+ # This method sets up some predetermined output variables. May take a while
132
+ # to run with these settings.
133
+ # @author Phylroy A. Lopez
134
+ # @param model [OpenStudio::Model::Model]
135
+ # @param frequency [Fixnum]
136
+ # @param output_variable_array [Array<String>] A list of output variables
137
+ # that you wish to report from the simulation.
138
+ # @return [OpenStudio::Model::Model] The OpenStudio model object (self
139
+ # reference).
259
140
  def self.set_output_variables(model,frequency, output_variable_array)
260
141
  raise("Frequency is not valid. Must by \"Hourly\" or \"Timestep\" but got #{frequency}.") unless ["Hourly","Timestep"].include?(frequency)
261
142
  output_variable_array.each do |variable|
@@ -265,20 +146,19 @@ module BTAP
265
146
  end
266
147
  return model
267
148
  end
268
-
269
-
270
149
  end
271
- # This contains methods for creation and querying object that deal with Envelope, SpaceLoads,Schedules, and HVAC.
272
150
 
151
+ # This contains methods for creation and querying object that deal with
152
+ # Envelope, SpaceLoads,Schedules, and HVAC.
273
153
  module Common
274
- #This model checks to see if the obj_array passed is
275
- #the object we require, or if a string is given to search for a object of that strings name.
276
- #@author Phylroy A. Lopez
277
- #@param model [OpenStudio::Model::Model] A model object
278
- #@param obj_array <Object>
279
- #@param object_type [Object]
280
- def self.validate_array(model,obj_array,object_type)
281
154
 
155
+ # This model checks to see if the obj_array passed is the object we require,
156
+ # or if a string is given to search for a object of that strings name.
157
+ # @author Phylroy A. Lopez
158
+ # @param model [OpenStudio::Model::Model] A model object
159
+ # @param obj_array <Object>
160
+ # @param object_type [Object]
161
+ def self.validate_array(model,obj_array,object_type)
282
162
  command =
283
163
  %Q^#make copy of argument to avoid side effect.
284
164
  object_array = obj_array
@@ -320,20 +200,20 @@ module BTAP
320
200
  eval(command)
321
201
  end
322
202
 
323
- #This method gets a date from a string.
324
- #@author phylroy.lopez@nrcan.gc.ca
325
- #@param datestring [String] a date string
203
+ # This method gets a date from a string.
204
+ # @author phylroy.lopez@nrcan.gc.ca
205
+ # @param datestring [String] a date string
326
206
  def self.get_date_from_string(datestring)
327
207
  month = datestring.split("-")[0].to_s
328
208
  day = datestring.split("-")[1].to_i
329
- month_list = ["Jan","Feb","Mar","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
209
+ month_list = ["Jan", "Feb", "Mar", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
330
210
  raise ("Month given #{month} is not in format required please enter month with following 3 letter format#{month_list}.") unless month_list.include?(month)
331
211
  OpenStudio::Date.new(OpenStudio::MonthOfYear.new(month),day)
332
212
  end
333
213
 
334
- #This method gets a time from a string.
335
- #@author phylroy.lopez@nrcan.gc.ca
336
- #@param timestring [String] a time string
214
+ # This method gets a time from a string.
215
+ # @author phylroy.lopez@nrcan.gc.ca
216
+ # @param timestring [String] a time string
337
217
  def self.get_time_from_string(timestring)
338
218
  #ensure that it is in 0-24 hour format.
339
219
  hour = timestring.split(":")[0].to_i
@@ -343,4 +223,3 @@ module BTAP
343
223
  end
344
224
  end
345
225
  end
346
- #module BTAP