Skip to content

Commit

Permalink
SetActuatedBranchFlowRate - avoid array bounds errors - move early es…
Browse files Browse the repository at this point in the history
…cape to top
  • Loading branch information
mjwitte committed Mar 11, 2019
1 parent 9451557 commit d136c4c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/EnergyPlus/PlantUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ namespace PlantUtilities {
// Set flow on node and branch while honoring constraints on actuated node

auto &a_node(DataLoopNode::Node(ActuatedNode));
if (LoopNum == 0 || LoopSideNum == 0) {
// early in simulation before plant loops are setup and found
a_node.MassFlowRate = CompFlow;
return;
}

auto &loop_side(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum));

// store original flow
Expand Down Expand Up @@ -495,10 +501,6 @@ namespace PlantUtilities {
DataLoopNode::Node(NodeNum).MassFlowRate = a_node_MasFlowRate;
DataLoopNode::Node(NodeNum).MassFlowRateRequest = a_node_MasFlowRateRequest;
}

} else {
// early in simulation before plant loops are setup and found
a_node.MassFlowRate = CompFlow;
}
}

Expand Down

0 comments on commit d136c4c

Please sign in to comment.