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

How to add a setpoint manager after cooling coil in an airloop through openstudio sdk python

asked 2023-06-13 20:41:14 -0500

Kunyu's avatar

updated 2023-06-14 11:57:56 -0500

I would like to add a setpoint manager to control the humidity ratio after the cooling coil in an air loop, and I'm doing this through openstudio sdk python.

image description

The python code for this is like: object.addToNode(node)

My question is that how to get the oulet node object of the cooling coil instead of supply outlet node of the air loop?

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-05-24 07:14:47 -0500

mattkoch's avatar

The cooling coil appears to be a CoilCoolingWater. As such, it is a WaterToAirComponent. And as such, it inherits the airInletModelObject(), airOutletModelObject(), waterInletModelObject() and waterOutletModelObject() methods. I do not kow whether these always return a node, but here is a Pyhton snippet to see what gives.

import openstudio
cooling_coil_name = "CHWC-1"
cooling_coil = model.getCoilCoolingWaterByName(cooling_coil_name)
if cooling_coil.is_initialized():
  cooling_coil = cooling_coil.get()
  cooling_coil_node = cooling_coil.airOutletModelObject()
  if cooling_coil_node.is_initialized():
    cooling_coil_node = cooling_coil_node.get()
    if isinstance(cooling_coil_node,openstudio.openstudiomodelhvac.Node):
      print("Congratulations, this is a Node: ",cooling_coil_node)
    else:
      cooling_coil_node = cooling_coil_node.to_Node()
      if cooling_coil_node.is_initialized():
        cooling_coil_node = cooling_coil_node.get()
        print("Congratulations perhaps, this may be a Node: ",cooling_coil_node)
edit flag offensive delete link more

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: 2023-06-13 20:41:14 -0500

Seen: 44 times

Last updated: 8 hours ago