oemof / DHNx

District heating system optimisation and simulation models
MIT License
27 stars 12 forks source link

Workaround consumer to consumer nodes #126

Closed ddceruti closed 1 year ago

ddceruti commented 1 year ago

Hi, I am looking to test DHNx. So far I have had no troubles generating the input files for it. However, in my problem formulation consumer to consumer connections are admissible. Do you have a workaround for it?

If not, I thought of the following workaround to compare it with my current approach, which accepts consumer to consumer connections: add one dummy fork everywhere where there are two consumers and then add a new pipe without fixed costs, zero variable costs and very low length between both. The problem is that both approaches are not directly comparable since the topologies differ due to these dummy variables.

The error can be seen below and the code is working as expected, since the input file indeed has two consumers connected to eachother directly: introduction_cons-to-cons.zip

File "[...]\Miniconda3\envs\dhnx\Lib\site-packages\dhnx\optimization\optimization_models.py", line 150, in check_input
    raise ValueError(
ValueError: Pipe id 19 goes from consumer to consumer. This is not allowed!

I have added a reproducible example with an adapted case of the introduction example.

Thank you in advance!

ddceruti commented 1 year ago

introduction_cons-to-cons.zip

ddceruti commented 1 year ago

I eneded up implementing my workaround: I moved the consumers a short distance and added pipes between the original consumers and their new locations.

joroeder commented 1 year ago

I eneded up implementing my workaround: I moved the consumers a short distance and added pipes between the original consumers and their new locations.

Great! This would also have been my suggestion, but I had not time answering so far.