irena-flextool / flextool

IRENA FlexTool is an energy and power systems model for understanding the role of variable power generation in future energy systems.
https://www.irena.org/energytransition/Energy-System-Models-and-Data/IRENA-FlexTool
Other
21 stars 5 forks source link

Improve flow time series outputs #117

Closed jkiviluo closed 7 months ago

jkiviluo commented 9 months ago

At the moment, FlexTool outputs all flows in the model without reasonable way to distinguish between categorically different flows. E.g. coal power plant has a flow from the coal_market and a flow to the electricity node. Both of these will be plotted, unless the user manually chooses only one of them in the plotting (typically the flow to the electricity node is the interesting one).

To mitigate this, we should include group dimension in all flow outputs.

First, a new parameter for groups: output_node_flows. It's meant to be used with group__node (and not with group__unit__node). Using group__node results in far less entity relations to indicate what flows are to be in the same group. If it's set to true, then all unit flows in and out of the nodes in that group will get the group name as a further dimension in unit__outputNode__period__t.csv and unit__inputNode__period__t.csv. (Maybe also the ones without t - let's see bit later how that would feel.)

Since creating a group is up-to the user, we will make things bit more convenient by putting all flows without a group into a default group (that could be called unnamed_group).

If some node is in two or more groups with the output_node_flows flag set to true, we could give a warning, but let it happen. At first, no warning required - let's see how it feels.

Let's do this first without connection flows. A later step will be to add all imports from connections outside of the selected nodes as 'imports' and same with export. This will require some calculations in flexModel3.mod to exclude all connections between nodes in the same group while counting any losses in those group internal connections as 'losses'.

Once the group dimension is there, we can use it to make better plots - mainly to use the group to create separate subplots for the flows in the nodes of each group. E.g. to show only stuff that relates to electricity nodes.

There could also be a model level parameter to choose whether to create the unnamed_group. If it's not there, then flows of the nodes that are not in any group with output_node_flows set to true will not be plotted (and it should save on output time).

jkiviluo commented 7 months ago

The first step (units) has been taken with c1e53d4b20c53801646d6636601ebfde415c53b7

jkiviluo commented 7 months ago

There is no unnamed_group, but otherwise this has been implemented.