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

Correct logic in supplemental water coil used in UnitarySystem #10479

Merged
merged 5 commits into from
May 23, 2024

Conversation

rraustad
Copy link
Contributor

@rraustad rraustad commented Apr 24, 2024

Pull request overview

NOTE: ENHANCEMENTS MUST FOLLOW A SUBMISSION PROCESS INCLUDING A FEATURE PROPOSAL AND DESIGN DOCUMENT PRIOR TO SUBMITTING CODE

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

@rraustad rraustad added the Defect Includes code to repair a defect in EnergyPlus label Apr 24, 2024
this->m_SuppHeatCoilIndex,
QActual,
this->m_FanOpMode,
this->m_SuppHeatPartLoadFrac);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how this coil wound up not calling the coil model when there was no supplemental heating load. I also wonder if this is the only coil model doing that?

Copy link
Contributor Author

@rraustad rraustad Apr 24, 2024

Choose a reason for hiding this comment

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

I see, lines 12181 was changed to 12182. So these changes probably need to be revised in case the coil is not present or is off for this time step.

        // if (present(SuppCoilLoad)) {
        if (SuppHeatCoilLoad > 0.0) {

@@ -1050,6 +1057,7 @@ namespace UnitarySystems {
} else {
this->m_DesignSuppHeatingCapacity = 0.0;
}
state.dataLoopNodes->Node(this->m_SuppCoilAirInletNode).MassFlowRate = saveCoilAirflow;

This comment was marked as outdated.

@rraustad
Copy link
Contributor Author

Defect file in this branch:

image

if (SuppHeatCoilLoad > 0.0) {
// see if HW coil has enough capacity to meet the load
mdot = min(state.dataLoopNodes->Node(this->m_SuppCoilFluidOutletNodeNum).MassFlowRateMaxAvail, this->m_MaxSuppCoilFluidFlow);
Copy link
Contributor Author

@rraustad rraustad Apr 24, 2024

Choose a reason for hiding this comment

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

There are 2 parts to this simple change. The first is if there is a supplemental heating load set the water mass flow rate to max, else set it to 0.

General::SolveRoot(state, Acc, MaxIte, SolFla, PartLoadFrac, f, 0.0, 1.0);
this->m_SuppHeatPartLoadFrac = PartLoadFrac;
} else {
this->m_SuppHeatPartLoadFrac = (SuppHeatCoilLoad > 0.0) ? 1.0 : 0.0;
}
Copy link
Contributor Author

@rraustad rraustad Apr 25, 2024

Choose a reason for hiding this comment

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

And second is if QActual > SuppHeatCoilLoad (12188) then SolveRoot on the result (that part I did not change), else (12201 - this part I did change) set supp heater PLR to 1, unless supp heater load is 0 in which case set PLR to 0. This code now executes whether or not the coil is on so need to account now for when it's off. If mdot water = 0 then QActual should return as 0, so, hopefully, QActaul > SuppHeatCoilLoad should be false in that case. So at the else here, either the load is greater than what the coil can provide or the coil is off because there is no load. I guess I could have also used (mdot > 0) here. There is no change to the other section of this code, it just looks that way since I added the else for mdot = 0 (12176 and 12177).

@rraustad rraustad added this to the EnergyPlus 24.2 milestone Apr 25, 2024
@Myoldmopar
Copy link
Member

Pretty minimal set of changes here @rraustad, and yet they conflicted. :) I'm wondering if it's just the HVAC namespace change.

If this is ready for review, could you go ahead and resolve the conflict, and is there a test to be added to cover this fix?

@rraustad
Copy link
Contributor Author

rraustad commented May 3, 2024

@Myoldmopar will do.

@rraustad
Copy link
Contributor Author

rraustad commented May 3, 2024

It was just the one line #include HVACFan.hh. Not sure why Git got confused on that. I'll run the unit tests and then merge.

Copy link
Contributor

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

@rraustad Fix looks proper. Unit tests pass. Thanks for the extensive charts to compare before and after. Will let CI run with updated branch and then merge.

@mjwitte
Copy link
Contributor

mjwitte commented May 23, 2024

CI is all clean and green. Mergine. Thanks @rraustad

@mjwitte mjwitte merged commit ef36322 into develop May 23, 2024
15 checks passed
@mjwitte mjwitte deleted the 10478-poor-HW-supp-heat-control branch May 23, 2024 12:47
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.

UnitarySystem does not control properly when using a water heating coil as a supplemental heating coil
8 participants