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/no bidirectional consumer connection #63

Merged
merged 9 commits into from
Jan 15, 2021

Conversation

joroeder
Copy link
Member

Bug: If the setting bidirectional_pipes=True is selected, also the connecting line to the building was created as bidirectional.

This only matters if a source or a storage is added at the consumers.

This PR fixes the issue.

@joroeder joroeder requested a review from jnnr November 16, 2020 10:03
@joroeder joroeder added the bug Something isn't working label Nov 16, 2020
Copy link
Member

@jnnr jnnr left a comment

Choose a reason for hiding this comment

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

I tested the 3 examples and they run. I did not test if the bug was solved as I am not too deep into the optmization model and do not know what to look for. If this solves your problem, I am fine with it.

However, the different handling for different cases is now somehow hard-coded within the if-else statements. I do not understand the code that much that I could come up with an idea, but this may be worth thinking.

To make the code more readable and maintainable, it would certainly help to refactor it in a way that avoids the nested if else statements in optimization_dhs_nodes.py

dhnx/optimization_add_components.py Outdated Show resolved Hide resolved
@joroeder
Copy link
Member Author

joroeder commented Dec 16, 2020

Thank you for reviewing!

However, the different handling for different cases is now somehow hard-coded within the if-else statements. I do not understand the code that much that I could come up with an idea, but this may be worth thinking.

The reason is that it should be possible to have the option of using bidirectional pipelines, which means a bidirectional flow in solph, or not. If not, two pipelines in each direction are created. Maybe, this if else statment is not needed, because in solph a bidirecitonal flow directly sets the min attribute to -1. This would be a new issue for further improvment (#70)

To make the code more readable and maintainable, it would certainly help to refactor it in a way that avoids the nested if else statements in optimization_dhs_nodes.py

Yes, thats a good idea. I refactored the q.

@joroeder joroeder merged commit d17df4c into dev Jan 15, 2021
@joroeder joroeder deleted the Fix/No_bidirectional_consumer_connection branch July 9, 2021 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants