-
Notifications
You must be signed in to change notification settings - Fork 8
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
Zero impedance line open at one side NPE #606
Conversation
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
A zero impedance line open at one side is equivalent to a zero impedance line open at the two sides. In my opinion should be managed as a disconnected line and should not be included in the internal network used for the loadflow calculation. This comment does not apply in this case because the opened line is a line with impedance. |
Network network = NodeBreakerNetworkFactory.create3Bars(); | ||
network.getLine("L2").setR(0.0).setX(0.0); | ||
network.getLine("L1").getTerminal1().disconnect(); | ||
LoadFlow.run(network); |
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.
@annetill Maybe we can add a check on values?
branch.updateFlows(pqBus.p, pqBus.q, pqOtherBus.p, pqOtherBus.q); | ||
} else { | ||
branch.updateFlows(pqOtherBus.p, pqOtherBus.q, pqBus.p, pqBus.q); | ||
} | ||
} | ||
|
||
private PQ getBranchFlow(LfBranch branch, LfBus bus) { | ||
return branch.getBus1().equals(bus) ? new PQ(branch.getP1().eval(), branch.getQ1().eval()) | ||
: new PQ(branch.getP2().eval(), branch.getQ2().eval()); | ||
if (branch.getBus1() != null && branch.getBus1().equals(bus)) { |
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 is enough... if it is not bus1, so it is bus2 as the branch is adjacent. My only question is about disabled branch. It is not managed and we never compute zero impedance flows in a security analysis, right?
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.
Better the previous fix. When a line is antenna the opened bus is null and the returned flow at this side is NaN. With the previous fix the returned flow will be 0.0, the right flow. However, to calculate zeroImpedanceFlows both fixes are ok as the method will never be used to calculate the flow at the antenna side, the flow is always needed at the connected side.
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.
With previous fix, the last else
is never reached by unit tests. I have tried during one hour and I think that it could not be reached as it is an adjacent branch. So I think that the right fix is this one.
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.
ok
Kudos, SonarCloud Quality Gate passed! |
Signed-off-by: Anne Tilloy <anne.tilloy@rte-france.com>
Signed-off-by: Anne Tilloy anne.tilloy@rte-france.com
Please check if the PR fulfills these requirements (please use
'[x]'
to check the checkboxes, or submit the PR and then click the checkboxes)Does this PR already have an issue describing the problem ? If so, link to this issue using
'#XXX'
and skip the restWhat kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change or deprecate an API? If yes, check the following:
Other information:
(if any of the questions/checkboxes don't apply, please delete them entirely)