Fix generator targetP update in AC-DC networks#1373
Merged
SylvestreSakti merged 4 commits intomainfrom Mar 23, 2026
Merged
Conversation
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
Signed-off-by: b.perreyon <baptiste.perreyon@supergrid-institute.com>
SylvestreSakti
approved these changes
Mar 23, 2026
jeandemanged
approved these changes
Mar 23, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Please check if the PR fulfills these requirements
Does this PR already have an issue describing the problem?
No
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
For a load flow with an AC-DC network, several
LfNetworkare created with their components (LfBus, LfBranch, etc...) and then copied into one uniqueLfAcDcNetwork. This network is the one used in for load flow computation.However the elements (i.e. LfBus) inside have a method
getNetwork()which returns their original LfNetwork (i.e. not theLfAcDcNetwork).This may cause non convergence of the load flow.
Indeed, in the
DistributedSlackOuterLoop, the targetP attribute of genererators/loads may be modified. The following lines insetTargetP()method allows to notify the AcTargetVector that is must be updated at the beginning of the next Newtown-Raphson iteration.However, the
LfNetworkreturned bybus.getNetwork()is as mentioned the originalLfNetworkof the LfBus, which has no listeners (they are stored in theLfAcDcNetwork).Therefore, the AcTargetVector is never notified that it must be updated and the load flow does not converge.
What is the new behavior (if this is a feature change)?
The correction proposed here consist in adding the listerners of the
LfAcDcNetworkto theLfNetworkobjects stored inside it. Thus, a LfBusgetNetwork()method still returns the originalLfNetwork, but it has access to the listeners added to theLfAcDcNetworkDoes this PR introduce a breaking change or deprecate an API?
What changes might users need to make in their application due to this PR? (migration steps)
Other information:
Two others options are possible:
LfAcDcNetworkmodify thenetworkattribute of all elements (LfBus, LfBranch, etc...) so thatgetNetwork()returns theLfAcDcNetworkobject.This imply adding a
setNetwork()method to theLfElementinterface which might have larger consequencesLfAcDcNetworkobject to add direclty the elements inside it (do not create anyLfNetworkbeforehand. This require more development and might complexify the management of several synchronous components and DC components in the same object.