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

How to get Condenser PlantLoop associated with Chiller PlantLoop in OpenStudio

asked 2015-04-08 08:04:13 -0600

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-08 13:39:32 -0600

updated 2015-04-08 13:41:57 -0600

I just added an updated Annual End Use Breakdown measure to BCL. it includes air and plant loop summaries. As shown below it does link the chiller loop to condenser loop.

image description

The code below is within a loop of all supply side components for the chiller loop. Once a ChillerElectricEIR is found then component.secondaryPlantLoop returns an optional.

elsif component.to_ChillerElectricEIR.is_initialized
  component = component.to_ChillerElectricEIR.get
  sizing_source_units = "W"
  sizing_target_units = "Btu/h"
  if component.referenceCapacity.is_initialized
    sizing_ip = OpenStudio.convert(component.referenceCapacity.get,sizing_source_units,sizing_target_units).get
    sizing_ip_neat = OpenStudio.toNeatString(sizing_ip,2,true)
  else
    sizing_ip_neat = "Autosized"
  end
  value = component.referenceCOP
  value_neat = OpenStudio.toNeatString(value,2,true)
  description = "Reference COP"
  @output_data_plant_loops[:data] <<  [component.iddObject.name,sizing_ip_neat,sizing_target_units,description,value_neat,"",""]

  # second line to indicate if water or air cooled
  if component.secondaryPlantLoop.is_initialized
    @output_data_plant_loops[:data] <<  ["#{component.iddObject.name} (cont)","","","Chiller Source",component.secondaryPlantLoop.get.name,"",""]
  else
    @output_data_plant_loops[:data] <<  ["#{component.iddObject.name} (cont)","","","Chiller Source","Air Cooled","",""]
  end

The code for this is in the os_lib_reporting.rb file in the resources folder of the measure.

edit flag offensive delete link more

Comments

Thanks @David Goldwasser. Is Chiller.secondaryPlantLoop defined somewhere in the SDK documentation? I can't find it.

Julien Marrec's avatar Julien Marrec  ( 2015-04-08 13:52:37 -0600 )edit

ChillerEIR inherits methods from WaterToWaterComponent.

Tricks in the documentation

  1. Click "Inheritnace diagram" near the top to see what it inherits from. You can click objects on diagram to see their methods.
  2. Click "List of all members" to see all of the inherited methods.
David Goldwasser's avatar David Goldwasser  ( 2015-04-08 14:08:18 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2015-04-08 08:04:13 -0600

Seen: 390 times

Last updated: Apr 08 '15