powsybl / powsybl-distribution

Allows to generate a basic PowSyBl distribution
2 stars 2 forks source link

Conversion from CGMES: incorrect current limits #7

Open bhnm-akbari opened 3 years ago

bhnm-akbari commented 3 years ago
annetill commented 3 years ago

Hi, thanks for reporting this behaviour. Without the file, it is not easy for us to understand but maybe you can try to give us some clues: in which country is this line located? I understand that it is probably a line inside a country (CH or DE), why do you expect that the permanent limit to change to 1760 at both side? Finally we maybe expect that nothing change and stay to 1792? So please if you can give us more details.

miovd commented 3 years ago

Hello, Could you check when you include AT, FR and IT files that there is no other additional OperationalLimit for _56e86b7f-2db3-4001-a3d1-0d879ced8261 or its terminals in these files? The definition of PATL in our code takes the lowest limit value so it appears weird to me that we ignore a lower limit that the one defined if it is present with only CH and DE.

bhnm-akbari commented 3 years ago

Hello, Thank you for the replies. The line lies in DE and the relevant capacity values I found in the input EQ file are the following: ` ...

2024.0000000000 1848.0000000000 1760.0000000000 1760.0000000000 1848.0000000000 1760.0000000000 ` and ` Normal_Ir 1760.0000000000 ` and ` Normal_Ir 1760.0000000000 ` I’m not sure if fgh:ACLineSegment.imax values are considered at all, but the expected capacity would not be 1792 with any consideration. Side note: I could not convert DE alone because of an error, which I can post if it helps.
miovd commented 3 years ago

Thank you for your answer! Indeed, imax values are not taken into account by PowSyBl's importer. Could you also send here the OperationalLimitType, there may be a mishap in the way we read it? Knowing the error which prevents you to import DE file alone could also help, thanks!

bhnm-akbari commented 3 years ago

Thank you; here's the OperationalLimitType: `

PATL ` I'll send the error, once I have access to it (in the evening).
miovd commented 3 years ago

(Sorry, I forgot to also ask you the associated OperationalLimitSet... thank you!)

bhnm-akbari commented 3 years ago

No worries; I'm here to have my problem solved. Here you go: `

Ratings ` and ` Ratings `
bhnm-akbari commented 3 years ago

Update: The error in converting the DE files was due to the fact <md:Model.version> is expected to be an integer, but it was a string. After editing this in all files (EQ, SSH, SV, and TP), I managed to convert DE alone. The result surprisingly matches the expected behavior. ` <iidm:line id="_56e86b7f-2db3-4001-a3d1-0d879ced8261" ...>

_d07901a4-8926-49f8-89a4-78f962a3ed08 _dc654cfa-452b-43b8-918e-1be9c5596578 ` Still, I wouldn't call the issue resolved, because I need to convert all my files together to account for inter-country connections. Thank you
miovd commented 3 years ago

Hm, I'm not seeing anything that could be misinterpreted by PowSyBl's importer... Could you please check if in your logs' warnings, you have a message that looks like this : Several permanent limits defined for Terminal _dc654cfa-452b-43b8-918e-1be9c5596578. Only the lowest is kept. or Several permanent limits defined for Terminal _d07901a4-8926-49f8-89a4-78f962a3ed08. Only the lowest is kept. when importing several input files?

bhnm-akbari commented 3 years ago

In CMD, the only output message is Generating file ... How should I check the logs?

miovd commented 3 years ago

Ah yes, you may need to go to the /etc/ folder of your distribution and change the logback-itools.xml file to:


<!--

    Copyright (c) 2016, All partners of the iTesla project (http://www.itesla-project.eu/consortium)
    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/.

-->
<!--Configuration of the command line process log-->
<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <Pattern>%d{yyyy-MM-dd_HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
        </encoder>
    </appender>
    <root level="WARN">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>
`
bhnm-akbari commented 3 years ago

There are indeed a number of the following warning type: WARN com.powsybl.cgmes.conversion.Context - Fixed Permanent Limit. Reason: Several permanent limits defined for Terminal ... . Only the lowest is kept. But none is related to the adjacent terminals of the line we're interested in.

bhnm-akbari commented 3 years ago

May I ask if you're working on this issue? Otherwise, I'll have to consider alternative approaches.

I have anyway to go through some other conversion steps to convert AMPL format to MATPOWER format.

Thank you.

miovd commented 3 years ago

Sorry for the delayed answer! I tried looking a bit around the code but I really can't seem to find where it could go wrong and it is a bit difficult to try and guess without files to test... @zamarrenolm do you have any idea on why the CGMES importer has this behavior?

annetill commented 3 years ago

If you want us to help, you have to provide us a way to reproduce your issue. The issue could be in our project, but it could be also in your files. We know the code, but we don't have your files. If you don't provide this way to reproduce the behavior, we will not work on it. And yes, if you prefer, use another tool.

bhnm-akbari commented 3 years ago

I'm not allowed to share the files. That's why I haven't done it so far. I've detected some clues to the issue. I will share my findings when finalized. If still needed, I will consider how to share some data without violating the license terms.

bhnm-akbari commented 3 years ago

I sketched the network diagram based on CIM input files. CIM Diagram

The line that was referred to is Line1 which is expected to have capacity of 1760. It is connected to another line, namely Line2 which is expected to have a capacity of 1792. Both lines lie in DE.

When converting only DE, everything goes as expected: Line1 is converted to a iidm:line element with a capacity of 1760 and Line2 is converted to a iidm:danglingLine element with a capacity of 1792.

However, when I convert DE+CH, Line2, Line3, and Line4 do not appear in the xiidm file and the capacity of Line2 (i.e., 1792) is assigned to the capacity of Line1. So the problem is not limited to an incorrect capacity assignment, but also includes removal of some line elements.

My understanding is that the issue arises from the fact that there are more than two lines connected to a topological node (TN) at the boundary. However, the tieLine element in xiidm seems to support only two lines connected to a topological node at the boundary.

If you confirm my understanding, a solution would be to avoid merging lines at the boundary to a single tie line, but rather keep them as separate lines.

mathbagu commented 3 years ago

Thank you for these new elements. @annetill @MioRtia I think we can have access to this file asking people from the RTE R&D department. They probably already have this file or can download it from the ENTSO-E.

If I understand well your sketch, it seems that Line3 and Line4 are also dangling lines, right? We have here three danglingLines connected to the same TN. This use case is not supported by powsybl (I don't remember having encountered it in the past). In powsybl, we expect exactly two "matching" boundaryLine in order to create TieLine. If there are more, you should see an error message in the logs:

Invalid XXX. Reason: Too many equipment at boundary node

@bhnm-akbari Could you confirm?

My understanding is that there is probably no issue in the currentLimit conversion, except maybe the fact that when several limits are defined in the CGMES file, we keep only the lowest to be conservative. We do not want to miss overloads that could lead to security issues in our operational process.

If can have access to this file quickly, we should be able to diagnose more precisely the issue you described. Without it, it's really difficult for us. Is it possible to send us the logs (debug level) of the conversion tool by email at mathieu.bague AT rte-france.com?

bhnm-akbari commented 3 years ago

Thank you for your answer.

The data set is called TYNDP 2020 that can be requested from the following page: https://docstore.entsoe.eu/stum/

When converting only DE, everything goes as expected: Line1 is converted to a iidm:line element with a capacity of 1760 and Line2 is converted to a iidm:danglingLine element with a capacity of 1792.

When I convert DE+CH, Line2, Line3, and Line4 do not appear in the xiidm file and the capacity of Line2 (i.e., 1792) is assigned to the capacity of Line1. So the problem is not limited to an incorrect capacity assignment, but also includes removal of some line elements.

When I convert CH alone, Line3 and Line4 are merged together to form a tieLine, although they both lie in CH! So they are not converted to danglingLines.

I confirm the error. The following message is given when converting CH and DE together:

Invalid _0a7ff20b9b3e464a8f6dfbead0dbcb6d. Reason: Too many equipment at boundary node

Note that the current limit of one line is assigned to another line. Additionally, the assigned value is not the minimum of the two current limits.

I will send the log to the mentioned email address.

mathbagu commented 3 years ago

Thanks for the logs.

As explained this morning, this is a totally new use case we never encountered, but with your additional information we understand better the issue. We'll try to find a way to solve the issue you are facing.

zamarrenolm commented 3 years ago

We are also working on creating a minimal example that can be shared and reflects the explained configuration, to verify the incorrect limit assignment.

As @mathbagu said, three lines lying at the same boundary node is not supported by the current version. It is not described in the allowed ENTSO-E configurations that can be found at boundaries. Is there a particular reason for modelling that point in this way ?

bhnm-akbari commented 3 years ago

Thank you.

What about the case where the topological node with more than two connected ACLineSegments lies within the boundary not at the boundary? Is this case currently supported?

A possible application of such a configuration would be to model Tee-off line connections

zamarrenolm commented 3 years ago

I have been able to reproduce your issue with a minimal case built manually. I will analyze it and share it with you.

About modelling tee-of connections: as soon as the boundary nodes (published in ENTSO-E boundary files) receive at most two branches, everything should be ok.

bhnm-akbari commented 3 years ago

@zamarrenolm That's great; I'll be thrilled to follow the developments in this regard.

By definition at a Tee-off connection point, three line segments meet. But this is exactly what you you're addressing right now, and based on your explanation I assume this is not an issue if such a configuration exists somewhere not adjacent to the boundary.

zamarrenolm commented 3 years ago

Yes, I understand that tee-off connection modelling requires three line segments meeting at the same node.

The only issue is that this node can not be a boundary, only two "sides" are expected at a boundary in ENTSO-E definitions, with only one equipment at modelled at each side. As reference, the ENTSO-E extensions to CGMES (http://entsoe.eu/CIM/SchemaExtension/3/1#) define a naming scheme with allowing only "fromEnd" and "toEnd" equipment. The description of the "fromEndName" attribute:

The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases:

We will provide an example of how to keep the modelling the tee-off connection while preserving the restriction of having only two equipment at the boundary point.

bhnm-akbari commented 3 years ago

Thank you for the information. There are at least five instances of such connections at the boundary of TYNDP 2020 files, leading to the following warning during import: Invalid ... Reason: Too many equipment at boundary node

zamarrenolm commented 3 years ago

Please find attached two sets of files that reproduce and fix the problem in a minimal test network. They follow the identifiers you used in your drawing: line1 and line2 on DE side, line3 and line4 on CH side. Also, I have applied the same identifiers and values for the limits of line1 and line2 in DE.

In the file minimal-reproduce-error.zip the error reported is reproduced: if only DE files are loaded the limit for line1 is 1760. When all files, from both DE and CH are imported, the limit for line1 is incorrectly set as 1792. The following diagram shows the elements:

minimal-reproduce-error-diagram

The topological node at the boundary, TN1_BD, is connected to line2, line3 and line4. As you can see, CIMdesk is not drawing explicitly the three equipment connected at boundary node, although the references are correct.

The proposal to fix the issue is to model a zero-impedance line between the boundary and the point where line3 and line4 are connected, that will be tee-off connection point and will be kept inside CH. The files proposed for the fix can be found in this file: minimal-fix-with-z0.zip. The diagram that shows the elements in this case is:

minimal-fix-with-z0-diagram

With the proposed fix we keep only two branches at the boundary, and the line2 maintains its limit of 1760.

bhnm-akbari commented 3 years ago

Thank you for the test network and the associated fixed variant. It is indeed a wise solution. Do you plan to automate the fix in a near-future release or is the user expected to manually modify the input CGMES files before importing into PowSyBl?

zamarrenolm commented 3 years ago

Hope this helps in your analysis. For the moment we have not planned to automate the fix in the software, but we will discuss it with the rest of the team.