Skip to content

Use fan RTF only for cycling fan impact on AFN distribution losses#11571

Open
lymereJ wants to merge 5 commits intodevelopfrom
fix_unitary_system_afn_runtime_fracs_alt
Open

Use fan RTF only for cycling fan impact on AFN distribution losses#11571
lymereJ wants to merge 5 commits intodevelopfrom
fix_unitary_system_afn_runtime_fracs_alt

Conversation

@lymereJ
Copy link
Copy Markdown
Collaborator

@lymereJ lymereJ commented May 1, 2026

Pull request overview

Alternate approach to #11491 to fix #11490.

Description of the purpose of this PR

This branch produces the same results as #11491 for the defect file from #11490. Instead of using the maximum of the coils RTF and the fan RTF, it just uses the fan since the fan operation should be the factor impacting the AFN distribution losses.

The fan runtime is set here for cycling Fan:OnOff fans:

if (isAFNFan && (airLoopNum > 0)) {
if (type == HVAC::FanType::OnOff) {
state.dataAirLoop->AirLoopAFNInfo(airLoopNum).AFNLoopOnOffFanRTF = runtimeFrac;
}
}

And here for Fan:SystemModel objects:

if (isAFNFan && (airLoopNum > 0)) {
if (speedControl == SpeedControl::Continuous) {
state.dataAirLoop->AirLoopAFNInfo(airLoopNum).AFNLoopOnOffFanRTF = runtimeFracAtSpeed[0];
} else {
if (numSpeeds == 1) {
state.dataAirLoop->AirLoopAFNInfo(airLoopNum).AFNLoopOnOffFanRTF = outletAirMassFlowRate / maxAirMassFlowRate;
} else if (outletAirMassFlowRate <= massFlowAtSpeed[0]) {
state.dataAirLoop->AirLoopAFNInfo(airLoopNum).AFNLoopOnOffFanRTF = outletAirMassFlowRate / massFlowAtSpeed[0];
} else {
state.dataAirLoop->AirLoopAFNInfo(airLoopNum).AFNLoopOnOffFanRTF = 1.0;
}
}
}

  • The first if is for fan set up with the continuous speed control
  • The second deals with cases with discrete fan speed but only one speed is specified
  • The third is for more than one speed is specified, the runtime fraction is only < 1 if when the fan is cycling at its low speed outletAirMassFlowRate <= massFlowAtSpeed[0]

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

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

@lymereJ lymereJ added Defect Includes code to repair a defect in EnergyPlus AirflowNetwork Related primarily on airflow-network portions of the codebase labels May 1, 2026
@rraustad
Copy link
Copy Markdown
Collaborator

rraustad commented May 2, 2026

This seems like AFN should work the same as before.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 747594f

Regression Summary
  • EIO: 1
  • ESO Small Diffs: 1
  • MTR Small Diffs: 1
  • Table Small Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

⚠️ Regressions detected on macos-14 for commit 747594f

Regression Summary
  • EIO: 1
  • ESO Small Diffs: 1
  • MTR Small Diffs: 1
  • Table Small Diffs: 1

@NatLabRockies NatLabRockies deleted a comment from github-actions Bot May 3, 2026
@NatLabRockies NatLabRockies deleted a comment from github-actions Bot May 3, 2026
@lymereJ lymereJ marked this pull request as ready for review May 3, 2026 02:22
Copy link
Copy Markdown
Collaborator Author

@lymereJ lymereJ left a comment

Choose a reason for hiding this comment

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

Code walkthrough:

Comment on lines +9795 to +9797
OnOffFanRunTimeFraction = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
LoopOnOffFanRunTimeFraction(AirLoopNum) = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Only use fan RTF instead of the maximum of the coils and the fan RTF. All functioning air loops should have fans and when fans are cycling their RTF is the same as the coils.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That makes sense to me.


// Check that the runtime fraction is less than one so the impact of cycling fan is correctly accounted for in the AFN
EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopHeatingCoilMaxRTF < 1);
EXPECT_TRUE(state->dataAirLoop->AirLoopAFNInfo(1).AFNLoopOnOffFanRTF < 1);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Check for fan RTF instead of coil RTF.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 1af4c32

Regression Summary
  • EIO: 1
  • ESO Small Diffs: 1
  • MTR Small Diffs: 1
  • Table Small Diffs: 1

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

⚠️ Regressions detected on macos-14 for commit 1af4c32

Regression Summary
  • EIO: 1
  • ESO Small Diffs: 1
  • MTR Small Diffs: 1
  • Table Small Diffs: 1

Copy link
Copy Markdown
Collaborator

@mitchute mitchute left a comment

Choose a reason for hiding this comment

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

Thanks @lymereJ. This looks like a much more straight forward approach. There's a very minor diff in one file. Are you OK with that?

Comment on lines +9795 to +9797
OnOffFanRunTimeFraction = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
LoopOnOffFanRunTimeFraction(AirLoopNum) = m_state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopOnOffFanRTF;
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

That makes sense to me.

Comment on lines -1897 to -1908
if (std::abs(heatingCoil.NominalCapacity) < 1.e-8) {
if (heatingCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF, 0.0);
}
} else {
if (heatingCoil.AirLoopNum > 0) {
state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF =
max(state.dataAirLoop->AirLoopAFNInfo(heatingCoil.AirLoopNum).AFNLoopHeatingCoilMaxRTF,
HeatingCoilLoad / heatingCoil.NominalCapacity);
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's great that you were able to strip away so much and keep the same behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AirflowNetwork Related primarily on airflow-network portions of the codebase Defect Includes code to repair a defect in EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect heating energy use for AirLoopHVAC:UnitarySystem in AFN simulation with distribution losses

4 participants