Module: OpenstudioStandards::HVAC

Defined in:
lib/openstudio-standards/hvac/cbecs_hvac.rb,
lib/openstudio-standards/hvac/components/create.rb,
lib/openstudio-standards/hvac/components/modify.rb,
lib/openstudio-standards/hvac/air_loop/information.rb,
lib/openstudio-standards/hvac/exhaust/create_exhaust_fan.rb,
lib/openstudio-standards/hvac/setpoint_managers/information.rb

Overview

The HVAC module provides methods create, modify, and get information about HVAC systems in the model

CBECS HVAC collapse

Component:Create collapse

Component:Modify collapse

AirLoop:Information collapse

Exhaust collapse

Setpoint Managers:Information collapse

Class Method Details

.add_cbecs_hvac_system(model, standard, hvac_system_type, zones) ⇒ Boolean

Adds the HVAC system as derived from the combinations of CBECS 2012 MAINHT and MAINCL fields. Mapping between combinations and HVAC systems per www.nrel.gov/docs/fy08osti/41956.pdf Table C-31

Parameters:

  • model (OpenStudio::Model::Model)

    OpenStudio model object

  • standard (String)

    standard template, e.g. ‘90.1-2013’

  • hvac_system_type (String)

    HVAC system type

  • zones (Array<OpenStudio::Model::ThermalZone>)

    Array of OpenStudio ThermalZone objects

Returns:

  • (Boolean)

    returns true if successful, false if not



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/openstudio-standards/hvac/cbecs_hvac.rb', line 16

def self.add_cbecs_hvac_system(model, standard, hvac_system_type, zones)
  # the 'zones' argument includes zones that have heating, cooling, or both
  # if the HVAC system type serves a single zone, handle zones with only heating separately by adding unit heaters
  # applies to system types PTAC, PTHP, PSZ-AC, and Window AC
  heated_and_cooled_zones = zones.select { |zone| OpenstudioStandards::ThermalZone.thermal_zone_heated?(zone) && OpenstudioStandards::ThermalZone.thermal_zone_cooled?(zone) }
  heated_zones = zones.select { |zone| OpenstudioStandards::ThermalZone.thermal_zone_heated?(zone) }
  cooled_zones = zones.select { |zone| OpenstudioStandards::ThermalZone.thermal_zone_cooled?(zone) }
  cooled_only_zones = zones.select { |zone| !OpenstudioStandards::ThermalZone.thermal_zone_heated?(zone) && OpenstudioStandards::ThermalZone.thermal_zone_cooled?(zone) }
  heated_only_zones = zones.select { |zone| OpenstudioStandards::ThermalZone.thermal_zone_heated?(zone) && !OpenstudioStandards::ThermalZone.thermal_zone_cooled?(zone) }
  system_zones = heated_and_cooled_zones + cooled_only_zones

  # system type naming convention:
  # [ventilation strategy] [ cooling system and plant] [heating system and plant]

  case hvac_system_type

  when 'Baseboard electric'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Baseboard gas boiler'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Baseboard central air source heat pump'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_zones)

  when 'Baseboard district hot water'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'Direct evap coolers with baseboard electric'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'Direct evap coolers with baseboard gas boiler'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'Direct evap coolers with baseboard central air source heat pump'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_zones)
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'Direct evap coolers with baseboard district hot water'
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'Direct evap coolers with forced air furnace', 'Direct evap coolers with gas unit heaters'
    # Using unit heater to represent forced air furnace to limit to one airloop per thermal zone.
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'Direct evap coolers with no heat'
    standard.model_add_hvac_system(model, 'Evaporative Cooler', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'DOAS with fan coil chiller with boiler'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil chiller with central air source heat pump'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil chiller with district hot water'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil chiller with baseboard electric'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil chiller with gas unit heaters'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil chiller with no heat'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil air-cooled chiller with boiler'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil air-cooled chiller with central air source heat pump'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil air-cooled chiller with district hot water'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil air-cooled chiller with baseboard electric'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil air-cooled chiller with gas unit heaters'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil air-cooled chiller with no heat'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled',
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil district chilled water with boiler'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil district chilled water with central air source heat pump'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil district chilled water with district hot water'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with fan coil district chilled water with baseboard electric'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil district chilled water with gas unit heaters'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'DOAS with fan coil district chilled water with no heat'
    standard.model_add_hvac_system(model, 'DOAS', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with VRF'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'Electricity', znht = nil, cl = 'Electricity', system_zones,
                                   air_loop_heating_type: 'DX',
                                   air_loop_cooling_type: 'DX')
    standard.model_add_hvac_system(model, 'VRF', ht = 'Electricity', znht = nil, cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'DOAS with water source heat pumps fluid cooler with boiler'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   heat_pump_loop_cooling_type: 'FluidCooler',
                                   zone_equipment_ventilation: false)

  when 'DOAS with water source heat pumps cooling tower with boiler'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   heat_pump_loop_cooling_type: 'CoolingTower',
                                   zone_equipment_ventilation: false)

  when 'DOAS with water source heat pumps with ground source heat pump'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
                                   air_loop_heating_type: 'DX',
                                   air_loop_cooling_type: 'DX')
    standard.model_add_hvac_system(model, 'Ground Source Heat Pumps', ht = 'Electricity', znht = nil, cl = 'Electricity', zones,
                                   zone_equipment_ventilation: false)

  when 'DOAS with water source heat pumps district chilled water with district hot water'
    standard.model_add_hvac_system(model, 'DOAS', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones,
                                   zone_equipment_ventilation: false)

  # ventilation provided by zone fan coil unit in fan coil systems
  when 'Fan coil chiller with boiler'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)

  when 'Fan coil chiller with central air source heat pump'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones)

  when 'Fan coil chiller with district hot water'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones)

  when 'Fan coil chiller with baseboard electric'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Fan coil chiller with gas unit heaters'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Fan coil chiller with no heat'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones)

  when 'Fan coil air-cooled chiller with boiler'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'Fan coil air-cooled chiller with central air source heat pump'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'Fan coil air-cooled chiller with district hot water'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'Fan coil air-cooled chiller with baseboard electric'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Fan coil air-cooled chiller with gas unit heaters'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Fan coil air-cooled chiller with no heat'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'Fan coil district chilled water with boiler'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)

  when 'Fan coil district chilled water with central air source heat pump'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', zones)

  when 'Fan coil district chilled water with district hot water'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)

  when 'Fan coil district chilled water with baseboard electric'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Fan coil district chilled water with gas unit heaters'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Fan coil district chilled water with no heat'
    standard.model_add_hvac_system(model, 'Fan Coil', ht = nil, znht = nil, cl = 'DistrictCooling', zones)

  when 'Forced air furnace'
    # includes ventilation, whereas residential forced air furnace does not.
    standard.model_add_hvac_system(model, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Gas unit heaters'
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PTAC with baseboard electric'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'PTAC with baseboard gas boiler'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PTAC with baseboard district hot water'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'PTAC with gas unit heaters'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PTAC with electric coil'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = 'Electricity', cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PTAC with gas coil'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = 'NaturalGas', cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use gas unit heaters for heated only zones
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PTAC with gas boiler'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = 'NaturalGas', znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use 'Baseboard gas boiler' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PTAC with central air source heat pump'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use 'Baseboard central air source heat pump' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_only_zones)

  when 'PTAC with district hot water'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use 'Baseboard district hot water heat' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_only_zones)

  when 'PTAC with no heat'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTAC', ht = nil, znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)

  when 'PTHP'
    # default to have no ventilation air
    standard.model_add_hvac_system(model, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', system_zones,
                                   zone_equipment_ventilation: false)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with baseboard electric'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC with baseboard gas boiler'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC with baseboard district hot water'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC with gas unit heaters'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC with electric coil'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = 'Electricity', cl = 'Electricity', system_zones)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with gas coil'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = 'NaturalGas', cl = 'Electricity', system_zones)
    # use gas unit heaters for heated only zones
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with gas boiler'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'NaturalGas', znht = nil, cl = 'Electricity', system_zones)
    # use 'Baseboard gas boiler' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with central air source heat pump'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'AirSourceHeatPump', znht = nil, cl = 'Electricity', system_zones)
    # use 'Baseboard central air source heat pump' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with district hot water'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'DistrictHeating', znht = nil, cl = 'Electricity', system_zones)
    # use 'Baseboard district hot water' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC with no heat'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  when 'PSZ-AC district chilled water with baseboard electric'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'DistrictCooling', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC district chilled water with baseboard gas boiler'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'DistrictCooling', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC district chilled water with baseboard district hot water'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'DistrictCooling', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC district chilled water with gas unit heaters'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'DistrictCooling', system_zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'PSZ-AC district chilled water with electric coil'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = 'Electricity', cl = 'DistrictCooling', system_zones)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC district chilled water with gas coil'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = 'NaturalGas', cl = 'DistrictCooling', system_zones)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC district chilled water with gas boiler'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', system_zones)
    # use 'Baseboard gas boiler' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC district chilled water with central air source heat pump'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'AirSourceHeatPump', znht = nil, cl = 'DistrictCooling', system_zones)
    # use 'Baseboard central air source heat pump' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC district chilled water with district hot water'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', system_zones)
    # use 'Baseboard district hot water' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_only_zones)

  when 'PSZ-AC district chilled water with no heat'
    standard.model_add_hvac_system(model, 'PSZ-AC', ht = nil, znht = nil, cl = 'DistrictCooling', cooled_zones)

  when 'PSZ-HP'
    standard.model_add_hvac_system(model, 'PSZ-HP', ht = 'Electricity', znht = nil, cl = 'Electricity', system_zones)
    # use 'Baseboard electric' for heated only zones
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  # PVAV systems by default use a DX coil for cooling
  when 'PVAV with gas boiler reheat', 'Packaged VAV Air Loop with Boiler' # second enumeration for backwards compatibility with Tenant Star project
    standard.model_add_hvac_system(model, 'PVAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_only_zones)

  when 'PVAV with central air source heat pump reheat'
    standard.model_add_hvac_system(model, 'PVAV Reheat', ht = 'AirSourceHeatPump', znht = 'AirSourceHeatPump', cl = 'Electricity', zones)

  when 'PVAV with district hot water reheat'
    standard.model_add_hvac_system(model, 'PVAV Reheat', ht = 'DistrictHeating', znht = 'DistrictHeating', cl = 'Electricity', zones)

  when 'PVAV with PFP boxes'
    standard.model_add_hvac_system(model, 'PVAV PFP Boxes', ht = 'Electricity', znht = 'Electricity', cl = 'Electricity', system_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PVAV with gas heat with electric reheat', 'PVAV with gas coil heat with electric reheat'
    standard.model_add_hvac_system(model, 'PVAV Reheat', ht = 'Gas', znht = 'Electricity', cl = 'Electricity', system_zones,
                                   air_loop_heating_type: 'Gas')
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_only_zones)

  when 'PVAV with gas boiler heat with electric reheat'
    standard.model_add_hvac_system(model, 'PVAV Reheat', ht = 'Gas', znht = 'Electricity', cl = 'Electricity', zones)

  # all residential systems do not have ventilation
  when 'Residential AC with baseboard electric'
    standard.model_add_hvac_system(model, 'Residential AC', ht = nil, znht = nil, cl = nil, cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Residential AC with baseboard gas boiler'
    standard.model_add_hvac_system(model, 'Residential AC', ht = nil, znht = nil, cl = nil, cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Residential AC with baseboard central air source heat pump'
    standard.model_add_hvac_system(model, 'Residential AC', ht = nil, znht = nil, cl = nil, cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_zones)

  when 'Residential AC with baseboard district hot water'
    standard.model_add_hvac_system(model, 'Residential AC', ht = nil, znht = nil, cl = nil, cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'Residential AC with residential forced air furnace'
    standard.model_add_hvac_system(model, 'Residential Forced Air Furnace with AC', ht = nil, znht = nil, cl = nil, zones)

  when 'Residential AC with no heat'
    standard.model_add_hvac_system(model, 'Residential AC', ht = nil, znht = nil, cl = nil, cooled_zones)

  when 'Residential heat pump'
    standard.model_add_hvac_system(model, 'Residential Air Source Heat Pump', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'Residential heat pump with no cooling'
    standard.model_add_hvac_system(model, 'Residential Air Source Heat Pump', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Residential forced air furnace'
    standard.model_add_hvac_system(model, 'Residential Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, zones)

  when 'VAV chiller with gas boiler reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones)

  when 'VAV chiller with central air source heat pump reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'AirSourceHeatPump', znht = 'AirSourceHeatPump', cl = 'Electricity', zones)

  when 'VAV chiller with district hot water reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'DistrictHeating', znht = 'DistrictHeating', cl = 'Electricity', zones)

  when 'VAV chiller with PFP boxes'
    standard.model_add_hvac_system(model, 'VAV PFP Boxes', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones)

  when 'VAV chiller with gas coil reheat'
    standard.model_add_hvac_system(model, 'VAV Gas Reheat', ht = 'NaturalGas', ht = 'NaturalGas', cl = 'Electricity', zones)

  when 'VAV chiller with no reheat with baseboard electric'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'VAV chiller with no reheat with gas unit heaters'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'VAV chiller with no reheat with zone heat pump'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones)
    # Using PTHP to represent zone heat pump to limit to one airloop per thermal zone.
    standard.model_add_hvac_system(model, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'VAV air-cooled chiller with gas boiler reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'VAV air-cooled chiller with central air source heat pump reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'AirSourceHeatPump', znht = 'AirSourceHeatPump', cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'VAV air-cooled chiller with district hot water reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'DistrictHeating', znht = 'DistrictHeating', cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'VAV air-cooled chiller with PFP boxes'
    standard.model_add_hvac_system(model, 'VAV PFP Boxes', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'VAV air-cooled chiller with gas coil reheat'
    standard.model_add_hvac_system(model, 'VAV Gas Reheat', ht = 'NaturalGas', ht = 'NaturalGas', cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')

  when 'VAV air-cooled chiller with no reheat with baseboard electric'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'VAV air-cooled chiller with no reheat with gas unit heaters'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'VAV air-cooled chiller with no reheat with zone heat pump'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   chilled_water_loop_cooling_type: 'AirCooled')
    # Using PTHP to represent zone heat pump to limit to one airloop per thermal zone.
    standard.model_add_hvac_system(model, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'VAV district chilled water with gas boiler reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'DistrictCooling', zones)

  when 'VAV district chilled water with central air source heat pump reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'AirSourceHeatPump', znht = 'AirSourceHeatPump', cl = 'DistrictCooling', zones)

  when 'VAV district chilled water with district hot water reheat'
    standard.model_add_hvac_system(model, 'VAV Reheat', ht = 'DistrictHeating', znht = 'DistrictHeating', cl = 'DistrictCooling', zones)

  when 'VAV district chilled water with PFP boxes'
    standard.model_add_hvac_system(model, 'VAV PFP Boxes', ht = 'NaturalGas', znht = 'NaturalGas', cl = 'DistrictCooling', zones)

  when 'VAV district chilled water with gas coil reheat'
    standard.model_add_hvac_system(model, 'VAV Gas Reheat', ht = 'NaturalGas', ht = 'NaturalGas', cl = 'DistrictCooling', zones)

  when 'VAV district chilled water with no reheat with baseboard electric'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'VAV district chilled water with no reheat with gas unit heaters'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'VAV district chilled water with no reheat with zone heat pump'
    standard.model_add_hvac_system(model, 'VAV No Reheat', ht = 'NaturalGas', znht = nil, cl = 'DistrictCooling', zones)
    # Using PTHP to represent zone heat pump to limit to one airloop per thermal zone.
    standard.model_add_hvac_system(model, 'PTHP', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'VRF'
    standard.model_add_hvac_system(model, 'VRF', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'Water source heat pumps fluid cooler with boiler'
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   heat_pump_loop_cooling_type: 'FluidCooler')

  when 'Water source heat pumps cooling tower with boiler'
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'NaturalGas', znht = nil, cl = 'Electricity', zones,
                                   heat_pump_loop_cooling_type: 'CoolingTower')

  when 'Water source heat pumps with ground source heat pump'
    standard.model_add_hvac_system(model, 'Ground Source Heat Pumps', ht = 'Electricity', znht = nil, cl = 'Electricity', zones)

  when 'Water source heat pumps district chilled water with district hot water'
    standard.model_add_hvac_system(model, 'Water Source Heat Pumps', ht = 'DistrictHeating', znht = nil, cl = 'DistrictCooling', zones)

  when 'Window AC with baseboard electric'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'Electricity', znht = nil, cl = nil, heated_zones)

  when 'Window AC with baseboard gas boiler'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Window AC with baseboard central air source heat pump'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'AirSourceHeatPump', znht = nil, cl = nil, heated_zones)

  when 'Window AC with baseboard district hot water'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Baseboards', ht = 'DistrictHeating', znht = nil, cl = nil, heated_zones)

  when 'Window AC with forced air furnace'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Forced Air Furnace', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Window AC with unit heaters'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)
    standard.model_add_hvac_system(model, 'Unit Heaters', ht = 'NaturalGas', znht = nil, cl = nil, heated_zones)

  when 'Window AC with no heat'
    standard.model_add_hvac_system(model, 'Window AC', ht = nil, znht = nil, cl = 'Electricity', cooled_zones)

  else
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.HVAC', "CBECS HVAC system type #{hvac_system_type} not recognized.")
    return false
  end
  return true
end

.air_loop_hvac_direct_evap?(air_loop_hvac) ⇒ Boolean

Returns whether air loop HVAC is a direct evaporative system

Parameters:

  • air_loop_hvac (<OpenStudio::Model::AirLoopHVAC>)

    OpenStudio AirLoopHVAC object

Returns:

  • (Boolean)

    returns true if successful, false if not



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/openstudio-standards/hvac/air_loop/information.rb', line 11

def self.air_loop_hvac_direct_evap?(air_loop_hvac)
  # check if direct evap
  is_direct_evap = false
  air_loop_hvac.supplyComponents.each do |component|
    # Get the object type
    obj_type = component.iddObjectType.valueName.to_s
    case obj_type
    when 'OS_EvaporativeCooler_Direct_ResearchSpecial', 'OS_EvaporativeCooler_Indirect_ResearchSpecial'
      is_direct_evap = true
    end
  end
  return is_direct_evap
end

.air_loop_hvac_unitary_system?(air_loop_hvac) ⇒ Boolean

Returns whether air loop HVAC is a unitary system

Parameters:

  • air_loop_hvac (<OpenStudio::Model::AirLoopHVAC>)

    OpenStudio AirLoopHVAC object

Returns:

  • (Boolean)

    returns true if air_loop_hvac is a unitary system, false if not



29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/openstudio-standards/hvac/air_loop/information.rb', line 29

def self.air_loop_hvac_unitary_system?(air_loop_hvac)
  # check if unitary system
  is_unitary_system = false
  air_loop_hvac.supplyComponents.each do |component|
    # Get the object type
    obj_type = component.iddObjectType.valueName.to_s
    case obj_type
    when 'OS_AirLoopHVAC_UnitarySystem', 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir', 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed', 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass'
      is_unitary_system = true
    end
  end
  return is_unitary_system
end

.create_exhaust_fan(exhaust_zone, make_up_air_source_zone: nil, make_up_air_fraction: 0.5) ⇒ OpenStudio::Model::FanZoneExhaust

Create and add an exhaust fan to a thermal zone.

Parameters:

  • exhaust_zone (OpenStudio::Model::ThermalZone)

    The zone with the exhaust fan

  • make_up_air_source_zone (OpenStudio::Model::ThermalZone) (defaults to: nil)

    An optional source zone for make-up air

  • make_up_air_fraction (Double) (defaults to: 0.5)

    The fraction of make-up sourced from make_up_air_source_zone

Returns:

  • (OpenStudio::Model::FanZoneExhaust)

    The created exhaust fan



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/openstudio-standards/hvac/exhaust/create_exhaust_fan.rb', line 13

def self.create_exhaust_fan(exhaust_zone,
                            make_up_air_source_zone: nil,
                            make_up_air_fraction: 0.5)
  # load exhaust fan data
  data = JSON.parse(File.read("#{File.dirname(__FILE__)}/data/typical_exhaust.json"), symbolize_names: true)

  # loop through spaces to get standards space information
  space_type_hash = {}
  exhaust_zone.spaces.each do |space|
    next unless space.spaceType.is_initialized
    next unless space.partofTotalFloorArea

    space_type = space.spaceType.get
    if space_type_hash.key?(space_type)
      space_type_hash[space_type][:floor_area_m2] += space.floorArea * space.multiplier
    else
      next unless space_type.standardsBuildingType.is_initialized
      next unless space_type.standardsSpaceType.is_initialized


      standards_space_type = space_type.standardsSpaceType.get
      standards_building_type = space_type.standardsBuildingType.get

      exhaust_fan_properties = data[:space_types].select { |hash| (hash[:space_type] == standards_space_type) && (hash[:building_type] == standards_building_type) }

      # skip spaces with no exhaust fan information defined
      next if exhaust_fan_properties.empty?

      exhaust_fan_properties = exhaust_fan_properties[0]

      space_type_hash[space_type] = {}
      space_type_hash[space_type][:floor_area_m2] = space.floorArea * space.multiplier
      space_type_hash[space_type][:exhaust_cfm_per_area_ft2] = exhaust_fan_properties[:exhaust_per_area]
    end
  end

  # total exhaust
  exhaust_m3_per_s = 0.0
  space_type_hash.each do |space_type, fields|
    floor_area_ft2 = OpenStudio.convert(fields[:floor_area_m2], 'm^2', 'ft^2').get
    cfm = fields[:exhaust_cfm_per_area_ft2].to_f * floor_area_ft2.to_f
    exhaust_m3_per_s += OpenStudio.convert(cfm, 'cfm', 'm^3/s').get
  end

  if exhaust_m3_per_s.zero?
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.HVAC.create_exhaust_fan', "Calculated zero flow rate for thermal zone #{exhaust_zone.name}. No exhaust fan added.")
    return nil
  end

  # placeholders for exhaust schedules
  # @todo get the building HVAC schedule
  exhaust_availability_schedule = exhaust_zone.model.alwaysOnDiscreteSchedule
  exhaust_flow_fraction_schedule = exhaust_zone.model.alwaysOnDiscreteSchedule

  # add exhaust fan
  zone_exhaust_fan = OpenStudio::Model::FanZoneExhaust.new(exhaust_zone.model)
  zone_exhaust_fan.setName("#{exhaust_zone.name} Exhaust Fan")
  zone_exhaust_fan.setAvailabilitySchedule(exhaust_availability_schedule)
  zone_exhaust_fan.setFlowFractionSchedule(exhaust_flow_fraction_schedule)
  zone_exhaust_fan.setMaximumFlowRate(exhaust_m3_per_s)
  zone_exhaust_fan.setEndUseSubcategory('Zone Exhaust Fans')
  zone_exhaust_fan.addToThermalZone(exhaust_zone)

  # add objects to account for makeup air
  unless make_up_air_source_zone.nil?
    # add balanced exhaust schedule to zone_exhaust_fan
    balanced_exhaust_schedule = OpenstudioStandards::Schedules.create_constant_schedule_ruleset(make_up_air_source_zone.model, make_up_air_fraction,
                                                                                                name: "#{exhaust_zone.name} Balanced Exhaust Fraction Schedule",
                                                                                                schedule_type_limit: 'Fraction')
    zone_exhaust_fan.setBalancedExhaustFractionSchedule(balanced_exhaust_schedule)

    # use max value of balanced exhaust fraction schedule for maximum flow rate
    max_sch_val = OpenstudioStandards::Schedules.schedule_get_min_max(balanced_exhaust_schedule)['max']
    transfer_air_m3_per_s = exhaust_m3_per_s * max_sch_val

    # add dummy exhaust fan to account for loss of transfer air
    transfer_air_source_zone_exhaust = OpenStudio::Model::FanZoneExhaust.new(exhaust_zone.model)
    transfer_air_source_zone_exhaust.setName("#{exhaust_zone.name} Transfer Air Source")
    transfer_air_source_zone_exhaust.setAvailabilitySchedule(exhaust_availability_schedule)
    transfer_air_source_zone_exhaust.setMaximumFlowRate(transfer_air_m3_per_s)
    transfer_air_source_zone_exhaust.setFanEfficiency(1.0)
    transfer_air_source_zone_exhaust.setPressureRise(0.0)
    transfer_air_source_zone_exhaust.setEndUseSubcategory('Zone Exhaust Fans')
    transfer_air_source_zone_exhaust.addToThermalZone(make_up_air_source_zone)

    # add zone mixing
    zone_mixing = OpenStudio::Model::ZoneMixing.new(exhaust_zone)
    zone_mixing.setSchedule(exhaust_flow_fraction_schedule)
    zone_mixing.setSourceZone(make_up_air_source_zone)
    zone_mixing.setDesignFlowRate(transfer_air_m3_per_s)
  end

  return zone_exhaust_fan
end

.create_hx_air_to_air_sensible_and_latent(model, name: nil, type: nil, economizer_lockout: nil, supply_air_outlet_temperature_control: nil, frost_control_type: nil, nominal_electric_power: nil, sensible_heating_100_eff: nil, sensible_heating_75_eff: nil, latent_heating_100_eff: nil, latent_heating_75_eff: nil, sensible_cooling_100_eff: nil, sensible_cooling_75_eff: nil, latent_cooling_100_eff: nil, latent_cooling_75_eff: nil) ⇒ <OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent>

creates HeatExchangerAirToAirSensibleAndLatent object with user-input effectiveness values

Parameters:

  • model (OpenStudio::Model::Model)

    OpenStudio model

  • name (String) (defaults to: nil)
  • type (String) (defaults to: nil)

    Heat Exchanger Type. One of ‘Plate’, ‘Rotary’

  • economizer_lockout (Boolean) (defaults to: nil)

    whether hx is locked out during economizing

  • supply_air_outlet_temperature_control (Boolean) (defaults to: nil)
  • frost_control_type (String) (defaults to: nil)

    HX frost control type. One of ‘None’, ‘ExhaustAirRecirculation’, ‘ExhaustOnly’, ‘MinimumExhaustTemperature’

  • nominal_electric_power (Float) (defaults to: nil)

    Nominal electric power

  • sensible_heating_100_eff (Float) (defaults to: nil)
  • sensible_heating_75_eff (Float) (defaults to: nil)
  • latent_heating_100_eff (Float) (defaults to: nil)
  • latent_heating_75_eff (Float) (defaults to: nil)
  • sensible_cooling_100_eff (Float) (defaults to: nil)
  • sensible_cooling_75_eff (Float) (defaults to: nil)
  • latent_cooling_100_eff (Float) (defaults to: nil)
  • latent_cooling_75_eff (Float) (defaults to: nil)

Returns:

  • (<OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent>)


25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/openstudio-standards/hvac/components/create.rb', line 25

def self.create_hx_air_to_air_sensible_and_latent(model,
                                                  name: nil,
                                                  type: nil,
                                                  economizer_lockout: nil,
                                                  supply_air_outlet_temperature_control: nil,
                                                  frost_control_type: nil,
                                                  nominal_electric_power: nil,
                                                  sensible_heating_100_eff: nil,
                                                  sensible_heating_75_eff: nil,
                                                  latent_heating_100_eff: nil,
                                                  latent_heating_75_eff: nil,
                                                  sensible_cooling_100_eff: nil,
                                                  sensible_cooling_75_eff: nil,
                                                  latent_cooling_100_eff: nil,
                                                  latent_cooling_75_eff: nil)

  hx = OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.new(model)
  hx.setName(name) unless name.nil?

  unless type.nil?
    if OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.heatExchangerTypeValues.include?(type)
      hx.setHeatExchangerType(type)
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Hvac', "Entered heat exchanger type #{type} not a valid type value. Enter one of #{OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.heatExchangerTypeValues}")
    end
  end

  unless frost_control_type.nil?
    if OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.frostControlTypeValues.include?(frost_control_type)
      hx.setFrostControlType(frost_control_type)
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Hvac', "Entered heat exchanger frost control type #{frost_control_type} not a valid type value. Enter one of #{OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.frostControlTypeValues}")
    end
  end

  hx.setEconomizerLockout(economizer_lockout) unless economizer_lockout.nil?
  hx.setSupplyAirOutletTemperatureControl(supply_air_outlet_temperature_control) unless supply_air_outlet_temperature_control.nil?
  hx.setNominalElectricPower(nominal_electric_power) unless nominal_electric_power.nil?

  if model.version < OpenStudio::VersionString.new('3.8.0')
    hx.setSensibleEffectivenessat100HeatingAirFlow(sensible_heating_100_eff) unless sensible_heating_100_eff.nil?
    hx.setSensibleEffectivenessat75HeatingAirFlow(sensible_heating_75_eff) unless sensible_heating_75_eff.nil?
    hx.setLatentEffectivenessat100HeatingAirFlow(latent_heating_100_eff) unless latent_heating_100_eff.nil?
    hx.setLatentEffectivenessat75HeatingAirFlow(latent_heating_75_eff) unless latent_heating_75_eff.nil?
    hx.setSensibleEffectivenessat100CoolingAirFlow(sensible_cooling_100_eff) unless sensible_cooling_100_eff.nil?
    hx.setSensibleEffectivenessat75CoolingAirFlow(sensible_cooling_75_eff) unless sensible_cooling_75_eff.nil?
    hx.setLatentEffectivenessat100CoolingAirFlow(latent_cooling_100_eff) unless latent_cooling_100_eff.nil?
    hx.setLatentEffectivenessat75CoolingAirFlow(latent_cooling_75_eff) unless latent_cooling_75_eff.nil?
  else
    effectiveness_inputs = Hash.new { |hash, key| hash[key] = {} }
    effectiveness_inputs['Sensible Heating'][0.75] = sensible_heating_75_eff.to_f unless sensible_heating_75_eff.nil?
    effectiveness_inputs['Sensible Heating'][1.0] = sensible_heating_100_eff.to_f unless sensible_heating_100_eff.nil?
    effectiveness_inputs['Latent Heating'][0.75] = latent_heating_75_eff.to_f unless latent_heating_75_eff.nil?
    effectiveness_inputs['Latent Heating'][1.0] = latent_heating_100_eff.to_f unless latent_heating_100_eff.nil?
    effectiveness_inputs['Sensible Cooling'][0.75] = sensible_cooling_75_eff.to_f unless sensible_cooling_75_eff.nil?
    effectiveness_inputs['Sensible Cooling'][1.0] = sensible_cooling_100_eff.to_f unless sensible_cooling_100_eff.nil?
    effectiveness_inputs['Latent Cooling'][0.75] = latent_cooling_75_eff.to_f unless latent_cooling_75_eff.nil?
    effectiveness_inputs['Latent Cooling'][1.0] = latent_cooling_100_eff.to_f unless latent_cooling_100_eff.nil?

    if effectiveness_inputs.values.all?(&:empty?)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.Hvac', 'Creating HX with historical effectiveness curves')
      defaults = true
    else
      defaults = false
    end

    OpenstudioStandards::HVAC.heat_exchanger_air_to_air_set_effectiveness_values(hx, defaults: defaults, values: effectiveness_inputs)
  end

  return hx
end

.create_hx_effectiveness_table(hx, type, values_hash) ⇒ OpenStudio::Model::TableLookup

creates LookupTable objects to define effectiveness of HeatExchangerAirToAirSensibleAndLatent objects

Parameters:

  • hx (OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent)

    OpenStudio HX object to update

  • type (String)

    type of curve to create. one of ‘Sensible Heating’, ‘Latent Heating, ’Sensible Cooling’, ‘Latent Cooling’

  • values_hash (Hash{Float=>Float})

    user_input { flow decimal fraction => effectiveness } decimal fraction pairs, e.g. { 0.75 => 0.81, 1.0 => 0.76 }

Returns:

  • (OpenStudio::Model::TableLookup)

    lookup table object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/openstudio-standards/hvac/components/create.rb', line 103

def self.create_hx_effectiveness_table(hx, type, values_hash)
  # validate inputs
  types = ['Sensible Heating', 'Latent Heating', 'Sensible Cooling', 'Latent Cooling']
  unless types.include? type
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Hvac', "#{__method__} requires effectiveness type as one of #{types}")
    return false
  end

  def self.validate_effectiveness_hash(values_hash)
    values_hash.all? do |key, value|
      key.is_a?(Float) && value.is_a?(Float) && key.between?(0.0, 1.0) && value.between?(0.0, 1.0)
    end
  end

  if !validate_effectiveness_hash(values_hash)
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Hvac', "#{__method__} require values_hash to have keys and values between 0.0 and 1.0: #{values_hash}")
    return false
  end

  # look for existing curve
  type_a = type.split
  method_name = "#{type_a[0].downcase}Effectivenessof#{type_a[1]}AirFlowCurve"

  # use existing independent variable object if found and matches inputs
  iv = nil
  table = OpenStudio::Model::OptionalTableLookup.new
  if hx.send(method_name).is_initialized
    table = hx.send(method_name).get.to_TableLookup
    curve = table.get
    iv_existing = curve.independentVariables.first
    if values_hash.keys.sort == iv_existing.values.sort
      iv = iv_existing
    end
  end

  # otherwise create new independent variable
  if iv.nil?
    iv = OpenStudio::Model::TableIndependentVariable.new(hx.model)
    iv.setName("#{hx.name.get}_#{type.gsub(' ', '')}_IndependentVariable")
    iv.setInterpolationMethod('Linear')
    iv.setExtrapolationMethod('Linear')
    iv.setMinimumValue(0.0)
    iv.setMaximumValue(10.0)
    iv.setUnitType('Dimensionless')
    values_hash.keys.sort.each { |k| iv.addValue(k) }
  end

  # create new lookup table
  t = OpenStudio::Model::TableLookup.new(hx.model)
  t.setName("#{hx.name.get}_#{type.gsub(/ible|ent|ing|\s/, '')}Eff")
  t.addIndependentVariable(iv)
  t.setNormalizationMethod('DivisorOnly')
  t.setMinimumOutput(0.0)
  t.setMaximumOutput(10.0)
  t.setOutputUnitType('Dimensionless')
  values = values_hash.sort.map { |a| a[1] }
  # protect against setting normalization divisor to zero for zero effectiveness
  values[-1].zero? ? t.setNormalizationDivisor(1) : t.setNormalizationDivisor(values[-1])
  values.each { |v| t.addOutputValue(v) }

  # remove curve if found
  table.get.remove if table.is_initialized

  return t
end

.heat_exchanger_air_to_air_set_effectiveness_values(hx, defaults: false, values: nil) ⇒ <OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent>

Applies historical default or user-input effectiveness values to a HeatExchangerAirToAirSensibleAndLatent object

Parameters:

  • hx (<OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent>)

    OpenStudio HX object to update

  • defaults (Boolean) (defaults to: false)

    flag to apply historical default curves

  • values (Hash{String=>Hash{Float=>Float}}) (defaults to: nil)

    user-input effectiveness values, where keys are one of ‘Sensible Heating’, ‘Latent Heating, ’Sensible Cooling’, ‘Latent Cooling’ and value is a hash of { flow decimal fraction => effectivess decimal fraction }, e.g. { 0.75 => 0.81, 1.0 => 0.76 }

Returns:

  • (<OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent>)

    modified OpenStudio HX object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/openstudio-standards/hvac/components/modify.rb', line 15

def self.heat_exchanger_air_to_air_set_effectiveness_values(hx, defaults: false, values: nil)
  if defaults
    hx.assignHistoricalEffectivenessCurves
    if values.nil?
      return hx
    end
  elsif values.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.model.Hvac', "#{__method__} called with defaults=false and no values provided. #{hx.name.get} will not be modified")
    return hx
  end

  values.each do |type, values_hash|
    # ensure values_hash has one value at 100% flow
    unless values_hash.key?(1.0)
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Hvac', "Effectiveness Values for #{type} do not include 100% flow effectivenss. Cannot set effectiveness curves")
      return false
    end

    lookup_table = OpenstudioStandards::HVAC.create_hx_effectiveness_table(hx, type, values_hash)
    type_a = type.split
    hx.send("set#{type_a[0]}Effectivenessat100#{type_a[1]}AirFlow", values_hash[1.0])
    hx.send("set#{type_a[0]}Effectivenessof#{type_a[1]}AirFlowCurve", lookup_table)
  end

  return hx
end

.setpoint_manager_min_max_temperature(spm) ⇒ Hash

Get the min and max setpoint values for a setpoint manager

Parameters:

  • spm (<OpenStudio::Model::SetpointManager>)

    OpenStudio SetpointManager object

Returns:

  • (Hash)

    returns as hash with ‘min_temp’ and ‘max_temp’ in degrees Fahrenheit



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/openstudio-standards/hvac/setpoint_managers/information.rb', line 11

def self.setpoint_manager_min_max_temperature(spm)
  # use @standard to not build each time
  std = Standard.build('90.1-2013') # unused; just to access methods
  # Determine the min and max design temperatures
  loop_op_min_f = nil
  loop_op_max_f = nil
  obj_type = spm.iddObjectType.valueName.to_s
  case obj_type
  when 'OS_SetpointManager_Scheduled'
    sch = spm.to_SetpointManagerScheduled.get.schedule
    if sch.to_ScheduleRuleset.is_initialized
      min_c = OpenstudioStandards::Schedules.schedule_ruleset_get_min_max(sch.to_ScheduleRuleset.get)['min']
      max_c = OpenstudioStandards::Schedules.schedule_ruleset_get_min_max(sch.to_ScheduleRuleset.get)['max']
    elsif sch.to_ScheduleConstant.is_initialized
      min_c = OpenstudioStandards::Schedules.schedule_constant_get_min_max(sch.to_ScheduleConstant.get)['min']
      max_c = OpenstudioStandards::Schedules.schedule_constant_get_min_max(sch.to_ScheduleConstant.get)['max']
    else
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Model', "Could not find min and max values for #{obj_type} Setpoint Manager.")
    end
    loop_op_min_f = OpenStudio.convert(min_c, 'C', 'F').get
    loop_op_max_f = OpenStudio.convert(max_c, 'C', 'F').get
  when 'OS_SetpointManager_SingleZone_Reheat'
    spm = spm.to_SetpointManagerSingleZoneReheat.get
    loop_op_min_f = OpenStudio.convert(spm.minimumSupplyAirTemperature, 'C', 'F').get
    loop_op_max_f = OpenStudio.convert(spm.maximumSupplyAirTemperature, 'C', 'F').get
  when 'OS_SetpointManager_Warmest'
    spm = spm.to_SetpointManagerWarmest.get
    loop_op_min_f = OpenStudio.convert(spm.minimumSetpointTemperature, 'C', 'F').get
    loop_op_max_f = OpenStudio.convert(spm.maximumSetpointTemperature, 'C', 'F').get
  when 'OS_SetpointManager_WarmestTemperatureFlow'
    spm = spm.to_SetpointManagerWarmestTemperatureFlow.get
    loop_op_min_f = OpenStudio.convert(spm.minimumSetpointTemperature, 'C', 'F').get
    loop_op_max_f = OpenStudio.convert(spm.maximumSetpointTemperature, 'C', 'F').get
  when 'OS_SetpointManager_Scheduled_DualSetpoint'
    spm = spm.to_SetpointManagerScheduledDualSetpoint.get
    # Lowest setpoint is minimum of low schedule
    low_sch = spm.lowSetpointSchedule
    unless low_sch.empty?
      low_sch = low_sch.get
      min_c = nil
      if low_sch.to_ScheduleRuleset.is_initialized
        min_c = OpenstudioStandards::Schedules.schedule_ruleset_get_min_max(low_sch.to_ScheduleRuleset.get)['min']
      elsif low_sch.to_ScheduleConstant.is_initialized
        min_c = OpenstudioStandards::Schedules.schedule_constant_get_min_max(low_sch.to_ScheduleConstant.get)['min']
      else
        OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Model', "Could not find min and max values for #{obj_type} Setpoint Manager.")
      end
      loop_op_min_f = OpenStudio.convert(min_c, 'C', 'F').get unless min_c.nil?
    end

    # highest setpoint it maximum of high schedule
    high_sch = spm.highSetpointSchedule
    unless high_sch.empty?
      high_sch = high_sch.get
      max_c = nil
      if high_sch.to_ScheduleRuleset.is_initialized
        max_c = OpenstudioStandards::Schedules.schedule_ruleset_get_min_max(high_sch.to_ScheduleRuleset.get)['max']
      elsif high_sch.to_ScheduleConstant.is_initialized
        max_c = OpenstudioStandards::Schedules.schedule_constant_get_min_max(high_sch.to_ScheduleConstant.get)['max']
      else
        OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Model', "Could not find min and max values for #{obj_type} Setpoint Manager.")
      end
      loop_op_max_f = OpenStudio.convert(max_c, 'C', 'F').get unless max_c.nil?
    end
  when 'OS_SetpointManager_OutdoorAirReset'
    spm = spm.to_SetpointManagerOutdoorAirReset.get
    temp_1_f = OpenStudio.convert(spm.setpointatOutdoorHighTemperature, 'C', 'F').get
    temp_2_f = OpenStudio.convert(spm.setpointatOutdoorLowTemperature, 'C', 'F').get
    loop_op_min_f = [temp_1_f, temp_2_f].min
    loop_op_max_f = [temp_1_f, temp_2_f].max
  when 'OS_SetpointManager_FollowOutdoorAirTemperature'
    spm = spm.to_SetpointManagerFollowOutdoorAirTemperature.get
    loop_op_min_f = OpenStudio.convert(spm.minimumSetpointTemperature, 'C', 'F').get
    loop_op_max_f = OpenStudio.convert(spm.maximumSetpointTemperature, 'C', 'F').get
  else
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.model.Model', "Could not find min and max values for #{obj_type} Setpoint Manager.")
  end

  return { 'min_temp' => loop_op_min_f, 'max_temp' => loop_op_max_f }
end

.unitary_system_min_max_temperature_value(unitary_system) ⇒ Hash

Returns the unitary system minimum and maximum design temperatures

Parameters:

  • unitary_system (<OpenStudio::Model::ModelObject>)

    OpenStudio ModelObject object

Returns:

  • (Hash)

    returns as hash with ‘min_temp’ and ‘max_temp’ in degrees Fahrenheit



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/openstudio-standards/hvac/air_loop/information.rb', line 47

def self.unitary_system_min_max_temperature_value(unitary_system)
  min_temp = nil
  max_temp = nil
  # Get the object type
  obj_type = unitary_system.iddObjectType.valueName.to_s
  case obj_type
  when 'OS_AirLoopHVAC_UnitarySystem'
    unitary_system = unitary_system.to_AirLoopHVACUnitarySystem.get
    if unitary_system.useDOASDXCoolingCoil
      min_temp = OpenStudio.convert(unitary_system.dOASDXCoolingCoilLeavingMinimumAirTemperature, 'C', 'F').get
    end
    if unitary_system.maximumSupplyAirTemperature.is_initialized
      max_temp = OpenStudio.convert(unitary_system.maximumSupplyAirTemperature.get, 'C', 'F').get
    end
  when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir'
    unitary_system = unitary_system.to_AirLoopHVACUnitaryHeatPumpAirToAir.get
    if unitary_system.maximumSupplyAirTemperaturefromSupplementalHeater.is_initialized
      max_temp = OpenStudio.convert(unitary_system.maximumSupplyAirTemperaturefromSupplementalHeater.get, 'C', 'F').get
    end
  when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed'
    unitary_system = unitary_system.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.get
    if unitary_system.maximumSupplyAirTemperaturefromSupplementalHeater.is_initialized
      max_temp = OpenStudio.convert(unitary_system.maximumSupplyAirTemperaturefromSupplementalHeater.get, 'C', 'F').get
    end
  when 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass'
    unitary_system = unitary_system.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get
    min_temp = OpenStudio.convert(unitary_system.minimumOutletAirTemperatureDuringCoolingOperation, 'C', 'F').get
    max_temp = OpenStudio.convert(unitary_system.maximumOutletAirTemperatureDuringHeatingOperation, 'C', 'F').get
  end

  return { 'min_temp' => min_temp, 'max_temp' => max_temp }
end

.validate_effectiveness_hash(values_hash) ⇒ Object



111
112
113
114
115
# File 'lib/openstudio-standards/hvac/components/create.rb', line 111

def self.validate_effectiveness_hash(values_hash)
  values_hash.all? do |key, value|
    key.is_a?(Float) && value.is_a?(Float) && key.between?(0.0, 1.0) && value.between?(0.0, 1.0)
  end
end