Import post-processor#

The import post-processor is a feature that allows to do automatic modifications or simulations, just after a case is converted to an IIDM network. These post-processors rely on the plugin mechanism of PowSyBl meaning that they are discovered at runtime. To enable one or more post-processors, the postprocessors property of the import module must be defined in the configuration file. Note that if you configure several post-processors, they are executed in the declaration order, like a pipeline:
TODO: insert a picture

PowSyBl provides 2 different implementations of post-processors:

  • Groovy: to execute a groovy script

  • LoadFlow: to run a power flow simulation

Groovy post-processor#

This post-processor executes a groovy script, loaded from a file. The script can access to the network and the computation manager using the variables network and computationManager. To use this post-processor, add the com.powsybl:powsybl-iidm-scripting dependency to your classpath, and configure both import and groovy-post-processor modules:

YAML configuration:

import:
    postProcessors:
        - groovyScript

groovy-post-processor:
    script: /path/to/the/script

XML configuration:

<import>
    <postProcessors>groovyScript</postProcessors>
</import>
<groovy-post-processor>
    <script>/path/to/the/script</script>
</groovy-post-processor>

Note: the script property is optional. If it is not defined, the import-post-processor.groovy script from the PowSyBl configuration folder is used.

Example#

The following example prints meta-information from the network:

println "Network " + network.getId() + " (" + network.getSourceFormat()+ ") is imported"

LoadFlow post-processor#

Mathematically speaking, a load flow result is fully defined by the complex voltages at each node. The consequence is that most load flow algorithms converge very fast if they are initialized with voltages. As a result, it happens that load flow results include only voltages and not flows on branches. This post-processors computes the flows given the voltages. The equations (Kirchhoff law) used are the same as the one used in the load flow validation to compute \(P_1^{\text{calc}}\), \(Q_1^{\text{calc}}\), \(P_2^{\text{calc}}\), \(Q_2^{\text{calc}}\) for branches and \(P_3^{\text{calc}}\), \(Q_3^{\text{calc}}\) in addition for three-winding transformers.

To use this post-processor, add the com.powsybl:powsybl-loadflow-results-completion to your classpath and enable it setting the postProcessors property of the import module.

YAML configuration:

import:
    postProcessors:
        - loadflowResultsCompletion

XML configuration:

<import>
    <postProcessors>loadflowResultsCompletion</postProcessors>
</import>

Note: This post-processor relies on the load flow results completion module.

Geographical data import post-processor#

One way to add geographical positions on a network is to use the import post-processor named odreGeoDataImporter, that will automatically add the LinePosition and SubstationPosition extensions to the network model.

This processor uses geographical position data formatted in multiple csv files, as it can be obtained on the website OpenData Réseaux-Énergie for the network of the French TSO RTE.

Using the links in the table below, you can obtain the RTE data CSV files, to be used as reference for input data formatting.

(To download these files, you should first accept the usage conditions of the ODRÉ website, which can be found—in French only—at the bottom of the pages, and the Etalab Open License v2.0, available in English here.)


To use this import post-processor, add the com.powsybl:powsybl-iidm-geodata to your classpath and enable it setting the postProcessors and odre-geo-data-importer-post-processor modules :

YAML configuration:

import:
  postProcessors:
    - odreGeoDataImporter

odre-geo-data-importer-post-processor:
  substations: /path/to/substations.csv
  aerial-lines: /path/to/aerial-lines.csv
  underground-lines: /path/to/underground-lines.csv

XML configuration:

<import>
    <postProcessors>odreGeoDataImporter</postProcessors>
</import>
<odre-geo-data-importer-post-processor>
    <substations>/path/to/substations.csv</substations>
    <aerial-lines>/path/to/aerial-lines.csv</aerial-lines>
    <underground-lines>/path/to/underground-lines.csv</underground-lines>
</odre-geo-data-importer-post-processor>

The paths to the different files can be absolute paths or paths relative to the directory where your command is launched.

Going further#