Skip to content

WaterThermalTanks.cc never traps ErrorsFound #11156

@mjwitte

Description

@mjwitte

Issue overview

Stumbled across this by accidentally deleting the schedule object referenced in a WaterHeater:Mixed object. The simulation crashed. Watching in the debugger, ErrorsFound was set to true and returned by getWaterHeaterMixedInputs which is then returned by GetWaterThermalTankInput but it's never checked during a simulation. The return value is used in unit tests, but never even captured in the main code.

e.g. https://github.com/NREL/EnergyPlus/blob/acf7908bedc967ed80ec691f4441ec01702ec23c/src/EnergyPlus/WaterThermalTanks.cc#L135-L141

a. The simple fix is to change GetWaterThermalTankInput to void and add a fatal error at the end of GetWaterThermalTankInput, but this will break the unit tests that are checking the return value (about 26 occurrences).
b. Another option would be to wrap the approx 10 calls to GetWaterThermalTankInput with a function that checks the return value and throws a fatal error.

Operating System (Multiple choices)

Any

Operating System Version

any

Version of EnergyPlus

25.2.0-acf7908 pre-release

Unmethours link or helpdesk ticket number

N/A

Defect file

WaterHeaterStandAlone-Error.idf.txt

Metadata

Metadata

Assignees

Labels

DefectIncludes code to repair a defect in EnergyPlus

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions