Locations and energy carriers in oemof

We use oemof to model energy systems with several different energy carriers and nodes at different locations. We want to assign the location and energy carrier property to the single nodes to group and filter them for better processing and evaluation of results.

For the location we plan to realise this by adding location attributes to the single nodes (similar to the label attribute, but several nodes can have the same label attribute). Our idea is to implement this property in the node-class as any solph component inherits from this class. There might occur issues for grid elements because they require two location attributes.

For the energy carrier attribute we plan to add these properties to the inflow/outflow arguments. In a first step we plan to add this attribute in the bus class. This also allows to check if components of the same energy carrier are connected. Busses, sources, sinks, storages, network elements are only allowed to have the same energy carrier attribute for inflows/outflows. Transformers will have a unique energy carrier attribute for each inflow/outflow.

Before we start with the implementation, we want to know what you think of our approach? Or are there already developments in this field we can use? Are these feature for others of interest as well?

It is possible to tag your nodes using namedtuples as label. It is described in an example in the oemof_examples repository (basic_example_tuple_as_label.py). In this example only tag1, tag2 is used but you can name your tags however you want (region, fuel, category…). Afterwards you can filter the results using python’s list comprehensions.

nodes = [x[0] for x in results if x[0].label.region == 'germany' and x[1] is None]

This will give you all nodes in the region ‘germany’.

You can use the label to check for wrong connections. If you have the field ‘carrier’ defined in the named tuple you can do something like this (with a complete energy system).

wrong_connections = [
    x for x in energysystems.flows() if x[0].label.carrier != x[1].label.carrier]

If the list is empty everything is fine.

Thank you for your answer.

Text and images licensed under CC BY 4.0Data licensed under CC0 1.0Code licensed under MITSite terms of serviceOpenmod mailing list.