Skip to content

#11289 - Case sensitivity error in getWaterTankStratifiedInput#11290

Merged
mitchute merged 4 commits intodevelopfrom
11289_ThermalStorageWater
Oct 25, 2025
Merged

#11289 - Case sensitivity error in getWaterTankStratifiedInput#11290
mitchute merged 4 commits intodevelopfrom
11289_ThermalStorageWater

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Oct 24, 2025

Pull request overview

Description of the purpose of this PR

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
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

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

[ RUN      ] EnergyPlusFixture.thermalStorageTankInputReading_Autocalculate
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc:6856: Failure
Expected: WaterThermalTanks::getWaterTankStratifiedInput(*state, cStratifiedCWTankModuleObj) doesn't throw an exception.
  Actual: it throws nlohmann::json_abi_v3_12_0::detail::type_error with description "[json.exception.type_error.302] type must be number, but is string".
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc:6862: Failure
@jmarrec jmarrec self-assigned this Oct 24, 2025
@jmarrec jmarrec added the Defect Includes code to repair a defect in EnergyPlus label Oct 24, 2025
Comment on lines +6856 to +6865
EXPECT_NO_THROW(WaterThermalTanks::getWaterTankStratifiedInput(*state, cStratifiedCWTankModuleObj));
compare_err_stream("");

auto &TankChilled = state->dataWaterThermalTanks->WaterThermalTank(1);
EXPECT_EQ(TankChilled.Name, "CHILLED WATER STORAGE TANK 1");
EXPECT_EQ(8.0, TankChilled.Height);
EXPECT_EQ(TankChilled.Height, TankChilled.UseInletHeight);
EXPECT_EQ(TankChilled.Height, TankChilled.SourceOutletHeight);

EXPECT_NO_THROW(WaterThermalTanks::getWaterTankStratifiedInput(*state, cStratifiedHWTankModuleObj));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before fix

EnergyPlusFixture.thermalStorageTankInputReading_Autocalculate
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc:6856: Failure
Expected: WaterThermalTanks::getWaterTankStratifiedInput(*state, cStratifiedCWTankModuleObj) doesn't throw an exception.
  Actual: it throws nlohmann::json_abi_v3_12_0::detail::type_error with description "[json.exception.type_error.302] type must be number, but is string".
/home/julien/Software/Others/EnergyPlus/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc:6862: Failure

Comment on lines -3974 to -3979
auto const &SourceOutletHeight = fields.at("source_side_outlet_height");
if (SourceOutletHeight == "AutoCalculate") {
Tank.SourceOutletHeight = Tank.Height;
} else {
Tank.SourceOutletHeight = SourceOutletHeight.get<Real64>();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was the case sensitivity issue. getRealFieldValue is the right call now

}

// ======= Get 'ThermalStorage:ChilledWater:Stratified' =======================================================
// ======= Get 'ThermalStorage:HotWater:Stratified' =======================================================
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo

Comment on lines +4923 to +4946
auto const &Tank = state.dataWaterThermalTanks->WaterThermalTank(WaterThermalTankNum);

if (Tank.Sizing.DesignMode == SizingMode::Invalid) {
if (Tank.VolumeWasAutoSized) {
ShowSevereError(state,
format("{}='{}' has tank volume set to Autosize but it is missing associated WaterHeater:Sizing object",
DataPlant::PlantEquipTypeNames[static_cast<int>(Tank.WaterThermalTankType)],
Tank.Name));
ErrorsFound = true;
}
if (Tank.MaxCapacityWasAutoSized) {
ShowSevereError(state,
format("{}='{}' has heater capacity set to Autosize but it is missing associated WaterHeater:Sizing object",
DataPlant::PlantEquipTypeNames[static_cast<int>(Tank.WaterThermalTankType)],
Tank.Name));
ErrorsFound = true;
}
if (Tank.HeightWasAutoSized) {
ShowSevereError(state,
format("{}='{}' has tank height set to Autosize but it is missing associated WaterHeater:Sizing object",
DataPlant::PlantEquipTypeNames[static_cast<int>(Tank.WaterThermalTankType)],
Tank.Name));
ErrorsFound = true;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Improve message to include type of object, space issue and change into severe since it then fatals

-   ** Warning ** Water heater named CHILLED WATER STORAGE TANK 1has heater capacity set to AUTOSIZE but it is missing associated WaterHeater:Sizing object
+   ** Severe  ** ThermalStorage:ChilledWater:Stratified='CHILLED WATER STORAGE TANK 1' has heater capacity set to Autosize but it is missing associated WaterHeater:Sizing object

Copy link
Collaborator

Choose a reason for hiding this comment

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

The CW storage tank has a "Nominal Cooling Capacity" input. The HW has Nominal Heating Capacity. I still don't see how the WaterHeater:Sizing object will be used to size the thermal storage tank, but then I didn't look at code.

@mitchute mitchute merged commit 37f8c35 into develop Oct 25, 2025
12 checks passed
@mitchute mitchute deleted the 11289_ThermalStorageWater branch October 25, 2025 20:03
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Case sensitivity error in getWaterTankStratifiedInput

5 participants