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

Unitary system now reports warning when cycling supply fan schedule is used with setpoint control type #8323

Merged
merged 14 commits into from
Nov 2, 2020

Conversation

matthew-larson
Copy link
Contributor

@matthew-larson matthew-larson commented Sep 29, 2020

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

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

@matthew-larson matthew-larson added Defect Includes code to repair a defect in EnergyPlus NotIDDChange Code does not impact IDD (can be merged after IO freeze) labels Sep 29, 2020
@matthew-larson matthew-larson self-assigned this Sep 29, 2020
DataHVACGlobals::OnOffFanPartLoadFraction = 1.0;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Well, this works but now this same code is in 2 places, here and in initLoadBasedControl. Shouldn't these get moved to initUnitarySystems inside the FirstHVACIteration test (line 1084) so that both control types execute this, it's only done once per time step and there is only 1 copy of these lines of code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense, I'll make this adjustment once the CI finishes. Thanks

@matthew-larson matthew-larson marked this pull request as ready for review September 30, 2020 18:55
@matthew-larson
Copy link
Contributor Author

@rraustad I moved the fix to initUnitarySystems as recommended to eliminate the duplicated check. If you could make sure I got it in the right spot, it's ready for another review.

EXPECT_NEAR(DataLoopNode::Node(2).Temp, DataLoopNode::Node(2).TempSetPoint, 0.001);
// cooling coil air inlet node temp is greater than cooling coil air outlet node temp
EXPECT_GT(DataLoopNode::Node(3).Temp, DataLoopNode::Node(2).Temp);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Shoot, this was ready to merge. Line feed needed at end of unit test.

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

Revision to code location so load based and set point based control use same logic. This looks good. Unit test still needs mod to last line.

@@ -991,6 +991,15 @@ namespace UnitarySystems {
DataLoopNode::Node(this->m_HeatRecoveryInletNodeNum).MassFlowRate = mdotHR;
}

if (this->m_FanOpModeSchedPtr > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Well, I actually suggested this be moved to line 1006, or better yet 1010, below since it needs only be done once per time step. Might as well make that change while you correct the unit test.

@rraustad
Copy link
Contributor

Perfect, I think I'll run the defect file before merging this. Also, check off the pull request author items in the pull request description. Think about the PR title from the users perspective.

@matthew-larson matthew-larson changed the title Single speed cooling coil electric power for unitary system with cycling supply fan Fix enabling of single speed cooling coil for unitary system with cycling supply fan and setpoint control type Oct 15, 2020
@rraustad
Copy link
Contributor

Thanks @matthew-larson. You are done with this one unless something else unexpectedly pops up. I'll get to testing the defect file when I can.

@matthew-larson
Copy link
Contributor Author

Sounds good, thanks for your help and walking me through the code, it was very valuable. I'll keep tabs on this to make sure everything comes back clean.

@matthew-larson
Copy link
Contributor Author

@rraustad I updated the pull request for the new fix of making sure the correct error is caught when a cycling fan is used with Setpoint control. I also updated the unit test to check for the error. Let me know if you have any additional comments on this.

DataZoneEquipment::ZoneEquipInputsFilled = true; // indicate zone data is available
thisSys->getUnitarySystemInputData(state, compName, zoneEquipment, 0, ErrorsFound); // get UnitarySystem input from object above
std::string const error_string = delimited_string({
" ** Severe ** AirLoopHVAC:UnitarySystem = UNITARY SYSTEM MODEL\n ** ~~~ ** For FAN:ONOFF = SUPPLY FAN 1\n ** ~~~ ** Fan operating mode must be continuous (fan operating mode schedule values > 0).\n ** ~~~ ** Error found in Supply Air Fan Operating Mode Schedule Name ALWAYSZERO\n ** ~~~ ** ...schedule values must be (>0., <=1.)"
Copy link
Contributor

Choose a reason for hiding this comment

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

@matthew-larson are you clang formatting as you go? It seems this line would have wrapped. Not sure if it's worth another push if everything else is OK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have clang formatting ON in CLion. I can double check that it's working right.

@rraustad
Copy link
Contributor

rraustad commented Nov 2, 2020

This seems correct now.

The DOAS unit uses setpoint control and FanOpMode schedule value = 0

** Severe  ** AirLoopHVAC:UnitarySystem = DOAS UNITARY
**   ~~~   ** For FAN:ONOFF = DOAS UNITARY SUPPLY FAN
**   ~~~   ** Fan operating mode must be continuous (fan operating mode schedule values > 0).
**   ~~~   ** Error found in Supply Air Fan Operating Mode Schedule Name DOAS UNITARY FAN MODE SCHEDULE
**   ~~~   ** ...schedule values must be (>0., <=1.)
**  Fatal  ** getUnitarySystemInputData: previous errors cause termination. Check inputs

If value for FanOpMode schedule is changed to 1 or that input is left blank then there are no fan op mode schedule warnings and the coil turns on:

image

The check of the FanOpMode schedule for both set point control and load or SZVAV control is not necessary so I'm glad that code was not ultimately moved as discussed. For set point control, we know the fan op mode must be constant so only checking once that the schedule value is > 0 is the only thing needed.

@rraustad
Copy link
Contributor

rraustad commented Nov 2, 2020

Running unit tests locally multiple times to get a clean pass. Keeps stalling at LoggingSubStep4stepsPerHour. That unit test should not be related to this change.

@mitchute
Copy link
Collaborator

mitchute commented Nov 2, 2020

Keeps stalling at LoggingSubStep4stepsPerHour

@rraustad, FWIW, that test usually takes a few minutes to complete on my machine.

@rraustad
Copy link
Contributor

rraustad commented Nov 2, 2020

Yeah, that unit test finally finished after 15 minutes, using a release build.

image

Copy link
Contributor

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

Simple changes made to catch issues with fan operating mode schedule when set point control is used.

@rraustad rraustad changed the title Fix enabling of single speed cooling coil for unitary system with cycling supply fan and setpoint control type Unitary system now reports warning when cycling supply fan schedule is used with setpoint control type Nov 2, 2020
@rraustad rraustad merged commit ddd1a11 into NREL:develop Nov 2, 2020
@matthew-larson matthew-larson deleted the unitary-clgcoil-cycling branch November 2, 2020 18:53
@mitchute
Copy link
Collaborator

mitchute commented Nov 2, 2020

15 minutes... 😮

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 NotIDDChange Code does not impact IDD (can be merged after IO freeze)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Near zero single speed cooling coil electric power for unitary system with cycling supply fan
8 participants