lib/measures/tbd/resources/conditioned.rb
def plenum?(space, loops, setpoints)
  # Largely inspired from NREL's "space_plenum?" procedure.
  #
  # github.com/NREL/openstudio-standards/blob/
  # 58964222d25783e9da4ae292e375fb0d5c902aa5/lib/openstudio-standards/
  # standards/Standards.Space.rb#L1384

  # For a fully-developed OSM (complete with HVAC air loops), space tagged as
  # plenum if zone "isPlenum" (case A).
  #
  # In absence of HVAC air loops, 2x other cases trigger a plenum tag:
  #   case B. space excluded from building's total floor area, yet zone holds an
  #           "inactive" thermostat (i.e., can't extract valid setpoints); or
  #   case C. spacetype is "plenum".
  cl = OpenStudio::Model::Space
  unless space && space.is_a?(cl)
    TBD.log(TBD::DEBUG,
      "Invalid plenum space (argument) - skipping")
    return false
  end
  unless loops == true || loops == false
    TBD.log(TBD::DEBUG,
      "Invalid plenum loops (argument) - skipping")
    return false
  end
  unless setpoints == true || setpoints == false
    TBD.log(TBD::DEBUG,
      "Invalid plenum setpoints (argument) - skipping")
    return false
  end

  unless space.thermalZone.empty?
    zone = space.thermalZone.get
    return zone.isPlenum if loops                                       # case A

    if setpoints
      heating, dual1 = maxHeatScheduledSetpoint(zone)
      cooling, dual2 = minCoolScheduledSetpoint(zone)
      return false if heating || cooling            # directly conditioned space

      unless space.partofTotalFloorArea
        return true if dual1 || dual2                                   # case B
      else
        return false
      end
    end
  end

  unless space.spaceType.empty?                                         # case C
    type = space.spaceType.get
    return true if type.nameString.downcase == "plenum"
    unless type.standardsSpaceType.empty?
      type = type.standardsSpaceType.get
      return true if type.downcase == "plenum"
    end
  end
  false
end
##
# Validate whether space should be processed as a plenum.
#
# @param [OpenStudio::Model::Space] space An OS space
# @param [Bool] loops True if model has airLoopHVAC objects
# @param [Bool] setpoints True if model has valid temperature setpoints
#
# @return [Bool] Returns true if should be tagged as plenum.
Validate whether space should be processed as a plenum.
Validate whether space should be processed as a plenum .
def plenum?(space, loops, setpoints)
   github.com/NREL/openstudio-standards/blob/
   58964222d25783e9da4ae292e375fb0d5c902aa5/lib/openstudio-standards/
   standards/Standards.Space.rbL1384
   For a fully-developed OSM (complete with HVAC air loops), space tagged as
   plenum if zone "isPlenum" (case A).
   In absence of HVAC air loops, 2x other cases trigger a plenum tag:
     case B. space excluded from building's total floor area, yet zone holds an
             "inactive" thermostat (i.e., can't extract valid setpoints); or
     case C. spacetype is "plenum".
  cl = OpenStudio::Model::Space
  unless space && space.is_a?(cl)
    TBD.log(TBD::DEBUG,
      "Invalid plenum space (argument) - skipping")
    return false
  end
  unless loops == true || loops == false
    TBD.log(TBD::DEBUG,
      "Invalid plenum loops (argument) - skipping")
    return false
  end
  unless setpoints == true || setpoints == false
    TBD.log(TBD::DEBUG,
      "Invalid plenum setpoints (argument) - skipping")
    return false
  end
  unless space.thermalZone.empty?
    zone = space.thermalZone.get
    return zone.isPlenum if loops                                        case A
    if setpoints
      heating, dual1 = maxHeatScheduledSetpoint(zone)
      cooling, dual2 = minCoolScheduledSetpoint(zone)
      return false if heating || cooling             directly conditioned space
      unless space.partofTotalFloorArea
        return true if dual1 || dual2                                    case B
      else
        return false
      end
    end
  end
  unless space.spaceType.empty?                                          case C
    type = space.spaceType.get
    return true if type.nameString.downcase == "plenum"
    unless type.standardsSpaceType.empty?
      type = type.standardsSpaceType.get
      return true if type.downcase == "plenum"
    end
  end
  false
end
def plenum? ( space , loops , setpoints ) cl = OpenStudio :: Model :: Space unless space && space . is_a? ( cl ) TBD . log ( TBD :: DEBUG , "Invalid plenum space (argument) - skipping" ) return false end unless loops == true || loops == false TBD . log ( TBD :: DEBUG , "Invalid plenum loops (argument) - skipping" ) return false end unless setpoints == true || setpoints == false TBD . log ( TBD :: DEBUG , "Invalid plenum setpoints (argument) - skipping" ) return false end unless space . thermalZone . empty? zone = space . thermalZone . get return zone . isPlenum if loops if setpoints heating , dual1 = maxHeatScheduledSetpoint ( zone ) cooling , dual2 = minCoolScheduledSetpoint ( zone ) return false if heating || cooling unless space . partofTotalFloorArea return true if dual1 || dual2 else return false end end end unless space . spaceType . empty? type = space . spaceType . get return true if type . nameString . downcase == "plenum" unless type . standardsSpaceType . empty? type = type . standardsSpaceType . get return true if type . downcase == "plenum" end end false end
Validate whether space should be processed as a plenum.
Validate whether space should be processed as a plenum .
# Largely inspired from NREL's "space_plenum?" procedure. # # github.com/NREL/openstudio-standards/blob/ # 58964222d25783e9da4ae292e375fb0d5c902aa5/lib/openstudio-standards/ # standards/Standards.Space.rb#L1384 # For a fully-developed OSM (complete with HVAC air loops), space tagged as # plenum if zone "isPlenum" (case A). # # In absence of HVAC air loops, 2x other cases trigger a plenum tag: #   case B. space excluded from building's total floor area, yet zone holds an #           "inactive" thermostat (i.e., can't extract valid setpoints); or #   case C. spacetype is "plenum". # case A # directly conditioned space # case B # case C
Returns true if should be tagged as plenum.
Returns true if should be tagged as plenum .
Bool
space
loops
setpoints
setpoints True if model has valid temperature setpoints
setpoints True if model has valid temperature setpoints