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

Revision history [back]

As a workaround until better support is given in the OpenStudioApplication you can do this, assuming:

  • Your model is named model.osm
  • Your Surface to add the pool to (bottom one) is named My Surface
  • The PlantLoop to connect it to is named My Plant Loop

A one liner using the CLI (it's decomposed for clarity at the end of the answer)

openstudio -e "include OpenStudio::Model; vt = OpenStudio::OSVersion::VersionTranslator.new; m = vt.loadModel('model.osm').get; s = m.getSurfaceByName('My Surface').get; pool = SwimmingPoolIndoor.new(m, s); p = m.getPlantLoopByName('My Plant Loop').get; p.addDemandBranchForComponent(pool); m.save('model.osm', true)"

It'll be missing an icon and showing some fields (the Node ones) that you shouldn't edit, but you'll have access to everything by clicking on it on the plant loop:

image description


Decomposition of the one-liner:

# Load
include OpenStudio::Model
vt = OpenStudio::OSVersion::VersionTranslator.new
m = vt.loadModel('model.osm').get

# Get Floor Surface for the pool
s = m.getSurfaceByName('My Surface').get
pool = SwimmingPoolIndoor.new(m, s)

# Connect to a plant loop
p = m.getPlantLoopByName('My Plant Loop').get
p.addDemandBranchForComponent(pool)

# Save
m.save('model.osm', true)