Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloning a DualDuct AirLoopHVAC breaks the existing loop. #4060

Closed
jmarrec opened this issue Aug 28, 2020 · 0 comments · Fixed by #4061
Closed

Cloning a DualDuct AirLoopHVAC breaks the existing loop. #4060

jmarrec opened this issue Aug 28, 2020 · 0 comments · Fixed by #4061

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 28, 2020

Issue overview

Cloning an AirLoopHVAC will break the existing loop, dangling three nodes.

Steps to Reproduce

include OpenStudio::Model

def renameNodes(a)
  a.supplyInletNode.setName("#{a.nameString} Supply Inlet Node")
  a.supplyOutletNodes[0].setName("#{a.nameString} Supply Outlet 1 Node")
  a.supplyOutletNodes[1].setName("#{a.nameString} Supply Outlet 2 Node")
  a.demandInletNodes[0].setName("#{a.nameString} Demand Inlet 1 Node")
  a.demandOutletNode.setName("#{a.nameString} Demand Outlet Node")
  a.demandComponents(a.demandSplitter, a.demandMixer, "OS:Node".to_IddObjectType)[0].setName("#{a.nameString} Demand Connection Node")
end

m = Model.new
# Make a dual duct loop
a = AirLoopHVAC.new(m, true)
a.setName("Loop")
renameNodes(a)
raise if m.getNodes.size != 6
n_nodes = a.components("OS:Node".to_IddObjectType).size
raise "Expected 6 nodes on AirLoopHVAC 'Loop', found #{n_nodes}" if  n_nodes != 6

m.save('1.osm', true)

a2 = a.clone(m).to_AirLoopHVAC.get
a2.setName("LoopClone")
raise if m.getNodes.size != 12
# Throws, because it's 3 actually
n_nodes = a.components("OS:Node".to_IddObjectType).size
raise "Expected 6 nodes on AirLoopHVAC 'Loop', found #{n_nodes}" if  n_nodes != 6

n_nodesClone = a2.components("OS:Node".to_IddObjectType).size
raise "Expected 6 nodes on AirLoopHVAC 'LoopClone', found #{n_nodesClone}" if  n_nodesClone != 6

renameNodes(a2)


m.save('2.osm', true)


a.remove()
raise "There should be only 6 nodes after deleting 'Loop', but there are #{m.getNodes.size}" if m.getNodes.size != 6 # <= Throws, we have 9
n_nodesClone = a2.components("OS:Node".to_IddObjectType).size
raise "Expected 6 nodes on AirLoopHVAC 'LoopClone', found #{n_nodesClone}" if  n_nodesClone != 6

m.save('3.osm', true)

Possible Solution

The AirLoopHVAC::clone isn't adding the supply splitter like it should (createTopology doesn't do it)

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): All
  • Version of OpenStudio (if using an intermediate build, include SHA): Current develop, circa 3.1.0-alpha (757b033)

Context

openstudiocoalition/OpenStudioApplication#217

jmarrec added a commit that referenced this issue Aug 28, 2020
jmarrec added a commit that referenced this issue Sep 29, 2020
jmarrec added a commit that referenced this issue Mar 9, 2021
jmarrec added a commit that referenced this issue Mar 23, 2021
tijcolem added a commit that referenced this issue Apr 6, 2021
Fix #4060 Cloning a DualDuct AirLoopHVAC breaks the existing loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant