Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

How to get Condenser PlantLoop associated with Chiller PlantLoop in OpenStudio

Is there an easy way to return the condenser water PlantLoop that is associated with a given Chiller PlantLoop?

So far, I can get the chiller ok, but can't seem to directly get the associated condenser plant loop, just the condenser water inlet/outlet nodes.

if not chiller_plant_loop.supplyComponents(OpenStudio::Model::ChillerElectricEIR::iddObjectType).empty?

  # Get chiller
  chiller = chiller_plant_loop.supplyComponents(OpenStudio::Model::ChillerElectricEIR::iddObjectType).first.to_ChillerElectricEIR.get

  if chiller.condenserType == 'WaterCooled'
    # Chiller is WaterCooled therefore should be connected to a condenser water loop
    # How do I get the associated Condenser PlantLoop?
  end

end

If I can avoid getting the inlet or outlet node and looping on ALL condenser water loops to find that node, that'd be much better.