Skip to content

Commit

Permalink
Merge branch 'develop' into Add-more-convergence-check-for-CO2-and-Cont
Browse files Browse the repository at this point in the history
  • Loading branch information
lgu1234 committed May 13, 2024
2 parents 2d0b9c4 + 22053e4 commit 087377a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1771,7 +1771,7 @@ void CalcPumps(EnergyPlusData &state, int const PumpNum, Real64 const FlowReques
int InletNode;
int OutletNode;
Real64 LoopDensity;
Real64 VolFlowRate;
Real64 VolFlowRate = 0.0;
Real64 PartLoadRatio;
Real64 FracFullLoadPower;
Real64 FullLoadVolFlowRate;
Expand Down Expand Up @@ -1919,6 +1919,9 @@ void CalcPumps(EnergyPlusData &state, int const PumpNum, Real64 const FlowReques
FracFullLoadPower = thisPump.PartLoadCoef[0] + thisPump.PartLoadCoef[1] * PartLoadRatio + thisPump.PartLoadCoef[2] * pow_2(PartLoadRatio) +
thisPump.PartLoadCoef[3] * pow_3(PartLoadRatio);
daPumps->Power = (FullLoadPowerRatio * daPumps->NumPumpsFullLoad + FracFullLoadPower) * FullLoadPower;
if (thisPump.EMSPressureOverrideOn) {
VolFlowRate = PartLoadVolFlowRate;
}
} break;
default: {
assert(false);
Expand Down
61 changes: 61 additions & 0 deletions tst/EnergyPlus/unit/Pumps.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -716,4 +716,65 @@ TEST_F(EnergyPlusFixture, VariableSpeedPump_MinFlowEqualToMax)
EXPECT_NEAR(state->dataPumps->PumpEquip(1).NomVolFlowRate, expectedAnswer, allowableTolerance);
}

TEST_F(EnergyPlusFixture, HeaderedVariableSpeedPumpEMSPressureTest)
{
std::string const idf_objects = delimited_string({
"HeaderedPumps:VariableSpeed,",
"Chilled Water Headered Pumps, !- Name",
"CW Supply Inlet Node, !- Inlet Node Name",
"CW Pumps Outlet Node, !- Outlet Node Name",
"0.001, !- Total Design Flow Rate {m3/s}",
"2, !- Number of Pumps in Bank",
"SEQUENTIAL, !- Flow Sequencing Control Scheme",
"100000, !- Design Pump Head {Pa}",
"autosize, !- Design Power Consumption {W}",
"0.8, !- Motor Efficiency",
"0.0, !- Fraction of Motor Inefficiencies to Fluid Stream",
"0, !- Coefficient 1 of the Part Load Performance Curve",
"1, !- Coefficient 2 of the Part Load Performance Curve",
"0, !- Coefficient 3 of the Part Load Performance Curve",
"0, !- Coefficient 4 of the Part Load Performance Curve",
"0.1, !- Minimum Flow Rate Fraction",
"INTERMITTENT, !- Pump Control Type",
"CoolingPumpAvailSched, !- Pump Flow Rate Schedule Name",
", !- Zone Name",
", !- Skin Loss Radiative Fraction",
"PowerPerFlowPerPressure, !- Design Power Sizing Method",
", !- Design Electric Power per Unit Flow Rate",
"1.3, !- Design Shaft Power per Unit Flow Rate per Unit Head",
"Pump Energy; !- End-Use Subcategory",
});

ASSERT_TRUE(process_idf(idf_objects));
Pumps::GetPumpInput(*state);
Pumps::SizePump(*state, 1);
Real64 massflowrate = 1.0;
state->dataPumps->PumpEquip(1).EMSPressureOverrideOn = true;
state->dataPumps->PumpEquip(1).plantLoc.loopSideNum = DataPlant::LoopSideLocation::Supply;
state->dataPumps->PumpEquip(1).plantLoc.loopNum = 1;
state->dataPumps->PumpEquip(1).plantLoc.branchNum = 1;
state->dataPumps->PumpEquip(1).plantLoc.compNum = 1;
state->dataPumps->PumpEquip(1).MassFlowRateMax = massflowrate;
bool PumpRunning = true;
int thisLoopNum = 1, thisBranchNum = 1, thisCompNum = 1;
DataPlant::LoopSideLocation thisLoopSideNum = DataPlant::LoopSideLocation::Supply;
PlantLocation plantLoc{thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum};
state->dataPlnt->PlantLoop.allocate(1);
state->dataPlnt->PlantLoop(1).LoopSide(thisLoopSideNum).Branch.allocate(1);
state->dataPlnt->PlantLoop(1).LoopSide(thisLoopSideNum).Branch(thisBranchNum).Comp.allocate(1);
state->dataLoopNodes->Node(1).MassFlowRate = massflowrate;
state->dataLoopNodes->Node(1).MassFlowRateMinAvail = massflowrate;
state->dataLoopNodes->Node(1).MassFlowRateMin = massflowrate;
state->dataLoopNodes->Node(1).MassFlowRateMax = massflowrate;
state->dataLoopNodes->Node(2).MassFlowRateMaxAvail = massflowrate;
state->dataLoopNodes->Node(1).MassFlowRateMaxAvail = massflowrate;

state->dataPumps->PumpEquip(1).PumpEffic = 0.8;
state->dataPumps->PumpEquip(1).EMSPressureOverrideValue = 200.0;

Pumps::CalcPumps(*state, 1, massflowrate, PumpRunning);

EXPECT_NEAR(state->dataPumps->PumpEquip(1).Power, 0.1563, 0.0001);
}

} // namespace EnergyPlus

5 comments on commit 087377a

@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.

Add-more-convergence-check-for-CO2-and-Cont (lgu1234) - x86_64-MacOS-10.18-clang-15.0.0: OK (3562 of 3563 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 786
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Add-more-convergence-check-for-CO2-and-Cont (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3603 of 3604 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 806
  • Failed: 1

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

Add-more-convergence-check-for-CO2-and-Cont (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1987 of 1987 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

Add-more-convergence-check-for-CO2-and-Cont (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (791 of 791 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

Add-more-convergence-check-for-CO2-and-Cont (lgu1234) - Win64-Windows-10-VisualStudio-16: OK (2775 of 2775 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.