Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/EnergyPlus/Plant/LoopSide.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,50 @@ namespace DataPlant {
// equal to the inlet flow rate, according to flowlock logic.
this->FlowLock = DataPlant::FlowLock::Locked;
this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag);

// Supply side flow exceeds the demand side request and the demand side has no bypass
if (this->plantLoc.loopSideNum == DataPlant::LoopSideLocation::Supply) {
auto &loop = state.dataPlnt->PlantLoop(this->plantLoc.loopNum);
auto &demandSide = loop.LoopSide(DataPlant::LoopSideLocation::Demand);
Real64 const excessFlow = ThisLoopSideFlow - demandSide.flowRequestFinal;
if (!demandSide.BypassExists && loop.CommonPipeType == DataPlant::CommonPipeType::No &&
excessFlow > DataBranchAirLoopPlant::MassFlowTolerance) {
if (!demandSide.Splitter.Exists || demandSide.Splitter.TotalOutletNodes == 1) {
// Series demand side: pass the forced flow as MinAvail so components see the flow they receive
auto &outletNode = state.dataLoopNodes->Node(this->NodeNumOut);
outletNode.MassFlowRateMinAvail = max(outletNode.MassFlowRateMinAvail, min(ThisLoopSideFlow, outletNode.MassFlowRateMaxAvail));
} else if (!state.dataGlobal->WarmupFlag) {
// Parallel demand side branches: forced flow is not passed to the components
if (demandSide.errIndex_ForcedDemandFlow == 0) {
ShowWarningError(state,
std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the demand side "
"components,",
DataPlant::loopTypeNames[static_cast<int>(loop.TypeOfLoop)],
loop.Name));
ShowContinueError(state,
"and the demand side has no bypass branch, so the excess flow is forced through the demand side branches.");
ShowContinueError(state,
"This typically happens when supply side equipment operates at a constant flow rate (e.g., Boiler:HotWater "
"with Boiler Flow Mode = ConstantFlow, or a pump with Pump Control Type = Continuous).");
ShowContinueError(state,
"The results of the demand side components may be inaccurate (e.g., the loop demand may not match the "
"energy delivered by the demand side components). Add a bypass branch on the demand side of the loop.");
ShowContinueErrorTimeStamp(state, "");
}
ShowRecurringWarningErrorAtEnd(state,
std::format("{}=\"{}\": the loop flow rate is greater than the flow rate requested by the "
"demand side components, continues...",
DataPlant::loopTypeNames[static_cast<int>(loop.TypeOfLoop)],
loop.Name),
demandSide.errIndex_ForcedDemandFlow,
excessFlow,
excessFlow,
_,
"[kg/s]",
"[kg/s]");
}
}
}
Comment on lines +1294 to +1336

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When the supply side drives the loop flow above the demand side's request, for example with a ConstantFlow boiler, and the demand side has no bypass:

  • Series demand side (no splitter, or a single-outlet splitter): the loop flow is passed to the demand side as MinAvail, the same mechanism used for a pump's minimum flow. Demand components are then simulated with the flow they actually receive.
  • Parallel demand branches: the excess flow can't be passed to the individual branches, so a warning is issued suggesting a demand-side bypass.

}

void HalfLoopData::ResolveParallelFlows(EnergyPlusData &state,
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/Plant/LoopSide.hh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ namespace DataPlant {
int errIndex_LoadWasntDist;
int errCount_LoadRemains;
int errIndex_LoadRemains;
int errIndex_ForcedDemandFlow = 0;
Real64 LoopSideInlet_TankTemp;
Real64 LoopSideInlet_MdotCpDeltaT;
Real64 LoopSideInlet_McpDTdt;
Expand Down
7 changes: 2 additions & 5 deletions src/EnergyPlus/Pumps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1610,11 +1610,8 @@ void SetupPumpMinMaxFlows(EnergyPlusData &state, int const LoopNum, int const Pu
PumpMassFlowRateMax = min(InletNodeMax, PumpOverridableMaxLimit * PumpSchedFraction);

// Check for conflicts (MaxAvail < MinAvail)
if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side wants to operate outside of the pump range
// shut the pump (and the loop) down
PumpMassFlowRateMin = 0.0;
PumpMassFlowRateMax = 0.0;
// Let the user know that his input file is overconstrained
if (PumpMassFlowRateMin > PumpMassFlowRateMax) { // the demand side cannot accept the pump's minimum flow
PumpMassFlowRateMin = PumpMassFlowRateMax;
Comment on lines -1613 to +1614

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

When the pump minimum flow exceeds the maximum flow the loop can accept, the minimum is now set to that maximum instead of setting both to zero. Previously, any overshoot shut down the pump and the loop for the whole simulation, silently. This includes overshoots caused only by density conversions of the same design volume flow: the pump uses Constant::InitConvTemp (5.05 °C), while AirLoopHVAC:UnitarySystem sets the coil's maximum water flow using Constant::HWInitConvTemp (60 °C). The pump still shuts off when no flow is available (maximum = 0).

}

switch (thisPump.pumpType) {
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/UnitarySystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12349,7 +12349,7 @@ namespace UnitarySystems {
} else {
mdot = this->HeatCoilWaterFlowRatio * this->MaxHeatCoilFluidFlow;
}
state.dataLoopNodes->Node(this->HeatCoilFluidInletNode).MassFlowRate = mdot;
PlantUtilities::SetComponentFlowRate(state, mdot, this->HeatCoilFluidInletNode, this->HeatCoilFluidOutletNodeNum, this->HeatCoilPlantLoc);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The water flow request is now set through SetComponentFlowRate instead of being written directly to the coil inlet node. The direct write ignored the plant's flow limits (MinAvail/MaxAvail), so the coil could be simulated with a flow it wasn't receiving.

WaterCoils::SimulateWaterCoilComponents(
state, CompName, FirstHVACIteration, this->m_HeatingCoilIndex, QActual, this->m_FanOpMode, PartLoadRatio);
} break;
Expand Down
8 changes: 7 additions & 1 deletion src/EnergyPlus/WaterCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2793,7 +2793,7 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state,
Real64 E1;
Real64 E2;
Real64 Effec;
Real64 Cp;
Real64 Cp = 0.0;

auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum);
UA = waterCoil.UACoilVariable;
Expand Down Expand Up @@ -2875,6 +2875,12 @@ void CalcSimpleHeatingCoil(EnergyPlusData &state,
HeatingCoilLoad *= PartLoadRatio;
}

// Water outlet state based on the actual water flow rate through the coil
if (HeatingCoilLoad != 0.0 && waterCoil.InletWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) {
TempWaterOut = TempWaterIn - HeatingCoilLoad / (Cp * waterCoil.InletWaterMassFlowRate);
waterCoil.OutletWaterEnthalpy = waterCoil.InletWaterEnthalpy - HeatingCoilLoad / waterCoil.InletWaterMassFlowRate;
}

Comment on lines +2878 to +2883

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The water outlet temperature and enthalpy are now computed from the PLR-scaled coil load and the actual node water flow. With a cycling fan, the outlet water temperature used to be the full-output value. That's only correct if the node flow is the PLR-averaged flow. When the plant pushes more water through the coil, the water side gave up full-capacity heat while the air received PLR × capacity. When the node flow is the PLR-averaged flow, results are the same as before.

// Set the outlet conditions
waterCoil.TotWaterHeatingCoilRate = HeatingCoilLoad;
waterCoil.OutletAirTemp = TempAirOut;
Expand Down
2 changes: 2 additions & 0 deletions tst/EnergyPlus/unit/UnitarySystem.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8457,6 +8457,8 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem)
thisSys.m_HeatingCoilName = state->dataWaterCoils->WaterCoil(1).Name;
thisSys.HeatCoilFluidInletNode = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum;
thisSys.HeatCoilFluidOutletNodeNum = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum;
thisSys.HeatCoilPlantLoc = state->dataWaterCoils->WaterCoil(1).WaterPlantLoc;
PlantUtilities::InitComponentNodes(*state, 0.0, HotWaterMassFlowRate, thisSys.HeatCoilFluidInletNode, thisSys.HeatCoilFluidOutletNodeNum);
state->dataGlobal->DoingSizing = true;
state->dataWaterCoils->WaterCoil(1).TotWaterHeatingCoilRate = 0.0;

Expand Down
Loading
Loading