diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index d3627083a06..99ec418d85f 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1338,14 +1338,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; @@ -1356,6 +1352,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; @@ -1380,28 +1403,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) { diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 0d2e0fcf4f1..3e4656c8d71 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -954,8 +954,31 @@ void FluidCoolerspecs::size(EnergyPlusData &state) // Find the appropriate Plant Sizing object int PltSizCondNum = state.dataPlnt->PlantLoop(this->plantLoc.loopNum).PlantSizNum; + // This is to trap when the user specified Condenser/Fluid Cooler water design setpoint temperature is less than design inlet air dry bulb + // temperature + auto ensureSizingPlantExitTempIsNotLessThanDesignEnteringAirTemp = [this, &state, PltSizCondNum]() { + if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && state.dataPlnt->PlantFirstSizesOkayToFinalize) { + ShowSevereError(state, format("Error when autosizing the UA value for fluid cooler = {}.", this->Name)); + ShowContinueError(state, + format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb temperature " + "({:.2R} C) when autosizing the fluid cooler UA.", + state.dataSize->PlantSizData(PltSizCondNum).ExitTemp, + this->DesignEnteringAirTemp)); + ShowContinueError(state, + "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the 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 inlet air dry-bulb temp if autosizing the Fluid Cooler."); + ShowFatalError(state, "Review and revise design input values as appropriate."); + } + }; + if (this->DesignWaterFlowRateWasAutoSized) { if (PltSizCondNum > 0) { + + ensureSizingPlantExitTempIsNotLessThanDesignEnteringAirTemp(); + if (state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate >= HVAC::SmallWaterVolFlow) { tmpDesignWaterFlowRate = state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate; if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; @@ -986,23 +1009,6 @@ void FluidCoolerspecs::size(EnergyPlusData &state) ShowFatalError(state, "Autosizing of fluid cooler condenser flow rate requires a loop Sizing:Plant object."); } } - // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint - // temperature is less than design inlet air dry bulb temperature - if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && state.dataPlnt->PlantFirstSizesOkayToFinalize) { - ShowSevereError(state, format("Error when autosizing the UA value for fluid cooler = {}.", this->Name)); - ShowContinueError(state, - format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb temperature " - "({:.2R} C) when autosizing the fluid cooler UA.", - state.dataSize->PlantSizData(PltSizCondNum).ExitTemp, - this->DesignEnteringAirTemp)); - ShowContinueError(state, - "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the 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 inlet air dry-bulb temp if autosizing the Fluid Cooler."); - ShowFatalError(state, "Review and revise design input values as appropriate."); - } } PlantUtilities::RegisterPlantCompDesignFlow(state, this->WaterInletNodeNum, tmpDesignWaterFlowRate); @@ -1037,24 +1043,9 @@ void FluidCoolerspecs::size(EnergyPlusData &state) if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else if (PltSizCondNum > 0) { if (state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate >= HVAC::SmallWaterVolFlow) { - // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint - // temperature is less than design inlet air dry bulb temperature - if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && - state.dataPlnt->PlantFirstSizesOkayToFinalize) { - ShowSevereError(state, format("Error when autosizing the UA value for fluid cooler = {}.", this->Name)); - ShowContinueError(state, - format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " - "temperature ({:.2R} C) when autosizing the fluid cooler UA.", - state.dataSize->PlantSizData(PltSizCondNum).ExitTemp, - this->DesignEnteringAirTemp)); - ShowContinueError(state, - "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the " - "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 inlet air dry-bulb temp if autosizing the Fluid Cooler."); - ShowFatalError(state, "Review and revise design input values as appropriate."); - } + + ensureSizingPlantExitTempIsNotLessThanDesignEnteringAirTemp(); + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->plantLoc.loopNum).FluidName, Constant::InitConvTemp, @@ -1126,24 +1117,9 @@ void FluidCoolerspecs::size(EnergyPlusData &state) if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; } else if (PltSizCondNum > 0) { if (state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate >= HVAC::SmallWaterVolFlow) { - // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint - // temperature is less than design inlet air dry bulb temperature - if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && - state.dataPlnt->PlantFirstSizesOkayToFinalize) { - ShowSevereError(state, format("Error when autosizing the UA value for fluid cooler = {}.", this->Name)); - ShowContinueError(state, - format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " - "temperature ({:.2R} C) when autosizing the fluid cooler UA.", - state.dataSize->PlantSizData(PltSizCondNum).ExitTemp, - this->DesignEnteringAirTemp)); - ShowContinueError(state, - "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the " - "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 inlet air dry-bulb temp if autosizing the Fluid Cooler."); - ShowFatalError(state, "Review and revise design input values as appropriate."); - } + + ensureSizingPlantExitTempIsNotLessThanDesignEnteringAirTemp(); + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->plantLoc.loopNum).FluidName, Constant::InitConvTemp, @@ -1208,24 +1184,9 @@ void FluidCoolerspecs::size(EnergyPlusData &state) if (this->HighSpeedFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (PltSizCondNum > 0) { if (state.dataSize->PlantSizData(PltSizCondNum).DesVolFlowRate >= HVAC::SmallWaterVolFlow) { - // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint - // temperature is less than design inlet air dry bulb temperature - if (state.dataSize->PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && - state.dataPlnt->PlantFirstSizesOkayToFinalize) { - ShowSevereError(state, format("Error when autosizing the UA value for fluid cooler = {}.", this->Name)); - ShowContinueError(state, - format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " - "temperature ({:.2R} C) when autosizing the fluid cooler UA.", - state.dataSize->PlantSizData(PltSizCondNum).ExitTemp, - this->DesignEnteringAirTemp)); - ShowContinueError(state, - "It is recommended that the Design Loop Exit Temperature = design inlet air dry-bulb temp plus the 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 inlet air dry-bulb temp if autosizing the Fluid Cooler."); - ShowFatalError(state, "Review and revise design input values as appropriate."); - } + + ensureSizingPlantExitTempIsNotLessThanDesignEnteringAirTemp(); + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->plantLoc.loopNum).FluidName, Constant::InitConvTemp, @@ -1611,6 +1572,24 @@ void FluidCoolerspecs::size(EnergyPlusData &state) ErrorsFound = false; if (state.dataPlnt->PlantFinalSizesOkayToReport) { + + if (this->DesignLeavingWaterTemp <= HVAC::SmallTempDiff) { + this->WaterTemp = this->DesignEnteringWaterTemp; // design inlet water temperature + this->AirTemp = this->DesignEnteringAirTemp; // design inlet air dry-bulb temp + this->AirWetBulb = this->DesignEnteringAirWetBulbTemp; // design inlet air wet-bulb temp + this->AirPress = state.dataEnvrn->StdBaroPress; + this->AirHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, this->AirTemp, this->AirWetBulb, this->AirPress); + Real64 OutletTemp = 0; + rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(this->plantLoc.loopNum).FluidName, + Constant::InitConvTemp, + state.dataPlnt->PlantLoop(this->plantLoc.loopNum).FluidIndex, + CalledFrom); + CalcFluidCoolerOutlet( + state, this->indexInArray, rho * this->DesignWaterFlowRate, this->HighSpeedAirFlowRate, this->HighSpeedFluidCoolerUA, OutletTemp); + this->DesignLeavingWaterTemp = OutletTemp; + } + // create predefined report OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchMechType, this->Name, DataPlant::PlantEquipTypeNames[static_cast(this->FluidCoolerType)]); @@ -1642,7 +1621,8 @@ void FluidCoolerspecs::size(EnergyPlusData &state) state, state.dataOutRptPredefined->pdchCTFCDesFanPwr, this->Name, this->HighSpeedFanPower); // equivalent to Design Fan Power? OutputReportPredefined::PreDefTableEntry( state, state.dataOutRptPredefined->pdchCTFCDesInletAirWBT, this->Name, this->DesignEnteringAirWetBulbTemp); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCTFCDesWaterFlowRate, this->Name, this->DesignWaterFlowRate); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCTFCDesWaterFlowRate, this->Name, this->DesignWaterFlowRate, 6); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCTFCLevWaterSPTemp, this->Name, this->DesignLeavingWaterTemp); } diff --git a/testfiles/EvaporativeFluidCooler.idf b/testfiles/EvaporativeFluidCooler.idf index 3cf01f2b174..8e1ff465a3c 100644 --- a/testfiles/EvaporativeFluidCooler.idf +++ b/testfiles/EvaporativeFluidCooler.idf @@ -1678,10 +1678,10 @@ EvaporativeFluidCooler:SingleSpeed, !- Equipment 1 Object Type Big EvaporativeFluidCooler; !- Equipment 1 Name - EvaporativeFluidcooler:SingleSpeed, + EvaporativeFluidCooler:SingleSpeed, Big EvaporativeFluidCooler, !- Name - Condenser EvaporativeFluidcooler Inlet Node, !- Water Inlet Node Name - Condenser EvaporativeFluidcooler Outlet Node, !- Water Outlet Node Name + Condenser EvaporativeFluidCooler Inlet Node, !- Water Inlet Node Name + Condenser EvaporativeFluidCooler Outlet Node, !- Water Outlet Node Name 3.02, !- Design Air Flow Rate {m3/s} 2250, !- Design Air Flow Rate Fan Power {W} 0.002208, !- Design Spray Water Flow Rate {m3/s} diff --git a/testfiles/EvaporativeFluidCooler_TwoSpeed.idf b/testfiles/EvaporativeFluidCooler_TwoSpeed.idf index 51828a63c59..21f6a1dea52 100644 --- a/testfiles/EvaporativeFluidCooler_TwoSpeed.idf +++ b/testfiles/EvaporativeFluidCooler_TwoSpeed.idf @@ -1686,8 +1686,8 @@ EvaporativeFluidCooler:TwoSpeed, Big EvaporativeFluidCooler, !- Name - Condenser EvaporativeFluidcooler Inlet Node, !- Water Inlet Node Name - Condenser EvaporativeFluidcooler Outlet Node, !- Water Outlet Node Name + Condenser EvaporativeFluidCooler Inlet Node, !- Water Inlet Node Name + Condenser EvaporativeFluidCooler Outlet Node, !- Water Outlet Node Name Autosize, !- High Fan Speed Air Flow Rate {m3/s} Autosize, !- High Fan Speed Fan Power {W} autocalculate, !- Low Fan Speed Air Flow Rate {m3/s} diff --git a/testfiles/FluidCooler.idf b/testfiles/FluidCooler.idf index f0df70546be..3888bed4093 100644 --- a/testfiles/FluidCooler.idf +++ b/testfiles/FluidCooler.idf @@ -1535,7 +1535,7 @@ Branch, Condenser Supply FLUIDCOOLER Branch, !- Name , !- Pressure Drop Curve Name - Fluidcooler:SingleSpeed, !- Component 1 Object Type + FluidCooler:SingleSpeed, !- Component 1 Object Type Big FLUIDCOOLER, !- Component 1 Name Condenser FLUIDCOOLER Inlet Node, !- Component 1 Inlet Node Name Condenser FLUIDCOOLER Outlet Node; !- Component 1 Outlet Node Name @@ -1676,10 +1676,10 @@ CondenserEquipmentList, All FLUIDCOOLERs, !- Name - Fluidcooler:SingleSpeed, !- Equipment 1 Object Type + FluidCooler:SingleSpeed, !- Equipment 1 Object Type Big FLUIDCOOLER; !- Equipment 1 Name - Fluidcooler:SingleSpeed, + FluidCooler:SingleSpeed, Big FLUIDCOOLER, !- Name Condenser FLUIDCOOLER Inlet Node, !- Water Inlet Node Name Condenser FLUIDCOOLER Outlet Node, !- Water Outlet Node Name diff --git a/testfiles/FluidCoolerTwoSpeed.idf b/testfiles/FluidCoolerTwoSpeed.idf index 4744e939a38..5a55fbed406 100644 --- a/testfiles/FluidCoolerTwoSpeed.idf +++ b/testfiles/FluidCoolerTwoSpeed.idf @@ -1690,7 +1690,7 @@ CondenserEquipmentList, All FluidCoolers, !- Name - Fluidcooler:TwoSpeed, !- Equipment 1 Object Type + FluidCooler:TwoSpeed, !- Equipment 1 Object Type Big FluidCooler; !- Equipment 1 Name FluidCooler:TwoSpeed, diff --git a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc index 1238b47808c..75db5d8e630 100644 --- a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc @@ -93,7 +93,7 @@ TEST_F(EnergyPlusFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) thisEFC.WaterOutletNodeNum = 2; thisEFC.OutdoorAirInletNodeNum = 0; thisEFC.plantLoc.loopNum = 1; - thisEFC.plantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; + thisEFC.plantLoc.loopSideNum = DataPlant::LoopSideLocation::Supply; thisEFC.plantLoc.branchNum = 1; thisEFC.plantLoc.compNum = 1; PlantLocation pl; @@ -110,12 +110,12 @@ TEST_F(EnergyPlusFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) state->dataLoopNodes->Node(1).MassFlowRateMax = 0.05; state->dataLoopNodes->Node(1).MassFlowRateMaxAvail = 0.05; state->dataPlnt->PlantLoop.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).FlowLock = DataPlant::FlowLock::Locked; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).MyLoad = 1.0; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).ON = false; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).CurOpSchemeType = DataPlant::OpScheme::Invalid; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).FlowLock = DataPlant::FlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).MyLoad = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).ON = false; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).CurOpSchemeType = DataPlant::OpScheme::Invalid; thisEFC.DesignWaterFlowRateWasAutoSized = false; thisEFC.LowSpeedAirFlowRateWasAutoSized = false; thisEFC.HighSpeedEvapFluidCoolerUAWasAutoSized = false; @@ -140,7 +140,7 @@ TEST_F(EnergyPlusFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) ExpectedMinLoad = 0.0; // Call the routine to be tested and see if the fix is correct - PlantLocation loc = PlantLocation(1, DataPlant::LoopSideLocation::Demand, 1, 1); + PlantLocation loc = PlantLocation(1, DataPlant::LoopSideLocation::Supply, 1, 1); thisEFC.onInitLoopEquip(*state, loc); thisEFC.getDesignCapacities(*state, pl, MaxLoad, MinLoad, OptLoad); EXPECT_NEAR(MaxLoad, ExpectedMaxLoad, 0.01); @@ -173,10 +173,10 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedEvapFluidCooler) EvapFluidCoolerSpecs *ptr = EvapFluidCoolerSpecs::factory(*state, DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd, "BIG EVAPORATIVEFLUIDCOOLER"); - PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Demand, 1, 1}; + PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Supply, 1, 1}; state->dataPlnt->PlantLoop.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); Real64 max, opt, min = 0.0; ptr->getDesignCapacities(*state, pl, max, min, opt); @@ -185,17 +185,17 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedEvapFluidCooler) EXPECT_NEAR(opt, 1000.0, 1.0); state->dataPlnt->TotNumLoops = 1; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TotalBranches = 1; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TempSetPoint = 2.0; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).MyLoad = 1000; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).ON = true; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = ptr->WaterInletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = ptr->WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TempSetPoint = 2.0; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).MyLoad = 1000; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).ON = true; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).NodeNumIn = ptr->WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).NodeNumOut = ptr->WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = ptr->Name; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).Name = ptr->Name; state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 3; state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 3; state->dataSize->CurLoopNum = 1; @@ -209,7 +209,7 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedEvapFluidCooler) bool firstHVAC = true; Real64 curLoad = 0.0; ptr->plantLoc.loopNum = 1; - ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Demand; + ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Supply; ptr->plantLoc.branchNum = 1; ptr->plantLoc.compNum = 1; ptr->DesWaterMassFlowRate = 3.141; @@ -257,10 +257,10 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedEvapFluidCooler) EvapFluidCoolerSpecs *ptr = EvapFluidCoolerSpecs::factory(*state, DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd, "CENTRAL TOWER"); - PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Demand, 1, 1}; + PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Supply, 1, 1}; state->dataPlnt->PlantLoop.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); Real64 max, opt, min = 0.0; ptr->getDesignCapacities(*state, pl, max, min, opt); @@ -269,17 +269,17 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedEvapFluidCooler) EXPECT_NEAR(opt, 1000.0, 1.0); state->dataPlnt->TotNumLoops = 1; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TotalBranches = 1; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).TotalComponents = 1; state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TempSetPoint = 2.0; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).MyLoad = 1000; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).ON = true; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = ptr->WaterInletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = ptr->WaterOutletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TempSetPoint = 2.0; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).MyLoad = 1000; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).ON = true; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).NodeNumIn = ptr->WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).NodeNumOut = ptr->WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::EvapFluidCooler_TwoSpd; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = ptr->Name; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).Name = ptr->Name; state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 3; state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 3; state->dataSize->CurLoopNum = 1; @@ -297,7 +297,7 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedEvapFluidCooler) bool firstHVAC = true; Real64 curLoad = 0.0; ptr->plantLoc.loopNum = 1; - ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Demand; + ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Supply; ptr->plantLoc.branchNum = 1; ptr->plantLoc.compNum = 1; ptr->DesWaterMassFlowRate = 3.141; @@ -306,4 +306,47 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedEvapFluidCooler) ptr->simulate(*state, pl, firstHVAC, curLoad, true); } +TEST_F(EnergyPlusFixture, EvapFluidCooler_SizeWhenPlantSizingIndexIsZeroAndAutosized) +{ + // Test for #10817 + std::string const idf_objects = delimited_string({ + "EvaporativeFluidcooler:SingleSpeed,", + " Big EvaporativeFluidCooler, !- Name", + " Condenser EvaporativeFluidcooler Inlet Node, !- Water Inlet Node Name", + " Condenser EvaporativeFluidcooler Outlet Node, !- Water Outlet Node Name", + " Autosize, !- Design Air Flow Rate {m3/s}", + " Autosize, !- Design Air Flow Rate Fan Power {W}", + " 0.002208, !- Design Spray Water Flow Rate {m3/s}", + " UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method", + " , !- Outdoor Air Inlet Node Name", + " , !- Heat Rejection Capacity and Nominal Capacity Sizing Ratio", + " , !- Standard Design Capacity {W}", + " Autosize, !- Design Air Flow Rate U-factor Times Area Value {W/K}", + " Autosize, !- Design Water Flow Rate {m3/s}", + " , !- User Specified Design Capacity {W}", + " 46.11, !- Design Entering Water Temperature {C}", + " 35, !- Design Entering Air Temperature {C}", + " 25.6; !- Design Entering Air Wet-bulb Temperature {C}", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + EvapFluidCoolerSpecs *ptr = + EvapFluidCoolerSpecs::factory(*state, DataPlant::PlantEquipmentType::EvapFluidCooler_SingleSpd, "BIG EVAPORATIVEFLUIDCOOLER"); + + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).PlantSizNum = 0; + ptr->plantLoc.loopNum = 1; + + // Necessary to trigger the crash from # + state->dataPlnt->PlantFirstSizesOkayToFinalize = false; + + EXPECT_TRUE(ptr->DesignWaterFlowRateWasAutoSized); + EXPECT_TRUE(ptr->HighSpeedAirFlowRateWasAutoSized); + EXPECT_TRUE(ptr->HighSpeedFanPowerWasAutoSized); + EXPECT_TRUE(ptr->HighSpeedEvapFluidCoolerUAWasAutoSized); + + ptr->SizeEvapFluidCooler(*state); +} + } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/FluidCoolers.unit.cc b/tst/EnergyPlus/unit/FluidCoolers.unit.cc index 63fcf45c3e8..5c67d39a7d9 100644 --- a/tst/EnergyPlus/unit/FluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/FluidCoolers.unit.cc @@ -329,7 +329,7 @@ TEST_F(EnergyPlusFixture, SingleSpeedFluidCoolerInput_Test5) EXPECT_EQ(thisFluidCooler.HighSpeedFluidCoolerUA, 0.0); } -TEST_F(EnergyPlusFixture, SizeFunctionTestWhenPlantSizingIndexIsZero) +TEST_F(EnergyPlusFixture, FluidCooler_SizeWhenPlantSizingIndexIsZero) { int FluidCoolerNum(1); @@ -356,10 +356,10 @@ TEST_F(EnergyPlusFixture, SizeFunctionTestWhenPlantSizingIndexIsZero) auto &thisFluidCooler = state->dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum); state->dataPlnt->PlantLoop.allocate(FluidCoolerNum); - state->dataFluidCoolers->SimpleFluidCooler.allocate(FluidCoolerNum); state->dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum).plantLoc.loopNum = 1; state->dataPlnt->PlantLoop(FluidCoolerNum).PlantSizNum = 0; + EXPECT_EQ("DRY COOLER", thisFluidCooler.Name); EXPECT_FALSE(thisFluidCooler.HighSpeedFanPowerWasAutoSized); EXPECT_FALSE(thisFluidCooler.HighSpeedAirFlowRateWasAutoSized); EXPECT_FALSE(thisFluidCooler.HighSpeedFluidCoolerUAWasAutoSized); @@ -389,10 +389,10 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedFluidCooler) FluidCoolerspecs *ptr = FluidCoolerspecs::factory(*state, DataPlant::PlantEquipmentType::FluidCooler_SingleSpd, "DRY COOLER"); - PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Demand, 1, 1}; + PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Supply, 1, 1}; state->dataPlnt->PlantLoop.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); Real64 max, opt, min = 0.0; ptr->getDesignCapacities(*state, pl, max, min, opt); @@ -401,9 +401,9 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedFluidCooler) EXPECT_NEAR(opt, 58601.0, 1.0); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TempSetPoint = 2.0; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).MyLoad = 1000; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).ON = true; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TempSetPoint = 2.0; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).MyLoad = 1000; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).ON = true; state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 3; state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 3; @@ -422,7 +422,7 @@ TEST_F(EnergyPlusFixture, ExerciseSingleSpeedFluidCooler) bool firstHVAC = true; Real64 curLoad = 0.0; ptr->plantLoc.loopNum = 1; - ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Demand; + ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Supply; ptr->plantLoc.branchNum = 1; ptr->plantLoc.compNum = 1; ptr->DesWaterMassFlowRate = 3.141; @@ -460,10 +460,10 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedFluidCooler) FluidCoolerspecs *ptr = FluidCoolerspecs::factory(*state, DataPlant::PlantEquipmentType::FluidCooler_TwoSpd, "BIG FLUIDCOOLER"); - PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Demand, 1, 1}; + PlantLocation pl{1, EnergyPlus::DataPlant::LoopSideLocation::Supply, 1, 1}; state->dataPlnt->PlantLoop.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); Real64 max, opt, min = 0.0; ptr->getDesignCapacities(*state, pl, max, min, opt); @@ -472,9 +472,9 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedFluidCooler) EXPECT_NEAR(opt, 58601.0, 1.0); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::LoopDemandCalcScheme::SingleSetPoint; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).TempSetPoint = 2.0; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).MyLoad = 1000; - state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).ON = true; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).TempSetPoint = 2.0; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).MyLoad = 1000; + state->dataPlnt->PlantLoop(1).LoopSide(EnergyPlus::DataPlant::LoopSideLocation::Supply).Branch(1).Comp(1).ON = true; state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 3; state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 3; @@ -493,7 +493,7 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedFluidCooler) bool firstHVAC = true; Real64 curLoad = 0.0; ptr->plantLoc.loopNum = 1; - ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Demand; + ptr->plantLoc.loopSideNum = EnergyPlus::DataPlant::LoopSideLocation::Supply; ptr->plantLoc.branchNum = 1; ptr->plantLoc.compNum = 1; ptr->DesWaterMassFlowRate = 3.141; @@ -508,3 +508,44 @@ TEST_F(EnergyPlusFixture, ExerciseTwoSpeedFluidCooler) state->dataPlnt->PlantLoop(pl.loopNum).LoopSide(pl.loopSideNum).FlowLock = DataPlant::FlowLock::Locked; ptr->simulate(*state, pl, firstHVAC, curLoad, true); } + +TEST_F(EnergyPlusFixture, FluidCooler_SizeWhenPlantSizingIndexIsZeroAndAutosized) +{ + // Test for #10817 + std::string const idf_objects = delimited_string({ + " FluidCooler:SingleSpeed,", + " Dry Cooler, !- Name", + " Dry Cooler Inlet Node, !- Water Inlet Node Name", + " Dry Cooler Outlet Node, !- Water Outlet Node Name", + " NominalCapacity, !- Performance Input Method", + " Autosize, !- Design Air Flow Rate U-factor Times Area Value {W/K}", + " 58601, !- Nominal Capacity {W}", + " 50, !- Design Entering Water Temperature {C}", + " 35, !- Design Entering Air Temperature {C}", + " 25, !- Design Entering Air Wetbulb Temperature {C}", + " Autosize, !- Design Water Flow Rate {m3/s}", + " Autosize, !- Design Air Flow Rate {m3/s}", + " Autosize; !- Design Air Flow Rate Fan Power {W}", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + GetFluidCoolerInput(*state); + int FluidCoolerNum(1); + + state->dataPlnt->PlantLoop.allocate(FluidCoolerNum); + state->dataPlnt->PlantLoop(FluidCoolerNum).PlantSizNum = 0; + + auto &thisFluidCooler = state->dataFluidCoolers->SimpleFluidCooler(FluidCoolerNum); + thisFluidCooler.plantLoc.loopNum = 1; + + // Necessary to trigger the crash from # + state->dataPlnt->PlantFirstSizesOkayToFinalize = false; + + EXPECT_TRUE(thisFluidCooler.DesignWaterFlowRateWasAutoSized); + EXPECT_TRUE(thisFluidCooler.HighSpeedFanPowerWasAutoSized); + EXPECT_TRUE(thisFluidCooler.HighSpeedAirFlowRateWasAutoSized); + EXPECT_TRUE(thisFluidCooler.HighSpeedFluidCoolerUAWasAutoSized); + + thisFluidCooler.size(*state); +}