Skip to content

Commit

Permalink
Merge pull request #10855 from NREL/10817_CrashFluidCooler
Browse files Browse the repository at this point in the history
Fix #10817 - Avoid crash in FluidCooler/EvaporativeFluidCooler when Water flow rate autosized and no Sizing:Plant
  • Loading branch information
Myoldmopar authored Feb 6, 2025
2 parents 6fe081f + 080ff2e commit a402772
Show file tree
Hide file tree
Showing 8 changed files with 226 additions and 162 deletions.
61 changes: 31 additions & 30 deletions src/EnergyPlus/EvaporativeFluidCoolers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1341,14 +1341,10 @@ namespace EvaporativeFluidCoolers {
Real64 constexpr Acc(0.0001); // Accuracy of result
std::string const CalledFrom("SizeEvapFluidCooler");

int SolFla; // Flag of solver
Real64 UA; // Calculated UA value [W/C]
Real64 OutWaterTempAtUA0; // Water outlet temperature at UA0
Real64 OutWaterTempAtUA1; // Water outlet temperature at UA1
Real64 DesignEnteringAirWetBulb; // Intermediate variable to check that design exit
// temperature specified in the plant:sizing object
// is higher than the design entering air wet-bulb temp
// when autosize feature is used
int SolFla; // Flag of solver
Real64 UA; // Calculated UA value [W/C]
Real64 OutWaterTempAtUA0; // Water outlet temperature at UA0
Real64 OutWaterTempAtUA1; // Water outlet temperature at UA1

Real64 DesEvapFluidCoolerLoad = 0.0; // Design evaporative fluid cooler load [W]
Real64 tmpDesignWaterFlowRate = this->DesignWaterFlowRate;
Expand All @@ -1359,6 +1355,33 @@ namespace EvaporativeFluidCoolers {

if (this->DesignWaterFlowRateWasAutoSized && this->PerformanceInputMethod_Num != PIM::StandardDesignCapacity) {
if (PltSizCondNum > 0) {

// Check when the user specified Condenser/Evaporative Fluid Cooler water design setpoint
// temperature is less than design inlet air wet bulb temperature
Real64 DesignEnteringAirWetBulb = 0;
if (this->PerformanceInputMethod_Num == PIM::UFactor) {
DesignEnteringAirWetBulb = 25.6;
} else {
DesignEnteringAirWetBulb = this->DesignEnteringAirWetBulbTemp;
}
if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= DesignEnteringAirWetBulb) {
ShowSevereError(state, format("Error when autosizing the UA value for Evaporative Fluid Cooler = {}.", this->Name));
ShowContinueError(state,
format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air wet-bulb temperature "
"({:.2R} C) when autosizing the Evaporative Fluid Cooler UA.",
state.dataSize->PlantSizData(PltSizCondNum).ExitTemp,
DesignEnteringAirWetBulb));
ShowContinueError(
state,
"It is recommended that the Design Loop Exit Temperature = Design Entering Air Wet-bulb Temp plus the Evaporative "
"Fluid Cooler design approach temperature (e.g., 4 C).");
ShowContinueError(
state,
"If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be "
"> Design Entering Air Wet-bulb Temp if autosizing the Evaporative Fluid Cooler.");
ShowFatalError(state, "Review and revise design input values as appropriate.");
}

if (state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate >= HVAC::SmallWaterVolFlow) {
tmpDesignWaterFlowRate = state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate * this->SizFac;
if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate;
Expand All @@ -1383,28 +1406,6 @@ namespace EvaporativeFluidCoolers {
ShowFatalError(state, "Autosizing of evaporative fluid cooler condenser flow rate requires a loop Sizing:Plant object.");
}
}
// Check when the user specified Condenser/Evaporative Fluid Cooler water design setpoint
// temperature is less than design inlet air wet bulb temperature
if (this->PerformanceInputMethod_Num == PIM::UFactor) {
DesignEnteringAirWetBulb = 25.6;
} else {
DesignEnteringAirWetBulb = this->DesignEnteringAirWetBulbTemp;
}
if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= DesignEnteringAirWetBulb) {
ShowSevereError(state, format("Error when autosizing the UA value for Evaporative Fluid Cooler = {}.", this->Name));
ShowContinueError(state,
format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air wet-bulb temperature "
"({:.2R} C) when autosizing the Evaporative Fluid Cooler UA.",
state.dataSize->PlantSizData(PltSizCondNum).ExitTemp,
DesignEnteringAirWetBulb));
ShowContinueError(state,
"It is recommended that the Design Loop Exit Temperature = Design Entering Air Wet-bulb Temp plus the Evaporative "
"Fluid Cooler design approach temperature (e.g., 4 C).");
ShowContinueError(state,
"If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be "
"> Design Entering Air Wet-bulb Temp if autosizing the Evaporative Fluid Cooler.");
ShowFatalError(state, "Review and revise design input values as appropriate.");
}
}

if (this->PerformanceInputMethod_Num == PIM::UFactor && !this->HighSpeedEvapFluidCoolerUAWasAutoSized) {
Expand Down
Loading

3 comments on commit a402772

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.3: OK (2959 of 2959 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-UnitTestsCoverage-RelWithDebInfo: OK (2141 of 2141 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-24.04-gcc-13.3-IntegrationCoverage-RelWithDebInfo: OK (802 of 802 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.