Class: Standard Abstract

Inherits:
Object
  • Object
show all
Includes:
CoilDX, CoolingTower, Fan, PrototypeFan, Pump
Defined in:
lib/openstudio-standards/standards/standard.rb,
lib/openstudio-standards/standards/Standards.Model.rb,
lib/openstudio-standards/standards/Standards.Space.rb,
lib/openstudio-standards/standards/Standards.Surface.rb,
lib/openstudio-standards/standards/Standards.FanOnOff.rb,
lib/openstudio-standards/standards/Standards.PlantLoop.rb,
lib/openstudio-standards/standards/Standards.SpaceType.rb,
lib/openstudio-standards/standards/Standards.SubSurface.rb,
lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb,
lib/openstudio-standards/standards/Standards.FluidCooler.rb,
lib/openstudio-standards/standards/Standards.ThermalZone.rb,
lib/openstudio-standards/standards/Standards.PlanarSurface.rb,
lib/openstudio-standards/standards/Standards.BoilerHotWater.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingGas.rb,
lib/openstudio-standards/standards/Standards.FanZoneExhaust.rb,
lib/openstudio-standards/standards/Standards.ScheduleRuleset.rb,
lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb,
lib/openstudio-standards/standards/Standards.FanConstantVolume.rb,
lib/openstudio-standards/standards/Standards.FanVariableVolume.rb,
lib/openstudio-standards/standards/Standards.PumpConstantSpeed.rb,
lib/openstudio-standards/standards/Standards.PumpVariableSpeed.rb,
lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb,
lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb,
lib/openstudio-standards/standards/Standards.ServiceWaterHeating.rb,
lib/openstudio-standards/standards/Standards.CoolingTowerTwoSpeed.rb,
lib/openstudio-standards/standards/Standards.HeatExchangerSensLat.rb,
lib/openstudio-standards/standards/Standards.CoilCoolingDXTwoSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilCoolingDXMultiSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingDXMultiSpeed.rb,
lib/openstudio-standards/standards/Standards.CoolingTowerSingleSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanOnOff.rb,
lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingGasMultiStage.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb,
lib/openstudio-standards/standards/Standards.CoolingTowerVariableSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.hvac.rb,
lib/openstudio-standards/standards/Standards.HeaderedPumpsConstantSpeed.rb,
lib/openstudio-standards/standards/Standards.HeaderedPumpsVariableSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoolingTower.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.SizingSystem.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.refrigeration.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.BoilerHotWater.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilHeatingGas.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanZoneExhaust.rb,
lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.elevators.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilCoolingWater.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilHeatingWater.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanConstantVolume.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanVariableVolume.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.PumpVariableSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.transformers.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilHeatingElectric.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.ControllerWaterCoil.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilCoolingDXTwoSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.exterior_lights.rb,
lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.radiant_system_controls.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CentralAirSourceHeatPump.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilCoolingDXSingleSpeed.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilHeatingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilCoolingWaterToAirHeatPumpEquationFit.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingWaterToAirHeatPumpEquationFit.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.AirTerminalSingleDuctVAVReheat.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.AirConditionerVariableRefrigerantFlow.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.HeatExchangerAirToAirSensibleAndLatent.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilCoolingWaterToAirHeatPumpEquationFit.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.CoilHeatingWaterToAirHeatPumpEquationFit.rb

Overview

This class is abstract.

This abstract class holds generic methods that many energy standards would commonly use. Many of the methods in this class apply efficiency values from the OpenStudio-Standards spreadsheet. If a method in this class is redefined by a subclass, the implementation in the subclass is used.

Direct Known Subclasses

ASHRAE901, ASHRAE901PRM, CBES, DEER, ICCIECC, NECB2011, OEESC

Constant Summary collapse

STANDARDS_LIST =

A list of available Standards subclasses that can be created using the Standard.build() method.

{}

Instance Attribute Summary collapse

Model collapse

Space collapse

Surface collapse

PlantLoop collapse

SpaceType collapse

SubSurface collapse

AirLoopHVAC collapse

FluidCooler collapse

ThermalZone collapse

PlanarSurface collapse

BoilerHotWater collapse

CoilHeatingGas collapse

ScheduleRuleset collapse

WaterHeaterMixed collapse

ZoneHVACComponent collapse

ChillerElectricEIR collapse

HeatExchangerSensLat collapse

CoilCoolingDXMultiSpeed collapse

CoilHeatingDXMultiSpeed collapse

CoilHeatingGasMultiStage collapse

utilities collapse

Cooling Tower collapse

Sizing System collapse

hvac_systems collapse

refrigeration collapse

Boiler Hot Water collapse

AirTerminalSingleDuctVAVReheat collapse

CoilCoolingWater collapse

CoilHeatingWater collapse

CoilHeatingElectric collapse

ControllerWaterCoil collapse

CoilCoolingDXTwoSpeed collapse

AirTerminalSingleDuctParallelPIUReheat collapse

Central Air Source Heat Pump collapse

CoilCoolingDXSingleSpeed collapse

CoilHeatingDXSingleSpeed collapse

CoilCoolingWaterToAirHeatPumpEquationFit collapse

CoilHeatingWaterToAirHeatPumpEquationFit collapse

AirConditionerVariableRefrigerantFlow collapse

HeatExchangerAirToAirSensibleAndLatent collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PrototypeFan

apply_base_fan_variables, #create_fan_by_name, #get_fan_from_standards, #lookup_fan_curve_coefficients_from_json, #prototype_fan_apply_prototype_fan_efficiency

Methods included from CoilDX

#coil_dx_find_search_criteria, #coil_dx_heat_pump?, #coil_dx_heating_type, #coil_dx_subcategory

Methods included from CoolingTower

#cooling_tower_apply_minimum_power_per_flow, #cooling_tower_apply_minimum_power_per_flow_gpm_limit

Methods included from Pump

#pump_apply_prm_pressure_rise_and_motor_efficiency, #pump_apply_standard_minimum_motor_efficiency, #pump_brake_horsepower, #pump_motor_horsepower, #pump_pumppower, #pump_rated_w_per_gpm, #pump_standard_minimum_motor_efficiency_and_size

Methods included from Fan

#fan_adjust_pressure_rise_to_meet_fan_power, #fan_apply_standard_minimum_motor_efficiency, #fan_baseline_impeller_efficiency, #fan_brake_horsepower, #fan_change_impeller_efficiency, #fan_change_motor_efficiency, #fan_design_air_flow, #fan_fanpower, #fan_motor_horsepower, #fan_rated_w_per_cfm, #fan_small_fan?, #fan_standard_minimum_motor_efficiency_and_size

Constructor Details

#initializeStandard

set up template class variable.



44
45
46
# File 'lib/openstudio-standards/standards/standard.rb', line 44

def initialize
  super()
end

Instance Attribute Details

#space_multiplier_mapObject

Returns the value of attribute space_multiplier_map.



5
6
7
# File 'lib/openstudio-standards/standards/Standards.Model.rb', line 5

def space_multiplier_map
  @space_multiplier_map
end

#standards_dataObject

Returns the value of attribute standards_data.



7
8
9
# File 'lib/openstudio-standards/standards/standard.rb', line 7

def standards_data
  @standards_data
end

#templateObject (readonly)

Returns the value of attribute template.



8
9
10
# File 'lib/openstudio-standards/standards/standard.rb', line 8

def template
  @template
end

Class Method Details

.build(name) ⇒ Object

Create an instance of a Standard by passing it’s name

Examples:

Create a new Standard object by name

standard = Standard.build('NECB2011')

Parameters:

  • name (String)

    the name of the Standard to build. valid choices are: DOE Pre-1980, DOE 1980-2004, 90.1-2004, 90.1-2007, 90.1-2010, 90.1-2013, 90.1-2016, 90.1-2019, NREL ZNE Ready 2017, NECB2011



34
35
36
37
38
39
40
41
# File 'lib/openstudio-standards/standards/standard.rb', line 34

def self.build(name)
  if STANDARDS_LIST[name].nil?
    raise "ERROR: Did not find a class called '#{name}' to create in #{JSON.pretty_generate(STANDARDS_LIST)}"
  end

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.standard', "Using OpenStudio Standards version #{OpenstudioStandards::VERSION} with template #{name}.")
  return STANDARDS_LIST[name].new
end

.register_standard(name) ⇒ Object

Add the standard to the STANDARDS_LIST.



22
23
24
# File 'lib/openstudio-standards/standards/standard.rb', line 22

def self.register_standard(name)
  STANDARDS_LIST[name] = self
end

Instance Method Details

#adjust_sizing_system(air_loop_hvac, dsgn_temps, type_of_load_sizing: 'Sensible', min_sys_airflow_ratio: 0.3, sizing_option: 'Coincident') ⇒ OpenStudio::Model::SizingSystem

Prototype SizingSystem object

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • dsgn_temps (Hash)

    a hash of design temperature lookups from standard_design_sizing_temperatures

Returns:

  • (OpenStudio::Model::SizingSystem)

    sizing system object



9
10
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
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.SizingSystem.rb', line 9

def adjust_sizing_system(air_loop_hvac,
                         dsgn_temps,
                         type_of_load_sizing: 'Sensible',
                         min_sys_airflow_ratio: 0.3,
                         sizing_option: 'Coincident')

  # adjust sizing system defaults
  sizing_system = air_loop_hvac.sizingSystem
  sizing_system.setTypeofLoadtoSizeOn(type_of_load_sizing)
  sizing_system.autosizeDesignOutdoorAirFlowRate
  sizing_system.setPreheatDesignTemperature(dsgn_temps['prehtg_dsgn_sup_air_temp_c'])
  sizing_system.setPrecoolDesignTemperature(dsgn_temps['preclg_dsgn_sup_air_temp_c'])
  sizing_system.setCentralCoolingDesignSupplyAirTemperature(dsgn_temps['clg_dsgn_sup_air_temp_c'])
  sizing_system.setCentralHeatingDesignSupplyAirTemperature(dsgn_temps['htg_dsgn_sup_air_temp_c'])
  sizing_system.setPreheatDesignHumidityRatio(0.008)
  sizing_system.setPrecoolDesignHumidityRatio(0.008)
  sizing_system.setCentralCoolingDesignSupplyAirHumidityRatio(0.0085)
  sizing_system.setCentralHeatingDesignSupplyAirHumidityRatio(0.0080)
  if air_loop_hvac.model.version < OpenStudio::VersionString.new('2.7.0')
    sizing_system.setMinimumSystemAirFlowRatio(min_sys_airflow_ratio)
  else
    sizing_system.setCentralHeatingMaximumSystemAirFlowRatio(min_sys_airflow_ratio)
  end
  sizing_system.setSizingOption(sizing_option)
  sizing_system.setAllOutdoorAirinCooling(false)
  sizing_system.setAllOutdoorAirinHeating(false)
  sizing_system.setSystemOutdoorAirMethod('ZoneSum')
  sizing_system.setCoolingDesignAirFlowMethod('DesignDay')
  sizing_system.setHeatingDesignAirFlowMethod('DesignDay')

  return sizing_system
end

#afue_to_thermal_eff(afue) ⇒ Double

A helper method to convert from AFUE to thermal efficiency

Parameters:

  • afue (Double)

    Annual Fuel Utilization Efficiency

Returns:

  • (Double)

    Thermal efficiency (%)



407
408
409
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb', line 407

def afue_to_thermal_eff(afue)
  return afue
end

#air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, min_occ_pct = 0.05, occ_sch = nil) ⇒ Boolean

Add a motorized damper by modifying the OA schedule to require zero OA during unoccupied hours. This means that even during morning warmup or nightcyling, no OA will be brought into the building, lowering heating/cooling load. If no occupancy schedule is supplied, one will be created. In this case, occupied is defined as the total percent occupancy for the loop for all zones served. If the OA schedule is already other than Always On, will assume that this schedule reflects a motorized OA damper and not change.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • min_occ_pct (Double) (defaults to: 0.05)

    the fractional value below which the system will be considered unoccupied.

  • occ_sch (OpenStudio::Model::Schedule) (defaults to: nil)

    the occupancy schedule. If not supplied, one will be created based on the supplied occupancy threshold.

Returns:

  • (Boolean)

    returns true if successful, false if not



2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2834

def air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, min_occ_pct = 0.05, occ_sch = nil)
  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir

  # Get the current min OA schedule and do nothing
  # if it is already set to something other than Always On
  if oa_control.minimumOutdoorAirSchedule.is_initialized
    min_oa_sch = oa_control.minimumOutdoorAirSchedule.get
    unless min_oa_sch == air_loop_hvac.model.alwaysOnDiscreteSchedule
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Min OA damper schedule is already set to #{min_oa_sch.name}, assume this includes correct motorized OA damper control.")
      return true
    end
  end

  # Get the airloop occupancy schedule if none supplied
  # or if the supplied availability schedule is Always On, implying
  # that the availability schedule does not reflect occupancy.
  if occ_sch.nil? || occ_sch == air_loop_hvac.model.alwaysOnDiscreteSchedule
    occ_sch = air_loop_hvac_get_occupancy_schedule(air_loop_hvac, occupied_percentage_threshold: min_occ_pct)
    flh = OpenstudioStandards::Schedules.schedule_get_equivalent_full_load_hours(occ_sch)
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Annual occupied hours = #{flh.round} hr/yr, assuming a #{min_occ_pct} occupancy threshold.  This schedule will be used to close OA damper during unoccupied hours.")
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Setting motorized OA damper schedule to #{occ_sch.name}.")
  end

  # Set the minimum OA schedule to follow occupancy
  oa_control.setMinimumOutdoorAirSchedule(occ_sch)

  return true
end

#air_loop_hvac_adjust_minimum_vav_damper_positions(air_loop_hvac) ⇒ Boolean

TODO:

Add exception logic for systems serving parking garage, warehouse, or multifamily

Adjust minimum VAV damper positions and set minimum design system outdoor air flow

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if required, false if not



1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1997

def air_loop_hvac_adjust_minimum_vav_damper_positions(air_loop_hvac)
  # Do not apply the adjustment to some of the system in
  # the hospital and outpatient which have their minimum
  # damper position determined based on AIA 2001 ventilation
  # requirements
  if (@instvarbuilding_type == 'Hospital' && (air_loop_hvac.name.to_s.include?('VAV_ER') || air_loop_hvac.name.to_s.include?('VAV_ICU') ||
                                              air_loop_hvac.name.to_s.include?('VAV_OR') || air_loop_hvac.name.to_s.include?('VAV_LABS') ||
                                              air_loop_hvac.name.to_s.include?('VAV_PATRMS'))) ||
     (@instvarbuilding_type == 'Outpatient' && air_loop_hvac.name.to_s.include?('Outpatient F1'))

    return true
  end

  # Total uncorrected outdoor airflow rate
  v_ou = 0.0
  air_loop_hvac.thermalZones.each do |zone|
    # Vou is the system uncorrected outdoor airflow:
    # Zone airflow is multiplied by the zone multiplier
    v_ou += OpenstudioStandards::ThermalZone.thermal_zone_get_outdoor_airflow_rate(zone) * zone.multiplier.to_f
  end

  v_ou_cfm = OpenStudio.convert(v_ou, 'm^3/s', 'cfm').get

  # System primary airflow rate (whether autosized or hard-sized)
  v_ps = 0.0

  v_ps = if air_loop_hvac.designSupplyAirFlowRate.is_initialized
           air_loop_hvac.designSupplyAirFlowRate.get
         elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
           air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
         end
  v_ps_cfm = OpenStudio.convert(v_ps, 'm^3/s', 'cfm').get

  # Average outdoor air fraction
  x_s = v_ou / v_ps

  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: v_ou = #{v_ou_cfm.round} cfm, v_ps = #{v_ps_cfm.round} cfm, x_s = #{x_s.round(2)}.")

  # Determine the zone ventilation effectiveness
  # for every zone on the system.
  # When ventilation effectiveness is too low,
  # increase the minimum damper position.
  e_vzs = []
  e_vzs_adj = []
  num_zones_adj = 0

  # Retrieve the sum of the zone minimum primary airflow
  if air_loop_hvac.model.version < OpenStudio::VersionString.new('3.6.0')
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', 'Required AirLoopHVAC method .autosizedSumMinimumHeatingAirFlowRates is not available in pre-OpenStudio 3.6.0 versions. Use a more recent version of OpenStudio.')
  elsif air_loop_hvac.autosizedSumMinimumHeatingAirFlowRates.is_initialized
    vpz_min_sum = air_loop_hvac.autosizedSumMinimumHeatingAirFlowRates.get
  else
    OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', "autosizedSumMinimumHeatingAirFlowRates is not available for air loop #{air_loop_hvac}.")
  end

  air_loop_hvac.thermalZones.sort.each do |zone|
    # Breathing zone airflow rate
    v_bz = OpenstudioStandards::ThermalZone.thermal_zone_get_outdoor_airflow_rate(zone)

    # Zone air distribution, assumed 1 per PNNL
    e_z = 1.0

    # Zone airflow rate
    v_oz = v_bz / e_z

    # Primary design airflow rate
    # max of heating and cooling
    # design air flow rates
    v_pz = 0.0

    # error if zone autosized methods are not available
    if air_loop_hvac.model.version < OpenStudio::VersionString.new('3.6.0')
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', 'Required ThermalZone method .autosizedCoolingDesignAirFlowRate and .autosizedHeatingDesignAirFlowRate are not available in pre-OpenStudio 3.6.0 versions. Use a more recent version of OpenStudio.')
    end

    clg_dsn_flow = zone.autosizedCoolingDesignAirFlowRate
    if clg_dsn_flow.is_initialized
      clg_dsn_flow = clg_dsn_flow.get
      if clg_dsn_flow > v_pz
        v_pz = clg_dsn_flow
      end
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: #{zone.name}, zone CoolingDesignAirFlowRate could not be found.")
    end
    htg_dsn_flow = zone.autosizedHeatingDesignAirFlowRate
    if htg_dsn_flow.is_initialized
      htg_dsn_flow = htg_dsn_flow.get
      if htg_dsn_flow > v_pz
        v_pz = htg_dsn_flow
      end
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: #{zone.name}, zone HeatingDesignAirFlowRate could not be found.")
    end

    if v_pz.zero?
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: #{zone.name}, neither the CoolingDesignAirFlowRate nor the HeatingDesignAirFlowRate could be found. The primary design air flow rate, v_pz, is zero. The zone may be missing a DesignSpecificationOutdoorAir object, or both heating and cooling load may be zero.")
    end

    # Get the minimum damper position
    mdp_term = 1.0
    min_zn_flow = 0.0
    zone.equipment.each do |equip|
      if equip.to_AirTerminalSingleDuctVAVHeatAndCoolNoReheat.is_initialized
        term = equip.to_AirTerminalSingleDuctVAVHeatAndCoolNoReheat.get
        mdp_term = term.zoneMinimumAirFlowFraction
      elsif equip.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.is_initialized
        term = equip.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.get
        mdp_term = term.zoneMinimumAirFlowFraction
      elsif equip.to_AirTerminalSingleDuctVAVNoReheat.is_initialized
        term = equip.to_AirTerminalSingleDuctVAVNoReheat.get
        if term.constantMinimumAirFlowFraction.is_initialized
          mdp_term = term.constantMinimumAirFlowFraction.get
        end
      elsif equip.to_AirTerminalSingleDuctVAVReheat.is_initialized
        term = equip.to_AirTerminalSingleDuctVAVReheat.get
        if term.constantMinimumAirFlowFraction.is_initialized
          mdp_term = term.constantMinimumAirFlowFraction.get
        end
        if term.fixedMinimumAirFlowRate.is_initialized
          min_zn_flow = term.fixedMinimumAirFlowRate.get
        end
      end
    end

    # Zone ventilation efficiency calculation is computed
    # on a per zone basis, the zone primary airflow is
    # adjusted to removed the zone multiplier
    v_pz /= zone.multiplier.to_f

    # For VAV Reheat terminals, min flow is greater of mdp
    # and min flow rate / design flow rate.
    mdp = mdp_term
    mdp_oa = min_zn_flow / v_pz
    if min_zn_flow > 0.0
      mdp = [mdp_term, mdp_oa].max.round(2)
    end

    # Zone minimum discharge airflow rate
    v_dz = v_pz * mdp

    # Zone discharge air fraction
    z_d = v_dz.zero? || v_oz.zero? ? 0.0 : v_oz / v_dz

    # Zone ventilation effectiveness
    e_vz = 1.0 + x_s - z_d

    # Store the ventilation effectiveness
    e_vzs << e_vz

    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Zone #{zone.name} v_oz = #{v_oz.round(2)} m^3/s, v_pz = #{v_pz.round(2)} m^3/s, v_dz = #{v_dz.round(2)}, z_d = #{z_d.round(2)}.")

    # Check the ventilation effectiveness against
    # the minimum limit per PNNL and increase
    # as necessary.
    if e_vz < 0.6

      # Adjusted discharge air fraction
      z_d_adj = 1.0 + x_s - 0.6

      # Adjusted min discharge airflow rate
      v_dz_adj = v_oz / z_d_adj

      # Adjusted minimum damper position
      # default to 0.2 if either values are zero
      mdp_adj = v_dz_adj.zero? || v_pz.zero? ? 0.2 : v_dz_adj / v_pz

      # Don't allow values > 1
      if mdp_adj > 1.0
        mdp_adj = 1.0
      end

      # Zone ventilation effectiveness
      e_vz_adj = 1.0 + x_s - z_d_adj

      # Store the ventilation effectiveness
      e_vzs_adj << e_vz_adj
      # Round the minimum damper position to avoid nondeterministic results
      # at the ~13th decimal place, which can cause regression errors
      mdp_adj = mdp_adj.round(11)

      # Set the adjusted minimum damper position
      air_loop_hvac_set_minimum_damper_position(zone, mdp_adj)

      num_zones_adj += 1

      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Zone #{zone.name} has a ventilation effectiveness of #{e_vz.round(2)}.  Increasing to #{e_vz_adj.round(2)} by increasing minimum damper position from #{mdp.round(2)} to #{mdp_adj.round(2)}.")

    else
      # Store the unadjusted value
      e_vzs_adj << e_vz
    end
  end

  # Min system zone ventilation effectiveness
  e_v = e_vzs.min

  # Total system outdoor intake flow rate
  v_ot = v_ou / e_v
  v_ot_cfm = OpenStudio.convert(v_ot, 'm^3/s', 'cfm').get

  # Min system zone ventilation effectiveness
  e_v_adj = e_vzs_adj.min

  # Total system outdoor intake flow rate
  v_ot_adj = v_ou / e_v_adj
  v_ot_adj_cfm = OpenStudio.convert(v_ot_adj, 'm^3/s', 'cfm').get

  # Adjust minimum damper position if the sum of maximum
  # zone airflow are lower than the calculated system
  # outdoor air intake
  if v_ot_adj > vpz_min_sum && v_ot_adj > 0

    # Retrieve the sum of the zone maximum air flow rates
    if air_loop_hvac.model.version < OpenStudio::VersionString.new('3.6.0')
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', 'Required AirLoopHVAC method .autosizedSumAirTerminalMaxAirFlowRate is not available in pre-OpenStudio 3.6.0 versions. Use a more recent version of OpenStudio.')
    elsif air_loop_hvac.autosizedSumAirTerminalMaxAirFlowRate.is_initialized
      v_max = air_loop_hvac.autosizedSumAirTerminalMaxAirFlowRate.get
    else
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', "autosizedSumAirTerminalMaxAirFlowRate is not available for air loop #{air_loop_hvac}.")
    end

    mdp_adj = [v_ot_adj / v_max, 1].min
    air_loop_hvac.thermalZones.sort.each do |zone|
      air_loop_hvac_set_minimum_damper_position(zone, mdp_adj)
    end
  end

  # Report out the results of the multizone calculations
  if num_zones_adj > 0
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: the multizone outdoor air calculation method was applied.  A simple summation of the zone outdoor air requirements gives a value of #{v_ou_cfm.round} cfm.  Applying the multizone method gives a value of #{v_ot_cfm.round} cfm, with an original system ventilation effectiveness of #{e_v.round(2)}.  After increasing the minimum damper position in #{num_zones_adj} critical zones, the resulting requirement is #{v_ot_adj_cfm.round} cfm with a system ventilation effectiveness of #{e_v_adj.round(2)}.")
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: the multizone outdoor air calculation method was applied.  A simple summation of the zone requirements gives a value of #{v_ou_cfm.round} cfm.  However, applying the multizone method requires #{v_ot_adj_cfm.round} cfm based on the ventilation effectiveness of the system.")
  end

  # Hard-size the sizing:system
  # object with the calculated min OA flow rate
  sizing_system = air_loop_hvac.sizingSystem
  sizing_system.setDesignOutdoorAirFlowRate(v_ot_adj)
  sizing_system.setSystemOutdoorAirMethod('ZoneSum')

  return true
end

#air_loop_hvac_adjust_minimum_vav_damper_positions_outpatient(air_loop_hvac) ⇒ Boolean

For critical zones of Outpatient, if the minimum airflow rate required by the accreditation standard (AIA 2001) is significantly less than the autosized peak design airflow in any of the three climate zones (Houston, Baltimore and Burlington), the minimum airflow fraction of the terminal units is reduced to the value: “required minimum airflow rate / autosized peak design flow” Reference: <Achieving the 30% Goal: Energy and Cost Savings Analysis of ASHRAE Standard 90.1-2010> Page109-111 For implementation purpose, since it is time-consuming to perform autosizing in three climate zones, just use the results of the current climate zone

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2274

def air_loop_hvac_adjust_minimum_vav_damper_positions_outpatient(air_loop_hvac)
  air_loop_hvac.model.getSpaces.sort.each do |space|
    zone = space.thermalZone.get
    sizing_zone = zone.sizingZone
    space_area = space.floorArea
    next if sizing_zone.coolingDesignAirFlowMethod == 'DesignDay'

    if sizing_zone.coolingDesignAirFlowMethod == 'DesignDayWithLimit'
      minimum_airflow_per_zone_floor_area = sizing_zone.coolingMinimumAirFlowperZoneFloorArea
      minimum_airflow_per_zone = minimum_airflow_per_zone_floor_area * space_area
      # get the autosized maximum air flow of the VAV terminal
      zone.equipment.each do |equip|
        if equip.to_AirTerminalSingleDuctVAVReheat.is_initialized
          vav_terminal = equip.to_AirTerminalSingleDuctVAVReheat.get
          rated_maximum_flow_rate = vav_terminal.autosizedMaximumAirFlowRate.get
          # compare the VAV autosized maximum airflow with the minimum airflow rate required by the accreditation standard
          ratio = minimum_airflow_per_zone / rated_maximum_flow_rate

          # round to avoid results variances in sizing runs
          ratio = ratio.round(11)

          if ratio >= 0.95
            vav_terminal.setConstantMinimumAirFlowFraction(1)
          elsif ratio < 0.95
            vav_terminal.setConstantMinimumAirFlowFraction(ratio)
          end
        end
      end
    end
  end
  return true
end

#air_loop_hvac_allowable_system_brake_horsepower(air_loop_hvac) ⇒ Double

Determine the allowable fan system brake horsepower Per Table 6.5.3.1.1A

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Double)

    allowable fan system brake horsepower, in units of horsepower



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 487

def air_loop_hvac_allowable_system_brake_horsepower(air_loop_hvac)
  # Get design supply air flow rate (whether autosized or hard-sized)
  dsn_air_flow_m3_per_s = 0
  dsn_air_flow_cfm = 0
  if air_loop_hvac.designSupplyAirFlowRate.is_initialized
    dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
    dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
  elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
    dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
    dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
  end

  # Get the fan limitation pressure drop adjustment bhp
  fan_pwr_adjustment_bhp = air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower(air_loop_hvac)

  # Determine the number of zones the system serves
  num_zones_served = air_loop_hvac.thermalZones.size

  # Get the supply air fan and determine whether VAV or CAV system.
  # Assume that supply air fan is fan closest to the demand outlet node.
  # The fan may be inside of a piece of unitary equipment.
  fan_pwr_limit_type = nil
  air_loop_hvac.supplyComponents.reverse.each do |comp|
    if comp.to_FanConstantVolume.is_initialized || comp.to_FanOnOff.is_initialized
      fan_pwr_limit_type = 'constant volume'
    elsif comp.to_FanVariableVolume.is_initialized
      fan_pwr_limit_type = 'variable volume'
    elsif comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.is_initialized
      fan = comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get.supplyAirFan
      if fan.to_FanConstantVolume.is_initialized || fan.to_FanOnOff.is_initialized
        fan_pwr_limit_type = 'constant volume'
      elsif fan.to_FanVariableVolume.is_initialized
        fan_pwr_limit_type = 'variable volume'
      end
    elsif comp.to_AirLoopHVACUnitarySystem.is_initialized
      fan = comp.to_AirLoopHVACUnitarySystem.get.supplyFan.get
      if fan.to_FanConstantVolume.is_initialized || fan.to_FanOnOff.is_initialized
        fan_pwr_limit_type = 'constant volume'
      elsif fan.to_FanVariableVolume.is_initialized
        fan_pwr_limit_type = 'variable volume'
      end
    end
  end

  # For 90.1-2010, single-zone VAV systems use the
  # constant volume limitation per 6.5.3.1.1
  if template == 'ASHRAE 90.1-2010' && fan_pwr_limit_type == 'variable volume' && num_zones_served == 1
    fan_pwr_limit_type = 'constant volume'
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Using the constant volume limitation because single-zone VAV system.")
  end

  # Calculate the Allowable Fan System brake horsepower per Table G3.1.2.9
  allowable_fan_bhp = 0
  if fan_pwr_limit_type == 'constant volume'
    if dsn_air_flow_cfm > 0
      allowable_fan_bhp = (dsn_air_flow_cfm * 0.00094) + fan_pwr_adjustment_bhp
    else
      allowable_fan_bhp = 0.00094
    end
  elsif fan_pwr_limit_type == 'variable volume'
    if dsn_air_flow_cfm > 0
      allowable_fan_bhp = (dsn_air_flow_cfm * 0.0013) + fan_pwr_adjustment_bhp
    else
      allowable_fan_bhp = 0.0013
    end
  end
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Allowable brake horsepower = #{allowable_fan_bhp.round(2)}HP based on #{dsn_air_flow_cfm.round} cfm and #{fan_pwr_adjustment_bhp.round(2)} bhp of adjustment.")

  # Calculate and report the total area for debugging/testing
  floor_area_served_m2 = air_loop_hvac_floor_area_served(air_loop_hvac)

  if floor_area_served_m2.zero?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "AirLoopHVAC #{air_loop_hvac.name} serves zero floor area. Check that it has thermal zones attached to it, and that they have non-zero floor area'.")
    return allowable_fan_bhp
  end

  floor_area_served_ft2 = OpenStudio.convert(floor_area_served_m2, 'm^2', 'ft^2').get
  cfm_per_ft2 = dsn_air_flow_cfm / floor_area_served_ft2

  if allowable_fan_bhp.zero?
    cfm_per_hp = 0
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "AirLoopHVAC #{air_loop_hvac.name} has zero allowable fan bhp, probably due to zero design air flow cfm'.")
  else
    cfm_per_hp = dsn_air_flow_cfm / allowable_fan_bhp
  end
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: area served = #{floor_area_served_ft2.round} ft^2.")
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: flow per area = #{cfm_per_ft2.round} cfm/ft^2.")
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: flow per hp = #{cfm_per_hp.round} cfm/hp.")

  return allowable_fan_bhp
end

#air_loop_hvac_apply_baseline_fan_pressure_rise(air_loop_hvac) ⇒ Boolean

Set the fan pressure rises that will result in the system hitting the baseline allowable fan power

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 668

def air_loop_hvac_apply_baseline_fan_pressure_rise(air_loop_hvac)
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name}-Setting #{template} baseline fan power.")

  # Get the total system bhp from the proposed system, including terminal fans
  proposed_sys_bhp = air_loop_hvac_system_fan_brake_horsepower(air_loop_hvac, true)

  # Get the allowable fan brake horsepower
  allowable_fan_bhp = air_loop_hvac_allowable_system_brake_horsepower(air_loop_hvac)

  # Get the fan power limitation from proposed system
  fan_pwr_adjustment_bhp = air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower(air_loop_hvac)

  # Subtract the fan power adjustment
  allowable_fan_bhp -= fan_pwr_adjustment_bhp

  # Get all fans
  fans = air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac)

  # @todo improve description
  # Loop through the fans, changing the pressure rise
  # until the fan bhp is the same percentage of the baseline allowable bhp
  # as it was on the proposed system.
  fans.each do |fan|
    # @todo Yixing Check the model of the Fan Coil Unit
    next if fan.name.to_s.include?('Fan Coil fan')
    next if fan.name.to_s.include?('UnitHeater Fan')

    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', fan.name.to_s)

    # Get the bhp of the fan on the proposed system
    proposed_fan_bhp = fan_brake_horsepower(fan)

    # Get the bhp of the fan on the proposed system
    proposed_fan_bhp_frac = proposed_fan_bhp / proposed_sys_bhp

    # Determine the target bhp of the fan on the baseline system
    baseline_fan_bhp = proposed_fan_bhp_frac * allowable_fan_bhp
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "* #{baseline_fan_bhp.round(1)} bhp = Baseline fan brake horsepower.")

    # Set the baseline impeller eff of the fan,
    # preserving the proposed motor eff.
    baseline_impeller_eff = fan_baseline_impeller_efficiency(fan)
    fan_change_impeller_efficiency(fan, baseline_impeller_eff)
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "* #{(baseline_impeller_eff * 100).round(1)}% = Baseline fan impeller efficiency.")

    # Set the baseline motor efficiency for the specified bhp
    baseline_motor_eff = fan.standardMinimumMotorEfficiency(standards, allowable_fan_bhp)
    fan_change_motor_efficiency(fan, baseline_motor_eff)

    # Get design supply air flow rate (whether autosized or hard-sized)
    dsn_air_flow_m3_per_s = 0
    if fan.designSupplyAirFlowRate.is_initialized
      dsn_air_flow_m3_per_s = fan.designSupplyAirFlowRate.get
      dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
      OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = User entered Design Supply Air Flow Rate.")
    elsif fan.autosizedDesignSupplyAirFlowRate.is_initialized
      dsn_air_flow_m3_per_s = fan.autosizedDesignSupplyAirFlowRate.get
      dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
      OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
    end

    # Determine the fan pressure rise that will result in the target bhp
    # pressure_rise_pa = fan_bhp*746 / fan_motor_eff*fan_total_eff / dsn_air_flow_m3_per_s
    baseline_pressure_rise_pa = baseline_fan_bhp * 746 / fan.motorEfficiency * fan.fanEfficiency / dsn_air_flow_m3_per_s
    baseline_pressure_rise_in_wc = OpenStudio.convert(fan_pressure_rise_pa, 'Pa', 'inH_{2}O').get
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "* #{fan_pressure_rise_in_wc.round(2)} in w.c. = Pressure drop to achieve allowable fan power.")

    # Calculate the bhp of the fan to make sure it matches
    calc_bhp = fan_brake_horsepower(fan)
    if ((calc_bhp - baseline_fan_bhp) / baseline_fan_bhp).abs > 0.02
      OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', "#{fan.name} baseline fan bhp supposed to be #{baseline_fan_bhp}, but is #{calc_bhp}.")
    end
  end

  # Calculate the total bhp of the system to make sure it matches the goal
  calc_sys_bhp = air_loop_hvac_system_fan_brake_horsepower(air_loop_hvac, false)
  return true unless ((calc_sys_bhp - allowable_fan_bhp) / allowable_fan_bhp).abs > 0.02

  OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} baseline system bhp supposed to be #{allowable_fan_bhp}, but is #{calc_sys_bhp}.")
  return false
end

#air_loop_hvac_apply_economizer_integration(air_loop_hvac, climate_zone) ⇒ Boolean

Note:

this method assumes you previously checked that an economizer is required at all via #economizer_required?

For systems required to have an economizer, set the economizer to integrated on non-integrated per the standard.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1141

def air_loop_hvac_apply_economizer_integration(air_loop_hvac, climate_zone)
  # Determine if an integrated economizer is required
  integrated_economizer_required = air_loop_hvac_integrated_economizer_required?(air_loop_hvac, climate_zone)

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem

  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  # Apply integrated or non-integrated economizer
  if integrated_economizer_required
    oa_control.setLockoutType('LockoutWithHeating')
  else
    # If the airloop include hyrdronic cooling coils,
    # prevent economizer from operating at and above SAT,
    # similar to a non-integrated economizer. This is done
    # because LockoutWithCompressor doesn't work with hydronic
    # coils
    if air_loop_hvac_include_hydronic_cooling_coil?(air_loop_hvac)
      oa_control.setLockoutType('LockoutWithHeating')
      oa_control.setEconomizerMaximumLimitDryBulbTemperature(standard_design_sizing_temperatures['clg_dsgn_sup_air_temp_c'])
    else
      oa_control.setLockoutType('LockoutWithCompressor')
    end
  end

  return true
end

#air_loop_hvac_apply_economizer_limits(air_loop_hvac, climate_zone) ⇒ Boolean

Set the economizer limits per the standard. Limits are based on the economizer type currently specified in the ControllerOutdoorAir object on this air loop.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1025

def air_loop_hvac_apply_economizer_limits(air_loop_hvac, climate_zone)
  # EnergyPlus economizer types
  # 'NoEconomizer'
  # 'FixedDryBulb'
  # 'FixedEnthalpy'
  # 'DifferentialDryBulb'
  # 'DifferentialEnthalpy'
  # 'FixedDewPointAndDryBulb'
  # 'ElectronicEnthalpy'
  # 'DifferentialDryBulbAndEnthalpy'

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  # Return false if no economizer is present
  if economizer_type == 'NoEconomizer'
    return false
  end

  # Reset the limits
  oa_control.resetEconomizerMaximumLimitDryBulbTemperature
  oa_control.resetEconomizerMaximumLimitEnthalpy
  oa_control.resetEconomizerMaximumLimitDewpointTemperature
  oa_control.resetEconomizerMinimumLimitDryBulbTemperature

  # Determine the limits
  drybulb_limit_f, enthalpy_limit_btu_per_lb, dewpoint_limit_f = air_loop_hvac_economizer_limits(air_loop_hvac, climate_zone)

  # Do nothing if no limits were specified
  if drybulb_limit_f.nil? && enthalpy_limit_btu_per_lb.nil? && dewpoint_limit_f.nil?
    return false
  end

  # Set the limits
  case economizer_type
  when 'FixedDryBulb'
    if drybulb_limit_f
      drybulb_limit_c = OpenStudio.convert(drybulb_limit_f, 'F', 'C').get
      oa_control.setEconomizerMaximumLimitDryBulbTemperature(drybulb_limit_c)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, dry bulb limit = #{drybulb_limit_f}F")
    end
    # Some templates include fixed enthalpy limits in addition to fixed dry bulb limits
    if enthalpy_limit_btu_per_lb
      enthalpy_limit_j_per_kg = OpenStudio.convert(enthalpy_limit_btu_per_lb, 'Btu/lb', 'J/kg').get
      oa_control.setEconomizerMaximumLimitEnthalpy(enthalpy_limit_j_per_kg)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: additional economizer enthalpy limit = #{enthalpy_limit_btu_per_lb}Btu/lb")
    end
  when 'FixedEnthalpy'
    if enthalpy_limit_btu_per_lb
      enthalpy_limit_j_per_kg = OpenStudio.convert(enthalpy_limit_btu_per_lb, 'Btu/lb', 'J/kg').get
      oa_control.setEconomizerMaximumLimitEnthalpy(enthalpy_limit_j_per_kg)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, enthalpy limit = #{enthalpy_limit_btu_per_lb}Btu/lb")
    end
  when 'FixedDewPointAndDryBulb'
    if drybulb_limit_f && dewpoint_limit_f
      drybulb_limit_c = OpenStudio.convert(drybulb_limit_f, 'F', 'C').get
      dewpoint_limit_c = OpenStudio.convert(dewpoint_limit_f, 'F', 'C').get
      oa_control.setEconomizerMaximumLimitDryBulbTemperature(drybulb_limit_c)
      oa_control.setEconomizerMaximumLimitDewpointTemperature(dewpoint_limit_c)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, dry bulb limit = #{drybulb_limit_f}F, dew-point limit = #{dewpoint_limit_f}F")
    end
  end

  return true
end

#air_loop_hvac_apply_energy_recovery_ventilator(air_loop_hvac, climate_zone) ⇒ Boolean

TODO:

Add exception logic for systems serving parking garage, warehouse, or multifamily

Add an ERV to this airloop

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if required, false if not



1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1799

def air_loop_hvac_apply_energy_recovery_ventilator(air_loop_hvac, climate_zone)
  # Get the OA system
  oa_system = nil
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV cannot be added because the system has no OA intake.")
    return false
  end

  # Get the existing ERV or create an ERV and add it to the OA system
  erv = nil
  air_loop_hvac.supplyComponents.each do |supply_comp|
    if supply_comp.to_HeatExchangerAirToAirSensibleAndLatent.is_initialized
      erv = supply_comp.to_HeatExchangerAirToAirSensibleAndLatent.get
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, adjusting properties for existing ERV #{erv.name} instead of adding another one.")
    end
  end
  if erv.nil?
    erv = OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.new(air_loop_hvac.model)
    erv.addToNode(oa_system.outboardOANode.get)
  end

  # Determine whether to use an ERV and HRV and heat exchanger style
  erv_type = air_loop_hvac_energy_recovery_ventilator_type(air_loop_hvac, climate_zone)
  heat_exchanger_type = air_loop_hvac_energy_recovery_ventilator_heat_exchanger_type(air_loop_hvac)
  erv.setName("#{air_loop_hvac.name} #{erv_type}")
  erv.setHeatExchangerType(heat_exchanger_type)

  # apply heat exchanger efficiencies
  air_loop_hvac_apply_energy_recovery_ventilator_efficiency(erv, erv_type: erv_type, heat_exchanger_type: heat_exchanger_type)

  # Apply the prototype heat exchanger power assumptions for rotary style heat exchangers
  heat_exchanger_air_to_air_sensible_and_latent_apply_prototype_nominal_electric_power(erv)

  # add economizer lockout
  erv.setSupplyAirOutletTemperatureControl(true)
  erv.setEconomizerLockout(true)

  # add defrost
  erv.setFrostControlType('ExhaustOnly')
  erv.setThresholdTemperature(-23.3) # -10F
  erv.setInitialDefrostTimeFraction(0.167)
  erv.setRateofDefrostTimeFractionIncrease(1.44)

  # Add a setpoint manager OA pretreat to control the ERV
  spm_oa_pretreat = OpenStudio::Model::SetpointManagerOutdoorAirPretreat.new(air_loop_hvac.model)
  spm_oa_pretreat.setMinimumSetpointTemperature(-99.0)
  spm_oa_pretreat.setMaximumSetpointTemperature(99.0)
  spm_oa_pretreat.setMinimumSetpointHumidityRatio(0.00001)
  spm_oa_pretreat.setMaximumSetpointHumidityRatio(1.0)
  # Reference setpoint node and mixed air stream node are outlet node of the OA system
  mixed_air_node = oa_system.mixedAirModelObject.get.to_Node.get
  spm_oa_pretreat.setReferenceSetpointNode(mixed_air_node)
  spm_oa_pretreat.setMixedAirStreamNode(mixed_air_node)
  # Outdoor air node is the outboard OA node of the OA system
  spm_oa_pretreat.setOutdoorAirStreamNode(oa_system.outboardOANode.get)
  # Return air node is the inlet node of the OA system
  return_air_node = oa_system.returnAirModelObject.get.to_Node.get
  spm_oa_pretreat.setReturnAirStreamNode(return_air_node)
  # Attach to the outlet of the ERV
  erv_outlet = erv.primaryAirOutletModelObject.get.to_Node.get
  spm_oa_pretreat.addToNode(erv_outlet)

  # Determine if the system is a DOAS based on whether there is 100% OA in heating and cooling sizing.
  is_doas = false
  sizing_system = air_loop_hvac.sizingSystem
  if sizing_system.allOutdoorAirinCooling && sizing_system.allOutdoorAirinHeating
    is_doas = true
  end

  # Set the bypass control type
  # If DOAS system, BypassWhenWithinEconomizerLimits
  # to disable ERV during economizing.
  # Otherwise, BypassWhenOAFlowGreaterThanMinimum
  # to disable ERV during economizing and when OA
  # is also greater than minimum.
  bypass_ctrl_type = if is_doas
                       'BypassWhenWithinEconomizerLimits'
                     else
                       'BypassWhenOAFlowGreaterThanMinimum'
                     end
  oa_system.getControllerOutdoorAir.setHeatRecoveryBypassControlType(bypass_ctrl_type)

  return true
end

#air_loop_hvac_apply_energy_recovery_ventilator_efficiency(erv, erv_type: 'ERV', heat_exchanger_type: 'Rotary') ⇒ OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent

Apply efficiency values to the erv

Parameters:

  • erv (OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent)

    erv to apply efficiency values

  • erv_type (String) (defaults to: 'ERV')

    erv type ERV or HRV

  • heat_exchanger_type (String) (defaults to: 'Rotary')

    heat exchanger type Rotary or Plate

Returns:

  • (OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent)

    erv to apply efficiency values



1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1892

def air_loop_hvac_apply_energy_recovery_ventilator_efficiency(erv, erv_type: 'ERV', heat_exchanger_type: 'Rotary')
  erv.setSensibleEffectivenessat100HeatingAirFlow(0.7)
  erv.setLatentEffectivenessat100HeatingAirFlow(0.6)
  erv.setSensibleEffectivenessat75HeatingAirFlow(0.7)
  erv.setLatentEffectivenessat75HeatingAirFlow(0.6)
  erv.setSensibleEffectivenessat100CoolingAirFlow(0.75)
  erv.setLatentEffectivenessat100CoolingAirFlow(0.6)
  erv.setSensibleEffectivenessat75CoolingAirFlow(0.75)
  erv.setLatentEffectivenessat75CoolingAirFlow(0.6)
  return erv
end

#air_loop_hvac_apply_maximum_reheat_temperature(air_loop_hvac, max_reheat_c) ⇒ Boolean

Sets the maximum reheat temperature to the specified value for all reheat terminals (of any type) on the loop.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • max_reheat_c (Double)

    the maximum reheat temperature, in degrees Celsius

Returns:

  • (Boolean)

    returns true if successful, false if not



3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3543

def air_loop_hvac_apply_maximum_reheat_temperature(air_loop_hvac, max_reheat_c)
  air_loop_hvac.demandComponents.each do |sc|
    if sc.to_AirTerminalSingleDuctConstantVolumeReheat.is_initialized
      term = sc.to_AirTerminalSingleDuctConstantVolumeReheat.get
      term.setMaximumReheatAirTemperature(max_reheat_c)
    elsif sc.to_AirTerminalSingleDuctParallelPIUReheat.is_initialized
      # No control option available
    elsif sc.to_AirTerminalSingleDuctSeriesPIUReheat.is_initialized
      # No control option available
    elsif sc.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.is_initialized
      term = sc.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.get
      term.setMaximumReheatAirTemperature(max_reheat_c)
    elsif sc.to_AirTerminalSingleDuctVAVReheat.is_initialized
      term = sc.to_AirTerminalSingleDuctVAVReheat.get
      term.setMaximumReheatAirTemperature(max_reheat_c)
    end
  end

  max_reheat_f = OpenStudio.convert(max_reheat_c, 'C', 'F').get
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: reheat terminal maximum set to #{max_reheat_f.round} F.")

  return true
end

#air_loop_hvac_apply_minimum_vav_damper_positions(air_loop_hvac, has_ddc = true) ⇒ Boolean

Set the minimum VAV damper positions.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • has_ddc (Boolean) (defaults to: true)

    if true, will assume that there is DDC control of vav terminals. If false, assumes otherwise.

Returns:

  • (Boolean)

    returns true if successful, false if not



1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1977

def air_loop_hvac_apply_minimum_vav_damper_positions(air_loop_hvac, has_ddc = true)
  air_loop_hvac.thermalZones.each do |zone|
    zone.equipment.each do |equip|
      if equip.to_AirTerminalSingleDuctVAVReheat.is_initialized
        zone_oa = OpenstudioStandards::ThermalZone.thermal_zone_get_outdoor_airflow_rate(zone)
        vav_terminal = equip.to_AirTerminalSingleDuctVAVReheat.get
        air_terminal_single_duct_vav_reheat_apply_minimum_damper_position(vav_terminal, zone_oa, has_ddc)
      end
    end
  end

  return true
end

#air_loop_hvac_apply_multizone_vav_outdoor_air_sizing(air_loop_hvac) ⇒ Object

TODO:

move building-type-specific code to Prototype classes

Apply multizone vav outdoor air method and adjust multizone VAV damper positions to achieve a system minimum ventilation effectiveness of 0.6 per PNNL. Hard-size the resulting min OA into the sizing:system object.

return [Boolean] returns true if successful, false if not

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop



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

def air_loop_hvac_apply_multizone_vav_outdoor_air_sizing(air_loop_hvac)
  # First time adjustment:
  # Only applies to multi-zone vav systems
  # exclusion: for Outpatient: (1) both AHU1 and AHU2 in 'DOE Ref Pre-1980' and 'DOE Ref 1980-2004'
  # (2) AHU1 in 2004-2019
  # @todo refactor: move building-type-specific code to Prototype classes
  if air_loop_hvac_multizone_vav_system?(air_loop_hvac) && !(air_loop_hvac.name.to_s.include? 'Outpatient F1')
    air_loop_hvac_adjust_minimum_vav_damper_positions(air_loop_hvac)
  end

  return true
end

#air_loop_hvac_apply_prm_baseline_controls(air_loop_hvac, climate_zone) ⇒ Boolean

Apply all PRM baseline required controls to the airloop. Only applies those controls that differ from the normal prescriptive controls, which are added via air_loop_hvac_apply_standard_controls(air_loop_hvac, climate_zone)

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 194

def air_loop_hvac_apply_prm_baseline_controls(air_loop_hvac, climate_zone)
  # Economizers
  if air_loop_hvac_prm_baseline_economizer_required?(air_loop_hvac, climate_zone)
    air_loop_hvac_apply_prm_baseline_economizer(air_loop_hvac, climate_zone)
  else
    # Make sure if economizer is not required then the OA controller should have No Economizer
    oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
    if oa_sys.is_initialized
      oa_sys.get.getControllerOutdoorAir.setEconomizerControlType('NoEconomizer')
    end
  end

  # Multizone VAV Systems
  if air_loop_hvac_multizone_vav_system?(air_loop_hvac)

    # VSD no Static Pressure Reset on all VAV systems
    # per G3.1.3.15
    air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac).each do |fan|
      if fan.to_FanVariableVolume.is_initialized
        OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Setting fan part load curve per G3.1.3.15.")
        fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with VSD and Fixed SP Setpoint')
      end
    end

    # SAT Reset
    # G3.1.3.12 SAT reset required for all Multizone VAV systems,
    # even if not required by prescriptive section.
    air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone(air_loop_hvac)

  end

  # Unoccupied shutdown
  occ_threshold = air_loop_hvac_unoccupied_threshold
  air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac, occ_threshold)

  return true
end

#air_loop_hvac_apply_prm_baseline_economizer(air_loop_hvac, climate_zone) ⇒ Boolean

Apply the PRM economizer type and set temperature limits

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1433

def air_loop_hvac_apply_prm_baseline_economizer(air_loop_hvac, climate_zone)
  # EnergyPlus economizer types
  # 'NoEconomizer'
  # 'FixedDryBulb'
  # 'FixedEnthalpy'
  # 'DifferentialDryBulb'
  # 'DifferentialEnthalpy'
  # 'FixedDewPointAndDryBulb'
  # 'ElectronicEnthalpy'
  # 'DifferentialDryBulbAndEnthalpy'

  # Determine the type and limits
  economizer_type, drybulb_limit_f, enthalpy_limit_btu_per_lb, dewpoint_limit_f = air_loop_hvac_prm_economizer_type_and_limits(air_loop_hvac, climate_zone)

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir

  # Set the economizer type
  oa_control.setEconomizerControlType(economizer_type)

  # Reset the limits
  oa_control.resetEconomizerMaximumLimitDryBulbTemperature
  oa_control.resetEconomizerMaximumLimitEnthalpy
  oa_control.resetEconomizerMaximumLimitDewpointTemperature
  oa_control.resetEconomizerMinimumLimitDryBulbTemperature

  # Set the limits
  case economizer_type
  when 'FixedDryBulb'
    if drybulb_limit_f
      drybulb_limit_c = OpenStudio.convert(drybulb_limit_f, 'F', 'C').get
      oa_control.setEconomizerMaximumLimitDryBulbTemperature(drybulb_limit_c)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, dry bulb limit = #{drybulb_limit_f}F")
    end
  when 'FixedEnthalpy'
    if enthalpy_limit_btu_per_lb
      enthalpy_limit_j_per_kg = OpenStudio.convert(enthalpy_limit_btu_per_lb, 'Btu/lb', 'J/kg').get
      oa_control.setEconomizerMaximumLimitEnthalpy(enthalpy_limit_j_per_kg)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, enthalpy limit = #{enthalpy_limit_btu_per_lb}Btu/lb")
    end
  when 'FixedDewPointAndDryBulb'
    if drybulb_limit_f && dewpoint_limit_f
      drybulb_limit_c = OpenStudio.convert(drybulb_limit_f, 'F', 'C').get
      dewpoint_limit_c = OpenStudio.convert(dewpoint_limit_f, 'F', 'C').get
      oa_control.setEconomizerMaximumLimitDryBulbTemperature(drybulb_limit_c)
      oa_control.setEconomizerMaximumLimitDewpointTemperature(dewpoint_limit_c)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer type = #{economizer_type}, dry bulb limit = #{drybulb_limit_f}F, dew-point limit = #{dewpoint_limit_f}F")
    end
  end

  return true
end

#air_loop_hvac_apply_prm_baseline_fan_power(air_loop_hvac) ⇒ Object

TODO:

Figure out how to split fan power between multiple fans if the proposed model had multiple fans (supply, return, exhaust, etc.)

Calculate and apply the performance rating method baseline fan power to this air loop. Fan motor efficiency will be set, and then fan pressure rise adjusted so that the fan power is the maximum allowable. Also adjusts the fan power and flow rates of any parallel PIU terminals on the system. return [Boolean] true if successful, false if not

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 387

def air_loop_hvac_apply_prm_baseline_fan_power(air_loop_hvac)
  # Main AHU fans

  # Calculate the allowable fan motor bhp
  # for the entire airloop.
  allowable_fan_bhp = air_loop_hvac_allowable_system_brake_horsepower(air_loop_hvac)

  # Divide the allowable power evenly between the fans
  # on this airloop.
  all_fans = air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac)
  allowable_fan_bhp /= all_fans.size

  # Set the motor efficiencies
  # for all fans based on the calculated
  # allowed brake hp.  Then calculate the allowable
  # fan power for each fan and adjust
  # the fan pressure rise accordingly
  all_fans.each do |fan|
    fan_apply_standard_minimum_motor_efficiency(fan, allowable_fan_bhp)
    allowable_power_w = allowable_fan_bhp * 746 / fan.motorEfficiency
    fan_adjust_pressure_rise_to_meet_fan_power(fan, allowable_power_w)
  end

  # Fan powered terminal fans

  # Adjust each terminal fan
  air_loop_hvac.demandComponents.each do |dc|
    next if dc.to_AirTerminalSingleDuctParallelPIUReheat.empty?

    pfp_term = dc.to_AirTerminalSingleDuctParallelPIUReheat.get
    air_terminal_single_duct_parallel_piu_reheat_apply_prm_baseline_fan_power(pfp_term)
  end

  return true
end

#air_loop_hvac_apply_prm_sizing_temperatures(air_loop_hvac) ⇒ Boolean

Set the system sizing properties based on the zone sizing information

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3571

def air_loop_hvac_apply_prm_sizing_temperatures(air_loop_hvac)
  # Get the design heating and cooling SAT information
  # for all zones served by the system.
  htg_setpts_c = []
  clg_setpts_c = []
  air_loop_hvac.thermalZones.each do |zone|
    sizing_zone = zone.sizingZone
    htg_setpts_c << sizing_zone.zoneHeatingDesignSupplyAirTemperature
    clg_setpts_c << sizing_zone.zoneCoolingDesignSupplyAirTemperature
  end

  # Cooling SAT set to minimum zone cooling design SAT
  clg_sat_c = clg_setpts_c.min

  # If the system has terminal reheat,
  # heating SAT is set to the same value as cooling SAT
  # and the terminals are expected to do the heating.
  # If not, heating SAT set to maximum zone heating design SAT.
  has_term_rht = air_loop_hvac_terminal_reheat?(air_loop_hvac)
  htg_sat_c = if has_term_rht
                clg_sat_c
              else
                htg_setpts_c.max
              end

  # Set the central SAT values
  sizing_system = air_loop_hvac.sizingSystem
  sizing_system.setCentralCoolingDesignSupplyAirTemperature(clg_sat_c)
  sizing_system.setCentralHeatingDesignSupplyAirTemperature(htg_sat_c)

  clg_sat_f = OpenStudio.convert(clg_sat_c, 'C', 'F').get
  htg_sat_f = OpenStudio.convert(htg_sat_c, 'C', 'F').get
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: central heating SAT set to #{htg_sat_f.round} F, cooling SAT set to #{clg_sat_f.round} F.")

  # If it's a terminal reheat system, set the reheat terminal setpoints too
  if has_term_rht
    rht_c = htg_setpts_c.max
    air_loop_hvac_apply_maximum_reheat_temperature(air_loop_hvac, rht_c)
  end

  return true
end

#air_loop_hvac_apply_single_zone_controls(air_loop_hvac, climate_zone) ⇒ Boolean

Generate the EMS used to implement the economizer and staging controls for packaged single zone units.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2915

def air_loop_hvac_apply_single_zone_controls(air_loop_hvac, climate_zone)
  # These controls only apply to systems with DX cooling
  unless air_loop_hvac_dx_cooling?(air_loop_hvac)
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Single zone controls not applicable because no DX cooling.")
    return true
  end

  # Number of stages is determined by the template
  num_stages = air_loop_hvac_single_zone_controls_num_stages(air_loop_hvac, climate_zone)

  # If zero stages, no special control is required
  if num_stages.zero?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: No special economizer controls were modeled.")
    return true
  end

  # Fan control program only used for systems with two-stage DX coils
  fan_control = air_loop_hvac_multi_stage_dx_cooling?(air_loop_hvac)

  # Scrub special characters from the system name
  snc = ems_friendly_name(air_loop_hvac.name)

  # Get the zone name
  zone = air_loop_hvac.thermalZones[0]
  zn_name_clean = ems_friendly_name(zone.name)

  # Zone air node
  zone_air_node = zone.zoneAirNode

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  oa_node = oa_sys.outboardOANode.get

  # Get the name of the min oa schedule
  min_oa_sch = if oa_control.minimumOutdoorAirSchedule.is_initialized
                 oa_control.minimumOutdoorAirSchedule.get
               else
                 air_loop_hvac.model.alwaysOnDiscreteSchedule
               end

  # Create an economizer maximum OA fraction schedule with
  # a maximum of 70% to reflect damper leakage per PNNL
  max_oa_sch = set_maximum_fraction_outdoor_air_schedule(air_loop_hvac, oa_control, snc) unless air_loop_hvac_has_simple_transfer_air?(air_loop_hvac)

  # Get the supply fan
  if air_loop_hvac.supplyFan.empty?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: No supply fan found, cannot apply DX fan/economizer control.")
    return false
  end
  fan = air_loop_hvac.supplyFan.get

  # Supply outlet node
  sup_out_node = air_loop_hvac.supplyOutletNode

  # DX Cooling Coil
  dx_coil = nil
  air_loop_hvac.supplyComponents.each do |equip|
    if equip.to_CoilCoolingDXSingleSpeed.is_initialized
      dx_coil = equip.to_CoilCoolingDXSingleSpeed.get
    elsif equip.to_CoilCoolingDXTwoSpeed.is_initialized
      dx_coil = equip.to_CoilCoolingDXTwoSpeed.get
    end
  end
  if dx_coil.nil?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: No DX cooling coil found, cannot apply DX fan/economizer control.")
    return false
  end

  # Heating Coil
  htg_coil = nil
  air_loop_hvac.supplyComponents.each do |equip|
    if equip.to_CoilHeatingGas.is_initialized
      htg_coil = equip.to_CoilHeatingGas.get
    elsif equip.to_CoilHeatingElectric.is_initialized
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: electric heating coil was found, cannot apply DX fan/economizer control.")
      return false
    elsif equip.to_CoilHeatingWater.is_initialized
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: hot water heating coil was found found, cannot apply DX fan/economizer control.")
      return false
    end
  end
  if htg_coil.nil?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: No heating coil found, cannot apply DX fan/economizer control.")
    return false
  end

  ### EMS shared by both programs ###
  # Sensors
  oat_db_c_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Site Outdoor Air Drybulb Temperature')
  oat_db_c_sen.setName('OATF')
  oat_db_c_sen.setKeyName('Environment')

  oat_wb_c_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Site Outdoor Air Wetbulb Temperature')
  oat_wb_c_sen.setName('OAWBC')
  oat_wb_c_sen.setKeyName('Environment')

  oa_sch_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Schedule Value')
  oa_sch_sen.setName("#{snc}_OASch")
  oa_sch_sen.setKeyName(min_oa_sch.handle.to_s)

  oa_flow_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'System Node Mass Flow Rate')
  oa_flow_sen.setName("#{snc}_OAFlowMass")
  oa_flow_sen.setKeyName(oa_node.handle.to_s)

  dat_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'System Node Setpoint Temperature')
  dat_sen.setName("#{snc}_DATRqd")
  dat_sen.setKeyName(sup_out_node.handle.to_s)

  # Internal Variables
  oa_flow_var = OpenStudio::Model::EnergyManagementSystemInternalVariable.new(air_loop_hvac.model, 'Outdoor Air Controller Minimum Mass Flow Rate')
  oa_flow_var.setName("#{snc}_OADesignMass")
  oa_flow_var.setInternalDataIndexKeyName(oa_control.handle.to_s)

  # Global Variables
  gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_NumberofStages")

  # Programs
  num_stg_prg = OpenStudio::Model::EnergyManagementSystemProgram.new(air_loop_hvac.model)
  num_stg_prg.setName("#{snc}_SetNumberofStages")
  num_stg_prg_body = <<-EMS
    SET #{snc}_NumberofStages = #{num_stages}
  EMS
  num_stg_prg.setBody(num_stg_prg_body)

  # Program Calling Managers
  setup_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(air_loop_hvac.model)
  setup_mgr.setName("#{snc}_SetNumberofStagesCallingManager")
  setup_mgr.setCallingPoint('BeginNewEnvironment')
  setup_mgr.addProgram(num_stg_prg)

  ### Fan Control ###
  if fan_control

    ### Economizer Control ###
    # Actuators
    econ_eff_act = OpenStudio::Model::EnergyManagementSystemActuator.new(max_oa_sch, 'Schedule:Year', 'Schedule Value')
    econ_eff_act.setName("#{snc}_TimestepEconEff")

    # Programs
    econ_prg = OpenStudio::Model::EnergyManagementSystemProgram.new(air_loop_hvac.model)
    econ_prg.setName("#{snc}_EconomizerCTRLProg")
    econ_prg_body = <<-EMS
      SET #{econ_eff_act.handle} = 0.7
      SET MaxE = 0.7
      SET #{dat_sen.handle} = (#{dat_sen.handle}*1.8)+32
      SET OATF = (#{oat_db_c_sen.handle}*1.8)+32
      SET OAwbF = (#{oat_wb_c_sen.handle}*1.8)+32
      IF #{oa_flow_sen.handle} > (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
        SET EconoActive = 1
      ELSE
        SET EconoActive = 0
      ENDIF
      SET dTNeeded = 75-#{dat_sen.handle}
      SET CoolDesdT = ((98*0.15)+(75*(1-0.15)))-55
      SET CoolLoad = dTNeeded/ CoolDesdT
      IF CoolLoad > 1
        SET CoolLoad = 1
      ELSEIF CoolLoad < 0
        SET CoolLoad = 0
      ENDIF
      IF EconoActive == 1
        SET Stage = #{snc}_NumberofStages
        IF Stage == 2
          IF CoolLoad < 0.6
            SET #{econ_eff_act.handle} = MaxE
          ELSE
            SET ECOEff = 0-2.18919863612305
            SET ECOEff = ECOEff+(0-0.674461284910428*CoolLoad)
            SET ECOEff = ECOEff+(0.000459106275872404*(OATF^2))
            SET ECOEff = ECOEff+(0-0.00000484778537945252*(OATF^3))
            SET ECOEff = ECOEff+(0.182915713033586*OAwbF)
            SET ECOEff = ECOEff+(0-0.00382838660261133*(OAwbF^2))
            SET ECOEff = ECOEff+(0.0000255567460240583*(OAwbF^3))
            SET #{econ_eff_act.handle} = ECOEff
          ENDIF
        ELSE
          SET ECOEff = 2.36337942464462
          SET ECOEff = ECOEff+(0-0.409939515512619*CoolLoad)
          SET ECOEff = ECOEff+(0-0.0565205596792225*OAwbF)
          SET ECOEff = ECOEff+(0-0.0000632612294169389*(OATF^2))
          SET #{econ_eff_act.handle} = ECOEff+(0.000571724868775081*(OAwbF^2))
        ENDIF
        IF #{econ_eff_act.handle} > MaxE
          SET #{econ_eff_act.handle} = MaxE
        ELSEIF #{econ_eff_act.handle} < (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
          SET #{econ_eff_act.handle} = (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
        ENDIF
      ENDIF
    EMS
    econ_prg.setBody(econ_prg_body)

    # Program Calling Managers
    econ_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(air_loop_hvac.model)
    econ_mgr.setName("#{snc}_EcoManager")
    econ_mgr.setCallingPoint('InsideHVACSystemIterationLoop')
    econ_mgr.addProgram(econ_prg)

    # Sensors
    zn_temp_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'System Node Temperature')
    zn_temp_sen.setName("#{zn_name_clean}_Temp")
    zn_temp_sen.setKeyName(zone_air_node.handle.to_s)

    htg_rtf_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Heating Coil Runtime Fraction')
    htg_rtf_sen.setName("#{snc}_HeatingRTF")
    htg_rtf_sen.setKeyName(htg_coil.handle.to_s)

    clg_rtf_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Cooling Coil Runtime Fraction')
    clg_rtf_sen.setName("#{snc}_RTF")
    clg_rtf_sen.setKeyName(dx_coil.handle.to_s)

    spd_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Coil System Compressor Speed Ratio')
    spd_sen.setName("#{snc}_SpeedRatio")
    spd_sen.setKeyName("#{dx_coil.handle} CoilSystem")

    # Internal Variables
    fan_pres_var = OpenStudio::Model::EnergyManagementSystemInternalVariable.new(air_loop_hvac.model, 'Fan Nominal Pressure Rise')
    fan_pres_var.setName("#{snc}_FanDesignPressure")
    fan_pres_var.setInternalDataIndexKeyName(fan.handle.to_s)

    dsn_flow_var = OpenStudio::Model::EnergyManagementSystemInternalVariable.new(air_loop_hvac.model, 'Outdoor Air Controller Maximum Mass Flow Rate')
    dsn_flow_var.setName("#{snc}_DesignFlowMass")
    dsn_flow_var.setInternalDataIndexKeyName(oa_control.handle.to_s)

    # Actuators
    fan_pres_act = OpenStudio::Model::EnergyManagementSystemActuator.new(fan, 'Fan', 'Fan Pressure Rise')
    fan_pres_act.setName("#{snc}_FanPressure")

    # Global Variables
    gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_FanPwrExp")
    gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_Stg1Spd")
    gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_Stg2Spd")
    gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_HeatSpeed")
    gvar = OpenStudio::Model::EnergyManagementSystemGlobalVariable.new(air_loop_hvac.model, "#{snc}_VenSpeed")

    # Programs
    fan_par_prg = OpenStudio::Model::EnergyManagementSystemProgram.new(air_loop_hvac.model)
    fan_par_prg.setName("#{snc}_SetFanPar")
    fan_par_prg_body = <<-EMS
      IF #{snc}_NumberofStages == 1
        Return
      ENDIF
      SET #{snc}_FanPwrExp = 2.2
      SET OAFrac = #{oa_flow_sen.handle}/#{dsn_flow_var.handle}
      IF  OAFrac < 0.66
        SET #{snc}_VenSpeed = 0.66
        SET #{snc}_Stg1Spd = 0.66
      ELSE
        SET #{snc}_VenSpeed = OAFrac
        SET #{snc}_Stg1Spd = OAFrac
      ENDIF
      SET #{snc}_Stg2Spd = 1.0
      SET #{snc}_HeatSpeed = 1.0
    EMS
    fan_par_prg.setBody(fan_par_prg_body)

    fan_ctrl_prg = OpenStudio::Model::EnergyManagementSystemProgram.new(air_loop_hvac.model)
    fan_ctrl_prg.setName("#{snc}_FanControl")
    fan_ctrl_prg_body = <<-EMS
      IF #{snc}_NumberofStages == 1
        Return
      ENDIF
      IF #{htg_rtf_sen.handle} > 0
        SET Heating = #{htg_rtf_sen.handle}
        SET Ven = 1-#{htg_rtf_sen.handle}
        SET Eco = 0
        SET Stage1 = 0
        SET Stage2 = 0
      ELSE
        SET Heating = 0
        SET EcoSpeed = #{snc}_VenSpeed
        IF #{spd_sen.handle} == 0
          IF #{clg_rtf_sen.handle} > 0
            SET Stage1 = #{clg_rtf_sen.handle}
            SET Stage2 = 0
            SET Ven = 1-#{clg_rtf_sen.handle}
            SET Eco = 0
            IF #{oa_flow_sen.handle} > (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
              SET #{snc}_Stg1Spd = 1.0
            ENDIF
          ELSE
            SET Stage1 = 0
            SET Stage2 = 0
            IF #{oa_flow_sen.handle} > (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
              SET Eco = 1.0
              SET Ven = 0
              !Calculate the expected discharge air temperature if the system runs at its low speed
              SET ExpDAT = #{dat_sen.handle}-(1-#{snc}_VenSpeed)*#{zn_temp_sen.handle}
              SET ExpDAT = ExpDAT/#{snc}_VenSpeed
              IF #{oat_db_c_sen.handle} > ExpDAT
                SET EcoSpeed = #{snc}_Stg2Spd
              ENDIF
            ELSE
              SET Eco = 0
              SET Ven = 1.0
            ENDIF
          ENDIF
        ELSE
          SET Stage1 = 1-#{spd_sen.handle}
          SET Stage2 = #{spd_sen.handle}
          SET Ven = 0
          SET Eco = 0
          IF #{oa_flow_sen.handle} > (#{oa_flow_var.handle}*#{oa_sch_sen.handle})
            SET #{snc}_Stg1Spd = 1.0
          ENDIF
        ENDIF
      ENDIF
      ! For each mode (percent time in mode)*(fanSpeer^PwrExp) is the contribution to weighted fan power over time step
      SET FPR = Ven*(#{snc}_VenSpeed ^ #{snc}_FanPwrExp)
      SET FPR = FPR+Eco*(EcoSpeed^#{snc}_FanPwrExp)
      SET FPR1 = Stage1*(#{snc}_Stg1Spd^#{snc}_FanPwrExp)
      SET FPR = FPR+FPR1
      SET FPR2 = Stage2*(#{snc}_Stg2Spd^#{snc}_FanPwrExp)
      SET FPR = FPR+FPR2
      SET FPR3 = Heating*(#{snc}_HeatSpeed^#{snc}_FanPwrExp)
      SET FanPwrRatio = FPR+ FPR3
      ! system fan power is directly proportional to static pressure so this change linearly adjusts fan energy for speed control
      SET #{fan_pres_act.handle} = #{fan_pres_var.handle}*FanPwrRatio
    EMS
    fan_ctrl_prg.setBody(fan_ctrl_prg_body)

    # Program Calling Managers
    # Note that num_stg_prg must be listed before fan_par_prg
    # because it initializes a variable used by fan_par_prg.
    setup_mgr.addProgram(fan_par_prg)

    fan_ctrl_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(air_loop_hvac.model)
    fan_ctrl_mgr.setName("#{snc}_FanMainManager")
    fan_ctrl_mgr.setCallingPoint('BeginTimestepBeforePredictor')
    fan_ctrl_mgr.addProgram(fan_ctrl_prg)

  end

  return true
end

#air_loop_hvac_apply_standard_controls(air_loop_hvac, climate_zone) ⇒ Boolean

TODO:

optimum start

TODO:

night damper shutoff

TODO:

nightcycle control

TODO:

night fan shutoff

Apply all standard required controls to the airloop

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if successful, false if not



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 33

def air_loop_hvac_apply_standard_controls(air_loop_hvac, climate_zone)
  # Unoccupied shutdown
  # Apply this before ERV because it modifies annual hours of operation which can impact ERV requirements
  if air_loop_hvac_unoccupied_fan_shutoff_required?(air_loop_hvac)
    occ_threshold = air_loop_hvac_unoccupied_threshold
    air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac, min_occ_pct = occ_threshold)
  else
    air_loop_hvac.setAvailabilitySchedule(air_loop_hvac.model.alwaysOnDiscreteSchedule)
  end

  # Energy Recovery Ventilation
  if air_loop_hvac_energy_recovery_ventilator_required?(air_loop_hvac, climate_zone)
    air_loop_hvac_apply_energy_recovery_ventilator(air_loop_hvac, climate_zone)
  end

  # Economizers
  air_loop_hvac_apply_economizer_limits(air_loop_hvac, climate_zone)
  air_loop_hvac_apply_economizer_integration(air_loop_hvac, climate_zone)

  # Multizone VAV Systems
  if air_loop_hvac_multizone_vav_system?(air_loop_hvac)

    # VAV Reheat Control
    air_loop_hvac_apply_vav_damper_action(air_loop_hvac)

    # Multizone VAV Optimization
    # This rule does not apply to two hospital and one outpatient systems
    unless (@instvarbuilding_type == 'Hospital' && (air_loop_hvac.name.to_s.include?('VAV_ER') || air_loop_hvac.name.to_s.include?('VAV_ICU') ||
           air_loop_hvac.name.to_s.include?('VAV_OR') || air_loop_hvac.name.to_s.include?('VAV_LABS') ||
           air_loop_hvac.name.to_s.include?('VAV_PATRMS'))) ||
           (@instvarbuilding_type == 'Outpatient' && air_loop_hvac.name.to_s.include?('Outpatient F1'))
      if air_loop_hvac_multizone_vav_optimization_required?(air_loop_hvac, climate_zone)
        air_loop_hvac_enable_multizone_vav_optimization(air_loop_hvac)
      else
        air_loop_hvac_disable_multizone_vav_optimization(air_loop_hvac)
      end
    end

    # Static Pressure Reset
    # Per 5.2.2.16 (Halverson et al 2014), all multiple zone VAV systems are assumed to have DDC for all years of DOE 90.1 prototypes, so the has_ddc is not used any more.
    air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac).each do |fan|
      if fan.to_FanVariableVolume.is_initialized
        plr_req = fan_variable_volume_part_load_fan_power_limitation?(fan)
        # Part Load Fan Pressure Control
        if plr_req
          vsd_curve_type = air_loop_hvac_set_vsd_curve_type
          fan_variable_volume_set_control_type(fan, vsd_curve_type)
        # No Part Load Fan Pressure Control
        else
          fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with discharge dampers')
        end
      else
        OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{fan}: This is not a multizone VAV fan system.")
      end
    end

    ## # Static Pressure Reset
    ## # assume no systems have DDC control of VAV terminals
    ## has_ddc = false
    ## spr_req = air_loop_hvac_static_pressure_reset_required?(air_loop_hvac, template, has_ddc)
    ## air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac).each do |fan|
    ##   if fan.to_FanVariableVolume.is_initialized
    ##     plr_req = fan_variable_volume_part_load_fan_power_limitation?(fan, template)
    ##     # Part Load Fan Pressure Control & Static Pressure Reset
    ##     if plr_req && spr_req
    ##       fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with VSD and Static Pressure Reset')
    ##     # Part Load Fan Pressure Control only
    ##     elsif plr_req && !spr_req
    ##       fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with VSD and Fixed SP Setpoint')
    ##     # Static Pressure Reset only
    ##     elsif !plr_req && spr_req
    ##       fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with VSD and Fixed SP Setpoint')
    ##     # No Control Required
    ##     else
    ##       fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with AF or BI Riding Curve')
    ##     end
    ##   else
    ##     OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.AirLoopHVAC', "For #{name}: there is a constant volume fan on a multizone vav system.  Cannot apply static pressure reset controls.")
    ##   end
    ## end
  end

  # DCV
  if air_loop_hvac_demand_control_ventilation_required?(air_loop_hvac, climate_zone)
    air_loop_hvac_enable_demand_control_ventilation(air_loop_hvac, climate_zone)
    # For systems that require DCV,
    # all individual zones that require DCV preserve
    # both per-area and per-person OA requirements.
    # Other zones have OA requirements converted
    # to per-area values only so DCV performance is only
    # based on the subset of zones that required DCV.
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Converting ventilation requirements to per-area for all zones served that do not require DCV.")
    air_loop_hvac.thermalZones.sort.each do |zone|
      unless thermal_zone_demand_control_ventilation_required?(zone, climate_zone)
        OpenstudioStandards::ThermalZone.thermal_zone_convert_outdoor_air_to_per_area(zone)
      end
    end
  end

  # SAT reset
  if air_loop_hvac_supply_air_temperature_reset_required?(air_loop_hvac, climate_zone)
    reset_type = air_loop_hvac_supply_air_temperature_reset_type(air_loop_hvac)
    case reset_type
      when 'warmest_zone'
        air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone(air_loop_hvac)
      when 'oa'
        air_loop_hvac_enable_supply_air_temperature_reset_outdoor_temperature(air_loop_hvac)
      else
        OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "No SAT reset for #{air_loop_hvac.name}.")
    end
  end

  # Motorized OA damper
  if air_loop_hvac_motorized_oa_damper_required?(air_loop_hvac, climate_zone)
    # Assume that the availability schedule has already been
    # set to reflect occupancy and use this for the OA damper.
    occ_threshold = air_loop_hvac_unoccupied_threshold
    air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, occ_threshold, air_loop_hvac.availabilitySchedule)
  else
    air_loop_hvac_remove_motorized_oa_damper(air_loop_hvac)
  end

  # Optimum Start
  air_loop_hvac_enable_optimum_start(air_loop_hvac) if air_loop_hvac_optimum_start_required?(air_loop_hvac)

  # Single zone systems
  if air_loop_hvac.thermalZones.size == 1
    air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac).each do |fan|
      if fan.to_FanVariableVolume.is_initialized
        fan_variable_volume_set_control_type(fan, 'Single Zone VAV Fan')
      end
    end
    air_loop_hvac_apply_single_zone_controls(air_loop_hvac, climate_zone)
  end

  # Standby mode occupancy control
  unless air_loop_hvac.thermalZones.empty?
    thermal_zones = air_loop_hvac.thermalZones

    standby_mode_spaces = []
    thermal_zones.sort.each do |thermal_zone|
      thermal_zone.spaces.sort.each do |space|
        if space_occupancy_standby_mode_required?(space)
          standby_mode_spaces << space
        end
      end
    end

    if !standby_mode_spaces.empty?
      air_loop_hvac_standby_mode_occupancy_control(air_loop_hvac, standby_mode_spaces)
    end
  end
end

#air_loop_hvac_apply_vav_damper_action(air_loop_hvac) ⇒ Boolean

TODO:

see if this impacts the sizing run.

Set the VAV damper control to single maximum or dual maximum control depending on the standard.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2680

def air_loop_hvac_apply_vav_damper_action(air_loop_hvac)
  damper_action = air_loop_hvac_vav_damper_action(air_loop_hvac)

  # Interpret this as an EnergyPlus input
  damper_action_eplus = nil
  if damper_action == 'Single Maximum'
    damper_action_eplus = 'Normal'
  elsif damper_action == 'Dual Maximum'
    # EnergyPlus 8.7 changed the meaning of 'Reverse'.
    # For versions of OpenStudio using E+ 8.6 or lower
    damper_action_eplus = if air_loop_hvac.model.version < OpenStudio::VersionString.new('2.0.5')
                            'Reverse'
                          # For versions of OpenStudio using E+ 8.7 or higher
                          else
                            'ReverseWithLimits'
                          end
  end

  # Set the control for any VAV reheat terminals on this airloop.
  control_type_set = false
  air_loop_hvac.demandComponents.each do |equip|
    if equip.to_AirTerminalSingleDuctVAVReheat.is_initialized
      term = equip.to_AirTerminalSingleDuctVAVReheat.get
      # Dual maximum only applies to terminals with HW reheat coils
      if damper_action == 'Dual Maximum'
        if term.reheatCoil.to_CoilHeatingWater.is_initialized
          term.setDamperHeatingAction(damper_action_eplus)
          control_type_set = true
          term.setMaximumFlowFractionDuringReheat(0.5)
        end
      else
        term.setDamperHeatingAction(damper_action_eplus)
        control_type_set = true
      end
    end
  end

  if control_type_set
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: VAV damper action was set to #{damper_action} control.")
  end

  return true
end

#air_loop_hvac_data_center_area_served(air_loop_hvac) ⇒ Double

TODO:

Add an is_data_center field to the standards space type spreadsheet instead of relying on the standards space type name to identify a data center.

Determine how much data center area the airloop serves.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Double)

    the area of data center is served in m^2.



3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3496

def air_loop_hvac_data_center_area_served(air_loop_hvac)
  dc_area_m2 = 0.0

  air_loop_hvac.thermalZones.each do |zone|
    zone.spaces.each do |space|
      # Skip spaces with no space type
      next if space.spaceType.empty?

      space_type = space.spaceType.get

      # Skip spaces with no standards space type
      next if space_type.standardsSpaceType.empty?

      standards_space_type = space_type.standardsSpaceType.get
      # Counts as a data center if the name includes 'data'
      if standards_space_type.downcase.include?('data center') || standards_space_type.downcase.include?('datacenter')
        dc_area_m2 += space.floorArea
      end
      std_bldg_type = space.spaceType.get.standardsBuildingType.get
      if std_bldg_type.downcase.include?('datacenter') && standards_space_type.downcase.include?('computerroom')
        dc_area_m2 += space.floorArea
      end
    end
  end

  return dc_area_m2
end

#air_loop_hvac_dcv_required_when_erv(air_loop_hvac) ⇒ Boolean

Determine if the standard has an exception for demand control ventilation when an energy recovery device is present. Defaults to true.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if required, false if not



2407
2408
2409
2410
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2407

def air_loop_hvac_dcv_required_when_erv(air_loop_hvac)
  dcv_required_when_erv_present = false
  return dcv_required_when_erv_present
end

#air_loop_hvac_demand_control_ventilation_limits(air_loop_hvac) ⇒ Array<Double>

Determines the OA flow rates above which an economizer is required. Two separate rates, one for systems with an economizer and another for systems without. Defaults to pre-1980 logic, where the limits are zero for both types.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Array<Double>)
    min_oa_without_economizer_cfm, min_oa_with_economizer_cfm


2396
2397
2398
2399
2400
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2396

def air_loop_hvac_demand_control_ventilation_limits(air_loop_hvac)
  min_oa_without_economizer_cfm = 0
  min_oa_with_economizer_cfm = 0
  return [min_oa_without_economizer_cfm, min_oa_with_economizer_cfm]
end

#air_loop_hvac_demand_control_ventilation_required?(air_loop_hvac, climate_zone) ⇒ Boolean

TODO:

Add exception logic for systems that serve multifamily, parking garage, warehouse

Determine if demand control ventilation (DCV) is required for this air loop.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if required, false if not



2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2313

def air_loop_hvac_demand_control_ventilation_required?(air_loop_hvac, climate_zone)
  dcv_required = false

  # OA flow limits
  min_oa_without_economizer_cfm, min_oa_with_economizer_cfm = air_loop_hvac_demand_control_ventilation_limits(air_loop_hvac)

  # If the limits are zero for both, DCV not required
  if min_oa_without_economizer_cfm.zero? && min_oa_with_economizer_cfm.zero?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{template} #{climate_zone}:  #{air_loop_hvac.name}: DCV is not required for any system.")
    return dcv_required
  end

  # Check if the system has an ERV
  if air_loop_hvac_energy_recovery?(air_loop_hvac)
    # May or may not be required for systems that have an ERV
    if air_loop_hvac_dcv_required_when_erv(air_loop_hvac)
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV may be required although the system has Energy Recovery.")
    else
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV is not required since the system has Energy Recovery.")
      return dcv_required
    end
  end

  # Get the min OA flow rate
  oa_flow_m3_per_s = 0
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
    controller_oa = oa_system.getControllerOutdoorAir
    if controller_oa.minimumOutdoorAirFlowRate.is_initialized
      oa_flow_m3_per_s = controller_oa.minimumOutdoorAirFlowRate.get
    elsif controller_oa.autosizedMinimumOutdoorAirFlowRate.is_initialized
      oa_flow_m3_per_s = controller_oa.autosizedMinimumOutdoorAirFlowRate.get
    end
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, DCV not applicable because it has no OA intake.")
    return dcv_required
  end
  oa_flow_cfm = OpenStudio.convert(oa_flow_m3_per_s, 'm^3/s', 'cfm').get

  # Check for min OA without an economizer OR has economizer
  if oa_flow_cfm < min_oa_without_economizer_cfm && air_loop_hvac_economizer?(air_loop_hvac) == false
    # Message if doesn't pass OA limit
    if oa_flow_cfm < min_oa_without_economizer_cfm
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV is not required since the system min oa flow is #{oa_flow_cfm.round} cfm, less than the minimum of #{min_oa_without_economizer_cfm.round} cfm.")
    end
    # Message if doesn't have economizer
    if air_loop_hvac_economizer?(air_loop_hvac) == false
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV is not required since the system does not have an economizer.")
    end
    return dcv_required
  end

  # If has economizer, cfm limit is lower
  if oa_flow_cfm < min_oa_with_economizer_cfm && air_loop_hvac_economizer?(air_loop_hvac)
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV is not required since the system has an economizer, but the min oa flow is #{oa_flow_cfm.round} cfm, less than the minimum of #{min_oa_with_economizer_cfm.round} cfm for systems with an economizer.")
    return dcv_required
  end

  # Check area and density limits
  # for all of zones on the loop
  any_zones_req_dcv = false
  air_loop_hvac.thermalZones.sort.each do |zone|
    if thermal_zone_demand_control_ventilation_required?(zone, climate_zone)
      any_zones_req_dcv = true
      break
    end
  end
  unless any_zones_req_dcv
    return dcv_required
  end

  # If here, DCV is required
  dcv_required = true

  return dcv_required
end

#air_loop_hvac_disable_multizone_vav_optimization(air_loop_hvac) ⇒ Boolean

Disable multizone vav optimization by changing the Outdoor Air Method in the Controller:MechanicalVentilation object to ‘ZoneSum’

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if required, false if not



1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1946

def air_loop_hvac_disable_multizone_vav_optimization(air_loop_hvac)
  # Disable multizone vav optimization
  # at each timestep.
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
    controller_oa = oa_system.getControllerOutdoorAir
    controller_mv = controller_oa.controllerMechanicalVentilation
    controller_mv.setSystemOutdoorAirMethod('ZoneSum')
    controller_oa.autosizeMinimumOutdoorAirFlowRate
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, cannot disable multizone vav optimization because the system has no OA intake.")
    return false
  end
end

#air_loop_hvac_dx_cooling?(air_loop_hvac) ⇒ Boolean

Determine if this Air Loop uses DX cooling.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if uses DX cooling, false if not



3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3643

def air_loop_hvac_dx_cooling?(air_loop_hvac)
  dx_clg = false

  # Check for all DX coil types
  dx_types = [
    'OS_Coil_Cooling_DX_MultiSpeed',
    'OS_Coil_Cooling_DX_SingleSpeed',
    'OS_Coil_Cooling_DX_TwoSpeed',
    'OS_Coil_Cooling_DX_TwoStageWithHumidityControlMode',
    'OS_Coil_Cooling_DX_VariableRefrigerantFlow',
    'OS_Coil_Cooling_DX_VariableSpeed',
    'OS_CoilSystem_Cooling_DX_HeatExchangerAssisted'
  ]

  air_loop_hvac.supplyComponents.each do |component|
    # Get the object type, getting the internal coil
    # type if inside a unitary system.
    obj_type = component.iddObjectType.valueName.to_s
    case obj_type
    when 'OS_AirLoopHVAC_UnitaryHeatCool_VAVChangeoverBypass'
      component = component.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get
      obj_type = component.coolingCoil.iddObjectType.valueName.to_s
    when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir'
      component = component.to_AirLoopHVACUnitaryHeatPumpAirToAir.get
      obj_type = component.coolingCoil.iddObjectType.valueName.to_s
    when 'OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed'
      component = component.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.get
      obj_type = component.coolingCoil.iddObjectType.valueName.to_s
    when 'OS_AirLoopHVAC_UnitarySystem'
      component = component.to_AirLoopHVACUnitarySystem.get
      if component.coolingCoil.is_initialized
        obj_type = component.coolingCoil.get.iddObjectType.valueName.to_s
      end
    end
    # See if the object type is a DX coil
    if dx_types.include?(obj_type)
      dx_clg = true
      break # Stop if find a DX coil
    end
  end

  return dx_clg
end

#air_loop_hvac_economizer?(air_loop_hvac) ⇒ Boolean

Determine if the system has an economizer

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if required, false if not



2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2551

def air_loop_hvac_economizer?(air_loop_hvac)
  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  # Return false if no economizer is present
  return false if economizer_type == 'NoEconomizer'

  return true
end

#air_loop_hvac_economizer_limits(air_loop_hvac, climate_zone) ⇒ Array<Double>

Determine the limits for the type of economizer present on the AirLoopHVAC, if any.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Array<Double>)
    drybulb_limit_f, enthalpy_limit_btu_per_lb, dewpoint_limit_f


1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1101

def air_loop_hvac_economizer_limits(air_loop_hvac, climate_zone)
  drybulb_limit_f = nil
  enthalpy_limit_btu_per_lb = nil
  dewpoint_limit_f = nil

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return [nil, nil, nil] unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  case economizer_type
  when 'NoEconomizer'
    return [nil, nil, nil]
  when 'FixedDryBulb'
    search_criteria = {
      'template' => template,
      'climate_zone' => climate_zone
    }
    econ_limits = model_find_object(standards_data['economizers'], search_criteria)
    drybulb_limit_f = econ_limits['fixed_dry_bulb_high_limit_shutoff_temp']
  when 'FixedEnthalpy'
    enthalpy_limit_btu_per_lb = 28
  when 'FixedDewPointAndDryBulb'
    drybulb_limit_f = 75
    dewpoint_limit_f = 55
  end

  return [drybulb_limit_f, enthalpy_limit_btu_per_lb, dewpoint_limit_f]
end

#air_loop_hvac_economizer_required?(air_loop_hvac, climate_zone) ⇒ Boolean

Determine whether or not this system is required to have an economizer.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if an economizer is required, false if not



949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 949

def air_loop_hvac_economizer_required?(air_loop_hvac, climate_zone)
  economizer_required = false

  # skip systems without outdoor air
  return economizer_required unless air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized

  # Determine if the system serves residential spaces
  is_res = false
  if air_loop_hvac_residential_area_served(air_loop_hvac) > 0
    is_res = true
  end

  # Determine if the airloop serves any computer rooms
  # / data centers, which changes the economizer.
  is_dc = false
  if air_loop_hvac_data_center_area_served(air_loop_hvac) > 0
    is_dc = true
  end

  # Retrieve economizer limits from JSON
  search_criteria = {
    'template' => template,
    'climate_zone' => climate_zone,
    'data_center' => is_dc
  }
  econ_limits = model_find_object(standards_data['economizers'], search_criteria)
  if econ_limits.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "Cannot find economizer limits for template '#{template}' and climate zone '#{climate_zone}', assuming no economizer required.")
    return economizer_required
  end

  # Determine the minimum capacity and whether or not it is a data center
  minimum_capacity_btu_per_hr = econ_limits['capacity_limit']

  # A big number of btu per hr as the minimum requirement if nil in spreadsheet
  infinity_btu_per_hr = 999_999_999_999
  minimum_capacity_btu_per_hr = infinity_btu_per_hr if minimum_capacity_btu_per_hr.nil?

  # Exception valid for 90.1-2004 (6.5.1.(e)) through 90.1-2019 (6.5.1.4)
  if is_res
    minimum_capacity_btu_per_hr *= 5
  end

  # Check whether the system requires an economizer by comparing
  # the system capacity to the minimum capacity.
  total_cooling_capacity_w = air_loop_hvac_total_cooling_capacity(air_loop_hvac)
  total_cooling_capacity_btu_per_hr = OpenStudio.convert(total_cooling_capacity_w, 'W', 'Btu/hr').get

  if total_cooling_capacity_btu_per_hr >= minimum_capacity_btu_per_hr
    if is_dc
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} requires an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr exceeds the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr for data centers.")
    elsif is_res
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} requires an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr exceeds the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr for residential spaces.")
    else
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} requires an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr exceeds the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr.")
    end
    economizer_required = true
  else
    if is_dc
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} does not require an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr is less than the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr for data centers.")
    elsif is_res
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} requires an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr exceeds the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr for residential spaces.")
    else
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} does not require an economizer because the total cooling capacity of #{total_cooling_capacity_btu_per_hr.round} Btu/hr is less than the minimum capacity of #{minimum_capacity_btu_per_hr.round} Btu/hr.")
    end
  end

  return economizer_required
end

#air_loop_hvac_economizer_type_allowable?(air_loop_hvac, climate_zone) ⇒ Boolean

Check the economizer type currently specified in the ControllerOutdoorAir object on this air loop is acceptable per the standard. Defaults to 90.1-2007 logic.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if allowable, if the system has no economizer or no OA system Returns false if the economizer type is not allowable.



1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1554

def air_loop_hvac_economizer_type_allowable?(air_loop_hvac, climate_zone)
  # EnergyPlus economizer types
  # 'NoEconomizer'
  # 'FixedDryBulb'
  # 'FixedEnthalpy'
  # 'DifferentialDryBulb'
  # 'DifferentialEnthalpy'
  # 'FixedDewPointAndDryBulb'
  # 'ElectronicEnthalpy'
  # 'DifferentialDryBulbAndEnthalpy'

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return true unless oa_sys.is_initialized

  oa_sys = oa_sys.get
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  # Return true if no economizer is present
  return true if economizer_type == 'NoEconomizer'

  # Determine the prohibited types
  prohibited_types = []
  case climate_zone
  when 'ASHRAE 169-2006-0B',
       'ASHRAE 169-2006-1B',
       'ASHRAE 169-2006-2B',
       'ASHRAE 169-2006-3B',
       'ASHRAE 169-2006-3C',
       'ASHRAE 169-2006-4B',
       'ASHRAE 169-2006-4C',
       'ASHRAE 169-2006-5B',
       'ASHRAE 169-2006-6B',
       'ASHRAE 169-2006-7A',
       'ASHRAE 169-2006-7B',
       'ASHRAE 169-2006-8A',
       'ASHRAE 169-2006-8B',
       'ASHRAE 169-2013-0B',
       'ASHRAE 169-2013-1B',
       'ASHRAE 169-2013-2B',
       'ASHRAE 169-2013-3B',
       'ASHRAE 169-2013-3C',
       'ASHRAE 169-2013-4B',
       'ASHRAE 169-2013-4C',
       'ASHRAE 169-2013-5B',
       'ASHRAE 169-2013-6B',
       'ASHRAE 169-2013-7A',
       'ASHRAE 169-2013-7B',
       'ASHRAE 169-2013-8A',
       'ASHRAE 169-2013-8B'
    prohibited_types = ['FixedEnthalpy']
  when 'ASHRAE 169-2006-0A',
       'ASHRAE 169-2006-1A',
       'ASHRAE 169-2006-2A',
       'ASHRAE 169-2006-3A',
       'ASHRAE 169-2006-4A',
       'ASHRAE 169-2013-0A',
       'ASHRAE 169-2013-1A',
       'ASHRAE 169-2013-2A',
       'ASHRAE 169-2013-3A',
       'ASHRAE 169-2013-4A'
    prohibited_types = ['DifferentialDryBulb']
  when 'ASHRAE 169-2006-5A',
       'ASHRAE 169-2006-6A',
       'ASHRAE 169-2013-5A',
       'ASHRAE 169-2013-6A'
    prohibited_types = []
  end

  # Check if the specified type is allowed
  economizer_type_allowed = true
  if prohibited_types.include?(economizer_type)
    economizer_type_allowed = false
  end

  return economizer_type_allowed
end

#air_loop_hvac_enable_demand_control_ventilation(air_loop_hvac, climate_zone) ⇒ Boolean

Enable demand control ventilation (DCV) for this air loop. Zones on this loop that require DCV preserve both per-area and per-person OA reqs. Other zones have OA reqs converted to per-area values only so that DCV won’t impact these zones.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if required, false if not



2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2419

def air_loop_hvac_enable_demand_control_ventilation(air_loop_hvac, climate_zone)
  # Get the OA intake
  controller_oa = nil
  controller_mv = nil
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
    controller_oa = oa_system.getControllerOutdoorAir
    controller_mv = controller_oa.controllerMechanicalVentilation
    if controller_mv.demandControlledVentilation == true
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: DCV was already enabled.")
      return true
    end
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Could not enable DCV since the system has no OA intake.")
    return false
  end

  # Change the min flow rate in the controller outdoor air
  controller_oa.setMinimumOutdoorAirFlowRate(0.0)

  # Enable DCV in the controller mechanical ventilation
  controller_mv.setDemandControlledVentilation(true)
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Enabled DCV.")

  return true
end

#air_loop_hvac_enable_multizone_vav_optimization(air_loop_hvac) ⇒ Boolean

Enable multizone vav optimization by changing the Outdoor Air Method in the Controller:MechanicalVentilation object to ‘VentilationRateProcedure’

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if required, false if not



1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1921

def air_loop_hvac_enable_multizone_vav_optimization(air_loop_hvac)
  # Enable multizone vav optimization
  # at each timestep.
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
    controller_oa = oa_system.getControllerOutdoorAir
    controller_mv = controller_oa.controllerMechanicalVentilation
    if air_loop_hvac.model.version < OpenStudio::VersionString.new('3.3.0')
      controller_mv.setSystemOutdoorAirMethod('VentilationRateProcedure')
    else
      controller_mv.setSystemOutdoorAirMethod('Standard62.1VentilationRateProcedureWithLimit')
    end
    # Change the min flow rate in the controller outdoor air
    controller_oa.setMinimumOutdoorAirFlowRate(0.0)
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, cannot enable multizone vav optimization because the system has no OA intake.")
    return false
  end
end

#air_loop_hvac_enable_optimum_start(air_loop_hvac) ⇒ Boolean

Adds optimum start control to the airloop.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 272

def air_loop_hvac_enable_optimum_start(air_loop_hvac)
  # Get the heating and cooling setpoint schedules
  # for all zones on this airloop.
  htg_clg_schs = []
  air_loop_hvac.thermalZones.each do |zone|
    # Skip zones with no thermostat
    next if zone.thermostatSetpointDualSetpoint.empty?

    # Get the heating and cooling setpoint schedules
    tstat = zone.thermostatSetpointDualSetpoint.get
    htg_sch = nil
    if tstat.heatingSetpointTemperatureSchedule.is_initialized
      htg_sch = tstat.heatingSetpointTemperatureSchedule.get
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{zone.name}: Cannot find a heating setpoint schedule for this zone, cannot apply optimum start control.")
      next
    end
    clg_sch = nil
    if tstat.coolingSetpointTemperatureSchedule.is_initialized
      clg_sch = tstat.coolingSetpointTemperatureSchedule.get
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{zone.name}: Cannot find a cooling setpoint schedule for this zone, cannot apply optimum start control.")
      next
    end
    htg_clg_schs << [htg_sch, clg_sch]
  end

  # Clean name of airloop
  loop_name_clean = ems_friendly_name(air_loop_hvac.name)

  # Sensors
  oat_db_c_sen = OpenStudio::Model::EnergyManagementSystemSensor.new(air_loop_hvac.model, 'Site Outdoor Air Drybulb Temperature')
  oat_db_c_sen.setName('OAT')
  oat_db_c_sen.setKeyName('Environment')

  # Make a program for each unique set of schedules.
  # For most air loops, all zones will have the same
  # pair of schedules.
  htg_clg_schs.uniq.each_with_index do |htg_clg_sch, i|
    htg_sch = htg_clg_sch[0]
    clg_sch = htg_clg_sch[1]

    if htg_sch.to_ScheduleConstant.is_initialized
      htg_sch_type = 'Schedule:Constant'
    elsif htg_sch.to_ScheduleCompact.is_initialized
      htg_sch_type = 'Schedule:Compact'
    else
      htg_sch_type = 'Schedule:Year'
    end

    if clg_sch.to_ScheduleCompact.is_initialized
      clg_sch_type = 'Schedule:Constant'
    elsif clg_sch.to_ScheduleCompact.is_initialized
      clg_sch_type = 'Schedule:Compact'
    else
      clg_sch_type = 'Schedule:Year'
    end

    # Actuators
    htg_sch_act = OpenStudio::Model::EnergyManagementSystemActuator.new(htg_sch, htg_sch_type, 'Schedule Value')
    htg_sch_act.setName("#{loop_name_clean}_HtgSch#{i}")

    clg_sch_act = OpenStudio::Model::EnergyManagementSystemActuator.new(clg_sch, clg_sch_type, 'Schedule Value')
    clg_sch_act.setName("#{loop_name_clean}_ClgSch#{i}")

    # Programs
    optstart_prg = OpenStudio::Model::EnergyManagementSystemProgram.new(air_loop_hvac.model)
    optstart_prg.setName("#{loop_name_clean}_OptimumStartProg#{i}")
    optstart_prg_body = <<-EMS
    IF DaylightSavings==0 && DayOfWeek>1 && Hour==5 && #{oat_db_c_sen.handle}<23.9 && #{oat_db_c_sen.handle}>1.7
      SET #{clg_sch_act.handle} = 29.4
      SET #{htg_sch_act.handle} = 15.6
    ELSEIF DaylightSavings==0 && DayOfWeek==1 && Hour==7 && #{oat_db_c_sen.handle}<23.9 && #{oat_db_c_sen.handle}>1.7
      SET #{clg_sch_act.handle} = 29.4
      SET #{htg_sch_act.handle} = 15.6
    ELSEIF DaylightSavings==1 && DayOfWeek>1 && Hour==4 && #{oat_db_c_sen.handle}<23.9 && #{oat_db_c_sen.handle}>1.7
      SET #{clg_sch_act.handle} = 29.4
      SET #{htg_sch_act.handle} = 15.6
    ELSEIF DaylightSavings==1 && DayOfWeek==1 && Hour==6 && #{oat_db_c_sen.handle}<23.9 && #{oat_db_c_sen.handle}>1.7
      SET #{clg_sch_act.handle} = 29.4
      SET #{htg_sch_act.handle} = 15.6
    ELSE
      SET #{clg_sch_act.handle} = NULL
      SET #{htg_sch_act.handle} = NULL
    ENDIF
    EMS
    optstart_prg.setBody(optstart_prg_body)

    # Program Calling Managers
    setup_mgr = OpenStudio::Model::EnergyManagementSystemProgramCallingManager.new(air_loop_hvac.model)
    setup_mgr.setName("#{loop_name_clean}_OptimumStartCallingManager#{i}")
    setup_mgr.setCallingPoint('BeginTimestepBeforePredictor')
    setup_mgr.addProgram(optstart_prg)
  end

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Optimum start control enabled.")

  return true
end

#air_loop_hvac_enable_supply_air_temperature_reset_delta(air_loop_hvac) ⇒ Double

Determines supply air temperature (SAT) temperature. Defaults to 90.1-2007, 5 delta-F ®

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Double)

    the SAT reset amount in degrees Rankine



2496
2497
2498
2499
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2496

def air_loop_hvac_enable_supply_air_temperature_reset_delta(air_loop_hvac)
  sat_reset_r = 5.0
  return sat_reset_r
end

#air_loop_hvac_enable_supply_air_temperature_reset_outdoor_temperature(air_loop_hvac) ⇒ Boolean

Enable supply air temperature (SAT) reset based on outdoor air conditions. SAT will be kept at the current design temperature when outdoor air is above 70F, increased by 5F when outdoor air is below 50F, and reset linearly when outdoor air is between 50F and 70F.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2508

def air_loop_hvac_enable_supply_air_temperature_reset_outdoor_temperature(air_loop_hvac)
  # for AHU1 in Outpatient, SAT is 52F constant, no reset
  return true if air_loop_hvac.name.get == 'PVAV Outpatient F1'

  # Get the current setpoint and calculate
  # the new setpoint.
  sizing_system = air_loop_hvac.sizingSystem
  sat_at_hi_oat_c = sizing_system.centralCoolingDesignSupplyAirTemperature
  sat_at_hi_oat_f = OpenStudio.convert(sat_at_hi_oat_c, 'C', 'F').get
  # 5F increase when it's cold outside,
  # and therefore less cooling capacity is likely required.
  increase_f = air_loop_hvac_enable_supply_air_temperature_reset_delta(air_loop_hvac)
  sat_at_lo_oat_f = sat_at_hi_oat_f + increase_f
  sat_at_lo_oat_c = OpenStudio.convert(sat_at_lo_oat_f, 'F', 'C').get

  # Define the high and low outdoor air temperatures
  lo_oat_f = 50
  lo_oat_c = OpenStudio.convert(lo_oat_f, 'F', 'C').get
  hi_oat_f = 70
  hi_oat_c = OpenStudio.convert(hi_oat_f, 'F', 'C').get

  # Create a setpoint manager
  sat_oa_reset = OpenStudio::Model::SetpointManagerOutdoorAirReset.new(air_loop_hvac.model)
  sat_oa_reset.setName("#{air_loop_hvac.name} SAT Reset")
  sat_oa_reset.setControlVariable('Temperature')
  sat_oa_reset.setSetpointatOutdoorLowTemperature(sat_at_lo_oat_c)
  sat_oa_reset.setOutdoorLowTemperature(lo_oat_c)
  sat_oa_reset.setSetpointatOutdoorHighTemperature(sat_at_hi_oat_c)
  sat_oa_reset.setOutdoorHighTemperature(hi_oat_c)

  # Attach the setpoint manager to the
  # supply outlet node of the system.
  sat_oa_reset.addToNode(air_loop_hvac.supplyOutletNode)

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Supply air temperature reset was enabled.  When OAT is greater than #{hi_oat_f.round}F, SAT is #{sat_at_hi_oat_f.round}F.  When OAT is less than #{lo_oat_f.round}F, SAT is #{sat_at_lo_oat_f.round}F.  It varies linearly in between these points.")

  return true
end

#air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone(air_loop_hvac) ⇒ Boolean

Enable supply air temperature (SAT) reset based on the cooling demand of the warmest zone.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if successful, false if not



2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2461

def air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone(air_loop_hvac)
  # Get the current setpoint and calculate
  # the new setpoint.
  sizing_system = air_loop_hvac.sizingSystem
  design_sat_c = sizing_system.centralCoolingDesignSupplyAirTemperature
  design_sat_f = OpenStudio.convert(design_sat_c, 'C', 'F').get

  # Get the SAT reset delta
  sat_reset_r = air_loop_hvac_enable_supply_air_temperature_reset_delta(air_loop_hvac)
  sat_reset_k = OpenStudio.convert(sat_reset_r, 'R', 'K').get

  max_sat_f = design_sat_f + sat_reset_r
  max_sat_c = design_sat_c + sat_reset_k

  # Create a setpoint manager
  sat_warmest_reset = OpenStudio::Model::SetpointManagerWarmest.new(air_loop_hvac.model)
  sat_warmest_reset.setName("#{air_loop_hvac.name} SAT Warmest Reset")
  sat_warmest_reset.setStrategy('MaximumTemperature')
  sat_warmest_reset.setMinimumSetpointTemperature(design_sat_c)
  sat_warmest_reset.setMaximumSetpointTemperature(max_sat_c)

  # Attach the setpoint manager to the
  # supply outlet node of the system.
  sat_warmest_reset.addToNode(air_loop_hvac.supplyOutletNode)

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Supply air temperature reset was enabled using a SPM Warmest with a min SAT of #{design_sat_f.round}F and a max SAT of #{max_sat_f.round}F.")

  return true
end

#air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac, min_occ_pct = 0.05) ⇒ Boolean

Shut off the system during unoccupied periods. During these times, systems will cycle on briefly if temperature drifts below setpoint. If the system already has a schedule other than Always-On, no change will be made. If the system has an Always-On schedule assigned, a new schedule will be created. In this case, occupied is defined as the total percent occupancy for the loop for all zones served.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • min_occ_pct (Double) (defaults to: 0.05)

    the fractional value below which the system will be considered unoccupied.

Returns:

  • (Boolean)

    returns true if successful, false if not



3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3340

def air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac, min_occ_pct = 0.05)
  # Set the system to night cycle
  # The fan of a parallel PIU terminal are set to only cycle during heating operation
  # This is achieved using the CycleOnAnyCoolingOrHeatingZone; During cooling operation
  # the load is met by running the central system which stays off during heating
  # operation
  air_loop_hvac.setNightCycleControlType('CycleOnAny')
  if air_loop_hvac_has_parallel_piu_air_terminals?(air_loop_hvac)
    avail_mgrs = air_loop_hvac.availabilityManagers
    if !avail_mgrs.nil?
      avail_mgrs.each do |avail_mgr|
        if avail_mgr.to_AvailabilityManagerNightCycle.is_initialized
          avail_mgr_nc = avail_mgr.to_AvailabilityManagerNightCycle.get
          avail_mgr_nc.setControlType('CycleOnAnyCoolingOrHeatingZone')
          zones = air_loop_hvac.thermalZones
          avail_mgr_nc.setCoolingControlThermalZones(zones)
          avail_mgr_nc.setHeatingZoneFansOnlyThermalZones(zones)
        end
      end
    end
  end

  model = air_loop_hvac.model
  # Check if schedule was stored in an additionalProperties field of the air loop
  air_loop_name = air_loop_hvac.name
  if air_loop_hvac.hasAdditionalProperties && air_loop_hvac.additionalProperties.hasFeature('fan_sched_name')
    fan_sched_name = air_loop_hvac.additionalProperties.getFeatureAsString('fan_sched_name').get
    fan_sched = model.getScheduleRulesetByName(fan_sched_name).get
    air_loop_hvac.setAvailabilitySchedule(fan_sched)
    return true
  end

  # Check if already using a schedule other than always on
  avail_sch = air_loop_hvac.availabilitySchedule
  unless avail_sch == air_loop_hvac.model.alwaysOnDiscreteSchedule
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Availability schedule is already set to #{avail_sch.name}.  Will assume this includes unoccupied shut down; no changes will be made.")
    return true
  end

  # Get the airloop occupancy schedule
  loop_occ_sch = air_loop_hvac_get_occupancy_schedule(air_loop_hvac, occupied_percentage_threshold: min_occ_pct)
  flh = OpenstudioStandards::Schedules.schedule_get_equivalent_full_load_hours(loop_occ_sch)
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Annual occupied hours = #{flh.round} hr/yr, assuming a #{min_occ_pct} occupancy threshold.  This schedule will be used as the HVAC operation schedule.")

  # Set HVAC availability schedule to follow occupancy
  air_loop_hvac.setAvailabilitySchedule(loop_occ_sch)
  air_loop_hvac.supplyComponents.each do |comp|
    if comp.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.is_initialized
      comp.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.get.setSupplyAirFanOperatingModeSchedule(loop_occ_sch)
    elsif comp.to_AirLoopHVACUnitarySystem.is_initialized
      comp.to_AirLoopHVACUnitarySystem.get.setSupplyAirFanOperatingModeSchedule(loop_occ_sch)
    end
  end

  return true
end

#air_loop_hvac_energy_recovery?(air_loop_hvac) ⇒ Boolean

Determine if the system has energy recovery already

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if an ERV is present, false if not



2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2641

def air_loop_hvac_energy_recovery?(air_loop_hvac)
  has_erv = false

  # Get the OA system
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  return false unless oa_sys.is_initialized

  # Find any ERV on the OA system
  oa_sys = oa_sys.get
  oa_sys.oaComponents.each do |oa_comp|
    if oa_comp.to_HeatExchangerAirToAirSensibleAndLatent.is_initialized
      has_erv = true
    end
  end

  return has_erv
end

#air_loop_hvac_energy_recovery_ventilator_flow_limit(air_loop_hvac, climate_zone, pct_oa) ⇒ Double

Determine the airflow limits that govern whether or not an ERV is required. Based on climate zone and % OA. Defaults to DOE Ref Pre-1980, not required.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

  • pct_oa (Double)

    percentage of outdoor air

Returns:

  • (Double)

    the flow rate above which an ERV is required. if nil, ERV is never required.



1745
1746
1747
1748
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1745

def air_loop_hvac_energy_recovery_ventilator_flow_limit(air_loop_hvac, climate_zone, pct_oa)
  erv_cfm = nil # Not required
  return erv_cfm
end

#air_loop_hvac_energy_recovery_ventilator_heat_exchanger_type(air_loop_hvac) ⇒ String

Determine whether to use a Plate-Frame or Rotary Wheel style ERV depending on air loop outdoor air flow rate Defaults to Rotary.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:



1767
1768
1769
1770
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1767

def air_loop_hvac_energy_recovery_ventilator_heat_exchanger_type(air_loop_hvac)
  heat_exchanger_type = 'Rotary'
  return heat_exchanger_type
end

#air_loop_hvac_energy_recovery_ventilator_required?(air_loop_hvac, climate_zone) ⇒ Boolean

TODO:

Add exception logic for systems serving parking garage, warehouse, or multifamily

Check if ERV is required on this airloop.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if required, false if not



1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1639

def air_loop_hvac_energy_recovery_ventilator_required?(air_loop_hvac, climate_zone)
  # ERV Not Applicable for AHUs that serve
  # parking garage, warehouse, or multifamily
  # if space_types_served_names.include?('PNNL_Asset_Rating_Apartment_Space_Type') ||
  # space_types_served_names.include?('PNNL_Asset_Rating_LowRiseApartment_Space_Type') ||
  # space_types_served_names.include?('PNNL_Asset_Rating_ParkingGarage_Space_Type') ||
  # space_types_served_names.include?('PNNL_Asset_Rating_Warehouse_Space_Type')
  # OpenStudio::logFree(OpenStudio::Info, "openstudio.standards.AirLoopHVAC", "For #{self.name}, ERV not applicable because it because it serves parking garage, warehouse, or multifamily.")
  # return false
  # end

  erv_required = nil
  # ERV not applicable for medical AHUs (AHU1 in Outpatient), per AIA 2001 - 7.31.D2.
  # @todo refactor: move building type specific code
  if air_loop_hvac.name.to_s.include? 'Outpatient F1'
    erv_required = false
    return erv_required
  end

  # ERV not applicable for medical AHUs, per AIA 2001 - 7.31.D2.
  if air_loop_hvac.name.to_s.include? 'VAV_ER'
    erv_required = false
    return erv_required
  elsif air_loop_hvac.name.to_s.include? 'VAV_OR'
    erv_required = false
    return erv_required
  end
  case template
  when '90.1-2004', '90.1-2007'
    # @todo Refactor figure out how to remove this.
    if air_loop_hvac.name.to_s.include? 'VAV_ICU'
      erv_required = false
      return erv_required
    elsif air_loop_hvac.name.to_s.include? 'VAV_PATRMS'
      erv_required = false
      return erv_required
    end
  end

  # ERV Not Applicable for AHUs that have DCV or that have no OA intake.
  if air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized
    oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get
    controller_oa = oa_system.getControllerOutdoorAir
    controller_mv = controller_oa.controllerMechanicalVentilation
    if controller_mv.demandControlledVentilation == true
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV not applicable because DCV enabled.")
      return false
    end
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV not applicable because it has no OA intake.")
    return false
  end

  # Get the AHU design supply air flow rate
  dsn_flow_m3_per_s = nil
  if air_loop_hvac.designSupplyAirFlowRate.is_initialized
    dsn_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
  elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
    dsn_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} design supply air flow rate is not available, cannot apply efficiency standard.")
    return false
  end
  dsn_flow_cfm = OpenStudio.convert(dsn_flow_m3_per_s, 'm^3/s', 'cfm').get

  # Get the minimum OA flow rate
  min_oa_flow_m3_per_s = nil
  if controller_oa.minimumOutdoorAirFlowRate.is_initialized
    min_oa_flow_m3_per_s = controller_oa.minimumOutdoorAirFlowRate.get
  elsif controller_oa.autosizedMinimumOutdoorAirFlowRate.is_initialized
    min_oa_flow_m3_per_s = controller_oa.autosizedMinimumOutdoorAirFlowRate.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{controller_oa.name}: minimum OA flow rate is not available, cannot apply efficiency standard.")
    return false
  end
  min_oa_flow_cfm = OpenStudio.convert(min_oa_flow_m3_per_s, 'm^3/s', 'cfm').get

  # Calculate the percent OA at design airflow
  pct_oa = min_oa_flow_m3_per_s / dsn_flow_m3_per_s

  # Determine the airflow limit
  erv_cfm = air_loop_hvac_energy_recovery_ventilator_flow_limit(air_loop_hvac, climate_zone, pct_oa)

  # Determine if an ERV is required
  if erv_cfm.nil?
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV not required based on #{(pct_oa * 100).round}% OA flow, design supply air flow of #{dsn_flow_cfm.round}cfm, and climate zone #{climate_zone}.")
    erv_required = false
  elsif dsn_flow_cfm < erv_cfm
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV not required based on #{(pct_oa * 100).round}% OA flow, design supply air flow of #{dsn_flow_cfm.round}cfm, and climate zone #{climate_zone}. Does not exceed minimum flow requirement of #{erv_cfm}cfm.")
    erv_required = false
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}, ERV required based on #{(pct_oa * 100).round}% OA flow, design supply air flow of #{dsn_flow_cfm.round}cfm, and climate zone #{climate_zone}. Exceeds minimum flow requirement of #{erv_cfm}cfm.")
    erv_required = true
  end

  return erv_required
end

#air_loop_hvac_energy_recovery_ventilator_type(air_loop_hvac, climate_zone) ⇒ String

Determine whether to apply an Energy Recovery Ventilator ‘ERV’ or a Heat Recovery Ventilator ‘HRV’ depending on the climate zone Defaults to ERV.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:



1757
1758
1759
1760
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1757

def air_loop_hvac_energy_recovery_ventilator_type(air_loop_hvac, climate_zone)
  erv_type = 'ERV'
  return erv_type
end

#air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower(air_loop_hvac) ⇒ Double

TODO:

Determine the presence of MERV filters and other stuff in Table 6.5.3.1.1B. May need to extend AirLoopHVAC data model

Determine the fan power limitation pressure drop adjustment Per Table 6.5.3.1.1B

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Double)

    fan power limitation pressure drop adjustment, in units of horsepower



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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 429

def air_loop_hvac_fan_power_limitation_pressure_drop_adjustment_brake_horsepower(air_loop_hvac)
  # Get design supply air flow rate (whether autosized or hard-sized)
  dsn_air_flow_m3_per_s = 0
  dsn_air_flow_cfm = 0
  if air_loop_hvac.designSupplyAirFlowRate.is_initialized
    dsn_air_flow_m3_per_s = air_loop_hvac.designSupplyAirFlowRate.get
    dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Hard sized Design Supply Air Flow Rate.")
  elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
    dsn_air_flow_m3_per_s = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
    dsn_air_flow_cfm = OpenStudio.convert(dsn_air_flow_m3_per_s, 'm^3/s', 'cfm').get
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "* #{dsn_air_flow_cfm.round} cfm = Autosized Design Supply Air Flow Rate.")
  end

  # @todo determine the presence of MERV filters and other stuff
  # in Table 6.5.3.1.1B
  # perhaps need to extend AirLoopHVAC data model
  has_fully_ducted_return_and_or_exhaust_air_systems = false
  has_merv_9_through_12 = false
  has_merv_13_through_15 = false

  # Calculate Fan Power Limitation Pressure Drop Adjustment (in wc)
  fan_pwr_adjustment_in_wc = 0

  # Fully ducted return and/or exhaust air systems
  if has_fully_ducted_return_and_or_exhaust_air_systems
    adj_in_wc = 0.5
    fan_pwr_adjustment_in_wc += adj_in_wc
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "--Added #{adj_in_wc} in wc for Fully ducted return and/or exhaust air systems")
  end

  # MERV 9 through 12
  if has_merv_9_through_12
    adj_in_wc = 0.5
    fan_pwr_adjustment_in_wc += adj_in_wc
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "--Added #{adj_in_wc} in wc for Particulate Filtration Credit: MERV 9 through 12")
  end

  # MERV 13 through 15
  if has_merv_13_through_15
    adj_in_wc = 0.9
    fan_pwr_adjustment_in_wc += adj_in_wc
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "--Added #{adj_in_wc} in wc for Particulate Filtration Credit: MERV 13 through 15")
  end

  # Convert the pressure drop adjustment to brake horsepower (bhp)
  # assuming that all supply air passes through all devices
  fan_pwr_adjustment_bhp = fan_pwr_adjustment_in_wc * dsn_air_flow_cfm / 4131
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Fan Power Limitation Pressure Drop Adjustment = #{fan_pwr_adjustment_bhp.round(2)} bhp")

  return fan_pwr_adjustment_bhp
end

#air_loop_hvac_find_design_supply_air_flow_rate(air_loop_hvac) ⇒ Double

find design_supply_air_flow_rate

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Double)

    design supply air flow rate in m^3/s



3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3449

def air_loop_hvac_find_design_supply_air_flow_rate(air_loop_hvac)
  # Get the design_supply_air_flow_rate
  design_supply_air_flow_rate = nil
  if air_loop_hvac.designSupplyAirFlowRate.is_initialized
    design_supply_air_flow_rate = air_loop_hvac.designSupplyAirFlowRate.get
  elsif air_loop_hvac.autosizedDesignSupplyAirFlowRate.is_initialized
    design_supply_air_flow_rate = air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} design supply air flow rate is not available.")
  end

  return design_supply_air_flow_rate
end

#air_loop_hvac_floor_area_served(air_loop_hvac) ⇒ Object

Calculate the total floor area of all zones attached to the air loop, in m^2.

return [Double] the total floor area of all zones attached to the air loop in m^2.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop



3401
3402
3403
3404
3405
3406
3407
3408
3409
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3401

def air_loop_hvac_floor_area_served(air_loop_hvac)
  total_area = 0.0

  air_loop_hvac.thermalZones.each do |zone|
    total_area += zone.floorArea
  end

  return total_area
end

#air_loop_hvac_floor_area_served_exterior_zones(air_loop_hvac) ⇒ Object

Calculate the total floor area of all zones attached to the air loop that have at least one exterior surface, in m^2.

return [Double] the total floor area of all zones attached to the air loop in m^2.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop



3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3432

def air_loop_hvac_floor_area_served_exterior_zones(air_loop_hvac)
  total_area = 0.0

  air_loop_hvac.thermalZones.each do |zone|
    # Skip zones that have no exterior surface area
    next if zone.exteriorSurfaceArea.zero?

    total_area += zone.floorArea
  end

  return total_area
end

#air_loop_hvac_floor_area_served_interior_zones(air_loop_hvac) ⇒ Object

Calculate the total floor area of all zones attached to the air loop that have no exterior surfaces, in m^2.

return [Double] the total floor area of all zones attached to the air loop in m^2.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop



3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3415

def air_loop_hvac_floor_area_served_interior_zones(air_loop_hvac)
  total_area = 0.0

  air_loop_hvac.thermalZones.each do |zone|
    # Skip zones that have exterior surface area
    next if zone.exteriorSurfaceArea > 0

    total_area += zone.floorArea
  end

  return total_area
end

#air_loop_hvac_get_occupancy_schedule(air_loop_hvac, occupied_percentage_threshold: 0.05) ⇒ ScheduleRuleset

This method creates a new discrete fractional schedule ruleset. The value is set to one when occupancy across all zones is greater than or equal to the occupied_percentage_threshold, and zero all other times. This method is designed to use the total number of people on the airloop, so if there is a zone that is continuously occupied by a few people, but other zones that are intermittently occupied by many people, the first zone doesn’t drive the entire system.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • occupied_percentage_threshold (Double) (defaults to: 0.05)

    the minimum fraction (0 to 1) that counts as occupied

Returns:

  • (ScheduleRuleset)

    a ScheduleRuleset where 0 = unoccupied, 1 = occupied



2902
2903
2904
2905
2906
2907
2908
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2902

def air_loop_hvac_get_occupancy_schedule(air_loop_hvac, occupied_percentage_threshold: 0.05)
  # Create combined occupancy schedule of every space in every zone served by this airloop
  sch_ruleset = OpenstudioStandards::ThermalZone.thermal_zones_get_occupancy_schedule(air_loop_hvac.thermalZones,
                                                                                      sch_name: "#{air_loop_hvac.name} Occ Sch",
                                                                                      occupied_percentage_threshold: occupied_percentage_threshold)
  return sch_ruleset
end

#air_loop_hvac_get_relief_fan_power(air_loop) ⇒ Double

Get relief fan power for airloop

Parameters:

  • air_loop (OpenStudio::Model::AirLoopHVAC)

    AirLoopHVAC object

Returns:

  • (Double)

    Fan power



3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3820

def air_loop_hvac_get_relief_fan_power(air_loop)
  relief_fan_power = 0

  if air_loop.reliefFan.is_initialized
    # Get return fan
    fan = air_loop.reliefFan.get

    # Get fan object
    if fan.to_FanConstantVolume.is_initialized
      fan = fan.to_FanConstantVolume.get
    elsif fan.to_FanVariableVolume.is_initialized
      fan = fan.to_FanVariableVolume.get
    elsif fan.to_FanOnOff.is_initialized
      fan = fan.to_FanOnOff.get
    end

    # Get fan power
    relief_fan_power += fan_fanpower(fan)
  end

  return relief_fan_power
end

#air_loop_hvac_get_return_fan_power(air_loop) ⇒ Double

Get return fan power for airloop

Parameters:

  • air_loop (OpenStudio::Model::AirLoopHVAC)

    AirLoopHVAC object

Returns:

  • (Double)

    Fan power



3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3735

def air_loop_hvac_get_return_fan_power(air_loop)
  return_fan_power = 0

  if air_loop.returnFan.is_initialized
    # Get return fan
    fan = air_loop.returnFan.get

    # Get fan object
    if fan.to_FanConstantVolume.is_initialized
      fan = fan.to_FanConstantVolume.get
    elsif fan.to_FanVariableVolume.is_initialized
      fan = fan.to_FanVariableVolume.get
    elsif fan.to_FanOnOff.is_initialized
      fan = fan.to_FanOnOff.get
    end

    # Get fan power
    return_fan_power += fan_fanpower(fan)
  end

  return return_fan_power
end

#air_loop_hvac_get_supply_fan(air_loop) ⇒ Object

Get supply fan for airloop

Parameters:

  • air_loop (OpenStudio::Model::AirLoopHVAC)

    AirLoopHVAC object

Returns:

  • fan



3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3780

def air_loop_hvac_get_supply_fan(air_loop)
  fan = nil
  if air_loop.supplyFan.is_initialized
    # Get return fan
    fan = air_loop.supplyFan.get

    # Get fan object
    if fan.to_FanConstantVolume.is_initialized
      fan = fan.to_FanConstantVolume.get
    elsif fan.to_FanVariableVolume.is_initialized
      fan = fan.to_FanVariableVolume.get
    elsif fan.to_FanOnOff.is_initialized
      fan = fan.to_FanOnOff.get
    end

  else
    air_loop.supplyComponents.each do |comp|
      if comp.to_AirLoopHVACUnitarySystem.is_initialized
        fan = comp.to_AirLoopHVACUnitarySystem.get.supplyFan
        next if fan.empty?

        # Get fan object
        fan = fan.get
        if fan.to_FanConstantVolume.is_initialized
          fan = fan.to_FanConstantVolume.get
        elsif fan.to_FanVariableVolume.is_initialized
          fan = fan.to_FanVariableVolume.get
        elsif fan.to_FanOnOff.is_initialized
          fan = fan.to_FanOnOff.get
        end
      end
    end
  end
  return fan
end

#air_loop_hvac_get_supply_fan_power(air_loop) ⇒ Double

Get supply fan power for airloop

Parameters:

  • air_loop (OpenStudio::Model::AirLoopHVAC)

    AirLoopHVAC object

Returns:

  • (Double)

    Fan power



3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3762

def air_loop_hvac_get_supply_fan_power(air_loop)
  supply_fan_power = 0

  # Get fan
  fan = air_loop_hvac_get_supply_fan(air_loop)

  if !fan.nil?
    # Get fan power
    supply_fan_power += fan_fanpower(fan)
  end

  return supply_fan_power
end

#air_loop_hvac_has_parallel_piu_air_terminals?(air_loop_hvac) ⇒ Boolean

Determine if the air loop serves parallel PIU air terminals

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)


3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3316

def air_loop_hvac_has_parallel_piu_air_terminals?(air_loop_hvac)
  has_parallel_piu_terminals = false
  air_loop_hvac.thermalZones.each do |zone|
    zone.equipment.each do |equipment|
      # Get the object type
      obj_type = equipment.iddObjectType.valueName.to_s
      if obj_type == 'OS_AirTerminal_SingleDuct_ParallelPIU_Reheat'
        return true
      end
    end
  end

  return has_parallel_piu_terminals
end

#air_loop_hvac_has_simple_transfer_air?(air_loop_hvac) ⇒ Boolean

Checks if zones served by the air loop use zone exhaust fan a simplified approach to model transfer air

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    OpenStudio AirLoopHVAC object

Returns:

  • (Boolean)

    true if simple transfer air is modeled, false otherwise



3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3878

def air_loop_hvac_has_simple_transfer_air?(air_loop_hvac)
  simple_transfer_air = false
  zones = air_loop_hvac.thermalZones
  zones_name = []
  zones.each do |zone|
    zones_name << zone.name.to_s
  end
  air_loop_hvac.model.getFanZoneExhausts.sort.each do |exhaust_fan|
    if (zones_name.include? exhaust_fan.thermalZone.get.name.to_s) && exhaust_fan.balancedExhaustFractionSchedule.is_initialized
      simple_transfer_air = true
    end
  end
  return simple_transfer_air
end

#air_loop_hvac_humidifier_count(air_loop_hvac) ⇒ Integer

Determine how many humidifies are on the airloop

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Integer)

    the number of humidifiers



3528
3529
3530
3531
3532
3533
3534
3535
3536
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3528

def air_loop_hvac_humidifier_count(air_loop_hvac)
  humidifiers = 0
  air_loop_hvac.supplyComponents.each do |cmp|
    if cmp.to_HumidifierSteamElectric.is_initialized
      humidifiers += 1
    end
  end
  return humidifiers
end

#air_loop_hvac_include_cooling_coil?(air_loop_hvac) ⇒ Boolean

Determine if the airloop includes cooling coils

Returns:

  • (Boolean)

    returns true if cooling coils are included on the airloop



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1186

def air_loop_hvac_include_cooling_coil?(air_loop_hvac)
  air_loop_hvac.supplyComponents.each do |comp|
    return true if comp.to_CoilCoolingWater.is_initialized
    return true if comp.to_CoilCoolingWater.is_initialized
    return true if comp.to_CoilCoolingCooledBeam.is_initialized
    return true if comp.to_CoilCoolingDXMultiSpeed.is_initialized
    return true if comp.to_CoilCoolingDXSingleSpeed.is_initialized
    return true if comp.to_CoilCoolingDXTwoSpeed.is_initialized
    return true if comp.to_CoilCoolingDXTwoStageWithHumidityControlMode.is_initialized
    return true if comp.to_CoilCoolingDXVariableRefrigerantFlow.is_initialized
    return true if comp.to_CoilCoolingDXVariableSpeed.is_initialized
    return true if comp.to_CoilCoolingFourPipeBeam.is_initialized
    return true if comp.to_CoilCoolingLowTempRadiantConstFlow.is_initialized
    return true if comp.to_CoilCoolingLowTempRadiantVarFlow.is_initialized
    return true if comp.to_CoilCoolingWater.is_initialized
    return true if comp.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized
    return true if comp.to_CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.is_initialized

    if comp.to_AirLoopHVACUnitarySystem.is_initialized
      unitary_system = comp.to_AirLoopHVACUnitarySystem.get
      if unitary_system.coolingCoil.is_initialized
        cooling_coil = unitary_system.coolingCoil.get
        return true if cooling_coil.to_CoilCoolingWater.is_initialized
        return true if cooling_coil.to_CoilCoolingWater.is_initialized
        return true if cooling_coil.to_CoilCoolingCooledBeam.is_initialized
        return true if cooling_coil.to_CoilCoolingDXMultiSpeed.is_initialized
        return true if cooling_coil.to_CoilCoolingDXSingleSpeed.is_initialized
        return true if cooling_coil.to_CoilCoolingDXTwoSpeed.is_initialized
        return true if cooling_coil.to_CoilCoolingDXTwoStageWithHumidityControlMode.is_initialized
        return true if cooling_coil.to_CoilCoolingDXVariableRefrigerantFlow.is_initialized
        return true if cooling_coil.to_CoilCoolingDXVariableSpeed.is_initialized
        return true if cooling_coil.to_CoilCoolingFourPipeBeam.is_initialized
        return true if cooling_coil.to_CoilCoolingLowTempRadiantConstFlow.is_initialized
        return true if cooling_coil.to_CoilCoolingLowTempRadiantVarFlow.is_initialized
        return true if cooling_coil.to_CoilCoolingWater.is_initialized
        return true if cooling_coil.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized
        return true if cooling_coil.to_CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.is_initialized
      end
    end
  end
  return false
end

#air_loop_hvac_include_economizer?(air_loop_hvac) ⇒ Boolean

Determine if the airloop includes an air-economizer

Returns:

  • (Boolean)

    returns true if the airloop has an air-economizer



1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1243

def air_loop_hvac_include_economizer?(air_loop_hvac)
  return false unless air_loop_hvac.airLoopHVACOutdoorAirSystem.is_initialized

  # Get OA system
  air_loop_hvac_oa_system = air_loop_hvac.airLoopHVACOutdoorAirSystem.get

  # Get OA controller
  air_loop_hvac_oa_controller = air_loop_hvac_oa_system.getControllerOutdoorAir

  # Get economizer type
  economizer_type = air_loop_hvac_oa_controller.getEconomizerControlType.to_s
  return false if economizer_type == 'NoEconomizer'

  return true
end

#air_loop_hvac_include_evaporative_cooler?(air_loop_hvac) ⇒ Boolean

Determine if the airloop includes evaporative coolers

Returns:

  • (Boolean)

    returns true if evaporative coolers are included on the airloop



1232
1233
1234
1235
1236
1237
1238
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1232

def air_loop_hvac_include_evaporative_cooler?(air_loop_hvac)
  air_loop_hvac.supplyComponents.each do |comp|
    return true if comp.to_EvaporativeCoolerDirectResearchSpecial.is_initialized
    return true if comp.to_EvaporativeCoolerIndirectResearchSpecial.is_initialized
  end
  return false
end

#air_loop_hvac_include_hydronic_cooling_coil?(air_loop_hvac) ⇒ Boolean

Determine if the airloop includes hydronic cooling coils

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if hydronic cooling coils are included on the airloop



1176
1177
1178
1179
1180
1181
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1176

def air_loop_hvac_include_hydronic_cooling_coil?(air_loop_hvac)
  air_loop_hvac.supplyComponents.each do |comp|
    return true if comp.to_CoilCoolingWater.is_initialized
  end
  return false
end

#air_loop_hvac_include_unitary_system?(air_loop_hvac) ⇒ Boolean

Determine if the air loop includes a unitary system

Returns:

  • (Boolean)

    returns true if a unitary system is included on the air loop



1279
1280
1281
1282
1283
1284
1285
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1279

def air_loop_hvac_include_unitary_system?(air_loop_hvac)
  air_loop_hvac.supplyComponents.each do |comp|
    return true if comp.to_AirLoopHVACUnitarySystem.is_initialized
  end

  return false
end

#air_loop_hvac_include_wshp?(air_loop_hvac) ⇒ Boolean

Determine if the airloop includes WSHP cooling coils

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

Returns:

  • (Boolean)

    returns true if WSHP cooling coils are included on the airloop



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1263

def air_loop_hvac_include_wshp?(air_loop_hvac)
  air_loop_hvac.supplyComponents.each do |comp|
    return true if comp.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized

    if comp.to_AirLoopHVACUnitarySystem.is_initialized
      clg_coil = comp.to_AirLoopHVACUnitarySystem.get.coolingCoil.get
      return true if clg_coil.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized

    end
  end
  return false
end

#air_loop_hvac_integrated_economizer_required?(air_loop_hvac, climate_zone) ⇒ Boolean

Determine if the system economizer must be integrated or not. Default logic is from 90.1-2004.

Parameters:

  • air_loop_hvac (OpenStudio::Model::AirLoopHVAC)

    air loop

  • climate_zone (String)

    ASHRAE climate zone, e.g. ‘ASHRAE 169-2013-4A’

Returns:

  • (Boolean)

    returns true if required, false if not



1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
134