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.ThermalZone.rb,
lib/openstudio-standards/standards/Standards.Construction.rb,
lib/openstudio-standards/standards/Standards.BuildingStory.rb,
lib/openstudio-standards/standards/Standards.PlanarSurface.rb,
lib/openstudio-standards/standards/Standards.BoilerHotWater.rb,
lib/openstudio-standards/standards/Standards.FanZoneExhaust.rb,
lib/openstudio-standards/standards/Standards.ScheduleCompact.rb,
lib/openstudio-standards/standards/Standards.ScheduleRuleset.rb,
lib/openstudio-standards/standards/Standards.ScheduleConstant.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.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/standards/Standards.CoilCoolingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb,
lib/openstudio-standards/standards/Standards.CoilHeatingGasMultiStage.rb,
lib/openstudio-standards/standards/Standards.CoolingTowerVariableSpeed.rb,
lib/openstudio-standards/standards/Standards.HeaderedPumpsConstantSpeed.rb,
lib/openstudio-standards/standards/Standards.HeaderedPumpsVariableSpeed.rb,
lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb,
lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanOnOff.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.swh.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.hvac.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.CoilHeatingGas.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.FanZoneExhaust.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.elevators.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.ControllerWaterCoil.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.Model.exterior_lights.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.AirTerminalSingleDuctVAVReheat.rb,
lib/openstudio-standards/prototypes/common/objects/Prototype.HeatExchangerAirToAirSensibleAndLatent.rb,
lib/openstudio-standards/weather/Weather.Model.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, 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

ThermalZone collapse

Construction collapse

BuildingStory collapse

PlanarSurface collapse

BoilerHotWater collapse

ScheduleCompact collapse

ScheduleRuleset collapse

ScheduleConstant collapse

WaterHeaterMixed collapse

ZoneHVACComponent collapse

ChillerElectricEIR collapse

HeatExchangerSensLat collapse

CoilCoolingDXMultiSpeed collapse

CoilHeatingDXMultiSpeed collapse

CoilHeatingGasMultiStage collapse

AirTerminalSingleDuctVAVReheat collapse

AirTerminalSingleDuctParallelPIUReheat collapse

utilities collapse

hvac_systems collapse

refrigeration collapse

CoilHeatingGas collapse

ControllerWaterCoil collapse

HeatExchangerAirToAirSensibleAndLatent collapse

CoilDX collapse

CoolingTower collapse

Fan collapse

Pump collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#space_multiplier_mapObject

Returns the value of attribute space_multiplier_map


2
3
4
# File 'lib/openstudio-standards/standards/Standards.Model.rb', line 2

def space_multiplier_map
  @space_multiplier_map
end

#standards_dataObject (readonly)

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, NREL ZNE Ready 2017, NECB2011


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

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
  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_infiltration_to_lower_pressure(initial_infiltration_rate_m3_per_s, intial_pressure_pa, final_pressure_pa, infiltration_coefficient = 0.65) ⇒ Object

Convert one infiltration rate at a given pressure to an infiltration rate at another pressure per method described here: www.taskair.net/knowledge/Infiltration%20Modeling%20Guidelines%20for%20Commercial%20Building%20Energy%20Analysis.pdf where the infiltration coefficient is 0.65

Parameters:

  • initial_infiltration_rate_m3_per_s (Double)

    initial infiltration rate in m^3/s

  • intial_pressure_pa (Double)

    pressure rise at which initial infiltration rate was determined in Pa

  • final_pressure_pa (Double)

    desired pressure rise to adjust infiltration rate to in Pa

  • infiltration_coefficient (Double) (defaults to: 0.65)

    infiltration coeffiecient


299
300
301
302
303
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb', line 299

def adjust_infiltration_to_lower_pressure(initial_infiltration_rate_m3_per_s, intial_pressure_pa, final_pressure_pa, infiltration_coefficient = 0.65)
  adjusted_infiltration_rate_m3_per_s = initial_infiltration_rate_m3_per_s * (final_pressure_pa / intial_pressure_pa)**infiltration_coefficient

  return adjusted_infiltration_rate_m3_per_s
end

#adjust_infiltration_to_prototype_building_conditions(initial_infiltration_rate_m3_per_s) ⇒ Double

Convert the infiltration rate at a 75 Pa to an infiltration rate at the typical value for the prototype buildings per method described here: www.pnl.gov/main/publications/external/technical_reports/PNNL-18898.pdf Gowri K, DW Winiarski, and RE Jarnagin. 2009. Infiltration modeling guidelines for commercial building energy analysis. PNNL-18898, Pacific Northwest National Laboratory, Richland, WA.

Parameters:

  • initial_infiltration_rate_m3_per_s (Double)

    initial infiltration rate in m^3/s

Returns:

  • (Double)

314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb', line 314

def adjust_infiltration_to_prototype_building_conditions(initial_infiltration_rate_m3_per_s)
  # Details of these coefficients can be found in paper
  alpha = 0.22 # unitless - terrain adjustment factor
  intial_pressure_pa = 75.0 # 75 Pa
  uh = 4.47 # m/s - wind speed
  rho = 1.18 # kg/m^3 - air density
  cs = 0.1617 # unitless - positive surface pressure coefficient
  n = 0.65 # unitless - infiltration coefficient

  # Calculate the typical pressure - same for all building types
  final_pressure_pa = 0.5 * cs * rho * uh**2

  # OpenStudio::logFree(OpenStudio::Debug, "openstudio.Standards.Space", "Final pressure PA = #{final_pressure_pa.round(3)} Pa.")

  adjusted_infiltration_rate_m3_per_s = (1.0 + alpha) * initial_infiltration_rate_m3_per_s * (final_pressure_pa / intial_pressure_pa)**n

  return adjusted_infiltration_rate_m3_per_s
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 (%)

Technical References:


259
260
261
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.utilities.rb', line 259

def afue_to_thermal_eff(afue)
  return afue
end

#air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, min_occ_pct = 0.15, occ_sch = nil) ⇒ Bool

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.

the system will be considered unoccupied. If not supplied, one will be created based on the supplied occupancy threshold.

Parameters:

  • min_occ_pct (Double) (defaults to: 0.15)

    the fractional value below which

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

    the occupancy schedule.

Returns:

  • (Bool)

    true if successful, false if not


2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2198

def air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, min_occ_pct = 0.15, occ_sch = nil)
  # Get the airloop occupancy schedule if none supplied
  if occ_sch.nil?
    occ_sch = thermal_zone_get_occupancy_schedule(thermal_zone, min_occ_pct)
    flh = schedule_ruleset_annual_equivalent_full_load_hrs(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

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir

  # 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) ⇒ Bool

TODO:

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

Adjust minimum VAV damper positions to the values

Returns:

  • (Bool)

    Returns true if required, false if not.


1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
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
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1473

def air_loop_hvac_adjust_minimum_vav_damper_positions(air_loop_hvac)
  # Total uncorrected outdoor airflow rate
  v_ou = 0.0
  air_loop_hvac.thermalZones.each do |zone|
    v_ou += thermal_zone_outdoor_airflow_rate(zone)
  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.autosizedDesignSupplyAirFlowRate.is_initialized
           air_loop_hvac.autosizedDesignSupplyAirFlowRate.get
         else
           air_loop_hvac.designSupplyAirFlowRate.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
  air_loop_hvac.thermalZones.sort.each do |zone|
    # Breathing zone airflow rate
    v_bz = thermal_zone_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
    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} clg_dsn_flow 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} htg_dsn_flow could not be found.")
    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
        mdp_term = term.constantMinimumAirFlowFraction
        min_zn_flow = term.fixedMinimumAirFlowRate
      end
    end

    # 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_ps
    if min_zn_flow > 0.0
      mdp = [mdp_term, mdp_oa].max.round(2)
    end    # OpenStudio::logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{self.name}: Zone #{zone.name} mdp_term = #{mdp_term.round(2)}, mdp_oa = #{mdp_oa.round(2)}; mdp_final = #{mdp}")


    # Zone minimum discharge airflow rate
    v_dz = v_pz * mdp

    # Zone discharge air fraction
    z_d = 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
      mdp_adj = 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

      # Set the adjusted minimum damper position
      zone.equipment.each do |equip|
        if equip.to_AirTerminalSingleDuctVAVHeatAndCoolNoReheat.is_initialized
          term = equip.to_AirTerminalSingleDuctVAVHeatAndCoolNoReheat.get
          term.setZoneMinimumAirFlowFraction(mdp_adj)
        elsif equip.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.is_initialized
          term = equip.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.get
          term.setZoneMinimumAirFlowFraction(mdp_adj)
        elsif equip.to_AirTerminalSingleDuctVAVNoReheat.is_initialized
          term = equip.to_AirTerminalSingleDuctVAVNoReheat.get
          term.setConstantMinimumAirFlowFraction(mdp_adj)
        elsif equip.to_AirTerminalSingleDuctVAVReheat.is_initialized
          term = equip.to_AirTerminalSingleDuctVAVReheat.get
          term.setConstantMinimumAirFlowFraction(mdp_adj)
        end
      end

      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

  # 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)

  return true
end

#air_loop_hvac_adjust_minimum_vav_damper_positions_outpatient(air_loop_hvac) ⇒ Object

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


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

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
    if sizing_zone.coolingDesignAirFlowMethod == 'DesignDay'
      next
    elsif 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
          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

Returns:

  • (Double)

    allowable fan system brake horsepower units = horsepower


312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 312

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.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.")
  else
    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.")
  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 || comp.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
      if fan.to_FanConstantVolume.is_initialized || comp.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'
    allowable_fan_bhp = dsn_air_flow_cfm * 0.00094 + fan_pwr_adjustment_bhp
  elsif fan_pwr_limit_type == 'variable volume'
    allowable_fan_bhp = dsn_air_flow_cfm * 0.0013 + fan_pwr_adjustment_bhp
  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
  cfm_per_hp = dsn_air_flow_cfm / allowable_fan_bhp
  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) ⇒ Object

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


475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 475

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.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.")
    else
      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.")
    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)
  if ((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}.")
  end
end

#air_loop_hvac_apply_economizer_integration(air_loop_hvac, climate_zone) ⇒ Bool

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.

Returns:

  • (Bool)

    returns true if successful, false if not


896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 896

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
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir

  # Apply integrated or non-integrated economizer
  if integrated_economizer_required
    oa_control.setLockoutType('NoLockout')
  else
    oa_control.setLockoutType('LockoutWithCompressor')
  end

  return true
end

#air_loop_hvac_apply_economizer_limits(air_loop_hvac, climate_zone) ⇒ Bool

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

Returns:

  • (Bool)

    returns true if successful, false if not


766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 766

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
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  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
  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) ⇒ Bool

TODO:

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

Add an ERV to this airloop. Will be a rotary-type HX

Returns:

  • (Bool)

    Returns true if required, false if not.


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
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1314

def air_loop_hvac_apply_energy_recovery_ventilator(air_loop_hvac)
  # 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

  # Create an ERV
  erv = OpenStudio::Model::HeatExchangerAirToAirSensibleAndLatent.new(air_loop_hvac.model)
  erv.setName("#{air_loop_hvac.name} ERV")
  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)
  erv.setSupplyAirOutletTemperatureControl(true)
  erv.setHeatExchangerType('Rotary')
  erv.setFrostControlType('ExhaustOnly')
  erv.setEconomizerLockout(true)
  erv.setThresholdTemperature(-23.3) # -10F
  erv.setInitialDefrostTimeFraction(0.167)
  erv.setRateofDefrostTimeFractionIncrease(1.44)

  # Add the ERV to the OA system
  erv.addToNode(oa_system.outboardOANode.get)

  # 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 teh 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)

  # Apply the prototype Heat Exchanger power assumptions.
  heat_exchanger_air_to_air_sensible_and_latent_apply_prototype_nominal_electric_power(erv)

  # 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_maximum_reheat_temperature(air_loop_hvac, max_reheat_c) ⇒ Bool

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

Parameters:

  • max_reheat_c (Double)

    the maximum reheat temperature, in C

Returns:

  • (Bool)

    returns true if successful, false if not.


3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3037

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) ⇒ Bool

Set the minimum VAV damper positions.

is DDC control of vav terminals. If false, assumes otherwise.

Parameters:

  • has_ddc (Bool) (defaults to: true)

    if true, will assume that there

Returns:

  • (Bool)

    true if successful, false if not


1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1454

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 = thermal_zone_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 [Bool] returns true if successful, false if not


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

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-2013
  # 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) ⇒ Bool

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(AirLoopHVAC)

Returns:

  • (Bool)

    returns true if successful, false if not


187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 187

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)
  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
  air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac)

  return true
end

#air_loop_hvac_apply_prm_baseline_economizer(air_loop_hvac, climate_zone) ⇒ Bool

Apply the PRM economizer type and set temperature limits

Returns:

  • (Bool)

    returns true if successful, false if not


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

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
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  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

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.

if the proposed model had multiple fans (supply, return, exhaust, etc.) return [Bool] true if successful, false if not.


229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 229

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) ⇒ Bool

Set the system sizing properties based on the zone sizing information

Returns:

  • (Bool)

    true if successful, false if not.


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

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) ⇒ Bool

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

Returns:

  • (Bool)

    returns true if successful, false if not


2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
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
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
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
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2481

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 = if air_loop_hvac_multi_stage_dx_cooling?(air_loop_hvac)
                  true
                else
                  false
                end

  # Scrub special characters from the system name
  sn = air_loop_hvac.name.get.to_s
  snc = sn.gsub(/\W/, '').delete('_')  # If the name starts with a number, prepend with a letter

  if snc[0] =~ /[0-9]/
    snc = "SYS#{snc}"
  end

  # Get the zone name
  zone = air_loop_hvac.thermalZones[0]
  zone_name = zone.name.get.to_s
  zn_name_clean = zone_name.gsub(/\W/, '_')

  # Zone air node
  zone_air_node = zone.zoneAirNode

  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  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

  # 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

  # Create an economizer maximum OA fraction schedule with
  # a maximum of 70% to reflect damper leakage per PNNL
  max_oa_sch_name = "#{snc}maxOASch"
  max_oa_sch = OpenStudio::Model::ScheduleRuleset.new(air_loop_hvac.model)
  max_oa_sch.setName(max_oa_sch_name)
  max_oa_sch.defaultDaySchedule.setName("#{max_oa_sch_name}Default")
  max_oa_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), 0.7)
  oa_control.setMaximumFractionofOutdoorAirSchedule(max_oa_sch)

  ### 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)

  ### 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)

  ### Fan Control ###
  if fan_control

    # 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) ⇒ Bool

TODO:

optimum start

TODO:

night damper shutoff

TODO:

nightcycle control

TODO:

night fan shutoff

Apply all standard required controls to the airloop

Returns:

  • (Bool)

    returns true if successful, false if not


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

def air_loop_hvac_apply_standard_controls(air_loop_hvac, climate_zone)
  # 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)
  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 (TODO add hospital two systems as exception)
    unless 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
          fan_variable_volume_set_control_type(fan, 'Multi Zone VAV with VSD and SP Setpoint Reset')        # 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

  # 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

  # 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.

    air_loop_hvac.thermalZones.sort.each do |zone|
      if thermal_zone_demand_control_ventilation_required?(zone, climate_zone)
        thermal_zone_convert_oa_req_to_per_area(zone)
      end
    end
  else
    # For systems that do not require DCV,
    # convert OA requirements to per-area values
    # so that other features such as
    # multizone VAV optimization do not
    # incorrectly take variable occupancy into account.
    air_loop_hvac.thermalZones.sort.each do |zone|
      thermal_zone_convert_oa_req_to_per_area(zone)
    end
  end

  # SAT reset
  # TODO Prototype buildings use OAT-based SAT reset,
  # but PRM RM suggests Warmest zone based SAT reset.
  if air_loop_hvac_supply_air_temperature_reset_required?(air_loop_hvac, climate_zone)
    air_loop_hvac_enable_supply_air_temperature_reset_warmest_zone(air_loop_hvac)
  end

  # Unoccupied shutdown
  if air_loop_hvac_unoccupied_fan_shutoff_required?(air_loop_hvac)
    air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac)
  else
    air_loop_hvac.setAvailabilitySchedule(air_loop_hvac.model.alwaysOnDiscreteSchedule)
  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.

    air_loop_hvac_add_motorized_oa_damper(air_loop_hvac, 0.15, air_loop_hvac.availabilitySchedule)
  else
    air_loop_hvac_remove_motorized_oa_damper(air_loop_hvac)
  end

  # Zones 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
  air_loop_hvac.thermalZones.sort.each do |zone|
    if thermal_zone_demand_control_ventilation_required?(zone, climate_zone)
      thermal_zone_convert_oa_req_to_per_area(zone)
    end
  end

  # TODO: Optimum Start
  # for systems exceeding 10,000 cfm
  # Don't think that OS will be able to do this.
  # OS currently only allows 1 availability manager
  # at a time on an AirLoopHVAC.  If we add an
  # AvailabilityManager:OptimumStart, it
  # will replace the AvailabilityManager:NightCycle.
end

#air_loop_hvac_apply_vav_damper_action(air_loop_hvac) ⇒ Bool

TODO:

see if this impacts the sizing run.

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

Returns:

  • (Bool)

    Returns true if successful, false if not


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

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
        end
      else
        term.setDamperHeatingAction(damper_action_eplus)
        control_type_set = true
        term.setMaximumFlowFractionDuringReheat(0.5)
      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

Determine how much data center area the airloop serves.

in m^2. standards space type spreadsheet instead of relying on the standards space type name to identify a data center.

Returns:

  • (Double)

    the area of data center is served,


3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3013

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
      next if space_type.standardsSpaceType.empty?
      standards_space_type = space_type.standardsSpaceType.get      # Counts as a data center if the name includes 'data'

      next unless standards_space_type.downcase.include?('data')
      dc_area_m2 += space.floorArea
    end
  end

  return dc_area_m2
end

#air_loop_hvac_dcv_required_when_erv(air_loop_hvac) ⇒ Object

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


1795
1796
1797
1798
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1795

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.

Returns:

  • (Array<Double>)
    min_oa_without_economizer_cfm, min_oa_with_economizer_cfm

1787
1788
1789
1790
1791
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1787

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) ⇒ Bool

TODO:

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

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

Returns:

  • (Bool)

    Returns true if required, false if not.


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
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1705

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) ⇒ Bool

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

Returns:

  • (Bool)

    Returns true if required, false if not.


1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1434

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) ⇒ Bool

Determine if this Air Loop uses DX cooling.

Returns:

  • (Bool)

    true if uses DX cooling, false if not.


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

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) ⇒ Bool

Determine if the system has an economizer

Returns:

  • (Bool)

    Returns true if required, false if not.


1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1936

def air_loop_hvac_economizer?(air_loop_hvac)
  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  # Return false if no economizer is present
  if economizer_type == 'NoEconomizer'
    return false
  else
    return true
  end
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.

Returns:

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

836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 836

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
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return [nil, nil, nil] # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

  case economizer_type
  when 'NoEconomizer'
    return [nil, nil, nil]
  when 'FixedDryBulb'
    case climate_zone
    when '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-5C',
        'ASHRAE 169-2006-6B',
        'ASHRAE 169-2006-7B',
        'ASHRAE 169-2006-8A',
        'ASHRAE 169-2006-8B'
      drybulb_limit_f = 75
    when 'ASHRAE 169-2006-5A',
        'ASHRAE 169-2006-6A',
        'ASHRAE 169-2006-7A'
      drybulb_limit_f = 70
    when 'ASHRAE 169-2006-1A',
        'ASHRAE 169-2006-2A',
        'ASHRAE 169-2006-3A',
        'ASHRAE 169-2006-4A'
      drybulb_limit_f = 65
    end
  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) ⇒ Bool

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

'ASHRAE 169-2006-3A', 'ASHRAE 169-2006-3B', 'ASHRAE 169-2006-3C', 'ASHRAE 169-2006-4A', 'ASHRAE 169-2006-4B', 'ASHRAE 169-2006-4C', 'ASHRAE 169-2006-5A', 'ASHRAE 169-2006-5B', 'ASHRAE 169-2006-5C', 'ASHRAE 169-2006-6A', 'ASHRAE 169-2006-6B', 'ASHRAE 169-2006-7A', 'ASHRAE 169-2006-7B', 'ASHRAE 169-2006-8A', 'ASHRAE 169-2006-8B'

Parameters:

  • climate_zone (String)

    valid choices: 'ASHRAE 169-2006-1A', 'ASHRAE 169-2006-1B', 'ASHRAE 169-2006-2A', 'ASHRAE 169-2006-2B',

Returns:

  • (Bool)

    returns true if an economizer is required, false if not


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
749
750
751
752
753
754
755
756
757
758
759
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 708

def air_loop_hvac_economizer_required?(air_loop_hvac, climate_zone)
  economizer_required = false

  return economizer_required if air_loop_hvac.name.to_s.include? 'Outpatient F1'

  # 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, nil)
  if econ_limits.nil?
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "Cannot find economizer limits for #{template}, #{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?

  # 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.")
    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.")
    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) ⇒ Bool

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.

Returns false if the economizer type is not allowable.

Returns:

  • (Bool)

    Returns true if allowable, if the system has no economizer or no OA system.


1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
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
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1129

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
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return true # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir
  economizer_type = oa_control.getEconomizerControlType

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

  # Determine the prohibited types
  prohibited_types = []
  case climate_zone
  when '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'
    prohibited_types = ['FixedEnthalpy']
  when
    'ASHRAE 169-2006-1A',
      'ASHRAE 169-2006-2A',
      'ASHRAE 169-2006-3A',
      'ASHRAE 169-2006-4A'
    prohibited_types = ['DifferentialDryBulb']
  when
    'ASHRAE 169-2006-5A',
      'ASHRAE 169-2006-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) ⇒ Bool

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.

Returns:

  • (Bool)

    Returns true if required, false if not.


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

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)

  return true
end

#air_loop_hvac_enable_multizone_vav_optimization(air_loop_hvac) ⇒ Bool

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

Returns:

  • (Bool)

    Returns true if required, false if not.


1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1414

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
    controller_mv.setSystemOutdoorAirMethod('VentilationRateProcedure')    # 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_supply_air_temperature_reset_delta(air_loop_hvac) ⇒ Double

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

Returns:

  • (Double)

    the SAT reset amount (R)


1881
1882
1883
1884
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1881

def air_loop_hvac_enable_supply_air_temperature_reset_delta(air_loop_hvac)
  sat_reset_r = 5
  return sat_reset_r
end

#air_loop_hvac_enable_supply_air_temperature_reset_outdoor_temperature(air_loop_hvac) ⇒ Bool

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.

Returns:

  • (Bool)

    Returns true if successful, false if not.


1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1894

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 = 5.0
  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(supplyOutletNode)

  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Supply air temperature reset was enabled.  When OAT > #{hi_oat_f.round}F, SAT is #{sat_at_hi_oat_f.round}F.  When OAT < #{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) ⇒ Bool

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

Returns:

  • (Bool)

    Returns true if successful, false if not.


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

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.15) ⇒ Bool

Shut off the system during unoccupied periods. During these times, systems will cycle on briefly if temperature drifts below setpoint. For systems with fan-powered terminals, the whole system (not just the terminal fans) will cycle on. Terminal-only night cycling is not used because the terminals cannot provide cooling, so terminal-only night cycling leads to excessive unmet cooling hours during unoccupied periods. 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.

the system will be considered unoccupied.

Parameters:

  • min_occ_pct (Double) (defaults to: 0.15)

    the fractional value below which

Returns:

  • (Bool)

    true if successful, false if not


2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2916

def air_loop_hvac_enable_unoccupied_fan_shutoff(air_loop_hvac, min_occ_pct = 0.15)
  # Set the system to night cycle
  air_loop_hvac.setNightCycleControlType('CycleOnAny')

  # 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, min_occ_pct)
  flh = schedule_ruleset_annual_equivalent_full_load_hrs(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)

  return true
end

#air_loop_hvac_energy_recovery?(air_loop_hvac) ⇒ Bool

Determine if the system has energy recovery already

Returns:

  • (Bool)

    Returns true if an ERV is present, false if not.


2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2025

def air_loop_hvac_energy_recovery?(air_loop_hvac)
  has_erv = false

  # Get the OA system
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return has_erv # No OA system
  end

  # Find any ERV on the OA system
  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. if nil, ERV is never required.

Returns:

  • (Double)

    the flow rate above which an ERV is required.


1303
1304
1305
1306
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1303

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_required?(air_loop_hvac, climate_zone) ⇒ Bool

TODO:

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

Check if ERV is required on this airloop.

Returns:

  • (Bool)

    Returns true if required, false if not.


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
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1197

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.
  controller_oa = nil
  controller_mv = nil
  oa_system = 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}, 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_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

Returns:

  • (Double)

    fan power limitation pressure drop adjustment units = horsepower


270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 270

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.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.")
  else
    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.")
  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

  # 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

  # 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

Returns:

  • (Double)

    design_supply_air_flow_rate m^3/s


2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2990

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 sypply 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.


2943
2944
2945
2946
2947
2948
2949
2950
2951
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2943

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.


2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2975

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.


2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2958

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

TODO:

Speed up this method. Bottleneck is ScheduleRule.getDaySchedules

This method creates a schedule where the value is zero when the overall occupancy for all zones on the airloop is below the specified threshold, and one when the overall occupancy is greater than or equal to the threshold. 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:

  • 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


2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
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
2306
2307
2308
2309
2310
2311
2312
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
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
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
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2256

def air_loop_hvac_get_occupancy_schedule(air_loop_hvac, occupied_percentage_threshold = 0.05)
  # Get all the occupancy schedules in every space in every zone
  # served by this airloop.  Include people added via the SpaceType
  # in addition to people hard-assigned to the Space itself.
  occ_schedules_num_occ = {}
  max_occ_on_airloop = 0
  air_loop_hvac.thermalZones.each do |zone|
    # Get the people objects
    zone.spaces.each do |space|
      # From the space type
      if space.spaceType.is_initialized
        space.spaceType.get.people.each do |people|
          num_ppl_sch = people.numberofPeopleSchedule
          if num_ppl_sch.is_initialized
            num_ppl_sch = num_ppl_sch.get
            num_ppl_sch = num_ppl_sch.to_ScheduleRuleset
            next if num_ppl_sch.empty? # Skip non-ruleset schedules
            num_ppl_sch = num_ppl_sch.get
            num_ppl = people.getNumberOfPeople(space.floorArea)
            if occ_schedules_num_occ[num_ppl_sch].nil?
              occ_schedules_num_occ[num_ppl_sch] = num_ppl
            else
              occ_schedules_num_occ[num_ppl_sch] += num_ppl
            end
            max_occ_on_airloop += num_ppl
          end
        end
      end      # From the space

      space.people.each do |people|
        num_ppl_sch = people.numberofPeopleSchedule
        if num_ppl_sch.is_initialized
          num_ppl_sch = num_ppl_sch.get
          num_ppl_sch = num_ppl_sch.to_ScheduleRuleset
          next if num_ppl_sch.empty? # Skip non-ruleset schedules
          num_ppl_sch = num_ppl_sch.get
          num_ppl = people.getNumberOfPeople(space.floorArea)
          if occ_schedules_num_occ[num_ppl_sch].nil?
            occ_schedules_num_occ[num_ppl_sch] = num_ppl
          else
            occ_schedules_num_occ[num_ppl_sch] += num_ppl
          end
          max_occ_on_airloop += num_ppl
        end
      end
    end
  end

  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} has #{occ_schedules_num_occ.size} unique occ schedules.")
  occ_schedules_num_occ.each do |occ_sch, num_occ|
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "   #{occ_sch.name} - #{num_occ.round} people")
  end
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "   Total #{max_occ_on_airloop.round} people on #{air_loop_hvac.name}")

  # For each day of the year, determine
  # time_value_pairs = []
  year = air_loop_hvac.model.getYearDescription
  yearly_data = []
  yearly_times = OpenStudio::DateTimeVector.new
  yearly_values = []
  (1..365).each do |i|
    times_on_this_day = []
    os_date = year.makeDate(i)
    day_of_week = os_date.dayOfWeek.valueName

    # Get the unique time indices and corresponding day schedules
    occ_schedules_day_schs = {}
    day_sch_num_occ = {}
    occ_schedules_num_occ.each do |occ_sch, num_occ|
      # Get the day schedules for this day
      # (there should only be one)
      day_schs = occ_sch.getDaySchedules(os_date, os_date)
      OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "Schedule #{occ_sch.name} has #{day_schs.size} day schs") unless day_schs.size == 1
      day_schs[0].times.each do |time|
        times_on_this_day << time.toString
      end
      day_sch_num_occ[day_schs[0]] = num_occ
    end

    # Determine the total fraction for the airloop at each time
    daily_times = []
    daily_os_times = []
    daily_values = []
    daily_occs = []
    times_on_this_day.uniq.sort.each do |time|
      os_time = OpenStudio::Time.new(time)
      os_date_time = OpenStudio::DateTime.new(os_date, os_time)      # Total number of people at each time

      tot_occ_at_time = 0
      day_sch_num_occ.each do |day_sch, num_occ|
        occ_frac = day_sch.getValue(os_time)
        tot_occ_at_time += occ_frac * num_occ
      end

      # Total fraction for the airloop at each time
      air_loop_occ_frac = tot_occ_at_time / max_occ_on_airloop
      occ_status = 0 # unoccupied
      if air_loop_occ_frac >= occupied_percentage_threshold
        occ_status = 1
      end

      # Add this data to the daily arrays
      daily_times << time
      daily_os_times << os_time
      daily_values << occ_status
      daily_occs << air_loop_occ_frac.round(2)
    end

    # OpenStudio::logFree(OpenStudio::Debug, "openstudio.standards.AirLoopHVAC", "#{daily_times.join(', ')}                  #{daily_values.join(', ')}")

    # Simplify the daily times to eliminate intermediate
    # points with the same value as the following point.
    simple_daily_times = []
    simple_daily_os_times = []
    simple_daily_values = []
    simple_daily_occs = []
    daily_values.each_with_index do |value, j|
      next if value == daily_values[j + 1]
      simple_daily_times << daily_times[j]
      simple_daily_os_times << daily_os_times[j]
      simple_daily_values << daily_values[j]
      simple_daily_occs << daily_occs[j]
    end

    # OpenStudio::logFree(OpenStudio::Debug, "openstudio.standards.AirLoopHVAC", "#{simple_daily_times.join(', ')}                  {simple_daily_values.join(', ')}")

    # Store the daily values
    yearly_data << { 'date' => os_date, 'day_of_week' => day_of_week, 'times' => simple_daily_times, 'values' => simple_daily_values, 'daily_os_times' => simple_daily_os_times, 'daily_occs' => simple_daily_occs }
  end

  # Create a TimeSeries from the data
  # time_series = OpenStudio::TimeSeries.new(times, values, 'unitless')

  # Make a schedule ruleset
  sch_name = "#{air_loop_hvac.name} Occ Sch"
  sch_ruleset = OpenStudio::Model::ScheduleRuleset.new(air_loop_hvac.model)
  sch_ruleset.setName(sch_name.to_s)

  # Default - All Occupied
  day_sch = sch_ruleset.defaultDaySchedule
  day_sch.setName("#{sch_name} Default")
  day_sch.addValue(OpenStudio::Time.new(0, 24, 0, 0), 1)

  # Winter Design Day - All Occupied
  day_sch = OpenStudio::Model::ScheduleDay.new(air_loop_hvac.model)
  sch_ruleset.setWinterDesignDaySchedule(day_sch)
  day_sch = sch_ruleset.winterDesignDaySchedule
  day_sch.setName("#{sch_name} Winter Design Day")
  day_sch.addValue(OpenStudio::Time.new(0, 24, 0, 0), 1)

  # Summer Design Day - All Occupied
  day_sch = OpenStudio::Model::ScheduleDay.new(air_loop_hvac.model)
  sch_ruleset.setSummerDesignDaySchedule(day_sch)
  day_sch = sch_ruleset.summerDesignDaySchedule
  day_sch.setName("#{sch_name} Summer Design Day")
  day_sch.addValue(OpenStudio::Time.new(0, 24, 0, 0), 1)

  # Create ruleset schedules, attempting to create
  # the minimum number of unique rules.
  ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'].each do |weekday|
    OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', weekday.to_s)
    end_of_prev_rule = yearly_data[0]['date']
    yearly_data.each_with_index do |daily_data, k|
      # Skip unless it is the day of week
      # currently under inspection
      day = daily_data['day_of_week']
      next unless day == weekday
      date = daily_data['date']
      times = daily_data['times']
      values = daily_data['values']
      daily_occs = daily_data['daily_occs']

      # If the next (Monday, Tuesday, etc.)
      # is the same as today, keep going.
      # If the next is different, or if
      # we've reached the end of the year,
      # create a new rule
      unless yearly_data[k + 7].nil?
        next_day_times = yearly_data[k + 7]['times']
        next_day_values = yearly_data[k + 7]['values']
        next if times == next_day_times && values == next_day_values
      end

      daily_os_times = daily_data['daily_os_times']
      daily_occs = daily_data['daily_occs']

      # If here, we need to make a rule to cover from the previous
      # rule to today
      OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "Making a new rule for #{weekday} from #{end_of_prev_rule} to #{date}")
      sch_rule = OpenStudio::Model::ScheduleRule.new(sch_ruleset)
      sch_rule.setName("#{sch_name} #{weekday} Rule")
      day_sch = sch_rule.daySchedule
      day_sch.setName("#{sch_name} #{weekday}")
      daily_os_times.each_with_index do |time, t|
        value = values[t]
        next if value == values[t + 1] # Don't add breaks if same value
        day_sch.addValue(time, value)
        OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirLoopHVAC', "   Adding value #{time}, #{value}")
      end

      # Set the dates when the rule applies
      sch_rule.setStartDate(end_of_prev_rule)
      sch_rule.setEndDate(date)

      # Individual Days
      sch_rule.setApplyMonday(true) if weekday == 'Monday'
      sch_rule.setApplyTuesday(true) if weekday == 'Tuesday'
      sch_rule.setApplyWednesday(true) if weekday == 'Wednesday'
      sch_rule.setApplyThursday(true) if weekday == 'Thursday'
      sch_rule.setApplyFriday(true) if weekday == 'Friday'
      sch_rule.setApplySaturday(true) if weekday == 'Saturday'
      sch_rule.setApplySunday(true) if weekday == 'Sunday'

      # Reset the previous rule end date
      end_of_prev_rule = date + OpenStudio::Time.new(0, 24, 0, 0)
    end
  end

  return sch_ruleset
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.

Returns:

  • (Boolean)

921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 921

def air_loop_hvac_integrated_economizer_required?(air_loop_hvac, climate_zone)
  # Determine if it is a VAV system
  is_vav = air_loop_hvac_vav_system?(air_loop_hvac)

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

  minimum_capacity_btu_per_hr = 65_000
  minimum_capacity_w = OpenStudio.convert(minimum_capacity_btu_per_hr, 'Btu/hr', 'W').get  # 6.5.1.3 Integrated Economizer Control
  # Exception a, DX VAV systems

  if is_vav == true && num_zones_served > 1
    integrated_economizer_required = false
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: non-integrated economizer per 6.5.1.3 exception a, DX VAV system.")    # Exception b, DX units less than 65,000 Btu/hr

  elsif air_loop_hvac_total_cooling_capacity(air_loop_hvac) < minimum_capacity_w
    integrated_economizer_required = false
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: non-integrated economizer per 6.5.1.3 exception b, DX system less than #{minimum_capacity_btu_per_hr}Btu/hr.")
  else
    # Exception c, Systems in climate zones 1,2,3a,4a,5a,5b,6,7,8
    case climate_zone
    when 'ASHRAE 169-2006-1A',
        'ASHRAE 169-2006-1B',
        'ASHRAE 169-2006-2A',
        'ASHRAE 169-2006-2B',
        'ASHRAE 169-2006-3A',
        'ASHRAE 169-2006-4A',
        'ASHRAE 169-2006-5A',
        'ASHRAE 169-2006-5B',
        'ASHRAE 169-2006-6A',
        'ASHRAE 169-2006-6B',
        'ASHRAE 169-2006-7A',
        'ASHRAE 169-2006-7B',
        'ASHRAE 169-2006-8A',
        'ASHRAE 169-2006-8B'
      integrated_economizer_required = false
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: non-integrated economizer per 6.5.1.3 exception c, climate zone #{climate_zone}.")
    when 'ASHRAE 169-2006-3B',
        'ASHRAE 169-2006-3C',
        'ASHRAE 169-2006-4B',
        'ASHRAE 169-2006-4C',
        'ASHRAE 169-2006-5C'
      integrated_economizer_required = true
    end
  end

  return integrated_economizer_required
end

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

Determine the air flow and number of story limits for whether motorized OA damper is required. Defaults to DOE Ref Pre-1980 logic (never required). If both nil, never required

Returns:

  • (Array<Double>)

    [minimum_oa_flow_cfm, maximum_stories].


2178
2179
2180
2181
2182
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2178

def air_loop_hvac_motorized_oa_damper_limits(air_loop_hvac, climate_zone)
  minimum_oa_flow_cfm = nil
  maximum_stories = nil
  return [minimum_oa_flow_cfm, maximum_stories]
end

#air_loop_hvac_motorized_oa_damper_required?(air_loop_hvac, climate_zone) ⇒ Boolean

Determine if a motorized OA damper is required

Returns:

  • (Boolean)

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

def air_loop_hvac_motorized_oa_damper_required?(air_loop_hvac, climate_zone)
  motorized_oa_damper_required = false

  # TODO: refactor: Remove building type dependent logic
  if air_loop_hvac.name.to_s.include? 'Outpatient F1'
    motorized_oa_damper_required = true
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: always has a damper, the minimum OA schedule is the same as airloop availability schedule.")
    return motorized_oa_damper_required
  end

  # If the system has an economizer, it must have
  # a motorized damper.
  if air_loop_hvac_economizer?(air_loop_hvac)
    motorized_oa_damper_required = true
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Because the system has an economizer, it requires a motorized OA damper.")
    return motorized_oa_damper_required
  end

  # Determine the exceptions based on
  # number of stories, climate zone, and
  # outdoor air intake rates.
  minimum_oa_flow_cfm, maximum_stories = air_loop_hvac_motorized_oa_damper_limits(air_loop_hvac, climate_zone)

  # Assuming that buildings not requiring this always
  # used backdraft gravity dampers
  if minimum_oa_flow_cfm.nil? && maximum_stories.nil?
    return motorized_oa_damper_required
  end

  # Get the number of stories
  num_stories = air_loop_hvac.model.getBuildingStorys.size

  # Check the number of stories exception,
  # which is climate-zone dependent.
  if num_stories < maximum_stories
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Motorized OA damper not required because the building has #{num_stories} stories, less than the maximum of #{maximum_stories} stories for climate zone #{climate_zone}.")
    return motorized_oa_damper_required
  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}, Motorized OA damper not applicable because it has no OA intake.")
    return motorized_oa_damper_required
  end
  oa_flow_cfm = OpenStudio.convert(oa_flow_m3_per_s, 'm^3/s', 'cfm').get

  # Check the OA flow rate exception
  if oa_flow_cfm < minimum_oa_flow_cfm
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Motorized OA damper not required because the system OA intake of #{oa_flow_cfm.round} cfm is less than the minimum threshold of #{minimum_oa_flow_cfm} cfm.")
    return motorized_oa_damper_required
  end

  # If here, motorized damper is required
  motorized_oa_damper_required = true

  return motorized_oa_damper_required
end

#air_loop_hvac_multi_stage_dx_cooling?(air_loop_hvac) ⇒ Bool

Determine if this Air Loop uses multi-stage DX cooling.

Returns:

  • (Bool)

    true if uses multi-stage DX cooling, false if not.


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

def air_loop_hvac_multi_stage_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_TwoSpeed',
    'OS_Coil_Cooling_DX_TwoStageWithHumidityControlMode'
  ]

  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_multizone_vav_optimization_required?(air_loop_hvac, climate_zone) ⇒ Bool

TODO:

Add exception logic for systems with AIA healthcare ventilation requirements dual duct systems

Determine if multizone vav optimization is required. Defaults to 90.1-2007 logic, where it is not required.

Returns:

  • (Bool)

    Returns true if required, false if not.


1405
1406
1407
1408
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1405

def air_loop_hvac_multizone_vav_optimization_required?(air_loop_hvac, climate_zone)
  multizone_opt_required = false
  return multizone_opt_required
end

#air_loop_hvac_multizone_vav_system?(air_loop_hvac) ⇒ Bool

Determine if the system is a multizone VAV system

Returns:

  • (Bool)

    Returns true if required, false if not.


1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1983

def air_loop_hvac_multizone_vav_system?(air_loop_hvac)
  multizone_vav_system = false

  # Must serve more than 1 zone
  if air_loop_hvac.thermalZones.size < 2
    return multizone_vav_system
  end

  # Must be a variable volume system
  is_vav = air_loop_hvac_vav_system?(air_loop_hvac)
  if is_vav == false
    return multizone_vav_system
  end

  # If here, it's a multizone VAV system
  multizone_vav_system = true

  return multizone_vav_system
end

#air_loop_hvac_prm_baseline_economizer_required?(air_loop_hvac, climate_zone) ⇒ Bool

Determine if an economizer is required per the PRM. Default logic from 90.1-2007

Returns:

  • (Bool)

    returns true if required, false if not


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
1018
1019
1020
1021
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 975

def air_loop_hvac_prm_baseline_economizer_required?(air_loop_hvac, climate_zone)
  economizer_required = false

  # A big number of ft2 as the minimum requirement
  infinity_ft2 = 999_999_999_999
  min_int_area_served_ft2 = infinity_ft2
  min_ext_area_served_ft2 = infinity_ft2

  # Determine the minimum capacity that requires an economizer
  case climate_zone
  when 'ASHRAE 169-2006-1A',
      'ASHRAE 169-2006-1B',
      'ASHRAE 169-2006-2A',
      'ASHRAE 169-2006-3A',
      'ASHRAE 169-2006-4A'
    min_int_area_served_ft2 = infinity_ft2 # No requirement
    min_ext_area_served_ft2 = infinity_ft2 # No requirement
  else
    min_int_area_served_ft2 = 0 # Always required
    min_ext_area_served_ft2 = 0 # Always required
  end

  # Check whether the system requires an economizer by comparing
  # the system capacity to the minimum capacity.
  min_int_area_served_m2 = OpenStudio.convert(min_int_area_served_ft2, 'ft^2', 'm^2').get
  min_ext_area_served_m2 = OpenStudio.convert(min_ext_area_served_ft2, 'ft^2', 'm^2').get

  # Get the interior and exterior area served
  int_area_served_m2 = air_loop_hvac_floor_area_served_interior_zones(air_loop_hvac)
  ext_area_served_m2 = air_loop_hvac_floor_area_served_exterior_zones(air_loop_hvac)

  # Check the floor area exception
  if int_area_served_m2 < min_int_area_served_m2 && ext_area_served_m2 < min_ext_area_served_m2
    if min_int_area_served_ft2 == infinity_ft2 && min_ext_area_served_ft2 == infinity_ft2
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer not required for climate zone #{climate_zone}.")
    else
      OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer not required for because the interior area served of #{int_area_served_m2} ft2 < minimum of #{min_int_area_served_m2} and the perimeter area served of #{ext_area_served_m2} ft2 < minimum of #{min_ext_area_served_m2} for climate zone #{climate_zone}.")
    end
    return economizer_required
  end

  # If here, economizer required
  economizer_required = true
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Economizer required for the performance rating method baseline.")

  return economizer_required
end

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

Determine the economizer type and limits for the the PRM Defaults to 90.1-2007 logic.

Returns:

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

1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1089

def air_loop_hvac_prm_economizer_type_and_limits(air_loop_hvac, climate_zone)
  economizer_type = 'NoEconomizer'
  drybulb_limit_f = nil
  enthalpy_limit_btu_per_lb = nil
  dewpoint_limit_f = nil

  case climate_zone
  when '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-5C',
      'ASHRAE 169-2006-6B',
      'ASHRAE 169-2006-7B',
      'ASHRAE 169-2006-8A',
      'ASHRAE 169-2006-8B'
    economizer_type = 'FixedDryBulb'
    drybulb_limit_f = 75
  when 'ASHRAE 169-2006-5A',
      'ASHRAE 169-2006-6A',
      'ASHRAE 169-2006-7A'
    economizer_type = 'FixedDryBulb'
    drybulb_limit_f = 70
  else
    economizer_type = 'FixedDryBulb'
    drybulb_limit_f = 65
  end

  return [economizer_type, drybulb_limit_f, enthalpy_limit_btu_per_lb, dewpoint_limit_f]
end

#air_loop_hvac_remove_motorized_oa_damper(air_loop_hvac) ⇒ Object

Remove a motorized OA damper by modifying the OA schedule to require full OA at all times. Whenever the fan operates, the damper will be open and OA will be brought into the building. This reflects the use of a backdraft gravity damper, and increases building loads unnecessarily during unoccupied hours.


2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2228

def air_loop_hvac_remove_motorized_oa_damper(air_loop_hvac)
  # Get the OA system and OA controller
  oa_sys = air_loop_hvac.airLoopHVACOutdoorAirSystem
  if oa_sys.is_initialized
    oa_sys = oa_sys.get
  else
    return false # No OA system
  end
  oa_control = oa_sys.getControllerOutdoorAir

  # Set the minimum OA schedule to always 1 (100%)
  oa_control.setMinimumOutdoorAirSchedule(air_loop_hvac.model.alwaysOnDiscreteSchedule)

  return true
end

#air_loop_hvac_single_zone_controls_num_stages(air_loop_hvac, climate_zone) ⇒ Integer

Determine the number of stages that should be used as controls for single zone DX systems. Defaults to zero, which means that no special single zone control is required.

Returns:

  • (Integer)

    the number of stages: 0, 1, 2


2843
2844
2845
2846
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2843

def air_loop_hvac_single_zone_controls_num_stages(air_loop_hvac, climate_zone)
  num_stages = 0
  return num_stages
end

#air_loop_hvac_static_pressure_reset_required?(air_loop_hvac, has_ddc) ⇒ Boolean

TODO:

Instead of requiring the input of whether a system has DDC control of VAV terminals or not, determine this from the system itself. This may require additional information be added to the OpenStudio data model.

Determine if static pressure reset is required for this system. For 90.1, this determination needs information about whether or not the system has DDC control over the VAV terminals. Defaults to 90.1-2007 logic.

over VAV terminals. return [Bool] returns true if static pressure reset is required, false if not

Parameters:

  • has_ddc (Bool)

    whether or not the system has DDC control

Returns:

  • (Boolean)

2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2860

def air_loop_hvac_static_pressure_reset_required?(air_loop_hvac, has_ddc)
  sp_reset_required = false

  if has_ddc
    sp_reset_required = true
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Static pressure reset is required because the system has DDC control of VAV terminals.")
  else
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Static pressure reset not required because the system does not have DDC control of VAV terminals.")
  end

  return sp_reset_required
end

#air_loop_hvac_supply_air_temperature_reset_required?(air_loop_hvac, climate_zone) ⇒ Bool

Determine if the system required supply air temperature (SAT) reset. Defaults to 90.1-2007, no SAT reset required.

Returns:

  • (Bool)

    Returns true if required, false if not.


1838
1839
1840
1841
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1838

def air_loop_hvac_supply_air_temperature_reset_required?(air_loop_hvac, climate_zone)
  is_sat_reset_required = false
  return is_sat_reset_required
end

#air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac) ⇒ Array

Get all of the supply, return, exhaust, and relief fans on this system

Returns:

  • (Array)

    an array of FanConstantVolume, FanVariableVolume, and FanOnOff objects


395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 395

def air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac)
  # Fans on the supply side of the airloop directly, or inside of unitary equipment.
  fans = []
  sup_and_oa_comps = air_loop_hvac.supplyComponents
  sup_and_oa_comps += air_loop_hvac.oaComponents
  sup_and_oa_comps.each do |comp|
    if comp.to_FanConstantVolume.is_initialized
      fans << comp.to_FanConstantVolume.get
    elsif comp.to_FanVariableVolume.is_initialized
      fans << comp.to_FanVariableVolume.get
    elsif comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.is_initialized
      sup_fan = comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get.supplyAirFan
      if sup_fan.to_FanConstantVolume.is_initialized
        fans << sup_fan.to_FanConstantVolume.get
      elsif sup_fan.to_FanOnOff.is_initialized
        fans << sup_fan.to_FanOnOff.get
      end
    elsif comp.to_AirLoopHVACUnitarySystem.is_initialized
      sup_fan = comp.to_AirLoopHVACUnitarySystem.get.supplyFan
      next if sup_fan.empty?
      sup_fan = sup_fan.get
      if sup_fan.to_FanConstantVolume.is_initialized
        fans << sup_fan.to_FanConstantVolume.get
      elsif sup_fan.to_FanOnOff.is_initialized
        fans << sup_fan.to_FanOnOff.get
      elsif sup_fan.to_FanVariableVolume.is_initialized
        fans << sup_fan.to_FanVariableVolume.get
      end
    end
  end

  return fans
end

#air_loop_hvac_system_fan_brake_horsepower(air_loop_hvac, include_terminal_fans = true) ⇒ Double

Determine the total brake horsepower of the fans on the system with or without the fans inside of fan powered terminals.

Parameters:

  • include_terminal_fans (Bool) (defaults to: true)

    if true, power from fan powered terminals will be included

Returns:

  • (Double)

    total brake horsepower of the fans on the system units = horsepower


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

def air_loop_hvac_system_fan_brake_horsepower(air_loop_hvac, include_terminal_fans = true)
  # TODO: get the template from the parent model itself?
  # Or not because maybe you want to see the difference between two standards?
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name}-Determining #{template} allowable system fan power.")

  # Get all fans
  fans = []  # Supply, exhaust, relief, and return fans

  fans += air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac)

  # Fans inside of fan-powered terminals
  if include_terminal_fans
    air_loop_hvac.demandComponents.each do |comp|
      if comp.to_AirTerminalSingleDuctSeriesPIUReheat.is_initialized
        term_fan = comp.to_AirTerminalSingleDuctSeriesPIUReheat.get.supplyAirFan
        if term_fan.to_FanConstantVolume.is_initialized
          fans << term_fan.to_FanConstantVolume.get
        end
      elsif comp.to_AirTerminalSingleDuctParallelPIUReheat.is_initialized
        term_fan = comp.to_AirTerminalSingleDuctParallelPIUReheat.get.fan
        if term_fan.to_FanConstantVolume.is_initialized
          fans << term_fan.to_FanConstantVolume.get
        end
      end
    end
  end

  # Loop through all fans on the system and
  # sum up their brake horsepower values.
  sys_fan_bhp = 0
  fans.sort.each do |fan|
    sys_fan_bhp += fan_brake_horsepower(fan)
  end

  return sys_fan_bhp
end

#air_loop_hvac_system_multiplier(air_loop_hvac) ⇒ Integer

Determine if every zone on the system has an identical multiplier. If so, return this number. If not, return 1.

Returns:

  • (Integer)

    an integer representing the system multiplier.


3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 3110

def air_loop_hvac_system_multiplier(air_loop_hvac)
  mult = 1

  # Get all the zone multipliers
  zn_mults = []
  air_loop_hvac.thermalZones.each do |zone|
    zn_mults << zone.multiplier
  end

  # Warn if there are different multipliers
  uniq_mults = zn_mults.uniq
  if uniq_mults.size > 1
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: not all zones on the system have an identical zone multiplier.  Multipliers are: #{uniq_mults.join(', ')}.")
  else
    mult = uniq_mults[0]
  end

  return mult
end

#air_loop_hvac_terminal_reheat?(air_loop_hvac) ⇒ Bool

Determine if the system has terminal reheat

Returns:

  • (Bool)

    returns true if has one or more reheat terminals, false if it doesn't.


2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2006

def air_loop_hvac_terminal_reheat?(air_loop_hvac)
  has_term_rht = false
  air_loop_hvac.demandComponents.each do |sc|
    if sc.to_AirTerminalSingleDuctConstantVolumeReheat.is_initialized ||
       sc.to_AirTerminalSingleDuctParallelPIUReheat.is_initialized ||
       sc.to_AirTerminalSingleDuctSeriesPIUReheat.is_initialized ||
       sc.to_AirTerminalSingleDuctVAVHeatAndCoolReheat.is_initialized ||
       sc.to_AirTerminalSingleDuctVAVReheat.is_initialized
      has_term_rht = true
      break
    end
  end

  return has_term_rht
end

#air_loop_hvac_total_cooling_capacity(air_loop_hvac) ⇒ Double

TODO:

Change to pull water coil nominal capacity instead of design load; not a huge difference, but water coil nominal capacity not available in sizing table.

TODO:

Handle all additional cooling coil types. Currently only handles CoilCoolingDXSingleSpeed, CoilCoolingDXTwoSpeed, and CoilCoolingWater

Get the total cooling capacity for the air loop

Returns:

  • (Double)

    total cooling capacity units = Watts (W)


562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
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
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 562

def air_loop_hvac_total_cooling_capacity(air_loop_hvac)
  # Sum the cooling capacity for all cooling components
  # on the airloop, which may be inside of unitary systems.
  total_cooling_capacity_w = 0
  air_loop_hvac.supplyComponents.each do |sc|
    # CoilCoolingDXSingleSpeed
    if sc.to_CoilCoolingDXSingleSpeed.is_initialized
      coil = sc.to_CoilCoolingDXSingleSpeed.get
      if coil.ratedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.ratedTotalCoolingCapacity.get
      elsif coil.autosizedRatedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.autosizedRatedTotalCoolingCapacity.get
      else
        OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
      end      # CoilCoolingDXTwoSpeed

    elsif sc.to_CoilCoolingDXTwoSpeed.is_initialized
      coil = sc.to_CoilCoolingDXTwoSpeed.get
      if coil.ratedHighSpeedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.ratedHighSpeedTotalCoolingCapacity.get
      elsif coil.autosizedRatedHighSpeedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.autosizedRatedHighSpeedTotalCoolingCapacity.get
      else
        OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
      end      # CoilCoolingWater

    elsif sc.to_CoilCoolingWater.is_initialized
      coil = sc.to_CoilCoolingWater.get
      if coil.autosizedDesignCoilLoad.is_initialized # TODO: Change to pull water coil nominal capacity instead of design load
        total_cooling_capacity_w += coil.autosizedDesignCoilLoad.get
      else
        OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
      end      # CoilCoolingWaterToAirHeatPumpEquationFit

    elsif sc.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized
      coil = sc.to_CoilCoolingWaterToAirHeatPumpEquationFit.get
      if coil.ratedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.ratedTotalCoolingCapacity.get
      elsif coil.autosizedRatedTotalCoolingCapacity.is_initialized
        total_cooling_capacity_w += coil.autosizedRatedTotalCoolingCapacity.get
      else
        OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
      end
    elsif sc.to_AirLoopHVACUnitarySystem.is_initialized
      unitary = sc.to_AirLoopHVACUnitarySystem.get
      if unitary.coolingCoil.is_initialized
        clg_coil = unitary.coolingCoil.get        # CoilCoolingDXSingleSpeed

        if clg_coil.to_CoilCoolingDXSingleSpeed.is_initialized
          coil = clg_coil.to_CoilCoolingDXSingleSpeed.get
          if coil.ratedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.ratedTotalCoolingCapacity.get
          elsif coil.autosizedRatedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.autosizedRatedTotalCoolingCapacity.get
          else
            OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
          end        # CoilCoolingDXTwoSpeed

        elsif clg_coil.to_CoilCoolingDXTwoSpeed.is_initialized
          coil = clg_coil.to_CoilCoolingDXTwoSpeed.get
          if coil.ratedHighSpeedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.ratedHighSpeedTotalCoolingCapacity.get
          elsif coil.autosizedRatedHighSpeedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.autosizedRatedHighSpeedTotalCoolingCapacity.get
          else
            OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
          end        # CoilCoolingWater

        elsif clg_coil.to_CoilCoolingWater.is_initialized
          coil = clg_coil.to_CoilCoolingWater.get
          if coil.autosizedDesignCoilLoad.is_initialized # TODO: Change to pull water coil nominal capacity instead of design load
            total_cooling_capacity_w += coil.autosizedDesignCoilLoad.get
          else
            OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
          end        # CoilCoolingWaterToAirHeatPumpEquationFit

        elsif clg_coil.to_CoilCoolingWaterToAirHeatPumpEquationFit.is_initialized
          coil = clg_coil.to_CoilCoolingWaterToAirHeatPumpEquationFit.get
          if coil.ratedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.ratedTotalCoolingCapacity.get
          elsif coil.autosizedRatedTotalCoolingCapacity.is_initialized
            total_cooling_capacity_w += coil.autosizedRatedTotalCoolingCapacity.get
          else
            OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
          end
        end
      end
    elsif sc.to_AirLoopHVACUnitaryHeatPumpAirToAir.is_initialized
      unitary = sc.to_AirLoopHVACUnitaryHeatPumpAirToAir.get
      clg_coil = unitary.coolingCoil      # CoilCoolingDXSingleSpeed

      if clg_coil.to_CoilCoolingDXSingleSpeed.is_initialized
        coil = clg_coil.to_CoilCoolingDXSingleSpeed.get
        if coil.ratedTotalCoolingCapacity.is_initialized
          total_cooling_capacity_w += coil.ratedTotalCoolingCapacity.get
        elsif coil.autosizedRatedTotalCoolingCapacity.is_initialized
          total_cooling_capacity_w += coil.autosizedRatedTotalCoolingCapacity.get
        else
          OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
        end      # CoilCoolingDXTwoSpeed

      elsif clg_coil.to_CoilCoolingDXTwoSpeed.is_initialized
        coil = clg_coil.to_CoilCoolingDXTwoSpeed.get
        if coil.ratedHighSpeedTotalCoolingCapacity.is_initialized
          total_cooling_capacity_w += coil.ratedHighSpeedTotalCoolingCapacity.get
        elsif coil.autosizedRatedHighSpeedTotalCoolingCapacity.is_initialized
          total_cooling_capacity_w += coil.autosizedRatedHighSpeedTotalCoolingCapacity.get
        else
          OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
        end      # CoilCoolingWater

      elsif clg_coil.to_CoilCoolingWater.is_initialized
        coil = clg_coil.to_CoilCoolingWater.get
        if coil.autosizedDesignCoilLoad.is_initialized # TODO: Change to pull water coil nominal capacity instead of design load
          total_cooling_capacity_w += coil.autosizedDesignCoilLoad.get
        else
          OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name} capacity of #{coil.name} is not available, total cooling capacity of air loop will be incorrect when applying standard.")
        end
      end
    elsif sc.to_CoilCoolingDXMultiSpeed.is_initialized ||
          sc.to_CoilCoolingCooledBeam.is_initialized ||
          sc.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.is_initialized ||
          sc.to_AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.is_initialized ||
          sc.to_AirLoopHVACUnitarySystem.is_initialized
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.AirLoopHVAC', "#{air_loop_hvac.name} has a cooling coil named #{sc.name}, whose type is not yet covered by economizer checks.")      # CoilCoolingDXMultiSpeed
      # CoilCoolingCooledBeam
      # CoilCoolingWaterToAirHeatPumpEquationFit
      # AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass
      # AirLoopHVACUnitaryHeatPumpAirToAir
      # AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed
      # AirLoopHVACUnitarySystem

    end
  end

  return total_cooling_capacity_w
end

#air_loop_hvac_unoccupied_fan_shutoff_required?(air_loop_hvac) ⇒ Bool

Determine if a system's fans must shut off when not required.

Returns:

  • (Bool)

    true if required, false if not


2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2877

def air_loop_hvac_unoccupied_fan_shutoff_required?(air_loop_hvac)
  shutoff_required = true

  # Per 90.1 6.4.3.4.5, systems less than 0.75 HP
  # must turn off when unoccupied.
  minimum_fan_hp = 0.75

  # Determine the system fan horsepower
  total_hp = 0.0
  air_loop_hvac_supply_return_exhaust_relief_fans(air_loop_hvac).each do |fan|
    total_hp += fan_motor_horsepower(fan)
  end

  # Check the HP exception
  if total_hp < minimum_fan_hp
    shutoff_required = false
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.AirLoopHVAC', "For #{air_loop_hvac.name}: Unoccupied fan shutoff not required because system fan HP of #{total_hp.round(2)} HP is less than the minimum threshold of #{minimum_fan_hp} HP.")
  end

  return shutoff_required
end

#air_loop_hvac_vav_damper_action(air_loop_hvac) ⇒ String

Determine whether the VAV damper control is single maximum or dual maximum control. Defults to 90.1-2007.

Returns:

  • (String)

    the damper control type: Single Maximum, Dual Maximum


2100
2101
2102
2103
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 2100

def air_loop_hvac_vav_damper_action(air_loop_hvac)
  damper_action = 'Dual Maximum'
  return damper_action
end

#air_loop_hvac_vav_system?(air_loop_hvac) ⇒ Boolean

Determine if the system is a VAV system based on the fan which may be inside of a unitary system.

Returns:

  • (Boolean)

1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
# File 'lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb', line 1957

def air_loop_hvac_vav_system?(air_loop_hvac)
  is_vav = false
  air_loop_hvac.supplyComponents.reverse.each do |comp|
    if comp.to_FanVariableVolume.is_initialized
      is_vav = true
    elsif comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.is_initialized
      fan = comp.to_AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass.get.supplyAirFan
      if fan.to_FanVariableVolume.is_initialized
        is_vav = true
      end
    elsif comp.to_AirLoopHVACUnitarySystem.is_initialized
      fan = comp.to_AirLoopHVACUnitarySystem.get.supplyFan
      if fan.is_initialized
        if fan.get.to_FanVariableVolume.is_initialized
          is_vav = true
        end
      end
    end
  end

  return is_vav
end

#air_terminal_single_duct_parallel_piu_reheat_apply_prm_baseline_fan_power(air_terminal_single_duct_parallel_piu_reheat) ⇒ Bool

Sets the fan power of a PIU fan based on the W/cfm specified in the standard.

Returns:

  • (Bool)

    returns true if successful, false if not


8
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb', line 8

def air_terminal_single_duct_parallel_piu_reheat_apply_prm_baseline_fan_power(air_terminal_single_duct_parallel_piu_reheat)
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.model.AirTerminalSingleDuctParallelPIUReheat', "Setting PIU fan power for #{air_terminal_single_duct_parallel_piu_reheat.name}.")

  # Determine the fan sizing flow rate, min flow rate,
  # and W/cfm
  sec_flow_frac = 0.5
  min_flow_frac = 0.3
  fan_efficacy_w_per_cfm = 0.35

  # Convert efficacy to metric
  # 1 cfm = 0.0004719 m^3/s
  fan_efficacy_w_per_m3_per_s = fan_efficacy_w_per_cfm / 0.0004719

  # Get the maximum flow rate through the terminal
  max_primary_air_flow_rate = nil
  if air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.is_initialized
    max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.autosizedMaximumPrimaryAirFlowRate.get
  elsif air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.is_initialized
    max_primary_air_flow_rate = air_terminal_single_duct_parallel_piu_reheat.maximumPrimaryAirFlowRate.get
  end

  # Set the max secondary air flow rate
  max_sec_flow_rate_m3_per_s = max_primary_air_flow_rate * sec_flow_frac
  air_terminal_single_duct_parallel_piu_reheat.setMaximumSecondaryAirFlowRate(max_sec_flow_rate_m3_per_s)
  max_sec_flow_rate_cfm = OpenStudio.convert(max_sec_flow_rate_m3_per_s, 'm^3/s', 'ft^3/min').get

  # Set the minimum flow fraction
  # TODO Also compare to min OA requirement
  air_terminal_single_duct_parallel_piu_reheat.setMinimumPrimaryAirFlowFraction(min_flow_frac)

  # Get the fan
  fan = air_terminal_single_duct_parallel_piu_reheat.fan.to_FanConstantVolume.get

  # Set the impeller efficiency
  fan_change_impeller_efficiency(fan, fan_baseline_impeller_efficiency(fan))

  # Set the motor efficiency, preserving the impeller efficency.
  # For terminal fans, a bhp lookup of 0.5bhp is always used because
  # they are assumed to represent a series of small fans in reality.
  fan_apply_standard_minimum_motor_efficiency(fan, fan_brake_horsepower(fan))

  # Calculate a new pressure rise to hit the target W/cfm
  fan_tot_eff = fan.fanEfficiency
  fan_rise_new_pa = fan_efficacy_w_per_m3_per_s * fan_tot_eff
  fan.setPressureRise(fan_rise_new_pa)

  # Calculate the newly set efficacy
  fan_power_new_w = fan_rise_new_pa * max_sec_flow_rate_m3_per_s / fan_tot_eff
  fan_efficacy_new_w_per_cfm = fan_power_new_w / max_sec_flow_rate_cfm
  OpenStudio.logFree(OpenStudio::Info, 'openstudio.model.AirTerminalSingleDuctParallelPIUReheat', "For #{air_terminal_single_duct_parallel_piu_reheat.name}: fan efficacy set to #{fan_efficacy_new_w_per_cfm.round(2)} W/cfm.")

  return true
end

#air_terminal_single_duct_vav_reheat_apply_initial_prototype_damper_position(air_terminal_single_duct_vav_reheat, building_type, zone_oa_per_area) ⇒ Bool

Set the initial minimum damper position based on OA rate of the space and the template. Defaults to basic behavior, but this method is overridden by all of the ASHRAE-based templates. Zones with low OA per area get lower initial guesses. Final position will be adjusted upward as necessary by Standards.AirLoopHVAC.apply_minimum_vav_damper_positions

Parameters:

  • zone_oa_per_area (Double)

    the zone outdoor air per area, m^3/s

Returns:

  • (Bool)

    returns true if successful, false if not


13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/openstudio-standards/prototypes/common/objects/Prototype.AirTerminalSingleDuctVAVReheat.rb', line 13

def air_terminal_single_duct_vav_reheat_apply_initial_prototype_damper_position(air_terminal_single_duct_vav_reheat, building_type, zone_oa_per_area)
  vav_name = air_terminal_single_duct_vav_reheat.name.get
  min_damper_position = 0.3

  # High OA zones
  # Determine whether or not to use the high minimum guess.
  # Cutoff was determined by correlating apparent minimum guesses
  # to OA rates in prototypes since not well documented in papers.
  if zone_oa_per_area > 0.001 # 0.001 m^3/s*m^2 = .196 cfm/ft2
    min_damper_position = 0.7
  end

  # Set the minimum flow fraction
  air_terminal_single_duct_vav_reheat.setConstantMinimumAirFlowFraction(min_damper_position)

  return true
end

#air_terminal_single_duct_vav_reheat_apply_minimum_damper_position(air_terminal_single_duct_vav_reheat, zone_min_oa = nil, has_ddc = true) ⇒ Bool

TODO:

remove exception where older vintages don't have minimum positions adjusted.

Set the minimum damper position based on OA rate of the space and the template. Zones with low OA per area get lower initial guesses. Final position will be adjusted upward as necessary by Standards.AirLoopHVAC.adjust_minimum_vav_damper_positions If supplied, this will be set as a minimum limit in addition to the minimum damper position. EnergyPlus will use the larger of the two values during sizing. which impacts the minimum damper position requirement.

Parameters:

  • zone_min_oa (Double) (defaults to: nil)

    the zone outdoor air flow rate, in m^3/s.

  • has_ddc (Bool) (defaults to: true)

    whether or not there is DDC control of the VAV terminal,

Returns:

  • (Bool)

    returns true if successful, false if not


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb', line 17

def air_terminal_single_duct_vav_reheat_apply_minimum_damper_position(air_terminal_single_duct_vav_reheat, zone_min_oa = nil, has_ddc = true)
  # Minimum damper position
  min_damper_position = air_terminal_single_duct_vav_reheat_minimum_damper_position(air_terminal_single_duct_vav_reheat, has_ddc)
  air_terminal_single_duct_vav_reheat.setConstantMinimumAirFlowFraction(min_damper_position)
  OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.AirTerminalSingleDuctVAVReheat', "For #{air_terminal_single_duct_vav_reheat.name}: set minimum damper position to #{min_damper_position}.")

  # Minimum OA flow rate
  # If specified, will also add this limit
  # and the larger of the two will be used
  # for sizing.
  unless zone_min_oa.nil?
    air_terminal_single_duct_vav_reheat.setFixedMinimumAirFlowRate(zone_min_oa)
  end

  return true
end

#air_terminal_single_duct_vav_reheat_minimum_damper_position(air_terminal_single_duct_vav_reheat, has_ddc = false) ⇒ Object

Specifies the minimum damper position for VAV dampers. Defaults to 30%

Parameters:

  • has_ddc (Bool) (defaults to: false)

    whether or not there is DDC control of the VAV terminal in question


38
39
40
41
# File 'lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb', line 38

def air_terminal_single_duct_vav_reheat_minimum_damper_position(air_terminal_single_duct_vav_reheat, has_ddc = false)
  min_damper_position = 0.3
  return min_damper_position
end

#air_terminal_single_duct_vav_reheat_reheat_type(air_terminal_single_duct_vav_reheat) ⇒ String

Determines whether the terminal has a NaturalGas, Electricity, or HotWater reheat coil. Electricity, or HotWater.

Returns:

  • (String)

    reheat type. One of NaturalGas,


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb', line 62

def air_terminal_single_duct_vav_reheat_reheat_type(air_terminal_single_duct_vav_reheat)
  type = nil

  # Get the reheat coil
  rht_coil = air_terminal_single_duct_vav_reheat.reheatCoil
  if rht_coil.to_CoilHeatingElectric.is_initialized
    type = 'Electricity'
  elsif rht_coil.to_CoilHeatingWater.is_initialized
    type = 'HotWater'
  elsif rht_coil.to_CoilHeatingGas.is_initialized
    type = 'NaturalGas'
  end

  return type
end

#air_terminal_single_duct_vav_reheat_set_heating_cap(air_terminal_single_duct_vav_reheat) ⇒ Object

Sets the capacity of the reheat coil based on the minimum flow fraction, and the maximum flow rate.


45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb', line 45

def air_terminal_single_duct_vav_reheat_set_heating_cap(air_terminal_single_duct_vav_reheat)
  flow_rate_fraction = air_terminal_single_duct_vav_reheat.constantMinimumAirFlowFraction
  if air_terminal_single_duct_vav_reheat.reheatCoil.to_CoilHeatingWater.is_initialized
    reheat_coil = air_terminal_single_duct_vav_reheat.reheatCoil.to_CoilHeatingWater.get
    if reheat_coil.autosizedRatedCapacity.to_f < 1.0e-6
      cap = 1.2 * 1000.0 * air_terminal_single_duct_vav_reheat.constantMinimumAirFlowFraction * air_terminal_single_duct_vav_reheat.autosizedMaximumAirFlowRate.to_f * (18.0 - 13.0)
      reheat_coil.setPerformanceInputMethod('NominalCapacity')
      reheat_coil.setRatedCapacity(cap)
      air_terminal_single_duct_vav_reheat.setMaximumReheatAirTemperature(18.0)
    end
  end
end

#boiler_hot_water_apply_efficiency_and_curves(boiler_hot_water) ⇒ Bool

Applies the standard efficiency ratings and typical performance curves to this object.

Parameters:

  • boiler_hot_water (OpenStudio::Model::BoilerHotWater)

    the object to modify

Returns:

  • (Bool)

    true if successful, false if not


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

def boiler_hot_water_apply_efficiency_and_curves(boiler_hot_water)
  successfully_set_all_properties = false

  # Define the criteria to find the boiler properties
  # in the hvac standards data set.
  search_criteria = boiler_hot_water_find_search_criteria(boiler_hot_water)
  fuel_type = search_criteria['fuel_type']
  fluid_type = search_criteria['fluid_type']

  # Get the capacity
  capacity_w = boiler_hot_water_find_capacity(boiler_hot_water)

  # Convert capacity to Btu/hr
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Get the boiler properties
  blr_props = model_find_object(standards_data['boilers'], search_criteria, capacity_btu_per_hr)
  unless blr_props
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{boiler_hot_water.name}, cannot find boiler properties, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  # Make the EFFFPLR curve (not all boilers will have one)
  if blr_props['efffplr']
    eff_fplr = model_add_curve(boiler_hot_water.model, blr_props['efffplr'])
    if eff_fplr
      boiler_hot_water.setNormalizedBoilerEfficiencyCurve(eff_fplr)
    else
      OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{boiler_hot_water.name}, cannot find eff_fplr curve, will not be set.")
      successfully_set_all_properties = false
    end
  end

  # Get the minimum efficiency standards
  thermal_eff = nil

  # If specified as AFUE
  unless blr_props['minimum_annual_fuel_utilization_efficiency'].nil?
    min_afue = blr_props['minimum_annual_fuel_utilization_efficiency']
    thermal_eff = afue_to_thermal_eff(min_afue)
    new_comp_name = "#{boiler_hot_water.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_afue} AFUE"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.BoilerHotWater', "For #{template}: #{boiler_hot_water.name}: #{fuel_type} #{fluid_type} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; AFUE = #{min_afue}")
  end

  # If specified as thermal efficiency
  unless blr_props['minimum_thermal_efficiency'].nil?
    thermal_eff = blr_props['minimum_thermal_efficiency']
    new_comp_name = "#{boiler_hot_water.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{thermal_eff} Thermal Eff"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.BoilerHotWater', "For #{template}: #{boiler_hot_water.name}: #{fuel_type} #{fluid_type} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; Thermal Efficiency = #{thermal_eff}")
  end

  # If specified as combustion efficiency
  unless blr_props['minimum_combustion_efficiency'].nil?
    min_comb_eff = blr_props['minimum_combustion_efficiency']
    thermal_eff = combustion_eff_to_thermal_eff(min_comb_eff)
    new_comp_name = "#{boiler_hot_water.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_comb_eff} Combustion Eff"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.BoilerHotWater', "For #{template}: #{boiler_hot_water.name}: #{fuel_type} #{fluid_type} Capacity = #{capacity_kbtu_per_hr.round}kBtu/hr; Combustion Efficiency = #{min_comb_eff}")
  end

  # Set the name
  boiler_hot_water.setName(new_comp_name)

  # Set the efficiency values
  unless thermal_eff.nil?
    boiler_hot_water.setNominalThermalEfficiency(thermal_eff)
  end

  return successfully_set_all_properties
end

#boiler_hot_water_find_capacity(boiler_hot_water) ⇒ Double

Find capacity in W

Returns:

  • (Double)

    capacity in W


40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/openstudio-standards/standards/Standards.BoilerHotWater.rb', line 40

def boiler_hot_water_find_capacity(boiler_hot_water)
  capacity_w = nil
  if boiler_hot_water.nominalCapacity.is_initialized
    capacity_w = boiler_hot_water.nominalCapacity.get
  elsif boiler_hot_water.autosizedNominalCapacity.is_initialized
    capacity_w = boiler_hot_water.autosizedNominalCapacity.get
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{boiler_hot_water.name} capacity is not available, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  return capacity_w
end

#boiler_hot_water_find_search_criteria(boiler_hot_water) ⇒ Hash

find search criteria

Returns:

  • (Hash)

    used for model_find_object(model)


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

def boiler_hot_water_find_search_criteria(boiler_hot_water)
  # Define the criteria to find the boiler properties
  # in the hvac standards data set.
  search_criteria = {}
  search_criteria['template'] = template

  # Get fuel type
  fuel_type = nil
  case boiler_hot_water.fuelType
  when 'NaturalGas'
    fuel_type = 'Gas'
  when 'Electricity'
    fuel_type = 'Electric'
  when 'FuelOil#1', 'FuelOil#2'
    fuel_type = 'Oil'
  else
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{boiler_hot_water.name}, a fuel type of #{fuelType} is not yet supported.  Assuming 'Gas.'")
    fuel_type = 'Gas'
  end

  search_criteria['fuel_type'] = fuel_type

  # Get the fluid type
  fluid_type = 'Hot Water'
  search_criteria['fluid_type'] = fluid_type

  return search_criteria
end

#boiler_hot_water_standard_minimum_thermal_efficiency(boiler_hot_water, rename = false) ⇒ Double

Finds lookup object in standards and return minimum thermal efficiency

Returns:

  • (Double)

    minimum thermal efficiency


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

def boiler_hot_water_standard_minimum_thermal_efficiency(boiler_hot_water, rename = false)
  # Get the boiler properties
  search_criteria = boiler_hot_water_find_search_criteria(boiler_hot_water)
  capacity_w = boiler_hot_water_find_capacity(boiler_hot_water)
  capacity_btu_per_hr = OpenStudio.convert(capacity_w, 'W', 'Btu/hr').get
  capacity_kbtu_per_hr = OpenStudio.convert(capacity_w, 'W', 'kBtu/hr').get

  # Get the minimum efficiency standards
  thermal_eff = nil

  # Get the boiler properties
  blr_props = model_find_object(standards_data['boilers'], search_criteria, capacity_btu_per_hr)
  unless blr_props
    OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.BoilerHotWater', "For #{boiler_hot_water.name}, cannot find boiler properties, cannot apply efficiency standard.")
    successfully_set_all_properties = false
    return successfully_set_all_properties
  end

  fuel_type = blr_props['fuel_type']
  fluid_type = blr_props['fluid_type']

  # If specified as AFUE
  unless blr_props['minimum_annual_fuel_utilization_efficiency'].nil?
    min_afue = blr_props['minimum_annual_fuel_utilization_efficiency']
    thermal_eff = afue_to_thermal_eff(min_afue)
    new_comp_name = "#{boiler_hot_water.name} #{capacity_kbtu_per_hr.round}kBtu/hr #{min_afue} AFUE"
    OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.BoilerHotWater', "For #{template}: