Skip to content
New issue

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

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

Already on GitHub? # to your account

Issue in AirLoopHVACOutdoorAirSystem::reliefComponents with ZoneHVACComponents: wrong order #4354

Closed
jmarrec opened this issue Jun 14, 2021 · 0 comments · Fixed by #4355
Closed

Comments

@jmarrec
Copy link
Collaborator

jmarrec commented Jun 14, 2021

Issue overview

Current Behavior

The order is wrong.

m = Model.new
a = AirLoopHVAC.new(m)
oaController = OpenStudio::Model::ControllerOutdoorAir.new(m)
oaSystem = OpenStudio::Model::AirLoopHVACOutdoorAirSystem.new(m, oaController)
oaSystem.addToNode(a.supplyOutletNode)
vrftu = ZoneHVACTerminalUnitVariableRefrigerantFlow.new(m)

vrftu.addToNode(oaSystem.outboardReliefNode.get)

vrftu.inletNode.get.setName("VRF TU Inlet Node")
#vrftu.outletNode.get.setName("VRF TU Inlet Node")
oaSystem.outboardReliefNode.get.setName("Relief Node")

oaSystem.reliefComponents.map{|c| c.nameString}
=> ["Zone HVAC Terminal Unit Variable Refrigerant Flow 1", "VRF TU Inlet Node", "Relief Node"]

Expected Behavior

=> ["VRF TU Inlet Node", "Zone HVAC Terminal Unit Variable Refrigerant Flow 1", "Relief Node""]

Steps to Reproduce

See ruby code above

Possible Solution

This is wrong:

if (node) {
modelObjects.push_back(*node);
modelObject = node->outletModelObject();
} else if (comp) {
modelObjects.push_back(*comp);
modelObject = comp->outletModelObject();
} else if (boost::optional<AirToAirComponent> comp = modelObject->optionalCast<AirToAirComponent>()) {
modelObjects.push_back(*comp);
modelObject = comp->secondaryAirOutletModelObject();
} else if (boost::optional<WaterToAirComponent> comp = modelObject->optionalCast<WaterToAirComponent>()) {
modelObjects.push_back(*comp);
modelObject = comp->airOutletModelObject();
} else if (auto comp = modelObject->optionalCast<ZoneHVACComponent>()) {
modelObjects.insert(modelObjects.begin(), *comp);
modelObject = comp->outletNode();

Edit: it's my fault too, sorry about that. I introduced a copy paste error in 292cece

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): 1.2.0

Context

Found on openstudiocoalition/OpenStudioApplication#384

@jmarrec jmarrec self-assigned this Jun 14, 2021
jmarrec added a commit that referenced this issue Jun 14, 2021
jmarrec added a commit that referenced this issue Jun 14, 2021
@jmarrec jmarrec changed the title Issue in AirLoopHVACOutdoorAirSystem::refliefComponents with ZoneHVACComponents: wrong order Issue in AirLoopHVACOutdoorAirSystem::reliefComponents with ZoneHVACComponents: wrong order Jun 14, 2021
kbenne added a commit that referenced this issue Jun 21, 2021
Fix #4354 - Issue in AirLoopHVACOutdoorAirSystem::reliefComponents with ZoneHVACComponents: wrong order
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
1 participant