-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network modification. Replace threeWindingsTransformers by 3 twoWindingsTransformers and vice versa #3167
base: main
Are you sure you want to change the base?
Conversation
…ngsTranformers and vice versa. Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
…ansformers_by_3_twoWindingsTransformers
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
…ansformers_by_3_twoWindingsTransformers
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Show resolved
Hide resolved
...extensions/src/main/java/com/powsybl/iidm/network/extensions/RemoteReactivePowerControl.java
Show resolved
Hide resolved
...owsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformersTest.java
Show resolved
Hide resolved
Signed-off-by: marquesja1 <[email protected]>
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Outdated
Show resolved
Hide resolved
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Outdated
Show resolved
Hide resolved
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Outdated
Show resolved
Hide resolved
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Outdated
Show resolved
Hide resolved
...owsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformersTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
…ansformers_by_3_twoWindingsTransformers
iidm/iidm-modification/src/main/java/com/powsybl/iidm/modification/util/TransformerUtils.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Show resolved
Hide resolved
...om/powsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java
Outdated
Show resolved
Hide resolved
} else if (t2wLeg3.getOperationalLimitsGroups1().stream().anyMatch(operationalLimitsGroup -> propertyName.contains(operationalLimitsGroup.getId()))) { | ||
t2wLeg3.setProperty(propertyName, property); | ||
} else { | ||
copied = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all other properties should be copied on the 3 2wt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properties have a strong dependency on the propertyName. The propertyName is essential to use properly the property data. I'm not sure if copying properties with a general procedure, without adjusting their propertyNames will be the best option as the result will not be in general usable for exporting the model to the original format, the main use of the properties now, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properties are used to pass additional data on an identifiable. They may be used in a full IIDM context (without exporting the network in another format) and it can make sense to transfer them.
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Show resolved
Hide resolved
...ification/src/main/java/com/powsybl/iidm/modification/util/RegulatedTerminalControllers.java
Outdated
Show resolved
Hide resolved
...ification/src/main/java/com/powsybl/iidm/modification/util/RegulatedTerminalControllers.java
Outdated
Show resolved
Hide resolved
…tion/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
…tion/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java Co-authored-by: Olivier Perrin <[email protected]> Signed-off-by: marqueslanauja <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
...om/powsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java
Outdated
Show resolved
Hide resolved
...om/powsybl/iidm/modification/ReplaceThreeWindingsTransformersBy3TwoWindingsTransformers.java
Outdated
Show resolved
Hide resolved
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Signed-off-by: marquesja1 <[email protected]>
Quality Gate passedIssues Measures |
ThreeWindingsTransformerAdder t3wAdder = substation.newThreeWindingsTransformer() | ||
.setId(getId(twoR)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be safer to unsure that the new ID is unique. It could prevent exceptions during the network modification application:
ThreeWindingsTransformerAdder t3wAdder = substation.newThreeWindingsTransformer() | |
.setId(getId(twoR)) | |
ThreeWindingsTransformerAdder t3wAdder = substation.newThreeWindingsTransformer() | |
.setEnsureIdUnicity(true) | |
.setId(getId(twoR)) |
* <li>A new voltage level is created for the star node with nominal voltage of ratedU0.</li> | ||
* <li>Three new TwoWindingsTransformers are created, one for each leg of the removed ThreeWindingsTransformer.</li> | ||
* <li>The following attributes are copied from each leg to the new associated twoWindingsTransformer:</li> | ||
* <ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nested <ul>
tags should be inside their corresponding <li>
tag.
Source: The HTML specification of the WHATWG:
if (aliasType.equals("CGMES.TransformerEnd" + legEnd)) { | ||
t2wLeg.addAlias(alias, "CGMES.TransformerEnd1"); | ||
} else if (aliasType.equals("CGMES.Terminal" + legEnd)) { | ||
t2wLeg.addAlias(alias, "CGMES.Terminal1"); | ||
} else if (aliasType.equals("CGMES.RatioTapChanger" + legEnd)) { | ||
t2wLeg.addAlias(alias, "CGMES.RatioTapChanger1"); | ||
} else if (aliasType.equals("CGMES.PhaseTapChanger" + legEnd)) { | ||
t2wLeg.addAlias(alias, "CGMES.PhaseTapChanger1"); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for IDS, we should ensure the aliases are unique:
if (aliasType.equals("CGMES.TransformerEnd" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.TransformerEnd1"); | |
} else if (aliasType.equals("CGMES.Terminal" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.Terminal1"); | |
} else if (aliasType.equals("CGMES.RatioTapChanger" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.RatioTapChanger1"); | |
} else if (aliasType.equals("CGMES.PhaseTapChanger" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.PhaseTapChanger1"); | |
} else { | |
if (aliasType.equals("CGMES.TransformerEnd" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.TransformerEnd1", true); | |
} else if (aliasType.equals("CGMES.Terminal" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.Terminal1", true); | |
} else if (aliasType.equals("CGMES.RatioTapChanger" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.RatioTapChanger1", true); | |
} else if (aliasType.equals("CGMES.PhaseTapChanger" + legEnd)) { | |
t2wLeg.addAlias(alias, "CGMES.PhaseTapChanger1", true); | |
} else { |
...om/powsybl/iidm/modification/Replace3TwoWindingsTransformersByThreeWindingsTransformers.java
Show resolved
Hide resolved
if (aliasType.equals("CGMES.TransformerEnd" + end)) { | ||
t3w.addAlias(alias, "CGMES.TransformerEnd" + leg); | ||
} else if (aliasType.equals("CGMES.Terminal" + end)) { | ||
t3w.addAlias(alias, "CGMES.Terminal" + leg); | ||
} else if (aliasType.equals("CGMES.RatioTapChanger1")) { | ||
t3w.addAlias(alias, "CGMES.RatioTapChanger" + leg); | ||
} else if (aliasType.equals("CGMES.PhaseTapChanger1")) { | ||
t3w.addAlias(alias, "CGMES.PhaseTapChanger" + leg); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid potential collisions which may cause a crash of the network modification application:
if (aliasType.equals("CGMES.TransformerEnd" + end)) { | |
t3w.addAlias(alias, "CGMES.TransformerEnd" + leg); | |
} else if (aliasType.equals("CGMES.Terminal" + end)) { | |
t3w.addAlias(alias, "CGMES.Terminal" + leg); | |
} else if (aliasType.equals("CGMES.RatioTapChanger1")) { | |
t3w.addAlias(alias, "CGMES.RatioTapChanger" + leg); | |
} else if (aliasType.equals("CGMES.PhaseTapChanger1")) { | |
t3w.addAlias(alias, "CGMES.PhaseTapChanger" + leg); | |
} else { | |
if (aliasType.equals("CGMES.TransformerEnd" + end)) { | |
t3w.addAlias(alias, "CGMES.TransformerEnd" + leg, true); | |
} else if (aliasType.equals("CGMES.Terminal" + end)) { | |
t3w.addAlias(alias, "CGMES.Terminal" + leg, true); | |
} else if (aliasType.equals("CGMES.RatioTapChanger1")) { | |
t3w.addAlias(alias, "CGMES.RatioTapChanger" + leg, true); | |
} else if (aliasType.equals("CGMES.PhaseTapChanger1")) { | |
t3w.addAlias(alias, "CGMES.PhaseTapChanger" + leg, true); | |
} else { |
.newTwoWindingsTransformer() | ||
.setId(t3w.getId() + "-Leg" + leg.getSide().getNum()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid potential application crash due to an ID collision:
.newTwoWindingsTransformer() | |
.setId(t3w.getId() + "-Leg" + leg.getSide().getNum()) | |
.newTwoWindingsTransformer() | |
.setEnsureIdUnicity(true) | |
.setId(t3w.getId() + "-Leg" + leg.getSide().getNum()) |
* <li>Each twoWindingsTransformer is well oriented if the star bus is located at the end 2.</li> | ||
* <li>A new ThreeWindingsTransformer is created for replacing the three TwoWindingsTransformers.</li> | ||
* <li>The following attributes are copied from each twoWindingsTransformer to the new associated leg:</li> | ||
* <ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nested <ul>
tags should be inside their corresponding <li>
tag.
Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
What kind of change does this PR introduce?
Feature
This PR contains two network modification methods.
The first one, replaces all the ThreeWindingsTransformers of the network by 3 equivalent TwoWindingsTransformers. In this process:
TransformerFortescueData
,PhaseAngleClock
, andTransformerToBeEstimated
The second one, replaces all the 3 TwoWindingsTransformers of the network by an equivalent ThreeWindingsTransformer. In this process:
connectables
allowed In the voltageLevel associated with the star bus.TransformerFortescueData
,PhaseAngleClock
, andTransformerToBeEstimated
In both processes, internal connections are created to manage the replacement.
What is the current behavior?
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API?
If yes, please check if the following requirements are fulfilled
What changes might users need to make in their application due to this PR? (migration steps)
Custom IIDM implementation maintainers should implement the following method in their
RemoteReactivePowerControl
implementations:RemoteReactivePowerControl setRegulatingTerminal(Terminal regulatingTerminals);
Other information: