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

Fix issue 6998 Fuel Cell Zero Cp causing div-by-zero and repeated root solver errors #8624

Merged
merged 7 commits into from
Mar 22, 2021

Conversation

jcyuan2020
Copy link
Contributor

@jcyuan2020 jcyuan2020 commented Mar 16, 2021

Pull request overview

  • Fixes Fuel Cell Cp is zero when using "LiquidGeneric" #6998
  • Fixed the Zero-Cp problem when using LiquidGeneric fuel type for Fuel Cells, which could cause repeated root solver warning errors. What's worse for the problem is that, it could cause divide-by-zero faults but could still sneakily allow the program to run and get meaningless results.
  • Also suppressed the recurring warning/error messages to show only the first instance and then summarize the following instances into the recurring warnings/errors report.
  • Added a minor fix for Issue A minor data type consistency issue #8600

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 force-pushed the I6998_Fuel_Cell_Zero_Cp branch 2 times, most recently from 3050fd2 to 7d5f16f Compare March 16, 2021 19:46
@mjwitte mjwitte added this to the EnergyPlus 9.5.0 milestone Mar 16, 2021
@mjwitte mjwitte added the Defect Includes code to repair a defect in EnergyPlus label Mar 17, 2021
@jcyuan2020 jcyuan2020 force-pushed the I6998_Fuel_Cell_Zero_Cp branch 4 times, most recently from 3b8ab04 to 5398912 Compare March 19, 2021 00:05
@Myoldmopar
Copy link
Member

When I take the 9.4 defect file from devsupport and transition it up to latest code, I get the huge error file in develop, as expected. But with this branch (with develop pulled in), I get a NaN:

Program Version,EnergyPlus, Version 9.5.0-aa2716547d, YMD=2021.03.20 21:18,
   ************* Beginning Zone Sizing Calculations
   ** Warning ** CalcFuelCellGeneratorModel: Root Solver problem, flag = -1, check accuracy and iterations, did not converge
   ** Severe  ** DualSetPointWithDeadBand: Unanticipated combination of heating and cooling loads - report to EnergyPlus Development Team
   **   ~~~   ** occurs in Zone=ZN_1_FLR_1_SEC_1 During Warmup & Sizing, Environment=NEWARK ANN HTG 99.6% CONDNS DB, at Simulation time=01/21 00:00 - 00:10
   **   ~~~   ** LoadToHeatingSetPoint=NAN, LoadToCoolingSetPoint=NAN
   **   ~~~   ** Zone Heating Set-point=21.00
   **   ~~~   ** Zone Cooling Set-point=33.00
   **   ~~~   ** Zone TempDepZnLd=NAN
   **   ~~~   ** Zone TempIndZnLd=NAN
   **   ~~~   ** Zone ThermostatSetPoint=27.03
   **  Fatal  ** Program terminates due to above conditions.
   ...Summary of Errors that led to program termination:
   ..... Reference severe error count=1

Can someone confirm?

@jcyuan2020
Copy link
Contributor Author

When I take the 9.4 defect file from devsupport and transition it up to latest code, I get the huge error file in develop, as expected. But with this branch (with develop pulled in), I get a NaN:

Can someone confirm?

You need use a slightly changed defect file---there original had a few missing field. I will have this sent in in some way.

@Myoldmopar
Copy link
Member

Thank you @jcyuan2020 , but I'm still not quite there. When I download your modified file, in develop the file passes just fine. And in this branch the error file looks similar. I'm building a release build but even the numerics are the same in the error file. Can you confirm what I should be verifying as the reviewer? Or if there is some configuration I'm missing? Thanks!

@jcyuan2020
Copy link
Contributor Author

jcyuan2020 commented Mar 21, 2021

@Myoldmopar It is a little bit strange why the release version would let the simulation go so far with the div-by-zero error---the reason might partially be that the release version does not check the div-by-zero unless some other (severe) warnings or problems are triggered?
I tried with the most updates versions of both branches (most recent current PR branch with most recent develop branch (7ae5567) pulled in) In the debug mode, the develop branch will indeed encounter div-by-zero caused by zero Cp and then would not go any further. The current PR branch will set to handle the the zero Cp case and will allow the simulation to continue.

@Myoldmopar
Copy link
Member

OK, I'm starting to believe that it's just a thing on my machine. I trust that it is behaving well for you, and the changes are fine. This is going in. Thanks for bearing with me @jcyuan2020

@Myoldmopar Myoldmopar merged commit 58beb66 into NREL:develop Mar 22, 2021
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.

Fuel Cell Cp is zero when using "LiquidGeneric"
8 participants