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

Fixes approach definition for Std 229 fluid cooler reports and adds cooling tower implementation #10236

Merged
merged 4 commits into from Nov 21, 2023

Conversation

jcyuan2020
Copy link
Contributor

Pull request overview

  • Fixes an issue in Std 229 report that the approach of a cooling tower was defined incorrectly;
  • Adds Std 229 reports to cooling towers as well, which are similar to fluid cooler implementations;

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

@jcyuan2020 jcyuan2020 added the Defect Includes code to repair a defect in EnergyPlus label Sep 20, 2023
@Myoldmopar Myoldmopar added this to the EnergyPlus 24.1 milestone Sep 20, 2023
@nrel-bot-2c
Copy link

@jcyuan2020 @Myoldmopar it has been 28 days since this pull request was last updated.

@jcyuan2020 jcyuan2020 marked this pull request as ready for review October 19, 2023 20:51
@@ -2002,7 +2002,7 @@ void FluidCoolerspecs::update(EnergyPlusData &state)

// Check if OutletWaterTemp is below the minimum condenser loop temp and warn user
Real64 LoopMinTemp = state.dataPlnt->PlantLoop(this->plantLoc.loopNum).MinTemp;
if (this->OutletWaterTemp < LoopMinTemp && this->WaterMassFlowRate > 0.0) {
if (this->OutletWaterTemp<LoopMinTemp &&this->WaterMassFlowRate> 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.

Clang format comment: Reverse the order or create an intermediate variable

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just put the code back where it was and don't let VS reformat after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @mjwitte and @Myoldmopar . The clang formatting worked ok after putting brackets to the two conditions--not bad given the little bit clarity added with the cost of a little bit redundancy.

OutputReportPredefined::PreDefTableEntry(state,
state.dataOutRptPredefined->pdchCTFCCondLoopName,
this->Name,
this->plantLoc.loopNum > 0 ? state.dataPlnt->PlantLoop(this->plantLoc.loopNum).Name : "N/A");
Copy link
Contributor

Choose a reason for hiding this comment

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

This protection is fine, but is it necessary? When would a fluid cooler or tower not be connected to a plant loop? That seems possible only as an error condition. Or should "N/A" be "Not found"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is a very generic protection---actually I remember I encountered many crashes in CI test files (or unit tests which might not be complete cases) with similar "plantloop cannot find smoothing and then crash" cases (not necessarily this type of cond loop for fluid coolers though). I cannot speak for sure in this specific scenario if this is going to be always good without the check. For the text, whatever suitable would be fine---I think for the other similar scenarios "N/A" was used---or maybe I can change the other places to "Not found".

@Myoldmopar Myoldmopar self-assigned this Nov 8, 2023
@Myoldmopar
Copy link
Member

I've got no issue here. The extra protection is only happening early in the simulation, not all the time, so it shouldn't have an impact. I will just do a quick build/test and get this in.

@Myoldmopar
Copy link
Member

It's all fine here, dropping this one in now. Thanks @jcyuan2020. @mjwitte if you would like some adjustments to the protections added, we can do it in a follow-up.

@Myoldmopar Myoldmopar merged commit 321d7d1 into NREL:develop Nov 21, 2023
9 checks passed
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.

None yet

8 participants