Network Graph for Topologies#
Motivation#
To use the optimizer, an AssetTopology is needed. The AssetTopology stores information about a Topology, incl. Station layouts, assets and their topological state. The creation of an AssetTopology is easy if an asset is directly connected to a busbar with no additional nodes and switches in between (e.g., the UCTE Format). In a closer-to-reality Node-Breaker Model like CGMES, assets can be connected to multiple busbars via switches and additional non-busbar-nodes. With this info we can create possible splits for the optimizer and directly translate the optimization results into switching actions on the actual grid. The network graph model maps all important elements to the AssetTopology logic.
Core Concepts#
The data classes for the Network Graph:
-
NetworkGraphDataThis class is used as a starting point. All information needed to map the elements is included in these dataframes. The graph's edges are divided into switches and branches, as the "open" state of the switch is central information to get the zero impedance connection (zero impedance connection = currently connected via closed switches).NodeSchema: Defines all the nodes.NODE_TYPES: "busbar" a true physical busbar you can touch (but probably shouldn't) "node" is a connection point between elements or fictive nodes where two TSO meet (border nodes)SwitchSchema: This is core information. If no switches are present, the mapping will do nothing.SWITCH_TYPES: "DISCONNECTOR" (Power Switch), "BREAKER" (Non Power Switch)BranchSchema: Optional. If only a substation is represented, a branch would be represented in theNodeAssetSchemaat the outer edge of the network.BRANCH_TYPESdepend on the framework you use.BRANCH_TYPES_POWSYBL: "LINE", "TWO_WINDING_TRANSFORMER", "PHASE_SHIFTER", "TWO_WINDING_TRANSFORMER_WITH_TAP_CHANGER", "THREE_WINDINGS_TRANSFORMER",BRANCH_TYPES_PANDAPOWER: "line", "trafo", "trafo3w", "dcline", "tcsc", "impedance"NodeAssetSchema: Optional. Mainly used to represent node assets like generators, loads, etc. It can also be used to represent border lines of the network (either of a substation or a line leaving the network).HelperBranchSchema: A concept mainly introduced to support the exact layout ofpowsybl.net.get_node_breaker_topology(substation_info.voltage_level_id). For example, aBusbarSectionin the powsybl NodeBreakerTopology is a dead-end node. The true connection hub is a helper node, where all switches are connected (again with a helper node in between).
-
BusbarConnectionInfoand **EdgeConnectionInfoThese data classes are initialized blank. The data gets filled step by step using therun_default_filter_strategy. Most of the data is used for the AssetTopology, and some for tracking dependencies between the filter process.
Workflow: From a Grid Model to the Asset Topology#
-
Extract the Grid or a Station into the NetworkGraphData Format:
-
Enrich NetworkGraphData with Generic Data:
- Add
filter_weightsto NetworkGraphData – preparation for the filter process. Sets weights based on the three DataFrames:
- Add
-
Generate the Graph: A
networkx.Graphis generated based on theNetworkGraphDataclass.BusbarConnectionInfo(node only) andEdgeConnectionInfo(edge only) are initialized for all elements.- Add a Substation ID if missing (pandapower has no substation logic, but CGMES import does).
-
Run
run_default_filter_strategy: Here the mapping logic is implemented. The order of these steps is important, as there are dependencies between the steps.set_switch_busbar_connection_infoSets a filter valuebusbar_weight. It is applied to all switches directly connected to a busbar and is used as an indicator during the shortest path calculation to indicate that a busbar has been found.-
set_bay_weightsThe mapping of bays is a core functionality of the network graph module. We want to know which switches belong to a bay of an Branch/node-asset (e.g. Generator or in a reduced grid could also be a branch). After the algorithm is done, thebay_idis used to identify bays, where thebay_idis set to the Branch/node-asset id that it belongs to.The search starts at an node-asset or branch. From there, the shortest path is calculated to all busbars with a cutoff limit. The weights used for the shortest path are
busbar_weightandbay_weight. The cutoff limit is chosen so thatbusbar_weightis encountered only once. Thebay_weight(default value set byfilter_weights) is high for branches that leave a station; hence the cutoff is always within a station. To find the branches, the "from" and "to" nodes are used separately. Finally, it sets thebay_id(needed to map the switches to an asset) and thebay_weight. -set_empty_bay_weightsAn empty bay is a collection of switches that have no asset connected at the end. This can happen e.g. if an out of service asset is not being exported. Finding and categorizing couplers depends on all bays weights being set. -set_connectable_busbarsUsescoupler_weight(default value set byfilter_weights) and the updatedbay_weightto mark couplers between busbars. Thebay_weightneeds to be set first; otherwise, the bay connection is always an option to "couple" busbars. Thebay_weightnow blocks these paths. Sets the connectable busbars result fromcalculate_connectable_busbarsto theBusbarConnectionInfo. It setsconnectable_busbarsandconnectable_busbars_node_idsin the same order. -set_all_busbar_coupling_switchesSet all connection paths between busbars, be it "BREAKER" or "DISCONNECTOR". These paths will be busbar coupler, cross coupler or busbar disconnector. -set_zero_impedance_connectedSets the zero impedance connection for assets and busbars.
-
Extract the Filled
BusbarConnectionInfoandEdgeConnectionInfofrom the Network. -
Create the AssetTopology using the
NetworkGraphData,BusbarConnectionInfo, andEdgeConnectionInfo.
Note: A star equivalent transformation for three-winding transformers is not needed before using this module. The graph module only needs the connection and does no calculation.
Missing Features / Limitations#
- PSTs are not implemented, currently outside of the station due to the branch
bay_weight.