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

Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Code Not Hit #7286

Merged

Conversation

yzhou601
Copy link
Contributor

@yzhou601 yzhou601 commented May 1, 2019

Pull request overview

The source side flow set by calling function PlantMassFlowRatesFunc didn't actually work for source side flow control mode: IndirectHeatAlternateSetpoint for indirect water heater system and tankless coils. Relevant question on Unmet Hour: Click Here
The issue and CR9176 changes are made under condition of MaybeRequestingFlow which is not stepped at final iteration in every time step.
So these codes are added to condition ThrottlingFlow to fix this problem.

Work Checklist

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)
  • At least one of the following appropriate labels must be added to this PR to be consumed into the changelog:
    • Defect: This pull request repairs a github defect issue. The github issue should be referenced in the PR description
    • Refactoring: This pull request includes code changes that don't change the functionality of the program, just perform refactoring
    • NewFeature: This pull request includes code to add a new feature to EnergyPlus
    • Performance: This pull request includes code changes that are directed at improving the runtime performance of EnergyPlus
    • DoNoPublish: This pull request includes changes that shouldn't be included in the changelog

Review Checklist

This will not be exhaustively relevant to every PR.

  • Functional code review (it has to work!)
  • If defect, results of running current develop vs this branch should exhibit the fix
  • CI status: all green or justified
  • Performance: CI Linux results include performance check
  • Unit Test(s)
  • C++ checks:
    • Argument types
    • If any virtual classes, ensure virtual destructor included, other things
  • IDD changes:
    • Verify naming conventions and styles, memos and notes and defaults
    • Open windows IDF Editor with modified IDD to check for errors
    • If transition, add to input rules file for interfaces
    • If transition, add transition source
    • If transition, update idfs
  • If new idf included, locally check the err file and other outputs
  • Required documentation updates?
  • ExpandObjects changes?
  • If output changes, including tabular output structure, add to output rules file for interfaces

@yzhou601 yzhou601 added the Defect Includes code to repair a defect in EnergyPlus label May 1, 2019
@yzhou601 yzhou601 self-assigned this May 1, 2019
@yzhou601 yzhou601 marked this pull request as ready for review May 6, 2019 18:54
@yzhou601 yzhou601 requested a review from Myoldmopar May 6, 2019 18:56
@yzhou601 yzhou601 changed the title Water Heater Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not Working Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not Working May 15, 2019
@yzhou601 yzhou601 changed the title Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not Working Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not Activated May 15, 2019
@yzhou601 yzhou601 changed the title Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not Activated Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not hit May 15, 2019
@yzhou601 yzhou601 changed the title Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Not hit Tank Source Side Flow Control Mode IndirectHeatAlternateSetpoint Code Not Hit May 15, 2019
@yzhou601
Copy link
Contributor Author

This bug fix issue seems not have been covered in tests without any CI test fail. So it's necessary to show my local test results for indirect water heater system models (no backup water heater, 55C alternate setpoint schedule, 52.667C WH Setpoint, 1C deadband).

I expected the source side mass flow rate to be over 0 for time points when tank temperature is below 55C-1C.

Run in Develop

IndirectHeatAlternateSetpoint

image (4)

IndirectHeatPrimarySetpoint

image (6)

Run in this branch

IndirectHeatAlternateSetpoint

image (5)

IndirectHeatPrimarySetpoint

image (7)

It shows more insights of this bug, the alternate option is not really working.

@yzhou601 yzhou601 requested a review from mjwitte June 21, 2019 18:27
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 functional changes here look good, but I'd like to see some improvements made before this gets merged. Take a look at my comments and let me know what you think.

src/EnergyPlus/WaterThermalTanks.cc Outdated Show resolved Hide resolved
src/EnergyPlus/WaterThermalTanks.cc Outdated Show resolved Hide resolved
src/EnergyPlus/WaterThermalTanks.cc Outdated Show resolved Hide resolved
src/EnergyPlus/WaterThermalTanks.cc Outdated Show resolved Hide resolved
tst/EnergyPlus/unit/WaterThermalTanks.unit.cc Outdated Show resolved Hide resolved
src/EnergyPlus/WaterThermalTanks.cc Outdated Show resolved Hide resolved
@yzhou601 yzhou601 requested a review from Myoldmopar July 18, 2019 22:35
@mjwitte mjwitte added this to the EnergyPlus 9.2.0 milestone Aug 5, 2019
@yzhou601
Copy link
Contributor Author

yzhou601 commented Aug 21, 2019

@Myoldmopar Do you know why these commits that happened in develop branch all appeared in this PR once I pulled develop into this branch?
(seemed to be normal again.)

@Myoldmopar
Copy link
Member

Yeah I don't know what happened there. But your develop branch is 8 commits ahead of the NREL/EnergyPlus develop branch. So that's potentially problematic, but it seems not with the current issue.

@yzhou601
Copy link
Contributor Author

Yeah I don't know what happened there. But your develop branch is 8 commits ahead of the NREL/EnergyPlus develop branch. So that's potentially problematic, but it seems not with the current issue.

Yeah, these 8 commits are all pulling the latest changes from NREL/EnergyPlus/develop, might be fine?

@Myoldmopar
Copy link
Member

No, your develop branch should never be ahead of the NREL develop branch. Pulling in the latest changes from NREL develop should cause a git fast-forward, never a merge, so it should never be ahead. Something went wrong. But again, I don't think it caused an issue here, just something you need to get addressed before it accidentally does.

@mjwitte
Copy link
Contributor

mjwitte commented Aug 28, 2019

@Myoldmopar Um, there hasn't been a commit to this branch for 6 or 7 days, yet CI keeps making the rounds on this one. Working on it again now.

@Myoldmopar
Copy link
Member

Yeah, CI has been having a bit of trouble with some external PRs lately. Nothing serious, just wastes some cycles running extra commits. I'm currently unclear as to the reason, but will dig into it soon after the release, if not before.

@@ -1992,7 +1992,7 @@ TEST_F(EnergyPlusFixture, StratifiedTankCalc)
for (int i = 0; i < Tank.Nodes; ++i) {
NodeTemps[i] = Tank.Node[i].Temp;
}

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure what editor you are using to write C++, but it shouldn't be leaving these trailing whitespaces in the files. In most editors there is an option to clean any trailing whitespace when you save a file, I'd look for that option. I'm not going to hold up this PR just for that though.

@Myoldmopar
Copy link
Member

Code changes look much better now. I'm testing locally.

@Myoldmopar
Copy link
Member

Merged up with develop, unit test suite passes, and ran a sampling of regression files and got no diffs. I'm merging this in.

@Myoldmopar Myoldmopar merged commit 3f707fd into NREL:develop Aug 30, 2019
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.

8 participants