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

Add all-electric plant model to DHC package #3263

Merged
merged 157 commits into from
Aug 23, 2023
Merged

Conversation

AntoineGautier
Copy link
Contributor

@AntoineGautier AntoineGautier commented Feb 24, 2023

This closes #3188.

Two models fail to compile with OMC, see .conf.yml:

- model_name: Buildings.Experimental.DHC.Plants.Combined.Controls.BaseClasses.Validation.StagingPlant
  openmodelica:
    comment: Internal error BackendDAETransform.analyseStrongComponentBlock failed (Purely discrete algebraic loops cannot be solved by iterative processes. Try to break them open using the delay() operator.)
    translate: false
- model_name: Buildings.Experimental.DHC.Plants.Combined.Validation.AllElectricCWStorage
  openmodelica:
    comment: "Internal error NFCeval.evalBinaryDiv failed to evaluate \u20181.0 / pla.chiHea.COPCasCoo_nominal\u2018"
    translate: false

⚠️ This PR also introduces some changes in the graphical annotations of the following interface classes: PartialETS, PartialBuilding, PartialBuildingWithPartialETS, PartialPlant. The color convention for fluid streams previously used was confusing: for instance CHW return was represented in red color and CHW supply in blue color. The change consists in representing both the CHW return and CHW supply in blue color. In addition, the diagram layer for PartialETS is expanded as the current model showed a need for more real estate.

TODO: Refactor MultipleCommands with O conectors for On AND y1Mod
- Rounding at 4 is not enough: use 10 digits for all coefs.
- nChiCoo assumed equal to nChiHea
@dhblum
Copy link
Contributor

dhblum commented Jul 19, 2023

Some documentation and thoughts on why unit tests are failing at 9a94dce. @mwetter I appreciate any thoughts you have when you get a chance:

  • Job .35 is failing because of a message that the command returned non-zero exit status 137. This makes me think the process is running out of memory. Running $ python ../bin/runUnitTests.py --batch --single-package "Buildings.Experimental.DHC.Examples.Combined" --tool openmodelica --skip-verification locally passes ok, but uses > 7 GB of memory + up to 1 GB of swap. Forcing the tests to use only 1 processor (adding -n 1) uses only 4.5 GB memory, though takes longer to complete both tests. I'm testing whether forcing use of 1 processor helps in 750abf6, but this is intrusive because it requires use of a new argument in the TEST_ARG etc. to specify number of processors to use. Note also I moved the test to the top of the list just so I don't have to wait too long to see if it works. But in any case it seems its in a queue due to other PRs/commits in the library. UPDATE: Looks like this worked, see this passing Job.

  • Job .33 is failing due to RuntimeError: Wrong invocation, generated 0 unit tests.. The job only has 1 example model (split from previous implementation in 9a94dce to avoid timeout), but that model is on the exclude list for translation for Optimica so I wonder if it's trying to run a test when actually none are to be run, and that's an error not handled in buildingspy? The output does print Using 0 of 2 processors to run unit tests for optimica., which is maybe a no-no right now. UPDATE: I'll use the above implementation to re-combine the unit tests and make these pass too. But will need to confirm if forcing 1 processor is the correct solution.

  • Also a reminder to myself due to the merge of master the Experimental.DHC.Examples.Steam package needs to be added to the .travis.yml. since this PR has split up Experimental tests. UPDATE: Done in ddf793a.

@dhblum
Copy link
Contributor

dhblum commented Jul 21, 2023

@mwetter In summary, tests are now passing. But this includes a new modifier added in 750abf6 to enable tests to run one processor at a time in travis to not cause memory timeout. Your thoughts appreciated, maybe a better way to do it. Otherwise, this is ready to go I think.

@dhblum
Copy link
Contributor

dhblum commented Jul 27, 2023

Unit tests are failing for:

*** Error: Translation of Buildings.Obsolete.Examples.VAVReheat.Validation.Guideline36SteadyState failed: 'TimeoutExpired: Command '['omc', 'Buildings.Obsolete.Examples.VAVReheat.Validation.Guideline36SteadyState_translate.mos']' timed out after 300 seconds'. Directory is '/tmp/tmp-Buildings-0-511guoxa'.
Execution time = 2329.967 s
make: *** [Makefile:167: test-openmodelica] Error 1
The command "(cd Buildings/Resources/Scripts/travis && travis_wait 90 $TEST_ARG)" exited with 2.

@mwetter This is unrelated to any changes in the PR as far as I can tell.

@mwetter
Copy link
Member

mwetter commented Jul 27, 2023

@dhblum Can you improve the time out in conf.yml to 600?

@dhblum
Copy link
Contributor

dhblum commented Jul 27, 2023

Thanks @mwetter. The time_out parameter in conf.yml is new to me, but I think I did it right here: e8ba5cc.

@dhblum
Copy link
Contributor

dhblum commented Jul 27, 2023

Huzzah, unit tests pass.

@dhblum
Copy link
Contributor

dhblum commented Aug 1, 2023

@mwetter FYI despite my latest commits to address the hysteresis, this PR is not ready to merge anymore. I'm doing some testing to simulate the plant for a fully year and it's not finishing. Need to look into this again.

@dhblum
Copy link
Contributor

dhblum commented Aug 22, 2023

@mwetter This morning I tested again the example model which was failing the full simulation before, and after merging latest master, it is now working and simulated the full year ok with dassl and tol 10e-6. I'm not sure what happened before, maybe it was something with my setup at the time. I think I addressed all the hysteresis issues and your comments, so except for confirming unit test pass, let me know if you think there's anything else to be done. I don't have anything in mind. @AntoineGautier might have a review at it as he is back.

@mwetter mwetter merged commit 675801b into master Aug 23, 2023
2 checks passed
@mwetter mwetter deleted the issue3188_allElectricPlant branch August 23, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementation of an all-electric plant model
5 participants