Skip to content

Conversation

@spahrenk
Copy link
Contributor

Modifies HPWHsim to fix flawed calculation when the draw volume exceeds the tank volume. The case Vdraw > Vtank was formerly handled with separate code, which simplified the calculation by ignoring possible temperatures inversions in the tank. However, inversions are only to be expected when Tinlet > Ttank[0] (i.e., the bottom tank node), which is uncommon. (Perhaps the alternative code was introduced to improve computational speed.) Furthermore, separate algorithms for high and low draws can lead to discontinuities in the simulation results when Vdraw ~ Vtank. This PR applies the same algorithm (including possible inversion mixing) , regardless of draw volume.

The large-draw condition appears not to have been previously tested in HPWHsim. (Bug appear to have been introduced in balance-energy-hpwh) This PR adds energy-balance tests to check this case.

@spahrenk spahrenk self-assigned this Feb 26, 2025
@spahrenk spahrenk added the bug label Feb 26, 2025
@spahrenk spahrenk changed the title Fix large-draw bug (HPWHsim) Fix large-draw bug (HPWHsim) Fixed #531 Feb 26, 2025
@spahrenk spahrenk changed the title Fix large-draw bug (HPWHsim) Fixed #531 Fix large-draw bug (HPWHsim) Fixes #531 Feb 26, 2025
@spahrenk spahrenk changed the title Fix large-draw bug (HPWHsim) Fixes #531 Fix large-draw bug (HPWHsim) Feb 26, 2025
@spahrenk spahrenk linked an issue Feb 26, 2025 that may be closed by this pull request
@spahrenk spahrenk requested a review from chipbarnaby February 26, 2025 18:53
Copy link
Contributor

@chipbarnaby chipbarnaby left a comment

Choose a reason for hiding this comment

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

Looks plausible to me, since I benefit from not understanding to code in detail.

@nealkruis nealkruis merged commit c5c1b93 into main Mar 12, 2025
4 checks passed
@nealkruis nealkruis deleted the large-draw-fix-hpwh branch March 12, 2025 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HPWH incorrect handling of large draws

4 participants