powsybl / powsybl-open-loadflow

An open source loadflow based on PowSyBl
Mozilla Public License 2.0
45 stars 7 forks source link
energy-system java klu load-flow loadflow power-flow power-system-simulation power-systems powerflow powsybl

PowSyBl Open Load Flow

Actions Status Coverage Status Quality Gate MPL-2.0 License Slack

PowSyBl (Power System Blocks) is an open source library written in Java, that makes it easy to write complex software for power systems’ simulations and analysis. Its modular approach allows developers to extend or customize its features.

PowSyBl is part of the LF Energy Foundation, a project of The Linux Foundation that supports open source innovation projects within the energy and electricity sectors.

PowSyBl Logo

Read more at https://www.powsybl.org !

This project and everyone participating in it is under the Linux Foundation Energy governance principles and must respect the PowSyBl Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to powsybl-tsc@lists.lfenergy.org.

PowSyBl vs PowSyBl Open Load Flow

PowSyBl Open Load Flow provides:

Most of the code is written in Java. It only relies on native code for the KLU sparse linear solver. Linux, Windows and MacOS are supported. KLU is distributed with license LGPL-2.1+.

Common features

The AC calculations are based on full Newton-Raphson algorithm. The DC calculations are based on direct current linear approximation. Open Load Flow relies on:

Heterogeneous voltage controls management has become a key feature. All well-modeled voltage controls are kept and managed through a priority and a complex management of zero impedance lines. The generators have the first priority, followed by transformers, and then shunts. In a load flow run, in a controlled bus, only the main voltage control of highest priority controls voltage. When incremental outer loops are used, secondary priorities voltage controls can help generators that have reached reactive limits.

Security analysis implementation

Sensitivity analysis implementation

Open Load Flow both supports both AC and DC calculations. Even though it comes from the same powsybl-core API, the calculations behind are radically different. The AC post-contingency sensitivities calculation is based on the same principles than the AC security analysis. The DC post-contingency sensitivities calculation is highly optimized and fully documented here.

It supports all types of sensitivity factors that can be found in the API:

The following contingency types are supported:

Getting started

Running a load flow with PowSyBl Open Load Flow is easy. First let's start loading a IEEE 14 bus network. We first add a few Maven dependencies to respectively have access to network model, IEEE test networks and simple logging capabilities:

<dependency>
    <groupId>com.powsybl</groupId>
    <artifactId>powsybl-iidm-impl</artifactId>
    <version>6.4.0</version>
</dependency>
<dependency>
    <groupId>com.powsybl</groupId>
    <artifactId>powsybl-ieee-cdf-converter</artifactId>
    <version>6.4.0</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.13</version>
</dependency>

We are now able to load the IEEE 14 bus:

Network network = IeeeCdfNetworkFactory.create14();

After adding a last Maven dependency on Open Load Flow implementation:

<dependency>
    <groupId>com.powsybl</groupId>
    <artifactId>powsybl-open-loadflow</artifactId>
    <version>1.12.0</version>
</dependency>

We can run the load flow with default parameters on the network:

LoadFlow.run(network);

State variables and power flows computed by the load flow are have been updated inside the network model, and we can, for instance print on standard output buses voltage magnitude and angle:

network.getBusView().getBusStream().forEach(b -> System.out.println(b.getId() + " " + b.getV() + " " + b.getAngle()));

Contributing to PowSyBl Open Load Flow

PowSyBl Open Load Flow could support more features. The following list is not exhaustive and is an invitation to collaborate:

We can always increase or improves features and implementations. We have thought about:

For more details, to report bugs or if you need more features, visit our github and do not hesitate to write new issues.

Using Maven Wrapper

If you don't have a proper Maven installation, you could use the provided Apache Maven Wrapper scripts. They will download a compatible maven distribution and use it automatically.

You can see the Using Maven Wrapper section of the powsybl-core documentation if you want further information on this subject.