Skip to content

Commit

Permalink
Dynaflow integration (#475)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Biasuzzi <[email protected]>
Signed-off-by: Sylvain Leclerc <[email protected]>
Co-authored-by: Christian Biasuzzi <[email protected]>
Co-authored-by: Sylvain Leclerc <[email protected]>
  • Loading branch information
sylvlecl and CBiasuzzi authored Aug 11, 2022
1 parent ac67bb2 commit bd04f69
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/user_guide/loadflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ We can get the list of supported load flow implementations (so called providers)
.. doctest::

>>> lf.get_provider_names()
['OpenLoadFlow']
['DynaFlow', 'OpenLoadFlow']
>>> lf.get_default_provider()
'OpenLoadFlow'

By default, load flows are based on the OpenLoadFlow implementation,
fully described on `Powsybl website <https://www.powsybl.org/pages/documentation/simulation/powerflow/openlf.html>`_.
OpenLoadFlow supports AC Newton-Raphson and linear DC calculation methods.

You may also use DynaFlow, provided by the `Dynawo <https://dynawo.github.io>`_ project.
DynaFlow is a new steady-state simulation tool that aims at calculating the steady-state point by using
a simplified time-domain simulation.
Please see configuration instructions on `Powsybl website <https://www.powsybl.org/pages/documentation/simulation/powerflow/dynaflow.html>`_.


Parameters
----------

Expand Down
28 changes: 28 additions & 0 deletions integration_tests/test_dynaflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (c) 2022, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import pypowsybl as pp

from pypowsybl.loadflow import (
run_ac,
ComponentStatus
)


def test_dynaflow_ieee9():
"""
Running that test requires to have installed dynaflow,
and configured its path in your config.yml.
"""
network = pp.network.create_ieee9()
assert network.get_generators()['p'].isna().all() # No data for computed P

res = run_ac(network, provider='DynaFlow')
assert res[0].status == ComponentStatus.CONVERGED
# checks that computed P is almost equal to target_p
gens = network.get_generators()
assert max(abs(gens.p + gens.target_p)) < 0.1

4 changes: 4 additions & 0 deletions java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@
<artifactId>powsybl-config-classic</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-dynaflow</artifactId>
</dependency>
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-iidm-impl</artifactId>
Expand Down
1 change: 1 addition & 0 deletions tests/test_loadflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def test_validation_all():

def test_provider_names():
assert 'OpenLoadFlow' in pp.loadflow.get_provider_names()
assert 'DynaFlow' in pp.loadflow.get_provider_names()


def test_get_provider_parameters_names():
Expand Down

0 comments on commit bd04f69

Please sign in to comment.