-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #10889 - Fix reporting of Cooling Towers in Equipment Summary - Cooling Towers and Fluid Coolers #10900
base: develop
Are you sure you want to change the base?
Conversation
``` [ RUN ] EnergyPlusFixture.CondenserLoopTowers_VSCoolingTower_OutputReport /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4925: Failure Expected equality of these values: expectedDesOutletWaterTemp Which is: 27.84 VSTower.DesOutletWaterTemp Which is: 0 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4926: Failure Expected equality of these values: expectedDesInletWaterTemp Which is: 33.98 VSTower.DesInletWaterTemp Which is: 0 /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4952: Failure Expected equality of these values: fmt::format("{:.2f}", expectedDesignInletWB) Which is: "23.28" OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCDesInletAirWBT, TowerName) Which is: "0.00" /home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4955: Failure Expected equality of these values: fmt::format("{:.2f}", expectedDesOutletWaterTemp) Which is: "27.84" OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCLevWaterSPTemp, TowerName) Which is: "0.00" ```
| Kept | Removed | |----------------|-------------------| | DesignInletWB | DesInletAirWBTemp | | DesignApproach | DesApproach | | DesignRange | DesRange |
…esInletWaterTemp All other CT types do it properly already
Real64 DesInletAirWBTemp = 0.0; // design tower outlet air wet-bulb temperature (C) | ||
Real64 DesApproach = 0.0; // design tower approach temperature (deltaC) | ||
Real64 DesRange = 0.0; // design tower range temperature (deltaC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicated Variables on CoolingTower struct. I kept only the ones defined first in the file.
Kept | Removed |
---|---|
DesignInletWB | DesInletAirWBTemp |
DesignApproach | DesApproach |
DesignRange | DesRange |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EnergyPlus/src/EnergyPlus/CondenserLoopTowers.hh
Lines 165 to 167 in 31e3c33
Real64 DesignInletWB = 0.0; // Design inlet air wet-bulb temperature (C) | |
Real64 DesignApproach = 0.0; // Design approach (outlet water temp minus inlet air wet-bulb temp (C) | |
Real64 DesignRange = 0.0; // Design range temperature (inlet water temp minus outlet water temp (C) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The report was zero for "Cooling Tower Design Inlet Wet-Bulb Temperature" because of the fact that two variables exited for the same quantity.
DesignInletWB was the one that stored the CT:VariableSpeed input:
EnergyPlus/src/EnergyPlus/CondenserLoopTowers.cc
Line 1302 in 31e3c33
tower.DesignInletWB = NumArray(1); |
But the other one was reported
EnergyPlus/src/EnergyPlus/CondenserLoopTowers.cc
Line 3379 in 31e3c33
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCTFCDesInletAirWBT, this->Name, this->DesInletAirWBTemp); |
// set tower design water outlet and inlet temperatures | ||
tower.DesOutletWaterTemp = tower.DesignInletWB + tower.DesignApproach; | ||
tower.DesInletWaterTemp = tower.DesOutletWaterTemp + tower.DesignRange; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two variables were properly calculated for all CT Types except CoolingTower:VariableSpeed.
This fixes the "Leaving Water Setpoint Temperature" displaying as zero
" CoolingTower:VariableSpeed,", | ||
" CoolingTower Variable Speed, !- Name", | ||
" Tower Inlet Node, !- Water Inlet Node Name", | ||
" Tower Outlet Node, !- Water Outlet Node Name", | ||
" CoolToolsCrossFlow, !- Model Type", | ||
" , !- Model Coefficient Name", | ||
" 23.28, !- Design Inlet Air Wet-Bulb Temperature {C}", | ||
" 4.56, !- Design Approach Temperature {deltaC}", | ||
" 6.14, !- Design Range Temperature {deltaC}", | ||
" 0.02, !- Design Water Flow Rate {m3/s}", | ||
" 10.0, !- Design Air Flow Rate {m3/s}", | ||
" 1000.0, !- Design Fan Power {W}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit test input
VSTower.SizeTower(*state); // This calls PreDefTableEntry when state.dataPlnt->PlantFinalSizesOkayToReport == true | ||
|
||
auto &orp = *state->dataOutRptPredefined; | ||
std::string const TowerName = VSTower.Name; | ||
EXPECT_EQ("CoolingTower:VariableSpeed", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCType, TowerName)); | ||
EXPECT_EQ("WATER", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCFluidType, TowerName)); | ||
EXPECT_EQ(fmt::format("{:.2f}", expectedDesingRange), OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCRange, TowerName)); | ||
EXPECT_EQ(fmt::format("{:.2f}", expectedDesingApproach), | ||
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCApproach, TowerName)); | ||
EXPECT_EQ("1000.00", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCDesFanPwr, TowerName)); | ||
EXPECT_EQ(fmt::format("{:.2f}", expectedDesignInletWB), | ||
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCDesInletAirWBT, TowerName)); | ||
EXPECT_EQ("0.02", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCDesWaterFlowRate, TowerName)); | ||
EXPECT_EQ(fmt::format("{:.2f}", expectedDesOutletWaterTemp), | ||
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCLevWaterSPTemp, TowerName)); | ||
EXPECT_EQ("COOLINGTOWER LOOP", OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCCondLoopName, TowerName)); | ||
EXPECT_EQ("COOLINGTOWER SUPPLY EQUIPMENT BRANCH 1", | ||
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCCondLoopBranchName, TowerName)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that the report is ok.
Before fix:
[ RUN ] EnergyPlusFixture.CondenserLoopTowers_VSCoolingTower_OutputReport
/home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4925: Failure
Expected equality of these values:
expectedDesOutletWaterTemp
Which is: 27.84
VSTower.DesOutletWaterTemp
Which is: 0
/home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4926: Failure
Expected equality of these values:
expectedDesInletWaterTemp
Which is: 33.98
VSTower.DesInletWaterTemp
Which is: 0
/home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4952: Failure
Expected equality of these values:
fmt::format("{:.2f}", expectedDesignInletWB)
Which is: "23.28"
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCDesInletAirWBT, TowerName)
Which is: "0.00"
/home/julien/Software/Others/EnergyPlus2/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc:4955: Failure
Expected equality of these values:
fmt::format("{:.2f}", expectedDesOutletWaterTemp)
Which is: "27.84"
OutputReportPredefined::RetrievePreDefTableEntry(*state, orp.pdchCTFCLevWaterSPTemp, TowerName)
Which is: "0.00"
Using https://github.com/NREL/EnergyPlusDevSupport/blob/master/DefectFiles/10000s/10889/in.idf Before: After (I didn't increase the water flow rate precision from 2 to 6 digits (yet?)): |
|
tower.DesApproach = NumArray(15); | ||
if (tower.DesApproach == DataSizing::AutoSize || tower.DesApproach == 0) { | ||
tower.DesApproach = 3.9; | ||
tower.DesignApproach = NumArray(15); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is CoolingTower:SingleSpeed, Range and Approach where stored in the wrong variable as well
EnergyPlus/src/EnergyPlus/CondenserLoopTowers.cc
Lines 3375 to 3376 in 31e3c33
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCTFCRange, this->Name, this->DesignRange); | |
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCTFCApproach, this->Name, this->DesignApproach); |
Take 5ZoneBoilerOutsideAirReset.idf, which has a CT with defaulted Range and Approach.
Develop:
This PR:
tower.DesApproach = NumArray(23); | ||
if (tower.DesApproach == DataSizing::AutoSize || tower.DesApproach == 0) { | ||
tower.DesApproach = 3.9; | ||
tower.DesignApproach = NumArray(23); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is CoolingTower:TwoSpeed, same thing, Approach and Range are incorrectly reported before fix
tower.DesignApproach = NumArray(19); | ||
if (tower.DesignApproach == DataSizing::AutoSize || tower.DesignApproach == 0) { | ||
tower.DesignApproach = 3.9; | ||
tower.TowerInletCondsAutoSize = true; | ||
} | ||
tower.DesRange = NumArray(20); | ||
if (tower.DesRange == DataSizing::AutoSize || tower.DesRange == 0) { | ||
tower.DesRange = 5.5; | ||
tower.DesignRange = NumArray(20); | ||
if (tower.DesignRange == DataSizing::AutoSize || tower.DesignRange == 0) { | ||
tower.DesignRange = 5.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is VariableSpeedMerkel, also Range and Approach not reported correctly
|
The output changes are expected for files with a CoolingTower in it. First, sampling one file with each CT type, using the query
And comparing develop (ori) to this PR (new): CoolingTower:SingleSpeed - 5ZoneBoilerOutsideAirReset
CoolingTower:TwoSpeed - CoolingTower_TwoSpeed
CoolingTower:VariableSpeed - 2ZoneDataCenterHVAC_wEconomizer
CoolingTower:VariableSpeed:Merkel - CoolingTower_MerkelVariableSpeed
HVACTemplate:Plant:Tower - HAMT_DailyProfileReport
|
Sampling 10 random reported diff files HVACTemplate:Plant:Tower - CoolingTower_FluidBypass
HVACTemplate:Plant:Tower - PythonPluginLrgOff_GridStorageSmoothing
HVACTemplate:Plant:Tower - 5ZoneCoolBeam
HVACTemplate:Plant:Tower - LgOffVAV
HVACTemplate:Plant:Tower - 5ZoneWarmestMultDDSizVAV
HVACTemplate:Plant:Tower - TermReheatZoneExh
HVACTemplate:Plant:Tower - ASHRAE901_OfficeLarge_STD2019_Denver_Chiller205
HVACTemplate:Plant:Tower - 5ZoneFPIU
HVACTemplate:Plant:Tower - DualDuctConstVolDamper
HVACTemplate:Plant:Tower - Fault_ChillerSWTSensorOffset_RefBldgLargeOfficeNew2004
|
294b282
to
c2fee76
Compare
|
Pull request overview
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.