-
Notifications
You must be signed in to change notification settings - Fork 396
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
#7711 - Fix crash when using both WaterHeat:HeatPump:PumpedCondenser and WaterHeater:HeatPump:WrappedCondenser #7717
Conversation
…re both HPWH:Pumped and HPWH:Wrapped in the same container, but when querying for Wrapped we need the index as (HPWaterHeaterNum - NumPumpedCondenser)
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 review comments for a walkthrough of code changes
} else { | ||
// Wrapped Condenser | ||
DataIPShortCuts::cCurrentModuleObject = cHPWHWrappedCondenser; | ||
HPWH.TypeNum = DataPlant::TypeOf_HeatPumpWtrHeaterWrapped; | ||
nNumPossibleAlphaArgs = 27; | ||
nNumPossibleNumericArgs = 10; | ||
// Actual index of Wrapped type | ||
HPWaterHeaterNumOfSpecificType = HPWaterHeaterNum - NumPumpedCondenser; |
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 the actual fix basically.
Container HPWaterHeater
stores both HPWH:Pumped and HPWH:Wrapped in that order. Before fix if you had 1 HPWH:Pumped and one HPWH:Wrapped it would call getObjectItem for the wrapped one passing an index of 2, which doesn't exist in InputProcessor since there's only one object of type HPWH:WrappedCondenser, so it would crash hard.
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.
@jmarrec thanks for the fix. Having just worked through the refactor on this file, I can attest that there are several things like this in here that need to get cleaned up.
} | ||
|
||
int NumAlphas; | ||
int NumNums; | ||
int IOStat; | ||
inputProcessor->getObjectItem(DataIPShortCuts::cCurrentModuleObject, | ||
HPWaterHeaterNum, | ||
HPWaterHeaterNumOfSpecificType, |
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.
Has to be an index specific to the type of object you want to get.
|
||
ASSERT_TRUE(process_idf(idf_objects)); | ||
|
||
EXPECT_TRUE(WaterThermalTanks::GetWaterThermalTankInput()); |
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.
Before fix it crashes here.
Crash on WaterThermalTanks.cc:11674 energyplus_tests: /home/julien/Software/Others/EnergyPlus/third_party/ObjexxFCL/src/ObjexxFCL/Array1.hh:1172: T& ObjexxFCL::Array1< <template-parameter-1-1> >::operator()(int) [with T = EnergyPlus::WaterThermalTanks::HeatPumpWaterHeaterData]: Assertion `contains( i )' failed.
I verified that the unit tests pass locally. Assuming CI comes back clean, this can merge. |
CI is happy. Merging. |
…an E+ bug (fixed, but not in 9.2.0, so reenable after new E+ release 9.2.0+) cf NREL/EnergyPlus#7717
Pull request overview
InputProcessor
due toWaterThermalTanks
when using bothWaterHeat:HeatPump:PumpedCondenser
andWaterHeater:HeatPump:WrappedCondenser
While in the process of fixing it:
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.