buildingsync 0.2.0

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 (62) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/continuous_integration.yml +146 -0
  3. data/.gitignore +33 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +10 -0
  6. data/CHANGELOG.md +50 -0
  7. data/Gemfile +31 -0
  8. data/Jenkinsfile +10 -0
  9. data/LICENSE.md +29 -0
  10. data/README.md +105 -0
  11. data/Rakefile +77 -0
  12. data/bin/console +15 -0
  13. data/bin/setup +8 -0
  14. data/buildingsync.gemspec +37 -0
  15. data/config.rb.in +26 -0
  16. data/doc_templates/LICENSE.md +29 -0
  17. data/doc_templates/README.md.erb +42 -0
  18. data/doc_templates/copyright_erb.txt +38 -0
  19. data/doc_templates/copyright_js.txt +5 -0
  20. data/doc_templates/copyright_ruby.txt +36 -0
  21. data/lib/buildingsync.rb +43 -0
  22. data/lib/buildingsync/all_resource_total.rb +54 -0
  23. data/lib/buildingsync/audit_date.rb +54 -0
  24. data/lib/buildingsync/constants.rb +49 -0
  25. data/lib/buildingsync/contact.rb +54 -0
  26. data/lib/buildingsync/extension.rb +57 -0
  27. data/lib/buildingsync/generator.rb +584 -0
  28. data/lib/buildingsync/get_bcl_weather_file.rb +326 -0
  29. data/lib/buildingsync/helpers/Model.hvac.rb +216 -0
  30. data/lib/buildingsync/helpers/helper.rb +494 -0
  31. data/lib/buildingsync/helpers/xml_get_set.rb +215 -0
  32. data/lib/buildingsync/makers/phase_zero_base.osw +178 -0
  33. data/lib/buildingsync/makers/workflow_maker.json +811 -0
  34. data/lib/buildingsync/makers/workflow_maker.rb +581 -0
  35. data/lib/buildingsync/makers/workflow_maker_base.rb +167 -0
  36. data/lib/buildingsync/model_articulation/building.rb +1119 -0
  37. data/lib/buildingsync/model_articulation/building_and_system_types.json +121 -0
  38. data/lib/buildingsync/model_articulation/building_section.rb +190 -0
  39. data/lib/buildingsync/model_articulation/building_system.rb +49 -0
  40. data/lib/buildingsync/model_articulation/envelope_system.rb +102 -0
  41. data/lib/buildingsync/model_articulation/exterior_floor_system_type.rb +64 -0
  42. data/lib/buildingsync/model_articulation/facility.rb +439 -0
  43. data/lib/buildingsync/model_articulation/foundation_system_type.rb +64 -0
  44. data/lib/buildingsync/model_articulation/hvac_system.rb +395 -0
  45. data/lib/buildingsync/model_articulation/lighting_system.rb +102 -0
  46. data/lib/buildingsync/model_articulation/loads_system.rb +287 -0
  47. data/lib/buildingsync/model_articulation/location_element.rb +129 -0
  48. data/lib/buildingsync/model_articulation/measure.rb +57 -0
  49. data/lib/buildingsync/model_articulation/roof_system_type.rb +64 -0
  50. data/lib/buildingsync/model_articulation/service_hot_water_system.rb +87 -0
  51. data/lib/buildingsync/model_articulation/site.rb +242 -0
  52. data/lib/buildingsync/model_articulation/spatial_element.rb +343 -0
  53. data/lib/buildingsync/model_articulation/wall_system_type.rb +64 -0
  54. data/lib/buildingsync/report.rb +217 -0
  55. data/lib/buildingsync/resource_use.rb +55 -0
  56. data/lib/buildingsync/scenario.rb +622 -0
  57. data/lib/buildingsync/selection_tool.rb +98 -0
  58. data/lib/buildingsync/time_series.rb +85 -0
  59. data/lib/buildingsync/translator.rb +167 -0
  60. data/lib/buildingsync/utility.rb +67 -0
  61. data/lib/buildingsync/version.rb +45 -0
  62. metadata +223 -0
@@ -0,0 +1,326 @@
1
+ # frozen_string_literal: true
2
+
3
+ # *******************************************************************************
4
+ # OpenStudio(R), Copyright (c) 2008-2020, Alliance for Sustainable Energy, LLC.
5
+ # BuildingSync(R), Copyright (c) 2015-2020, Alliance for Sustainable Energy, LLC.
6
+ # All rights reserved.
7
+ #
8
+ # Redistribution and use in source and binary forms, with or without
9
+ # modification, are permitted provided that the following conditions are met:
10
+ #
11
+ # (1) Redistributions of source code must retain the above copyright notice,
12
+ # this list of conditions and the following disclaimer.
13
+ #
14
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
15
+ # this list of conditions and the following disclaimer in the documentation
16
+ # and/or other materials provided with the distribution.
17
+ #
18
+ # (3) Neither the name of the copyright holder nor the names of any contributors
19
+ # may be used to endorse or promote products derived from this software without
20
+ # specific prior written permission from the respective party.
21
+ #
22
+ # (4) Other than as required in clauses (1) and (2), distributions in any form
23
+ # of modifications or other derivative works may not use the "OpenStudio"
24
+ # trademark, "OS", "os", or any other confusingly similar designation without
25
+ # specific prior written permission from Alliance for Sustainable Energy, LLC.
26
+ #
27
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
28
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
29
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
31
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
32
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
34
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
37
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
+ # *******************************************************************************
39
+ require 'json'
40
+
41
+ require 'buildingsync/constants'
42
+
43
+ module BuildingSync
44
+ # GetBCLWeatherFile class to manage the process of getting weather files from BCL
45
+ class GetBCLWeatherFile
46
+ def initialize
47
+ # prefix for data weather path
48
+ @weather_file_path_prefix = WEATHER_DIR
49
+ @weather_file = File.join(@weather_file_path_prefix, 'weather_file.json')
50
+ # Above structured as {"weather_file_name":[],"city_name":[],"state_code":[],"weather_id":[]}
51
+
52
+ FileUtils.mkdir_p(@weather_file_path_prefix)
53
+ if File.exist?(@weather_file)
54
+ File.open(@weather_file, 'r') do |file|
55
+ @weather_json = JSON.parse(file.read, symbolize_names: true)
56
+ end
57
+ else
58
+ arr = []
59
+ @weather_json = {
60
+ 'weather_file_name': arr,
61
+ 'city_name': arr,
62
+ 'state_code': arr,
63
+ 'weather_id': arr
64
+ }
65
+ File.open(@weather_file, 'w') { |f| f.write(@weather_json.to_json) }
66
+ end
67
+ end
68
+
69
+ # download weather file from city name
70
+ # @param state [String]
71
+ # @param city [String]c
72
+ # @return string
73
+ def download_weather_file_from_city_name(state, city)
74
+ weather_file_name = get_weather_file_from_city(city)
75
+
76
+ if !weather_file_name.empty?
77
+ return File.join(@weather_file_path_prefix, weather_file_name)
78
+ else
79
+ wmo_no = 0
80
+ remote = OpenStudio::RemoteBCL.new
81
+
82
+ # Search for weather files
83
+ responses = remote.searchComponentLibrary(city, 'Weather File')
84
+ choices = OpenStudio::StringVector.new
85
+
86
+ filter_response = find_response_from_given_state(responses, state)
87
+
88
+ if !filter_response.nil?
89
+ choices << filter_response.uid
90
+ filter_response.attributes.each do |attribute|
91
+ if attribute.name == 'WMO'
92
+ wmo_no = attribute.valueAsDouble
93
+ end
94
+ end
95
+ end
96
+
97
+ if choices.count == 0
98
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_weather_file_from_city_name',
99
+ "Error, could not find uid for state #{state} and city #{city}. Initial count of weather files: #{responses.count}. Please try a different weather file.")
100
+ return false
101
+ end
102
+
103
+ epw_path = download_weather_file(remote, choices)
104
+ download_design_day_file(wmo_no, epw_path)
105
+ return epw_path
106
+ end
107
+ end
108
+
109
+ # download weather file from weather id
110
+ # @param weather_id [String]
111
+ # @return string
112
+ def download_weather_file_from_weather_id(weather_id)
113
+ weather_file_name = get_weather_file_from_weather_id(weather_id)
114
+
115
+ if !weather_file_name.empty?
116
+ return File.join(@weather_file_path_prefix, weather_file_name)
117
+ else
118
+ wmo_no = 0
119
+ remote = OpenStudio::RemoteBCL.new
120
+
121
+ # Search for weather files
122
+ responses = remote.searchComponentLibrary(weather_id, 'Weather File')
123
+
124
+ choices = OpenStudio::StringVector.new
125
+
126
+ responses.each do |response|
127
+ if response.name.include? 'TMY3'
128
+ choices << response.uid
129
+
130
+ response.attributes.each do |attribute|
131
+ if attribute.name == 'WMO'
132
+ wmo_no = attribute.valueAsDouble
133
+ end
134
+ end
135
+ end
136
+ end
137
+
138
+ if choices.count == 0
139
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_weather_file_from_weather_id',
140
+ "Error, could not find uid for #{weather_id}. Please try a different weather file.")
141
+ return false
142
+ end
143
+
144
+ epw_path = download_weather_file(remote, choices)
145
+ download_design_day_file(wmo_no, epw_path)
146
+ return epw_path
147
+ end
148
+ end
149
+
150
+ # download weather file
151
+ # @param remote [OpenStudio::RemoteBCL]
152
+ # @param choices [OpenStudio::StringVector]
153
+ # @return string
154
+ def download_weather_file(remote, choices)
155
+ epw_path = ''
156
+
157
+ choices.each do |uid|
158
+ remote.downloadComponent(uid)
159
+ component = remote.waitForComponentDownload
160
+
161
+ if component.empty?
162
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_weather_file',
163
+ "Error, cannot find the EPW weather file with uid: #{uid}. Please try a different weather file.")
164
+ return false
165
+ end
166
+
167
+ component = component.get
168
+
169
+ files = component.files('epw')
170
+
171
+ if files.empty?
172
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_weather_file',
173
+ "Error, cannot find the EPW weather file within the downloaded zip container with uid: #{uid}. Please try a different weather file.")
174
+ return false
175
+ end
176
+
177
+ epw_weather_file_path = component.files('epw')[0]
178
+ dir_path = File.dirname(epw_weather_file_path)
179
+ weather_file_name = File.basename(epw_weather_file_path)
180
+
181
+ epw_path = File.expand_path(@weather_file_path_prefix.to_s, File.dirname(__FILE__))
182
+
183
+ Dir.glob("#{dir_path}/**/*.*").each do |filename|
184
+ FileUtils.mv(filename, epw_path)
185
+ end
186
+ epw_path = File.expand_path("#{@weather_file_path_prefix}/#{weather_file_name}", File.dirname(__FILE__))
187
+ end
188
+
189
+ puts "Successfully set weather file to #{epw_path}"
190
+ return epw_path
191
+ end
192
+
193
+ # download design day file
194
+ # @param wmo_no [String]
195
+ # @param epw_path [String]
196
+ def download_design_day_file(wmo_no, epw_path)
197
+ remote = OpenStudio::RemoteBCL.new
198
+ responses = remote.searchComponentLibrary(wmo_no.to_s[0, 6], 'Design Day')
199
+ choices = OpenStudio::StringVector.new
200
+
201
+ idf_path_collection = []
202
+
203
+ responses.each do |response|
204
+ choices << response.uid
205
+ end
206
+
207
+ choices.each do |uid|
208
+ remote.downloadComponent(uid)
209
+ component = remote.waitForComponentDownload
210
+
211
+ if !component.empty?
212
+
213
+ component = component.get
214
+
215
+ files = component.files('idf')
216
+
217
+ if !files.empty?
218
+ idf_path_collection.push(component.files('idf')[0])
219
+ else
220
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_design_day_file',
221
+ "Error, cannot find the design day file within the downloaded zip container with uid: #{uid}. Please try a different weather file.")
222
+
223
+ raise "Error, cannot find the design day file within the downloaded zip container with uid: #{uid}. Please try a different weather file."
224
+ end
225
+ else
226
+ OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.GetBCLWeatherFile.download_design_day_file',
227
+ "Error, cannot find local component for: #{uid}. Please try a different weather file.")
228
+ raise "Error, cannot find local component for: #{uid}. Please try a different weather file."
229
+ end
230
+ end
231
+
232
+ puts "Successfully downloaded ddy file to #{epw_path}"
233
+ create_ddy_file(idf_path_collection, epw_path)
234
+ puts "Successfully combined design day files to ddy file in #{epw_path}"
235
+ end
236
+
237
+ # create design day file (ddy)
238
+ # @param idf_path_collection [array<string>]
239
+ # @param epw_path [String]
240
+ # @return [Boolean]
241
+ def create_ddy_file(idf_path_collection, epw_path)
242
+ idf_file_lines = []
243
+
244
+ idf_path_collection.each do |idf_file_path|
245
+ idf_file = File.open(idf_file_path)
246
+ idf_file_lines.push(idf_file.readlines)
247
+ end
248
+
249
+ design_day_path = File.dirname(epw_path)
250
+ weather_file_name = File.basename(epw_path, '.*')
251
+ design_day_file = File.new("#{design_day_path}/#{weather_file_name}.ddy", 'w')
252
+
253
+ idf_file_lines.each do |line|
254
+ design_day_file.puts(line)
255
+ end
256
+ design_day_file.close
257
+ end
258
+
259
+ # get weather file from weather ID
260
+ # @param weather_id [String]
261
+ # @return [String]
262
+ def get_weather_file_from_weather_id(weather_id)
263
+ weather_file_name = ''
264
+ is_found, counter = find_weather_counter(weather_id)
265
+ weather_file_name = @weather_json[:weather_file_name][counter] if is_found
266
+ return weather_file_name
267
+ end
268
+
269
+ # check if weather ID is found in JSON data
270
+ # @param weather_id [String]
271
+ # @return [array<boolean, int>]
272
+ def find_weather_counter(weather_id)
273
+ counter = 0
274
+ @weather_json[:weather_id].each do |cname|
275
+ if cname.include? weather_id
276
+ return true, counter
277
+ end
278
+ counter += 1
279
+ end
280
+ return false, counter
281
+ end
282
+
283
+ # get weather file from city
284
+ # @param city [String]
285
+ # @return [String]
286
+ def get_weather_file_from_city(city)
287
+ weather_file_name = ''
288
+ is_found, counter = city_found_in_json_data(city)
289
+ weather_file_name = @weather_json[:weather_file_name][counter] if is_found
290
+ return weather_file_name
291
+ end
292
+
293
+ # city found in JSON data
294
+ # @param city [String]
295
+ # @return [array<boolean, int>]
296
+ def city_found_in_json_data(city)
297
+ counter = 0
298
+ @weather_json[:city_name].each do |cname|
299
+ if cname.include? city
300
+ return true, counter
301
+ end
302
+ counter += 1
303
+ end
304
+ return false, counter
305
+ end
306
+
307
+ # find response from given state
308
+ # @param responses [array<BCLSearchResult>]
309
+ # @param state [String]
310
+ # @return [BCLSearchResult]
311
+ def find_response_from_given_state(responses, state)
312
+ responses.each do |response|
313
+ if response.name.include? 'TMY3'
314
+ response.attributes.each do |attribute|
315
+ if attribute.name == 'State'
316
+ if attribute.valueAsString == state
317
+ return response
318
+ end
319
+ end
320
+ end
321
+ end
322
+ end
323
+ return nil
324
+ end
325
+ end
326
+ end
@@ -0,0 +1,216 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Model class
4
+ class OpenStudio::Model::Model
5
+ # Adds the HVAC system as derived from the combinations of
6
+ # CBECS 2012 MAINHT and MAINCL fields.
7
+ # Mapping between combinations and HVAC systems per
8
+ # http://www.nrel.gov/docs/fy08osti/41956.pdf
9
+ # Table C-31
10
+ # @param standard [Standard]
11
+ # @param system_type [String]
12
+ # @param zones [Array<OpenStudio::Model::ThermalZone>]
13
+ def add_cbecs_hvac_system(standard, system_type, zones)
14
+ case system_type
15
+ when 'PTAC with hot water heat'
16
+ standard.model_add_hvac_system(self, 'PTAC', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
17
+
18
+ when 'PTAC with gas coil heat'
19
+ standard.model_add_hvac_system(self, 'PTAC', ht = nil, znht = 'NaturalGas', cl = 'Electricity', zones)
20
+
21
+ when 'PTAC with electric baseboard heat'
22
+ standard.model_add_hvac_system(self, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', zones)
23
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
24
+
25
+ when 'PTAC with no heat'
26
+ standard.model_add_hvac_system(self, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', zones)
27
+
28
+ when 'PTAC with district hot water heat'
29
+ standard.model_add_hvac_system(self, 'PTAC', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
30
+
31
+ when 'PTHP'
32
+ standard.model_add_hvac_system(self, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)
33
+
34
+ when 'PSZ-AC with gas coil heat'
35
+ standard.model_add_hvac_system(self, 'PSZ-AC', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
36
+
37
+ when 'PSZ-AC with electric baseboard heat'
38
+ standard.model_add_hvac_system(self, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', zones)
39
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
40
+
41
+ when 'PSZ-AC with no heat'
42
+ standard.model_add_hvac_system(self, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', zones)
43
+
44
+ when 'PSZ-AC with district hot water heat'
45
+ standard.model_add_hvac_system(self, 'PSZ-AC', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
46
+
47
+ when 'PSZ-HP'
48
+ standard.model_add_hvac_system(self, 'PSZ-HP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)
49
+
50
+ when 'Fan coil district chilled water with no heat'
51
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
52
+
53
+ when 'Fan coil district chilled water and boiler'
54
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
55
+
56
+ when 'Fan coil district chilled water unit heaters'
57
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
58
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
59
+
60
+ when 'Fan coil district chilled water electric baseboard heat'
61
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
62
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
63
+
64
+ when 'Fan coil district hot and chilled water'
65
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
66
+
67
+ when 'Fan coil district hot water and chiller'
68
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
69
+
70
+ when 'Fan coil chiller with no heat'
71
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones)
72
+
73
+ when 'Baseboard district hot water heat'
74
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, zones)
75
+
76
+ when 'Baseboard district hot water heat with direct evap coolers'
77
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, zones)
78
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
79
+
80
+ when 'Baseboard electric heat'
81
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
82
+
83
+ when 'Baseboard electric heat with direct evap coolers'
84
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
85
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
86
+
87
+ when 'Baseboard hot water heat'
88
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, zones)
89
+
90
+ when 'Baseboard hot water heat with direct evap coolers'
91
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, zones)
92
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
93
+
94
+ when 'Window AC with no heat'
95
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
96
+
97
+ when 'Window AC with forced air furnace'
98
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
99
+ standard.model_add_hvac_system(self, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, zones)
100
+
101
+ when 'Window AC with district hot water baseboard heat'
102
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
103
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, zones)
104
+
105
+ when 'Window AC with hot water baseboard heat'
106
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
107
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, zones)
108
+
109
+ when 'Window AC with electric baseboard heat'
110
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
111
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
112
+
113
+ when 'Window AC with unit heaters'
114
+ standard.model_add_hvac_system(self, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', zones)
115
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
116
+
117
+ when 'Direct evap coolers'
118
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
119
+
120
+ when 'Direct evap coolers with unit heaters'
121
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
122
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
123
+
124
+ when 'Unit heaters'
125
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
126
+
127
+ when 'Heat pump heat with no cooling'
128
+ standard.model_add_hvac_system(self, 'Residential Air Source Heat Pump', ht = nil, znht = nil, cl = 'Electricity', zones)
129
+
130
+ when 'Heat pump heat with direct evap cooler'
131
+ # standard.model_add_hvac_system(self, 'Residential Air Source Heat Pump', ht=nil, znht=nil, cl='Electricity', zones)
132
+ # Using PTHP to represent zone heat pump for this configuration
133
+ # because only one airloop may be connected to each thermal zone.
134
+ standard.model_add_hvac_system(self, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)
135
+ # disable the cooling coils in all the PTHPs
136
+ getZoneHVACPackagedTerminalHeatPumps.each do |pthp|
137
+ clg_coil = pthp.heatingCoil.to_CoilHeatingDXSingleSpeed.get
138
+ clg_coil.setAvailabilitySchedule(alwaysOffDiscreteSchedule)
139
+ end
140
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
141
+
142
+ when 'VAV with reheat'
143
+ standard.model_add_hvac_system(self, 'VAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones)
144
+
145
+ when 'VAV with PFP boxes'
146
+ standard.model_add_hvac_system(self, 'VAV PFP Boxes', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones)
147
+
148
+ when 'VAV with gas reheat'
149
+ standard.model_add_hvac_system(self, 'VAV Gas Reheat', ht = 'NaturalGas', ht = 'NaturalGas', cl = 'Electricity', zones)
150
+
151
+ when 'VAV with zone unit heaters'
152
+ standard.model_add_hvac_system(self, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
153
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
154
+
155
+ when 'VAV with electric baseboard heat'
156
+ standard.model_add_hvac_system(self, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
157
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
158
+
159
+ when 'VAV cool with zone heat pump heat'
160
+ standard.model_add_hvac_system(self, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
161
+ # standard.model_add_hvac_system(self, 'Residential Air Source Heat Pump', ht=nil, znht=nil, cl='Electricity', zones)
162
+ # Using PTHP to represent zone heat pump for this configuration
163
+ # because only one airloop may be connected to each thermal zone.
164
+ standard.model_add_hvac_system(self, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)
165
+ # disable the cooling coils in all the PTHPs
166
+ getZoneHVACPackagedTerminalHeatPumps.each do |pthp|
167
+ clg_coil = pthp.heatingCoil.to_CoilHeatingDXSingleSpeed.get
168
+ clg_coil.setAvailabilitySchedule(alwaysOffDiscreteSchedule)
169
+ end
170
+
171
+ when 'PVAV with reheat', 'Packaged VAV Air Loop with Boiler' # second enumeration for backwards compatibility with Tenant Star project
172
+ standard.model_add_hvac_system(self, 'PVAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones)
173
+
174
+ when 'PVAV with PFP boxes'
175
+ standard.model_add_hvac_system(self, 'PVAV PFP Boxes', ht = 'Electricity', znht = 'Electricity', cl = 'Electricity', zones)
176
+
177
+ when 'Residential forced air'
178
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
179
+
180
+ when 'Residential forced air cooling hot water baseboard heat'
181
+ standard.model_add_hvac_system(self, 'Residential AC', ht = nil, znht = nil, cl = 'Electricity', zones)
182
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, zones)
183
+
184
+ when 'Residential forced air with district hot water'
185
+ standard.model_add_hvac_system(self, 'Residential AC', ht = nil, znht = nil, cl = 'Electricity', zones)
186
+
187
+ when 'Residential heat pump'
188
+ standard.model_add_hvac_system(self, 'Residential Air Source Heat Pump', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)
189
+
190
+ when 'Forced air furnace'
191
+ standard.model_add_hvac_system(self, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, zones)
192
+
193
+ when 'Forced air furnace district chilled water fan coil'
194
+ standard.model_add_hvac_system(self, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, zones)
195
+ standard.model_add_hvac_system(self, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
196
+
197
+ when 'Forced air furnace direct evap cooler'
198
+ # standard.model_add_hvac_system(self, 'Forced Air Furnace', ht='NaturalGas', znht=nil, cl=nil, zones)
199
+ # Using unit heater to represent forced air furnace for this configuration
200
+ # because only one airloop may be connected to each thermal zone.
201
+ standard.model_add_hvac_system(self, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, zones)
202
+ standard.model_add_hvac_system(self, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', zones)
203
+
204
+ when 'Residential AC with no heat'
205
+ standard.model_add_hvac_system(self, 'Residential AC', ht = nil, znht = nil, cl = 'Electricity', zones)
206
+
207
+ when 'Residential AC with electric baseboard heat'
208
+ standard.model_add_hvac_system(self, 'Residential AC', ht = nil, znht = nil, cl = 'Electricity', zones)
209
+ standard.model_add_hvac_system(self, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, zones)
210
+
211
+ else
212
+ puts "HVAC system type '#{system_type}' not recognized"
213
+
214
+ end
215
+ end
216
+ end