Skip to content

Commit

Permalink
Testing for diffs not part of 9979 but needed for proper plant simula…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
rraustad committed Aug 1, 2023
1 parent 8f4cbad commit 8c0ffa6
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions src/EnergyPlus/PlantUtilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1023,18 +1023,23 @@ void UpdateChillerComponentCondenserSide(EnergyPlusData &state,
state.dataLoopNodes->Node(OutletNodeNum).Temp =
state.dataLoopNodes->Node(InletNodeNum).Temp + ModelCondenserHeatRate / (state.dataLoopNodes->Node(InletNodeNum).MassFlowRate * Cp);
}
state.dataLoopNodes->Node(OutletNodeNum).MassFlowRate =
state.dataLoopNodes->Node(InletNodeNum)
.MassFlowRate; // if condenser is on inlet branch, the outlet node needs to be updated or can get splitter/mixer failures

// set sim flag for this loop
state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true;

// set sim flag on connected loops to true because this side changed
if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) {
for (ConnectLoopNum = 1; ConnectLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) {
if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) {
OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum;
OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum;
state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true;
}
// if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) {
// full chiller model is not really run when called from the condenser side and the chiller evap loop puts demand on the condenser
// loop, so this logic is flawed, remove if statement so evap side gets simulated again
OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum;
OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum;
state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true;
// }
}
}

Expand Down Expand Up @@ -1108,6 +1113,9 @@ void UpdateComponentHeatRecoverySide(EnergyPlusData &state,
state, state.dataPlnt->PlantLoop(LoopNum).FluidName, ModelInletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName);
state.dataLoopNodes->Node(OutletNodeNum).Temp =
state.dataLoopNodes->Node(InletNodeNum).Temp + ModelRecoveryHeatRate / (state.dataLoopNodes->Node(InletNodeNum).MassFlowRate * Cp);
state.dataLoopNodes->Node(OutletNodeNum).MassFlowRate =
state.dataLoopNodes->Node(InletNodeNum).MassFlowRate; // if heat recovery bundle is on inlet branch, the mass flow needs to be
// updated or get splitter/mixer failures
}

// set sim flag for this loop
Expand All @@ -1116,11 +1124,13 @@ void UpdateComponentHeatRecoverySide(EnergyPlusData &state,
// set sim flag on connected loops to true because this side changed
if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) {
for (ConnectLoopNum = 1; ConnectLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) {
if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) {
OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum;
OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum;
state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true;
}
// if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) {
// full chiller model is not really run when called from the heat recovery side and the chiller evap loop puts demand on the heat
// recovery loop, so this logic is flawed, remove if statement so evap side gets simulated again
OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum;
OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum;
state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true;
// }
}
}

Expand Down

2 comments on commit 8c0ffa6

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9979-PlantUtilities-diff-code-test (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2673 of 2673 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9979-PlantUtilities-diff-code-test (rraustad) - x86_64-MacOS-10.17-clang-13.0.0: OK (3287 of 3446 tests passed, 84 test warnings)

Messages:\n

  • 119 tests had: ESO small diffs.
  • 188 tests had: EIO diffs.
  • 121 tests had: ESO big diffs.
  • 154 tests had: MTR small diffs.
  • 95 tests had: Table big diffs.
  • 62 tests had: MTR big diffs.
  • 1 test had: JSON big diffs.
  • 94 tests had: Table small diffs.
  • 29 tests had: ERR diffs.

Failures:\n

regression Test Summary

  • Passed: 613
  • Failed: 159

Build Badge Test Badge

Please sign in to comment.