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

how to get PlantLoop associated with airLoop component OpenStudio

asked 2014-11-03 18:43:28 -0600

Chienman's avatar

updated 2014-11-07 12:27:39 -0600

Hi there-

I'm working with C# bindings of OpenStudio 1.4.x, via IronPython, and what I want to do is to be able to modify plant loop components, given a user working on an airLoop.

Here's an example. I call the hot water coil associated with an air handler. Now what I want to do,is find the plant loop associated with this coil, and ultimately find the boiler and other components associated with the coil. I guess conceptually, this could be a way to tear up the guts of a plant loop upstream, starting with knowledge of only the airside system.

I've gone down a few dead ends...here is what I have tried:

I tried calling the heating coil object itself. x = airloop.supplyComponents(ops.IddObjectType("OS:Coil:Heating:Water")) hc = model.getCoilHeatingWater(x[0].handle()).get()

The problem with this is, the type returned by getCoilHeatingWater does not appear to in any way closer to the upstream parent boiler.

I tried calling the parent of the heating coil: x = airloop.supplyComponents(ops.IddObjectType("OS:Coil:Heating:Water")) b = x[0].parent() The problem here is, I get an OptionalParentObject, which is usually a dead end. I don't know of any way to do anything with this object.

I tried calling all the relationships, which looks promising, x = airloop.supplyComponents(ops.IddObjectType("OS:Coil:Heating:Water")) rels = x[0].relationships() for rel in rels: print rel This seems promising, but the relationships all seem pretty generic strings that I can't access.

Anyways, this is pretty new territory for me since I have just now gotten to the plant side of things in OpenStudio. I'm curious if anyone has some pseudo code or a basic gist that can help me out.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
7

answered 2014-11-03 20:26:50 -0600

updated 2014-11-03 20:41:40 -0600

Let me try to answer with an example in Ruby. I'm pretty sure you can convert to Python syntax.

  air_loop = OpenStudio::Model::addSystemType7(m).to_AirLoopHVAC.get
  heating_coil = air_loop.supplyComponents(OpenStudio::Model::CoilHeatingWater::iddObjectType).first.to_CoilHeatingWater.get
  hot_water_plant = heating_coil.plantLoop.get
  boiler = hot_water_plant.supplyComponents(OpenStudio::Model::BoilerHotWater::iddObjectType).first.to_BoilerHotWater.get
  puts boiler.name

Every HVACComponent in OpenStudio, including water coils have the methods plantLoop and airLoopHVAC that return the specified system.

edit flag offensive delete link more

Comments

@Chienman we did conclude that the to_Foo casting methods are available in C# / IronPython right? That will save you from the whole model.getCoilHeatingWater(x[0].handle) business.

Kyle Benne's avatar Kyle Benne  ( 2014-11-03 20:44:24 -0600 )edit
6

answered 2014-11-03 21:15:32 -0600

updated 2014-11-04 07:18:24 -0600

I can't tell if you want C# or Python code since you mention C# bindings but are using IronPython, but this is @Kyle Benne answer in Python.

from openstudio import model

m = model.Model()

air_loop = model.toAirLoopHVAC(model.addSystemType7(m)).get()

heating_coil = model.toCoilHeatingWater(air_loop.supplyComponents(model.CoilHeatingWater.iddObjectType).front()).get()

hot_water_plant = heating_coil.plantLoop().get()

boiler = model.toBoilerHotWater(hot_water_plant.supplyComponents(model.BoilerHotWater.iddObjectType).front()).get()

print(boiler.name())
edit flag offensive delete link more

Comments

My question is similar but would like to do this just within the OS GUI. My building has 7 air handlers with a common boiler supplying HW to each air handler's heating coil and the cooling coils are connected to 7 different exterior compressor units (condensers). I have created a plant loop with 7 Unit Heater HW Htg Coils which have been assigned individually to each zone as a second piece of Zone Equipment under the Zones tab by dragging and dropping. This all seems to work but I concerned on setting a schedule. The pump runs continuously but choosing this setting causes the following err

MattStewart's avatar MattStewart  ( 2015-01-17 17:44:45 -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: 2014-11-03 18:43:28 -0600

Seen: 404 times

Last updated: Nov 07 '14