Skip to content

Conversation

@yujiex
Copy link
Collaborator

@yujiex yujiex commented Apr 14, 2025

Pull request overview

Description of the purpose of this PR

Currently, EnergyPlus does not have a direct or explicit way to model passive hot water tanks , which stores hot water in a way that naturally maintains temperature stratification without the use of active mixing or heating elements. Users have used the heat pump water heater, WaterHeater:Mixed and WaterHeater:Stratified with tricks and limitations. This hinders the ability of users to model complex thermal energy storage systems.

Key drawbacks of the existing tank object include,

  • Ambiguity in Control: Due to the dual purpose of the water heater and water
    storage tank, it is sometimes unclear whether the setpoint temperature
    controls the source side flow request or the internal heater operation.
  • Fixed Flow Direction: In complex HVAC systems, such as the Time Independent
    Energy Recovery (TIER) system defined in [1] defined in , the water flow
    direction may change. For example, in the heating mode, water flows in at the
    bottom and exits at the top of the tank, whereas in the cooling mode, water
    flows in at the top and exits at the bottom. The current object has fixed
    inlet and outlet water heights, thereby only allowing a fixed flow direction.
    In contrast, the water storage tank implemented in Modelica is more flexible
    [2], with the flow direction indicated by the sign of the flow. Additionally,
    temperature sensors can be placed in all layers (at different heights) of the
    stratified tank, providing information for more complex control logic.
  • Simplified Charging Logic: The current object determines tank charges (source
    side requesting water flow) based on a temperature setpoint (default) or a
    temperature upper limit (storage tank mode). However, more complex charging
    control is sometimes needed. For example, in some applications, the charging
    percentage needs to be a function of the tank temperature, which could involve
    temperature of all stratified layers. The current object does not allow for
    such complex charging percentage calculations nor does it permit control of
    this parameter via EMS or Python plug-ins.
  • Issue with autosizing: Tank autosizing capability is present but with
    multiple issues (issue 8412, 8451, 9956). Actuators might need to be added to
    enable auto-sizing with external code (EMS or python API), especially for
    complex systems with heat pumps, heat recovery chillers, and thermal storage
    tanks.

The proposed new feature will introduce a passive hot water tank, similar to the
chilled water tank, but designed to hold hot water. It will also include various
actuators to control flow direction and tank charging. The autosizing
functionality will be thoroughly tested to ensure it functions properly. This
new tank can be incorporated into complex energy recovery systems like the TIER
system.

Regression diffs

  • 6 files with rdd diffs: this is caused by the change of output names for chilled water tank, where previously some fields are called "Thermal Storage ...", some are called "Thermal Storage Tank ...". This PR unified the names all to "Thermal Storage Tank..."
  • 2 files with audit diff: the feature branch NumOfRVariable is 2 greater than the develop branch. This is because 2 reporting variables are added:
Output:Variable,*,Chilled Water Thermal Storage Tank Temperature Setpoint,hourly; !- HVAC Average [C]
Output:Variable,*,Chilled Water Thermal Storage Tank Temperature Sensor Value,hourly; !- HVAC Average [C]

Function illustration

The following illustrations uses the PlantLoopHeatPump_EIR_AirSource_BufferTank.idf file.

two setpoints controlling charging
The hot water tank in this PR can control its charging with two setpoints: when the top temperature < setpoint - deadband or the bottom temperature < setpoint - deadband, the tank will charge. Otherwise it will not charge. In the following example, the setpoint at the top of the tank is 21C, the setpoint at the bottom of the tank is 15C. For simplicity, the dead band temperature is set to be very small.

image

flow direction switch
The new hot water tank object can switch the flow direction on the source side or the use side. The flow direction is controlled with a schedule. When the value is 1, it keeps the original direction, when it's -1, it reverses the direction. In the following example, the use side orginal flow direction draws water from the top, while the reverse direction will swap the use inlet and outlet node and draws hot water from the bottom. The tank temperature is higher when the use side flow direction is reversed, as cold water are removed on the tank use side.

image

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

@yujiex yujiex added NewFeature Includes code to add a new feature to EnergyPlus IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) labels Apr 14, 2025
@yujiex yujiex self-assigned this Apr 14, 2025
@yujiex yujiex marked this pull request as draft April 14, 2025 18:13
@nrel-bot-2c
Copy link

@yujiex @Myoldmopar it has been 31 days since this pull request was last updated.

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit 4f19c45

Regression Summary
  • Audit: 2
  • BND: 2
  • EIO: 2
  • ERR: 2
  • ESO Big Diffs: 2
  • Table Big Diffs: 1

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit 7e6e947

Regression Summary
  • Audit: 2
  • BND: 2
  • EIO: 2
  • ERR: 2
  • ESO Big Diffs: 2
  • Table Big Diffs: 1

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit ad28245

Regression Summary
  • BND: 2
  • EIO: 1
  • ERR: 2
  • ESO Big Diffs: 1
  • Table Big Diffs: 1

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit f9c0e53

Regression Summary
  • BND: 2
  • EIO: 1
  • ERR: 2
  • ESO Big Diffs: 1
  • Table Big Diffs: 1

@github-actions
Copy link

⚠️ Regressions detected on ubuntu-24.04 for commit b0714b5

Regression Summary
  • RDD: 6
  • Audit: 2
  • Table String Diffs: 5

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit 5adaecd

Regression Summary
  • RDD: 6
  • Audit: 2
  • Table String Diffs: 5

@github-actions
Copy link

⚠️ Regressions detected on ubuntu-24.04 for commit 5adaecd

Regression Summary
  • RDD: 6
  • Audit: 2
  • Table String Diffs: 5

@github-actions
Copy link

⚠️ Regressions detected on macos-14 for commit c847146

Regression Summary
  • RDD: 6
  • Audit: 2

@github-actions
Copy link

⚠️ Regressions detected on ubuntu-24.04 for commit c847146

Regression Summary
  • RDD: 6
  • Audit: 2

Tank.TankTempLimit = TankTempLimit;
} else {
// Default to very large number, boiling point of water
Tank.TankTempLimit = 100.0;
Copy link
Contributor

Choose a reason for hiding this comment

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

For CW this is a minimum tank temperature limit and for HW this is a maximum limit. I think this needs to get wrapped by the tanktype to apply the proper context.

 N6 , \field Minimum Temperature Limit         // CW

 N7 , \field Maximum Temperature Limit        // HW

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

indeed! I just added different temperature limit defaults for the hot water and chilled water tank separately.

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

⚠️ Regressions detected on macos-14 for commit ba7c3f9

Regression Summary
  • RDD: 6
  • Audit: 2

@github-actions
Copy link

github-actions bot commented Oct 3, 2025

⚠️ Regressions detected on ubuntu-24.04 for commit ba7c3f9

Regression Summary
  • RDD: 6
  • Audit: 2

@rraustad
Copy link
Contributor

rraustad commented Oct 7, 2025

@yujiex in the PR description figure, why is there a delay (~3 hours) before the tank starts charging when the tank temperature is below the set point? It seems like the tank is turned off but I don't see anything in the example file to explain this. This figure also shows the tank set point temperatures going to 0 at some points when the tank is off? or on (I can't tell which)?

image

@yujiex
Copy link
Collaborator Author

yujiex commented Oct 8, 2025

@yujiex in the PR description figure, why is there a delay (~3 hours) before the tank starts charging when the tank temperature is below the set point? It seems like the tank is turned off but I don't see anything in the example file to explain this. This figure also shows the tank set point temperatures going to 0 at some points when the tank is off? or on (I can't tell which)?

image

@rraustad
I have output the source side charging rate, it seems it is charging actually
image

The temperature didn't increase for a while may be because the use side heat transfer is high
image

@rraustad
Copy link
Contributor

rraustad commented Oct 8, 2025

@yujiex thanks for checking and figuring out why the tank temperature looked strange.

@mitchute
Copy link
Collaborator

mitchute commented Oct 9, 2025

I fixed the merge conflicts here. We'll run one more round of CI just to confirm the latest merge flurry didn't break anything, then merge.

Last call here for any final review/comments.

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

⚠️ Regressions detected on macos-14 for commit 427ff05

Regression Summary
  • RDD: 6
  • Audit: 2

@github-actions
Copy link

github-actions bot commented Oct 9, 2025

⚠️ Regressions detected on ubuntu-24.04 for commit 427ff05

Regression Summary
  • RDD: 6
  • Audit: 2

@dareumnam
Copy link
Collaborator

@rraustad Thank you so much for your review and input.
I built it locally with the latest develop branch pulled in, ran the two newly added test files, and confirmed the results look reasonable. The CI results look good. All diffs are explained and verified, comments have been addressed, and all related documentation has been updated. This one looks good to go. @mitchute
Thanks so much for your effort👍 @yujiex

@mitchute
Copy link
Collaborator

mitchute commented Oct 9, 2025

Alrighty. Thanks all. Merging.

@mitchute mitchute merged commit aae1001 into develop Oct 9, 2025
11 checks passed
@mitchute mitchute deleted the newPassiveWaterTank branch October 9, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) NewFeature Includes code to add a new feature to EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants