Direct component-to-component connections without a Bus in between

Hello oemof community,

I have a question regarding the general modeling philosophy of oemof.solph. Is it intended that components are always connected via a Bus, or is a direct connection between two components without a Bus in between also valid and supported?

As a more realistic example, consider this chain: a PV Source feeds a DC/DCConverter1, which feeds a DC Bus. A battery Storage and a DC/AC Converter2 are both connected to that Bus, and Converter2 feeds a grid Sink. My reasoning is that the Bus earns its place where Converter1, Storage, and Converter2 actually meet and need balancing, but the edges Source to Converter1 and Converter2 to Sink are exclusive 1:1 connections with nothing to balance, so I would connect those directly without a Bus.

I have already confirmed that direct connections work technically. My question is really about whether one should do this rather than whether it is possible. Is placing a Bus only where multiple flows actually converge a sound approach, or am I missing a reason a Bus should sit on every connection regardless, even the exclusive 1:1 ones?

Thanks in advance!

Hi @Marco,

thanks for your question. Indeed, it is possible to skip Buses that have just one input and one output. We teach to create Buses first, because there are sanity checks on initialisation that might not trigger when you directly connect components. Also, having a Bus provides some flexibility if you decide to add something later. This includes, optimising (or setting) the nominal_capacity for e.g. PV panels and inverter separately – in that case you will need two Flows anyway. Performance-wise, pre-solvers should have no problem with simplifying it again. Lastly, there are some people who generally do bipartite graph graphs (partly because it was suggested in the first oemof paper from 12 years ago). Your code might be hard to read for those.

Having said that, I would currently not recommend dropping Buses to beginners. However, when you know what you are doing, just go ahead. I would be surprised if something fails because of this. (Please provide a bug report in the unlikely event that you encounter real problems. I really think it should work without any problems.)

Regards,
Patrik

Edit: Fix wording. It should be bipartite graph.

I guess that bi‑parted graph should read bipartite graph? Best, R