-
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
Fix secondary voltage control in case of generator remote voltage control #1165
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
*/ | ||
package com.powsybl.openloadflow.network; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
|
@@ -80,4 +81,23 @@ public void updateReactiveKeys() { | |
controllerBus.setRemoteControlReactivePercent(reactiveKeysSum == 0 ? 0 : reactiveKeys[i] / reactiveKeysSum); | ||
} | ||
} | ||
|
||
/** | ||
* Returns itself in case of local control, split into several local voltage controls in case of remote control. | ||
*/ | ||
public List<GeneratorVoltageControl> split() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The method name is misleading. Maybe something like |
||
if (isLocalControl()) { | ||
return List.of(this); | ||
} else { | ||
List<GeneratorVoltageControl> generatorVoltageControls = new ArrayList<>(controllerElements.size()); | ||
// create one (local) generator control per controller bus and remove this one | ||
controlledBus.setGeneratorVoltageControl(null); | ||
for (LfBus controllerBus : controllerElements) { | ||
var generatorVoltageControl = new GeneratorVoltageControl(controllerBus, targetPriority, targetValue); | ||
generatorVoltageControl.addControllerElement(controllerBus); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. moving targetV pu of remote bus to targetV pu at local bus can change a lot the network configuration if the transformer between local and remote has ratedUi different from nominalVi, which is quite frequent. |
||
generatorVoltageControls.add(generatorVoltageControl); | ||
} | ||
return generatorVoltageControls; | ||
} | ||
} | ||
} |
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.
very subtle difference between controllerBusIndex and controlledBusIndex
Is it possible to use something with more visual constrast ?
For example controllingBusIndex / controlledBusIndex