-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature/stratified therm storage #711
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good so far - but is this working now? Can you post a description of the current status?
Also, please update the RTD for this functionality. Meaning:
- Add
relative_thermal_losses
andabsolute_thermal_losses
into this csv so that it is explained here. - Add a sub-section on how to simulate a thermal energy storage with an advanced level of detail here. Also mention possible pre-processing functions that can be used from oemof.thermal. If possible, also describe how normal storages would be modelled ;)
- Add the parameters as optional parameters below this section head
- Probably you need to adapt some pytest of
D1
(seetests/test_D1_*py
) - Post the simulation results (pdf) of a scenario calculated with the dev branch and one with your branch and the new storage (but rel_losses/abs_losses = 0) to this PR, so that I can check online if strange things happen.
- Create a new benchmark test in (this folder)[https://github.com/rl-institut/multi-vector-simulator/tree/dev/tests/benchmark_test_inputs] (
tests/benchmark_tests_inputs
) for your feature by copying one of the other tests, and writing the pytest (in this file)[https://github.com/rl-institut/multi-vector-simulator/blob/dev/tests/test_benchmark_scenarios.py]. We can discuss possible assertions together, which would validate that your asset works as planned. - Consider whether you need additonal KPI for the storage now, eg. to measure the thermal losses of your asset.
Co-authored-by: smartie2076 <[email protected]>
I also need to adapt these tests:
|
I implemented the two parameters in the mvs but have the following problems with it, when testing them with the simulation in pvcompare on this branch:
Also I adapted the test so they would run but I'm not sure if they make much sense. I set the losses in the benchmark test Surely there need to be a separate benchmark test as soon as the parameters work as intended. 🙃 @smartie2076 Could you help me solving the two above mentioned problems? Please tell me if you need further information! |
Hi @MaGering! Ah, that is a pity. I already have an idea what's happening, but I need more info. It would be great if you could attach the complete log file (it tells me until when everything is okay). Please use the logging depth DEBUG then. Can you copy the five warnings into the post as text, so that I can quote them individually? |
Thanks for your quick reply! Here's the mvs_logfile.log Here are the warnings:
|
Okay, looking good otherwise. The simulation does not terminate as far as I can see though? Well, no wonder, because actually I saw that there is one thing missing for what you what to do in our code. I did not consider that before. So, these warnings tell you that you did not define
What we actually should do is require it for
Usually, the parameters that are required are mentioned here, but when you check this out, you will actually notice that we do not have required parameters for Now, the MVS is confused about your inputs! Sadly for that file we do not have the neat parameter check as for the other files, but the checks are hidden somewhere in
|
Ah, yeah, it is defined where I thought and you could add the new parameters here. Then, those are required parameters, though! |
Thank you for looking at this!
I'm afraid I have to rule out the first option for now due to time constraints. That's why I would stick to the procedure described in your second option and do the changes on a new branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, may already be adressed in #718
Stratified thermal storage | ||
########################## | ||
|
||
In order to model a stratified thermal energy storage the two parameters `fixed_losses_relative` and `fixed_losses_absolute` are passed through `storage_xx.csv`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to model a stratified thermal energy storage the two parameters `fixed_losses_relative` and `fixed_losses_absolute` are passed through `storage_xx.csv`. | |
In order to model a stratified thermal energy storage the two parameters `fixed_losses_relative` and `fixed_losses_absolute` are passed to `storage_xx.csv`. |
You do not have to have linebreaks for each sentence, but you can.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add something that explicitly states that the parameters are not required for storage_*.csv
.
|
||
Please see the `oemof.thermal` `examples <https://github.com/oemof/oemof-thermal/tree/dev/examples/stratified_thermal_storage>`__ and the `documentation <https://oemof-thermal.readthedocs.io/en/latest/stratified_thermal_storage.html>`__ for further information. | ||
|
||
For an investment optimization the height of the storage should be left open in the precalculations and `installedCap` should be set to 0 or NaN. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For an investment optimization the height of the storage should be left open in the precalculations and `installedCap` should be set to 0 or NaN. | |
For an investment optimization the height of the storage should be left open in the precalculations and `installedCap` should be set to 0 or `NaN`. |
Can installedCap
be NaN
? It should always be a number, as far as I know. Please test this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
installedCap
beNaN
? It should always be a number, as far as I know. Please test this.
Actually I have. I was also wondering how this works, but it does. The background is, that I implemented precalculations in pvcompare, which calculate the oemof.thermal
parameter nominal_storage_capacity
(= mvs
parameter installedCap
= oemof.solph
parameter Investment(existing)
). If you want to do an investment optimization you leave the height open which leads to nominal_storage_capacity
= NaN in the precalculations. If you pass the height as a limiting parameter (no investment optimization) nominal_storage_capacity
is a fix number in the precalculations. In the precalculations the mvs
parameter installedCap
is overwritten with the corresponding value.
And this is why I documented it in this way. Does it make sense?
fixed_thermal_losses_relative,factor,0,, | ||
fixed_thermal_losses_absolute,kWh,0,, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope that we can keep fixed_thermal_losses_relative
and fixed_thermal_losses_absolute
optional parameters. If so, please remove the parameters from all other input files, and only leave one benchmark tests for your own feature.
Somehow I messed up this branch @smartie2076 :-( Can I do the following to fix that?
I've never forced a push but I can't find another way. Will all the comments from PR #718 stay either way? Can I do something else to go back to where it was? |
@mahendrark can you help @MaGering with this? Otherwise we will solve it in January. |
sure, I can take a look at it @MaGering can you tell me which commit would you like to go back to and do you want to keep the changes made after that commit.. If you can tell me that, I will force push and rebase the branch such that you wouldnt have any merge conflicts and you can take over from there |
Thank you very much @mahendrark! I would like to go back to commit 8a5e528 and also to erase the conversations which were merged from this PR #718. It concerns these conversations: #711 (review) The background is that I branched from feature/stratified_therm_storage (this branch) creating feature/stratified_therm_storage_A1 and made changes there, which were not supposed to get here. |
6998795
to
8a5e528
Compare
Hi @MaGering should I do anything with this PR, is it a backup or is it out-of-date and to be deleted? |
Fix Issue #667
With this PR it is possible to model the stratified thermal storage component, which has been developed in oemof.thermal, passing two further parameter
fixed_losses_relative
andfixed_losses_absolute
to the storage component.The following steps were realized, as well (if applies):
black . --exclude docs/
)EXECUTE_TESTS_ON=master pytest
)Please mark above checkboxes as following:
❌ Check not applicable to this PR
For more information on how to contribute check the CONTRIBUTING.md.