Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correction of Mechanical Ventilation Controller Index Problem #9580

Merged

Conversation

RKStrand
Copy link
Contributor

@RKStrand RKStrand commented Aug 1, 2022

Pull request overview

There was an improper index used for a calculation in the mechanical ventilation controller that would grab the wrong zone volume. This has been corrected and a unit test to verify the fix has been created. A few minor IDD, input file, and doc (IO Ref) fixes from check-ins in a previous release that missed the IDD freeze were tacked onto this work. No differences in the output as expected because there were no input files in the test suite where this problem was triggered.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • 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

This will not be exhaustively relevant to every PR.

  • 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

Fix for the problem.  Also, a new IDF was added to EnergyPlusDevSupport under 9558 that shows the differences before and after the fix.  Mostly happens during the July run period.
Added the unit test of the mechanical ventilation fix for ACH control.  Also, dropped in a couple of other random IDD and doc fixes from a previous release that missed the cut-off deadline.
Changes to IDD required change to input file.  This should take care of the problem.
@RKStrand RKStrand added Defect Includes code to repair a defect in EnergyPlus IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) labels Aug 1, 2022
@RKStrand RKStrand added this to the EnergyPlus 22.2 IOFreeze milestone Aug 1, 2022
@RKStrand RKStrand requested a review from mjwitte August 1, 2022 17:26
@RKStrand RKStrand self-assigned this Aug 1, 2022
Forgot to clang forat this file.  Not sure why it was so picky given that I just pasted in curZone but ok.
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

The zone index fix is pretty obvious, I'm just a little thrown by the tube sizing changes in this PR as well. I don't necessarily have a problem with them, but are they intentional?

ZoneOAACH = curZone.Multiplier * curZone.ListMultiplier *
(this->ZoneOAACHRate(ZoneIndex) * state.dataHeatBal->Zone(ZoneIndex).Volume) * curZoneOASchValue / 3600.0;
ZoneOAACH =
curZone.Multiplier * curZone.ListMultiplier * (this->ZoneOAACHRate(ZoneIndex) * curZone.Volume) * curZoneOASchValue / 3600.0;
Copy link
Member

Choose a reason for hiding this comment

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

Got it, so yeah, curZone is based on ZoneNum, ZoneIndex should not have been used here. Works for me.

@@ -4120,7 +4120,7 @@ \subsubsection{Inputs}\label{inputs-38}

\paragraph{Field: Tube Spacing}\label{field-tube-spacing}

This field defines the distance between adjacent hydronic tubes spaced in the direction perpendicular to the main direction of heat transfer. The value for this parameter must be greater than 0.01m (or a tube spacing of 1 cm) and less than 1.0m (or a tube spacing of 1m). Note that this parameter is only used for two-dimensional solutions (see previous field) or when the user requests that the tube length for a hydronic radiant system ( \textbf{\hyperref[zonehvaclowtemperatureradiantvariableflow]{variable flow}} or \textbf{\hyperref[zonehvaclowtemperatureradiantconstantflow]{constant flow}}) be autosized. In the case of autosizing the tube length, this parameter is used along with the dimensions of the surface to approximate the tube length.
This field defines the distance between adjacent hydronic tubes spaced in the direction perpendicular to the main direction of heat transfer. The value for this parameter must be greater than or equal to 0.01m (or a tube spacing of 1 cm) and less than or equal to 1.0m (or a tube spacing of 1m). Note that this parameter is only used for two-dimensional solutions (see previous field) or when the user requests that the tube length for a hydronic radiant system ( \textbf{\hyperref[zonehvaclowtemperatureradiantvariableflow]{variable flow}} or \textbf{\hyperref[zonehvaclowtemperatureradiantconstantflow]{constant flow}}) be autosized. In the case of autosizing the tube length, this parameter is used along with the dimensions of the surface to approximate the tube length.
Copy link
Member

Choose a reason for hiding this comment

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

I don't see from the PR description anything about the tube size issue. Is that just something you identified while fixing the zone index issue and added it here?

state->dataMixedAir->VentilationMechanical(1).SysDesOA = ExpectedOAMassFlow; // Set design outdoor air flow rate
state->dataSize->CurSysNum = 1; // Only one system in this instance
state->dataEnvrn->StdRhoAir = 1; // Standard air density assumed to be 1 kg/m3 (simplification)
state->dataMixedAir->VentilationMechanical(1).CalcMechVentController(*state, SysMassFlow, OAMassFlow);
Copy link
Member

Choose a reason for hiding this comment

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

Nice.

@RKStrand
Copy link
Contributor Author

RKStrand commented Aug 2, 2022

@Myoldmopar sorry, should have explained better. I combined in some IDD items that missed a previous release. They had nothing to do with this particular defect but I was trying to avoid having extra PRs. Is it okay to do this or do I need to create a separate branch to do this.

@Myoldmopar
Copy link
Member

Is it okay to do this or do I need to create a separate branch to do this.

Yes, this is perfectly OK, please combine away. Just make sure the PR description has enough detail so that I know what to expect with the changes being made. 👍

@@ -90281,10 +90283,10 @@ ElectricLoadCenter:Storage:Simple,
\minimum 0.0
N2, \field Nominal Energetic Efficiency for Charging
\maximum 1.0
\minimum 0.0
\minimum 0.001
Copy link
Member

Choose a reason for hiding this comment

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

@RKStrand @mjwitte what do you think about this versus like \minimum> 0. I'm not strongly opinionated either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Myoldmopar Well, the code that now exists uses 0.001 as a hard limit for both charging and discharging. I guess we could eliminate that logic now with the change to the IDD. If I remember correctly, my thinking was that it is going to divide by the number and I wanted to make sure we avoided the problem of having huge electric loads (an input file set this parameter to zero which ended up being a very tiny number and a massive electric load. I guess I'm okay with it like this, but I'll wait to hear if @mjwitte has a strong opinion.

Copy link
Contributor

Choose a reason for hiding this comment

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

No opinion, really. Anything below 0.1 seems pathetic anyway, so I would hope nobody actually models anything this low.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -182,7 +182,7 @@
1, !- Thermal Source Present After Layer Number
1, !- Temperature Calculation Requested After Layer Number
1, !- Dimensions for the CTF Calculation
0.0, !- Tube Spacing {m}
0.1, !- Tube Spacing {m}
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar
Copy link
Member

Alright, with that resolved, let's merge this in. Thanks @RKStrand

@Myoldmopar Myoldmopar merged commit 477cb77 into develop Aug 2, 2022
@Myoldmopar Myoldmopar deleted the 9558IncorrectIndexMechanicalVentilationController branch August 2, 2022 21:38
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 IDDChange Code changes impact the IDD file (cannot be merged after IO freeze)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect zone volume for Controller:MechanicalVentilation ACH
8 participants