-
Notifications
You must be signed in to change notification settings - Fork 466
Description
Issue overview
Summary
There is a hard crash occurring in a defect file when CurveValue is evaluated in the WAHP code. I tracked down the issue, but I'm not able to provide the defect file just yet in case it contains anything proprietary. It's pretty easy to see what's going on though.
Detective Work
In the WaterToAirHeatPumpSimple.cc file, inside GetSimpleWatertoAirHPInput(), the curves are retrieved from the curve manager. If the curve lookup is invalid, it sets ErrorsFound to true. This occurs in both develop and the curve API branch:
develop: https://github.com/NREL/EnergyPlus/blob/68a4a7c7744c380886913a92e061aba3d4a3fc54/src/EnergyPlus/WaterToAirHeatPumpSimple.cc#L317CurveAPI: https://github.com/NREL/EnergyPlus/blob/81b1cbde1b34e99b631f5b7f8d7402c9a7c4ec7c/src/EnergyPlus/WaterToAirHeatPumpSimple.cc#L316
This is all good, except that just a little while later in the same get input routine, there is a call to CheckSimpleWAHPRatedCurvesOutput:
develop: https://github.com/NREL/EnergyPlus/blob/68a4a7c7744c380886913a92e061aba3d4a3fc54/src/EnergyPlus/WaterToAirHeatPumpSimple.cc#L424CurveAPI: https://github.com/NREL/EnergyPlus/blob/81b1cbde1b34e99b631f5b7f8d7402c9a7c4ec7c/src/EnergyPlus/WaterToAirHeatPumpSimple.cc#L393
The CheckSimpleWAHPRatedCurvesOutput ends up making an attempted call to CurveValue on develop, or wahp.TotalCoolCapCurve->v on the CurveAPI branch, which causes the hard crash.
Fix
I'm guessing that we just need to check ErrorsFound before making the call to CheckSimpleWAHPRatedCurvesOutputs, and I think the rest of the get input could continue "successfully". It should still respect the ErrorsFound variable and give a fatal error, but it should be OK to continue processing the remaining objects.
Verify
I will try to get a defect file, but if it turns out I can't, the assignee can work up an example file that misspells the total cooling capacity curve on the simple WAHP. Alternatively, I can just verify the fix locally on the actual defect file and report back. Either way, a unit test should be moderately easy to set up to confirm.
Operating System (Multiple choices)
Any
Operating System Version
Any
Version of EnergyPlus
Reported with 24.2, transitioned and confirmed still occurs with 25.1
Unmethours link or helpdesk ticket number
N/A
Defect file
No response