Skip to content

Fix ADU duct leakage inflating system return flow when no return plenum - #11858

Draft
yujiex wants to merge 4 commits into
developfrom
fix_adu_duct_leakage
Draft

yujiex wants to merge 4 commits into
developfrom
fix_adu_duct_leakage

Conversation

@yujiex

@yujiex yujiex commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Pull request overview

Description of the purpose of this PR

Simple duct leakage from ZoneHVAC:AirDistributionUnit was always added to AirLoopFlow.LeakFlow, and therefore to SysRetFlow, even when the leaked air never reaches a return node. Only a connected AirLoopHVAC:ReturnPlenum adds the leak flow back into the return path. Without one, MixedAir computed the exhaust flow from the inflated SysRetFlow but the mixed flow from the actual return node flow, so the mixed air flow came up short by the leak flow on every HVAC iteration. The shortfall fed back through the available-flow limits on the supply fan and terminal, and the ADU leakage was then applied to the already reduced flow. In a VAV model with 26% leakage, delivered airflow fell by up to ~86% and annual site energy dropped by ~17% instead of rising.

  • CalcZoneMassBalance now counts upstream and downstream duct leakage in LeakFlow only if the ADU's zone has a return node feeding a return plenum (new ZonePlenum::zoneReturnFeedsPlenum). Leakage stays active and is replaced through the outdoor air path.
  • Remove the check in InitAirZoneReturnPlenum that zeroed leakage for ADUs without a plenum. It only ran when a model had a plenum, and only tested downstream leakage, so models with no plenum never reached it.
  • Add a one-time warning per ADU (upstream or downstream leakage, any model) when the ADU's zone has no return plenum, stating that the leaked air is treated as lost from the air loop.

Results are unchanged for models whose leaking ADUs have a return plenum. Models with duct leakage and no plenum will change, and ADUs without a plenum in models that do have one no longer have downstream leakage disabled.

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

Simple duct leakage from ZoneHVAC:AirDistributionUnit was always added to
AirLoopFlow.LeakFlow, and therefore to SysRetFlow, even when the leaked air
never reaches a return node. Only a connected AirLoopHVAC:ReturnPlenum adds
the leak flow back into the return path. Without one, MixedAir computed the
exhaust flow from the inflated SysRetFlow but the mixed flow from the actual
return node flow, so the mixed air flow came up short by the leak flow on
every HVAC iteration. The shortfall fed back through the available-flow
limits on the supply fan and terminal, and the ADU leakage was then applied
to the already reduced flow. In a VAV model with 26% leakage, delivered
airflow fell by up to ~86% and annual site energy dropped by ~17% instead of
rising.

- CalcZoneMassBalance now counts upstream and downstream duct leakage in
  LeakFlow only if the ADU's zone has a return node feeding a return plenum
  (new ZonePlenum::zoneReturnFeedsPlenum). Leakage stays active and is
  replaced through the outdoor air path.
- Remove the check in InitAirZoneReturnPlenum that zeroed leakage for ADUs
  without a plenum. It only ran when a model had a plenum, and only tested
  downstream leakage, so models with no plenum never reached it.
- Add a one-time warning per ADU (upstream or downstream leakage, any model)
  when the ADU's zone has no return plenum, stating that the leaked air is
  treated as lost from the air loop.

Results are unchanged for models whose leaking ADUs have a return plenum.
Models with duct leakage and no plenum will change, and ADUs without a
plenum in models that do have one no longer have downstream leakage
disabled.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@yujiex yujiex self-assigned this Oct 9, 2026
@yujiex yujiex added the Defect Includes code to repair a defect in EnergyPlus label Oct 9, 2026
Yujie Xu added 2 commits October 9, 2026 16:37
ZonePlenum_zoneReturnFeedsPlenumTest covers no plenum, a plenum on one zone, and
invalid zone indices.

ZoneEquipmentManager_CalcZoneMassBalance_DuctLeakReturnFlowTest covers LeakFlow
and SysRetFlow in three cases. With no plenum, leakage is excluded. With a
plenum on one of two zones, only that zone's ADU counts (0.15 of 0.30 kg/s).
With plenums on both zones, all leakage counts, as before.

ZoneAirLoopEquipment_DuctLeakNoReturnPlenumWarningTest checks the exact warning
for upstream-only, downstream-only and both. It also checks that there is no
warning with zero fractions or with a plenum, and that the leak flags stay set.
With ADU duct leakage no longer counted in the system return flow when
the zone has no return plenum, loops without outdoor air to replace the
leaked air now report "Supply is > return plus outdoor air" in
CheckAirLoopFlowBalance. Add the total unrecovered simple duct leakage
to that message so the cause is visible.
@yujiex
yujiex marked this pull request as draft October 10, 2026 00:08

This branch has not been deployed

No deployments
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.

ADU duct leakage without a return plenum causes excessive supply-airflow reduction through inconsistent return-flow accounting

2 participants