Skip to content

Conversation

@rraustad
Copy link
Contributor

@rraustad rraustad commented Apr 4, 2025

Pull request overview

  • Fixes AirTerminal:SingleDuct:Mixer reports odd mixed air condition during off cycle #11021
  • This correction sets the mixed air condition of the ATMixer to be equal to the primary inlet node when air flow rate = 0. Since this occurs during the off condition it doesn't really matter what condition is reported so it was chosen to report the mixed air condition the same as the primary inlet node. This is the same methodology used when calculating CO2 or contaminants.
    if (state.dataContaminantBalance->Contaminant.CO2Simulation) {
        if (state.dataSingleDuct->SysATMixer(SysNum).MixedAirMassFlowRate <= HVAC::VerySmallMassFlow) {
            state.dataLoopNodes->Node(MixedAirOutNode).CO2 = state.dataLoopNodes->Node(PriInNode).CO2;
        } else {
            state.dataLoopNodes->Node(MixedAirOutNode).CO2 =
                (state.dataLoopNodes->Node(SecInNode).MassFlowRate * state.dataLoopNodes->Node(SecInNode).CO2 +
                 state.dataLoopNodes->Node(PriInNode).MassFlowRate * state.dataLoopNodes->Node(PriInNode).CO2) /
                state.dataLoopNodes->Node(MixedAirOutNode).MassFlowRate;
        }
    }

Description of the purpose of this PR

This change reports the off condition of the ATMixer to be equal to the primary inlet node condition to replicate other node properties.

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

@rraustad
Copy link
Contributor Author

rraustad commented Apr 4, 2025

The same figure as shown in the issue description is shown here as a comparison. The supply air mixer now shows a more reasonable result where the mixed air condition is not outside the boundary of the inlet nodes (i.e., it does not look strange).

image

@rraustad rraustad added the Defect Includes code to repair a defect in EnergyPlus label Apr 4, 2025
@rraustad rraustad changed the title Update CalcATMixer Update AirTerminal:SingleDuct:Mixer to report primary air node condition when air flow = 0 (when ATMixer is off) Apr 4, 2025
@github-actions
Copy link

github-actions bot commented Apr 4, 2025

⚠️ Regressions detected on macos-14 for commit 0dd0c1c

Regression Summary
  • ESO Big Diffs: 4

@github-actions
Copy link

github-actions bot commented Apr 4, 2025

⚠️ Regressions detected on macos-14 for commit 9ea6307

Regression Summary
  • ESO Big Diffs: 4

state.dataLoopNodes->Node(VRFTUInletNodeNum).MassFlowRate);
SimATMixer(state, this->ATMixerName, FirstHVACIteration, this->ATMixerIndex);
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A unit test failure showed that the changes to CalcATMixer could lead to incorrect CompOnMassFlow calculation since the outlet of the inlet side ATMixer is the inlet to the VRF TU and that node condition affects the operating air mass flow rate. This code calculates a new CompOnMassFlow when an inlet side ATMixer exists.


// PURPOSE OF THIS SUBROUTINE
// Calculate the mixed air flow and conditions in the air terminal mixer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update CalcATMixer according to changes in #11004. This change causes diffs and this branch was created to isolate those diffs associated with the refactor of this function.

Real64 MixedAirMassFlowRateCATM = 0.0;
Real64 MixedAirEnthalpyCATM = 0.0;
Real64 MixedAirHumRatCATM = 0.0;
Real64 MixedAirTempCATM = 0.0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eliminate state variables used only in function CalcATMixer.

Copy link
Member

Choose a reason for hiding this comment

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

This is very very very nice. Thanks.

ASSERT_EQ(HVACInletMassFlowRate, state->dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate);
// check the cooling output delivered is within 5.0 Watt of zone cooling load
ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 5.0);
EXPECT_NEAR(0.965, state->dataDXCoils->DXCoil(1).PartLoadRatio, 0.001);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This unit test highlighted the fact that the inlet side ATMixer can affect the operating air mass flow rate of the VRF_FluidTCtrl model.

@github-actions
Copy link

github-actions bot commented Apr 4, 2025

⚠️ Regressions detected on macos-14 for commit 857b718

Regression Summary
  • ESO Big Diffs: 4

@rraustad
Copy link
Contributor Author

rraustad commented Apr 4, 2025

Diffs on this branch are a subset of DOATo* diffs on #11004 and do not match exactly.

DOAToUnitVentilator
DOAToWaterToAirHPInlet
DOAToWaterToAirHPInlet_MultispeedFan
DOAToWaterToAirHPSupply

Example absolute diffs for DOAToUnitVentilator:

image

@Myoldmopar Myoldmopar self-assigned this Apr 9, 2025
Real64 MixedAirMassFlowRateCATM = 0.0;
Real64 MixedAirEnthalpyCATM = 0.0;
Real64 MixedAirHumRatCATM = 0.0;
Real64 MixedAirTempCATM = 0.0;
Copy link
Member

Choose a reason for hiding this comment

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

This is very very very nice. Thanks.

@Myoldmopar
Copy link
Member

This is a great fix. I know you mentioned the diffs showing up here did not exactly match or complete the diffs showing in the other branch, so it will be interesting to see what the diffs look like once I merge this and develop gets pulled in there. Anyway, thanks @rraustad, always very exciting to see variables get removed from state!

@Myoldmopar Myoldmopar merged commit 92c844b into develop Apr 10, 2025
10 of 11 checks passed
@Myoldmopar Myoldmopar deleted the Correct-ATMixer-Updates branch April 10, 2025 19:41
@Myoldmopar Myoldmopar mentioned this pull request Apr 10, 2025
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.

AirTerminal:SingleDuct:Mixer reports odd mixed air condition during off cycle

5 participants