Skip to content
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

HotFix #8581: make AirLoopHVAC:DedicatedOutdoorAirSystem's airloophvac_name extension case-insentive #8582

Merged
merged 2 commits into from
Mar 5, 2021
Merged
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
4 changes: 2 additions & 2 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -753,8 +753,8 @@ namespace AirLoopHVACDOAS {
if (AirLoopNames != fields.end()) {
auto AirLoopArray = AirLoopNames.value();
int num = 0;
for (auto AirLoopHAVCName : AirLoopArray) {
std::string name = AirLoopHAVCName.at("airloophvac_name");
for (auto AirLoopHVACName : AirLoopArray) {
std::string name = UtilityRoutines::MakeUPPERCase(AirLoopHVACName.at("airloophvac_name"));
Comment on lines +756 to +757
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix is here. (I also fixed an unrelated typo in variable name)

Copy link
Member

Choose a reason for hiding this comment

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

Makes perfect sense. And thanks for the typo fix.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Myoldmopar This doesn't make perfect sense. It shouldn't be necessary to MakeUPPERCase object names during input processing. We don't do that everywhere. Shouldn't FindItemInList be case-insensitive as a general solution to idfs that may have varied case for the same name? In the olden days, the input processor pushed all strings to UPPERcase so it didn't matter, but that's not been happening since the new IP with epJSON. Have we just been lucky that most files use the same case for all references to a name? My question here is prompted by a new helpdesk ticket with a similar issue for ZoneHVAC:HybridUnitaryHVAC, see #8614.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is extensive examples of getinput routines that do makeuppercase already, and it seems it really is needed. I agree that this logic should probably be baked in to avoid having to worry about it (we support case insensitiveness, then act like it). If a modification is done at a higher level (inputprocessor or the finditeminlist) then existing calls to makeupercase prior to calling routines need to be eliminated to avoid the overhead of doing it twice though

int LoopNum = UtilityRoutines::FindItemInList(name, state.dataAirSystemsData->PrimaryAirSystems);
num += 1;
if (LoopNum > 0 && num <= thisDOAS.NumOfAirLoops) {
Expand Down
2 changes: 1 addition & 1 deletion testfiles/SmallOffice_CentralDOAS.idf
Original file line number Diff line number Diff line change
Expand Up @@ -4640,7 +4640,7 @@
17.5, !- Precool Design Temperature {C}
0.012, !- Precool Design Humidity Ratio {kgWater/kgDryAir}
5, !- Number of AirLoopHVAC
PSZ-AC:1, !- AirLoopHVAC 1 Name
PSZ-Ac:1, !- AirLoopHVAC 1 Name
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Doing same in IDF file...

PSZ-AC:2, !- AirLoopHVAC 2 Name
PSZ-AC:3, !- AirLoopHVAC 3 Name
PSZ-AC:4, !- AirLoopHVAC 4 Name
Expand Down
4 changes: 2 additions & 2 deletions tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOASTest)
" 100; !- Maximum Value of y",

" AirLoopHVAC,",
" PSZ-AC:1, !- Name",
" PSZ-ac:1, !- Name",
" , !- Controller List Name",
" PSZ-AC:1 Availability Manager List, !- Availability Manager List Name",
" AUTOSIZE, !- Design Supply Air Flow Rate {m3/s}",
Expand Down Expand Up @@ -3815,7 +3815,7 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOASTest)
" 11.5, !- Precool Design Temperature {C}",
" 0.008, !- Precool Design Humidity Ratio {kgWater/kgDryAir}",
" 5, !- Number of AirLoopHVAC",
" PSZ-AC:1, !- AirLoopHVAC 1 Name",
" PSZ-ac:1, !- AirLoopHVAC 1 Name",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unit test throws without fix

Copy link
Member

Choose a reason for hiding this comment

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

Excellent reuse of an existing test!

" PSZ-AC:2, !- AirLoopHVAC 2 Name",
" PSZ-AC:3, !- AirLoopHVAC 3 Name",
" PSZ-AC:4, !- AirLoopHVAC 4 Name",
Expand Down