-
Notifications
You must be signed in to change notification settings - Fork 421
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
AirloopHVAC:UnitaryHeatCool:VAVChangeoverBypass incorrectly indexes zone loads #7288
Conversation
Comparison of the defect file in develop and this branch is shown in #7283. |
} | ||
|
||
if (!CurDeadBandOrSetback(ZoneNum)) { | ||
if (!CurDeadBandOrSetback(actualZoneNum)) { |
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.
Fundamental change that corrects zone indexing in the defect file, this line is what was broken. ZoneNum is the loop index, should have used CBVAV(CBVAVNum).ControlledZoneNum(ZoneNum) here to point to the correct zone. This is why we should always test new features with TWO of them in the test file (e.g., 2 changeover bypass systems).
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.
Looks like a great, simple fix
.SequencedOutputRequiredToHeatingSP(CBVAV(CBVAVNum).ZoneSequenceHeatingNum(ZoneNum)); | ||
int actualZoneNum = CBVAV(CBVAVNum).ControlledZoneNum(ZoneNum); | ||
int coolSeqNum = CBVAV(CBVAVNum).ZoneSequenceCoolingNum(ZoneNum); | ||
int heatSeqNum = CBVAV(CBVAVNum).ZoneSequenceHeatingNum(ZoneNum); |
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.
Added these locals to simplify code (and use actualZoneNum on line 3529)
@Myoldmopar simple change here to correct indexing problem. |
@@ -68,6 +69,8 @@ TEST_F(EnergyPlusFixture, UnitaryBypassVAV_GetInputZoneEquipment) | |||
|
|||
std::string const idf_objects = delimited_string({ | |||
|
|||
"Zone,", | |||
" Zone 2; !- Name", |
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.
Add another zone so "Zone 1" is the second zone in the Zone() and CurDeadBandOrSetback() arrays.
" 0.023, !- No Load Supply Air Flow Rate {m3/s}", | ||
" 0.011, !- Cooling Outdoor Air Flow Rate {m3/s}", | ||
" 0.012, !- Heating Outdoor Air Flow Rate {m3/s}", | ||
" 0.013, !- No Load Outdoor Air Flow Rate {m3/s}", |
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.
Just differentiating these so lines 445-450 can test that input was gotten correctly.
Real64 QZoneReq = 0.0; | ||
HVACUnitaryBypassVAV::GetZoneLoads(CBVAVNum, QZoneReq); | ||
// should return cooling load for zone 2 | ||
EXPECT_EQ(-1000.0, QZoneReq); |
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.
Here's the defect test. Previous code would have found QZoneReq = 0 because CurDeadBandOrSetback(1) = true (and should have been looking at CurDeadBandOrSetback(2) = false). See line 3528/3529 above in HVACUnitaryBypassVAV.cc.
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 makes really good sense. A good unit test.
@rraustad it has been 12 days since this pull request was last updated. |
@rraustad it has been 7 days since this pull request was last updated. |
@rraustad it has been 8 days since this pull request was last updated. |
} | ||
|
||
if (!CurDeadBandOrSetback(ZoneNum)) { | ||
if (!CurDeadBandOrSetback(actualZoneNum)) { |
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.
Looks like a great, simple fix
Real64 QZoneReq = 0.0; | ||
HVACUnitaryBypassVAV::GetZoneLoads(CBVAVNum, QZoneReq); | ||
// should return cooling load for zone 2 | ||
EXPECT_EQ(-1000.0, QZoneReq); |
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 makes really good sense. A good unit test.
Pull request overview
The change fixes #7283. Zone loads are not accounted for correctly when the order of the Zone objects in the EnergyPlus input file includes one or more unconditioned zones within the list or there are multiple systems in the same input file.
Example that will cause a problem in identifying zone loads:
Zone 1 - Conditioned
Zone 2 - Conditioned
Zone 3 - Unconditioned
Zone 4 - Conditioned
Workaround: For simulations that use a single system order the zone objects with conditioned zones first in the input file in the order of the Zone objects. Conditioned zones are those with a ZoneHVAC:EquipmentList object to specify the cooling and heating sequence of the zone equipment. No workaround exists if there are multiple AirLoopHVAC:UnitaryHeatCool:VAVChangeoverBypass objects in the same file.
Work Checklist
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Review Checklist
This will not be exhaustively relevant to every PR.