Module: BTAP::Resources::HVAC

Defined in:
lib/openstudio-standards/btap/hvac.rb

Overview

This module contains methods that relate to Materials, Constructions and Construction Sets

Defined Under Namespace

Modules: HVACTemplates, Plant, ZoneEquipment

Class Method Summary collapse

Class Method Details

.clear_all_hvac_from_model(model) ⇒ Object



29
30
31
32
33
34
# File 'lib/openstudio-standards/btap/hvac.rb', line 29

def self.clear_all_hvac_from_model(model)
  BTAP::Resources::HVAC::clear_all_zone_equipment_from_model(model)
  BTAP::Resources::HVAC::clear_all_loops(model)
  # Delete outdoor VRF units (not in zone, not in loops)
  model.getAirConditionerVariableRefrigerantFlows.sort.each {|vrf| vrf.remove}
end

.clear_all_loops(model) ⇒ Object



12
13
14
15
# File 'lib/openstudio-standards/btap/hvac.rb', line 12

def self.clear_all_loops(model)
  model.getPlantLoops().each {|loop| loop.remove }
  model.getAirLoopHVACs().each {|loop| loop.remove }
end

.clear_all_zone_equipment_from_model(model) ⇒ Object



23
24
25
26
27
# File 'lib/openstudio-standards/btap/hvac.rb', line 23

def self.clear_all_zone_equipment_from_model(model)
  model.getThermalZones.sort.each do |thermal_zone|
    BTAP::Resources::HVAC::clear_all_zone_equipment_from_zone(thermal_zone)
  end
end

.clear_all_zone_equipment_from_zone(thermal_zone) ⇒ Object



17
18
19
20
21
# File 'lib/openstudio-standards/btap/hvac.rb', line 17

def self.clear_all_zone_equipment_from_zone(thermal_zone)
  thermal_zone.equipment().each do |zone_equipment|
    zone_equipment.remove()
  end
end

.enable_demand_control_ventilation(model, is_enabled) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/openstudio-standards/btap/hvac.rb', line 36

def self.enable_demand_control_ventilation(model,is_enabled)
  log = ""
  log << "ControllerMechanicalVentilation_handle,enabled?\n"
  model.getControllerMechanicalVentilations.sort.each do |item|
    item.setDemandControlledVentilation( is_enabled )
    log << "#{item.handle},#{item.demandControlledVentilation.to_s}\n"
  end
  return log
end

.enable_economizer(model, setEconomizerControlType = "FixedDryBulb", setEconomizerControlActionType = "ModulateFlow", setEconomizerMaximumLimitDryBulbTemperature = 28.0, setEconomizerMaximumLimitEnthalpy = 64000, setEconomizerMaximumLimitDewpointTemperature = 0.0, setEconomizerMinimumLimitDryBulbTemperature = -100.0) ⇒ Object



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
# File 'lib/openstudio-standards/btap/hvac.rb', line 93

def self.enable_economizer(
    model,
    setEconomizerControlType = "FixedDryBulb",
    setEconomizerControlActionType = "ModulateFlow",
    setEconomizerMaximumLimitDryBulbTemperature = 28.0,
    setEconomizerMaximumLimitEnthalpy = 64000,
    setEconomizerMaximumLimitDewpointTemperature = 0.0,
    setEconomizerMinimumLimitDryBulbTemperature = -100.0
  )
  log = ""
  log << "air_loop_handle,economizer_control_type,	economizer_control_action_type,	economizer_maximum_limit_dry_bulb_temperature,	economizer_maximum_limit_enthalpy,	economizer_maximum_limit_dewpoint_temperature,	economizer_minimum_limit_dry_bulb_temperature"

  model.getAirLoopHVACs().each do |air_loop|
    controller_oa = BTAP::Resources::HVAC::Plant::add_economizer(
      model,
      air_loop,
      setEconomizerControlType,
      setEconomizerControlActionType,
      setEconomizerMaximumLimitDryBulbTemperature,
      setEconomizerMaximumLimitEnthalpy,
      setEconomizerMaximumLimitDewpointTemperature,
      setEconomizerMinimumLimitDryBulbTemperature
    )
    if !!controller_oa == controller_oa  and controller_oa == false
      log << "no controller present and not adding any."
    else
      log << "#{air_loop.handle},#{controller_oa.getEconomizerControlType}, #{controller_oa.getEconomizerControlActionType},#{controller_oa.getEconomizerMaximumLimitDryBulbTemperature},#{controller_oa.getEconomizerMaximumLimitEnthalpy},#{controller_oa.getEconomizerMaximumLimitDewpointTemperature},#{controller_oa.getEconomizerMinimumLimitDryBulbTemperature}\n"
    end
  end
  return log
end

.enable_erv(model, autosizeNominalSupplyAirFlowRate = true, setNominalSupplyAirFlowRate = nil, setHeatExchangerType = 'Plate', setSensibleEffectivenessat100CoolingAirFlow = 0.76, setSensibleEffectivenessat75CoolingAirFlow = 0.81, setLatentEffectiveness100Cooling = 0.68, setLatentEffectiveness75Cooling = 0.73, setSensibleEffectiveness100Heating = 0.76, setSensibleEffectiveness75Heating = 0.81, setLatentEffectiveness100Heating = 0.68, setLatentEffectiveness75Heating = 0.73, setSupplyAirOutletTemperatureControl = true, setFrostControlType = 'None', setThresholdTemperature = 1.7, setInitialDefrostTimeFraction = 0, nominal_electric_power = nil, setEconomizerLockout = true) ⇒ Object



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/btap/hvac.rb', line 46

def self.enable_erv(
    model,
    autosizeNominalSupplyAirFlowRate = true,
    setNominalSupplyAirFlowRate = nil,
    setHeatExchangerType = 'Plate', # 'Rotary' or 'Plate'
    setSensibleEffectivenessat100CoolingAirFlow = 0.76,
    setSensibleEffectivenessat75CoolingAirFlow  = 0.81,
    setLatentEffectiveness100Cooling = 0.68,
    setLatentEffectiveness75Cooling = 0.73,
    setSensibleEffectiveness100Heating = 0.76,
    setSensibleEffectiveness75Heating = 0.81,
    setLatentEffectiveness100Heating = 0.68,
    setLatentEffectiveness75Heating = 0.73,
    setSupplyAirOutletTemperatureControl = true,
    setFrostControlType = 'None', # 'None', 'ExhaustAirRecirculation','ExhaustOnly','MinimumExhaustTemperature'
    setThresholdTemperature  = 1.7,
    setInitialDefrostTimeFraction = 0,
    nominal_electric_power = nil,
    setEconomizerLockout = true
  )
  erv_array = Array.new()
  erv_array << model.getAirLoopHVACs().each do |air_loop|
    BTAP::Resources::HVAC::Plant::add_erv(
      model,
      air_loop,
      autosizeNominalSupplyAirFlowRate,
      setNominalSupplyAirFlowRate,
      setHeatExchangerType, # 'Rotary' or 'Plate'
      setSensibleEffectivenessat100CoolingAirFlow,
      setSensibleEffectivenessat75CoolingAirFlow,
      setLatentEffectiveness100Cooling,
      setLatentEffectiveness75Cooling,
      setSensibleEffectiveness100Heating,
      setSensibleEffectiveness75Heating,
      setLatentEffectiveness100Heating,
      setLatentEffectiveness75Heating,
      setSupplyAirOutletTemperatureControl,
      setFrostControlType, # 'None', 'ExhaustAirRecirculation','ExhaustOnly','MinimumExhaustTemperature'
      setThresholdTemperature,
      setInitialDefrostTimeFraction,
      nominal_electric_power,
      setEconomizerLockout)
  end
  return erv_array
end