Skip to content

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Aug 26, 2025

Pull request overview

Description of the purpose of this PR

The defect file in DevSupport segfaults before fix. After fix it fatals out as expected.

$ $ep_build_rel/Products/energyplus -w $chig_epw -d out-new WaterHeaterStandAlone-Error.idf 
EnergyPlus Starting
EnergyPlus, Version 25.2.0-aa87688ddd, YMD=2025.08.26 11:08
Adjusting Air System Sizing
Adjusting Standard 62.1 Ventilation Sizing
Initializing Simulation
Program terminated: EnergyPlus Terminated--Error(s) Detected.
$ cat out-new/eplusout.err 
Program Version,EnergyPlus, Version 25.2.0-aa87688ddd, YMD=2025.08.26 11:08,
   ** Warning ** Version: in IDF="25.1" not the same as expected="25.2"
   ** Warning ** Version: in IDF="25.1" not the same as expected="25.2"
   ** Severe  ** getWaterHeaterMixedInputs: WaterHeater:Mixed = MIXED GAS TANK
   **   ~~~   ** Setpoint Temperature Schedule Name = HOT WATER XYZ SETPOINT TEMP SCHEDULE, item not found.
   **  Fatal  ** GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input.
   ...Summary of Errors that led to program termination:
   ..... Reference severe error count=1
   ..... Last severe error=getWaterHeaterMixedInputs: WaterHeater:Mixed = MIXED GAS TANK
   ************* Warning:  Node connection errors not checked - most system input has not been read (see previous warning).
   ************* Fatal error -- final processing.  Program exited before simulations began.  See previous error messages.
   ************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
   ************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
   ************* EnergyPlus Terminated--Fatal Error Detected. 2 Warning; 1 Severe Errors; Elapsed Time=00hr 00min  0.08sec

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

…t doesn't fatal due to missing zone

```
+   ** Severe  ** WaterHeater:HeatPump:PumpedCondenser=\"HPWHPUMPED\", not found
+   **   ~~~   ** Inlet Air Zone Name=\"ZONE1\".
+   ** Severe  ** WaterHeater:HeatPump:WrappedCondenser=\"HPWHWRAPPED\", not found
+   **   ~~~   ** Inlet Air Zone Name=\"ZONE1\".
+   ** Severe  ** WaterHeater:Mixed = HPWHPUMPED MIXED TANK:  Ambient Temperature Zone not found = ZONE1
+   ** Severe  ** WaterHeater:Stratified = HPWHWRAPPED STRATIFIED TANK:  Ambient Temperature Zone not found = ZONE1
+   ** Severe  ** WaterHeater:HeatPump:PumpedCondenser = HPWHPUMPED:
+   **   ~~~   ** ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.
+   ** Severe  ** WaterHeater:HeatPump:WrappedCondenser = HPWHWRAPPED:
+   **   ~~~   ** ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.
+   **  Fatal  ** GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input
```
@jmarrec jmarrec requested a review from Myoldmopar August 26, 2025 09:09
@jmarrec jmarrec self-assigned this Aug 26, 2025
@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze) labels Aug 26, 2025
}

bool GetWaterThermalTankInput(EnergyPlusData &state)
void GetWaterThermalTankInput(EnergyPlusData &state)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

void

Comment on lines 4905 to 4907
if (ErrorsFound) {
ShowFatalError(state, format("GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input."));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

And throw

state->dataEnvrn->StdRhoAir = 1.0;

ASSERT_FALSE(WaterThermalTanks::GetWaterThermalTankInput(*state));
WaterThermalTanks::GetWaterThermalTankInput(*state);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need to wrap into "EXPECT_NO_THROW". We just rely on gtest catching the exception if needed. This is what we do in most tests right now

Copy link
Member

Choose a reason for hiding this comment

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

Yep, let it fail if it's gonna fail.

Comment on lines 1051 to 1052
DataZoneEquipment::GetZoneEquipmentData(*state);
ASSERT_FALSE(ErrorsFound);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Missing call to GetZoneEquipmentData here, GetWaterThermalTankInput would eventually complain that ZoneEquipConfig isn't allocated

if ((HPWH.InletAirConfiguration == WTTAmbientTemp::TempZone || HPWH.InletAirConfiguration == WTTAmbientTemp::ZoneAndOA) &&
HPWH.AmbientTempZone > 0) {
if (allocated(state.dataZoneEquip->ZoneEquipConfig)) {

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to remove the format from the new fatal at WaterThermalTanks.cc line 4906 so you might as well also remove line 1052 above since it doesn't do anything (i.e., GetZoneEquipmentData doesn't have the ErrorsFound argument so of course ErrorsFound is still false). Other than that this is good to go.

Comment on lines +1250 to +1266
EXPECT_THROW(WaterThermalTanks::GetWaterThermalTankInput(*state), EnergyPlus::FatalError);

std::string const error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = DUMMYSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** When Inlet Air Configuration=\"OUTDOORAIRONLY\".",
" ** ~~~ ** Outdoor Air Node Name and Exhaust Air Node Name must be specified.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** Heat pump water heater fan outlet node name does not match next connected component.",
" ** ~~~ ** Fan outlet node name = ZONE4AIRINLETNODE"});
std::string const error_string = delimited_string({
" ** Warning ** ProcessScheduleInput: Schedule:Constant = DUMMYSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** When Inlet Air Configuration=\"OUTDOORAIRONLY\".",
" ** ~~~ ** Outdoor Air Node Name and Exhaust Air Node Name must be specified.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** Heat pump water heater fan outlet node name does not match next connected component.",
" ** ~~~ ** Fan outlet node name = ZONE4AIRINLETNODE",
" ** Fatal ** GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input.",
" ...Summary of Errors that led to program termination:",
" ..... Reference severe error count=2",
" ..... Last severe error=WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

HPWHOutdoorAirMissingNodeNameWarning: change to capture the FatalError

Copy link
Member

Choose a reason for hiding this comment

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

This is fine, although in the future if you want to just match some small portion of it and not worry about the ERR formatting, you can use compare_err_stream_substring... :)

Comment on lines +4254 to +4258
" OutdoorAirOnly, !- Inlet Air Configuration",
" , !- Air Inlet Node Name",
" , !- Air Outlet Node Name",
" HPWHPumped Air Inlet Node, !- Outdoor Air Node Name",
" HPWHPumped Air Outlet Node,!- Exhaust Air Node 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.

HPWH_Both_Pumped_and_Wrapped_InputProcessing: change to Outdoors so it doesn't fatal due to missing zone

Initial err stream

+   ** Severe  ** WaterHeater:HeatPump:PumpedCondenser=\"HPWHPUMPED\", not found
+   **   ~~~   ** Inlet Air Zone Name=\"ZONE1\".
+   ** Severe  ** WaterHeater:HeatPump:WrappedCondenser=\"HPWHWRAPPED\", not found
+   **   ~~~   ** Inlet Air Zone Name=\"ZONE1\".
+   ** Severe  ** WaterHeater:Mixed = HPWHPUMPED MIXED TANK:  Ambient Temperature Zone not found = ZONE1
+   ** Severe  ** WaterHeater:Stratified = HPWHWRAPPED STRATIFIED TANK:  Ambient Temperature Zone not found = ZONE1
+   ** Severe  ** WaterHeater:HeatPump:PumpedCondenser = HPWHPUMPED:
+   **   ~~~   ** ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.
+   ** Severe  ** WaterHeater:HeatPump:WrappedCondenser = HPWHWRAPPED:
+   **   ~~~   ** ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.
+   **  Fatal  ** GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

Good to go.

Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

Nice.

state->dataEnvrn->StdRhoAir = 1.0;

ASSERT_FALSE(WaterThermalTanks::GetWaterThermalTankInput(*state));
WaterThermalTanks::GetWaterThermalTankInput(*state);
Copy link
Member

Choose a reason for hiding this comment

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

Yep, let it fail if it's gonna fail.

Comment on lines +1250 to +1266
EXPECT_THROW(WaterThermalTanks::GetWaterThermalTankInput(*state), EnergyPlus::FatalError);

std::string const error_string =
delimited_string({" ** Warning ** ProcessScheduleInput: Schedule:Constant = DUMMYSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** When Inlet Air Configuration=\"OUTDOORAIRONLY\".",
" ** ~~~ ** Outdoor Air Node Name and Exhaust Air Node Name must be specified.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** Heat pump water heater fan outlet node name does not match next connected component.",
" ** ~~~ ** Fan outlet node name = ZONE4AIRINLETNODE"});
std::string const error_string = delimited_string({
" ** Warning ** ProcessScheduleInput: Schedule:Constant = DUMMYSCH",
" ** ~~~ ** Schedule Type Limits Name is empty.",
" ** ~~~ ** Schedule will not be validated.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** When Inlet Air Configuration=\"OUTDOORAIRONLY\".",
" ** ~~~ ** Outdoor Air Node Name and Exhaust Air Node Name must be specified.",
" ** Severe ** WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
" ** ~~~ ** Heat pump water heater fan outlet node name does not match next connected component.",
" ** ~~~ ** Fan outlet node name = ZONE4AIRINLETNODE",
" ** Fatal ** GetWaterThermalTankInput: Errors found in processing Water Thermal Tank input.",
" ...Summary of Errors that led to program termination:",
" ..... Reference severe error count=2",
" ..... Last severe error=WaterHeater:HeatPump:PumpedCondenser=\"ZONE4HEATPUMPWATERHEATER\":",
});
Copy link
Member

Choose a reason for hiding this comment

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

This is fine, although in the future if you want to just match some small portion of it and not worry about the ERR formatting, you can use compare_err_stream_substring... :)

@Myoldmopar
Copy link
Member

All happy here with develop pulled in. Thanks @jmarrec

@Myoldmopar Myoldmopar merged commit 58430fc into develop Sep 4, 2025
9 checks passed
@Myoldmopar Myoldmopar deleted the 11156_GetWaterThermalTankInput_ErrorsFound branch September 4, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WaterThermalTanks.cc never traps ErrorsFound

6 participants