-
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
Substation automation system #811
Merged
Merged
Changes from 40 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
436c7ae
Current limit automaton simulation
geofjamg c9ab21c
Wip
geofjamg 9a8f3cf
Wip
geofjamg b4c96c8
Merge branch 'main' into automaton2
geofjamg b08290e
Merge branch 'main' into automaton2
geofjamg 34c92a0
Fix merge
geofjamg b72f94b
Wip
geofjamg ea20d1a
Wip
geofjamg 8a4289a
Wip
geofjamg 47e6c63
Wip
geofjamg 6ac7542
Wip
geofjamg 2f143e9
Wip
geofjamg a414875
Wip
geofjamg 1e1006f
Merge branch 'main' into automaton2
geofjamg 77134c9
Fix
geofjamg 8787036
Merge branch 'main' into automaton2
geofjamg 7331cdf
Wip
geofjamg 3c38a7a
Merge branch 'main' into automaton2
geofjamg db356e2
Wip
geofjamg 211eaa5
Wip
geofjamg 4f1fea3
Wip
geofjamg bd6f307
Wip
geofjamg b201e49
Wip
geofjamg 7518849
Wip
geofjamg c7f61ad
Wip
geofjamg 83faddf
Wip
geofjamg f8e1be1
Wip
geofjamg 4d3dabb
Merge branch 'main' into automaton2
geofjamg eee52a5
Wip
geofjamg 2bd65b2
Merge branch 'main' into automaton2
geofjamg 58ecdf3
Merge branch 'main' into automaton2
geofjamg dc4f77e
Fix
geofjamg f168409
Merge remote-tracking branch 'origin/automaton2' into automaton2
geofjamg a1dc2b8
Wip
geofjamg 9703e12
Merge branch 'main' into automaton2
geofjamg 9018a6e
Wip
geofjamg b96d523
Wip
geofjamg f77f136
Wip
geofjamg 51411e6
Merge branch 'main' into automaton2
geofjamg 090c210
Wip
geofjamg c72ee2a
Merge branch 'main' into automaton2
geofjamg fa6f75c
Fix
geofjamg 8d96250
Merge branch 'main' into automaton2
geofjamg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
73 changes: 73 additions & 0 deletions
73
src/main/java/com/powsybl/openloadflow/ac/outerloop/AutomationSystemOuterLoop.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Copyright (c) 2023, RTE (http://www.rte-france.com) | ||
* 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/. | ||
*/ | ||
package com.powsybl.openloadflow.ac.outerloop; | ||
|
||
import com.powsybl.commons.reporter.Reporter; | ||
import com.powsybl.openloadflow.ac.AcOuterLoopContext; | ||
import com.powsybl.openloadflow.graph.GraphConnectivity; | ||
import com.powsybl.openloadflow.lf.outerloop.OuterLoopStatus; | ||
import com.powsybl.openloadflow.network.*; | ||
import com.powsybl.openloadflow.network.impl.LfSwitch; | ||
import com.powsybl.openloadflow.util.PerUnit; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Geoffroy Jamgotchian {@literal <geoffroy.jamgotchian at rte-france.com>} | ||
*/ | ||
public class AutomationSystemOuterLoop implements AcOuterLoop { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(AutomationSystemOuterLoop.class); | ||
|
||
public static final String NAME = "AutomationSystem"; | ||
|
||
@Override | ||
public String getName() { | ||
return NAME; | ||
} | ||
|
||
@Override | ||
public OuterLoopStatus check(AcOuterLoopContext context, Reporter reporter) { | ||
OuterLoopStatus status = OuterLoopStatus.STABLE; | ||
LfNetwork network = context.getNetwork(); | ||
Set<LfBranch> branchesToOpen = new HashSet<>(); | ||
Set<LfBranch> branchesToClose = new HashSet<>(); | ||
for (LfOverloadManagementSystem system : network.getOverloadManagementSystems()) { | ||
LfBranch branchToMonitor = system.getMonitoredBranch(); | ||
if (branchToMonitor.isConnectedAtBothSides()) { | ||
double i1 = branchToMonitor.getI1().eval(); | ||
double threshold = system.getThreshold(); | ||
if (i1 > threshold) { | ||
double ib = PerUnit.ib(branchToMonitor.getBus1().getNominalV()); | ||
LfSwitch switchToOperate = system.getSwitchToOperate(); | ||
if (system.isSwitchOpen() && switchToOperate.isConnectedAtBothSides()) { | ||
LOGGER.debug("Line '{}' is overloaded ({} A > {} A), open switch '{}'", | ||
branchToMonitor.getId(), i1 * ib, threshold * ib, switchToOperate.getId()); | ||
branchesToOpen.add(switchToOperate); | ||
} else if (!system.isSwitchOpen() && !switchToOperate.isConnectedAtBothSides()) { | ||
LOGGER.debug("Line '{}' is overloaded ({} A > {} A), close switch '{}'", | ||
branchToMonitor.getId(), i1 * ib, threshold * ib, switchToOperate.getId()); | ||
branchesToClose.add(switchToOperate); | ||
} | ||
} | ||
} | ||
} | ||
|
||
if (branchesToOpen.size() + branchesToClose.size() > 0) { | ||
GraphConnectivity<LfBus, LfBranch> connectivity = network.getConnectivity(); | ||
branchesToOpen.forEach(connectivity::removeEdge); | ||
branchesToClose.forEach(branch -> connectivity.addEdge(branch.getBus1(), branch.getBus2(), branch)); | ||
LfAction.updateBusesAndBranchStatus(connectivity); | ||
status = OuterLoopStatus.UNSTABLE; | ||
annetill marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
return status; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,8 @@ public class LfNetworkParameters { | |
|
||
public static final Set<Country> SLACK_BUS_COUNTRY_FILTER_DEFAULT_VALUE = Collections.emptySet(); | ||
|
||
public static final boolean SIMULATE_AUTOMATION_SYSTEMS_DEFAULT_VALUE = false; | ||
|
||
private SlackBusSelector slackBusSelector = new FirstSlackBusSelector(SLACK_BUS_COUNTRY_FILTER_DEFAULT_VALUE); | ||
|
||
private GraphConnectivityFactory<LfBus, LfBranch> connectivityFactory = new EvenShiloachGraphDecrementalConnectivityFactory<>(); | ||
|
@@ -121,6 +123,8 @@ public class LfNetworkParameters { | |
|
||
private boolean useLoadModel = USE_LOAD_MODE_DEFAULT_VALUE; | ||
|
||
private boolean simulateAutomationSystems = SIMULATE_AUTOMATION_SYSTEMS_DEFAULT_VALUE; | ||
|
||
public LfNetworkParameters() { | ||
} | ||
|
||
|
@@ -156,7 +160,9 @@ public LfNetworkParameters(LfNetworkParameters other) { | |
this.secondaryVoltageControl = other.secondaryVoltageControl; | ||
this.cacheEnabled = other.cacheEnabled; | ||
this.asymmetrical = other.asymmetrical; | ||
this.linePerUnitMode = other.linePerUnitMode; | ||
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. :-) |
||
this.useLoadModel = other.useLoadModel; | ||
this.simulateAutomationSystems = other.simulateAutomationSystems; | ||
} | ||
|
||
public SlackBusSelector getSlackBusSelector() { | ||
|
@@ -466,6 +472,15 @@ public LfNetworkParameters setUseLoadModel(boolean useLoadModel) { | |
return this; | ||
} | ||
|
||
public boolean isSimulateAutomationSystems() { | ||
return simulateAutomationSystems; | ||
} | ||
|
||
public LfNetworkParameters setSimulateAutomationSystems(boolean simulateAutomationSystems) { | ||
this.simulateAutomationSystems = simulateAutomationSystems; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "LfNetworkParameters(" + | ||
|
@@ -500,6 +515,7 @@ public String toString() { | |
", minNominalVoltageTargetVoltageCheck=" + minNominalVoltageTargetVoltageCheck + | ||
", linePerUnitMode=" + linePerUnitMode + | ||
", useLoadModel=" + useLoadModel + | ||
", simulateAutomationSystems=" + simulateAutomationSystems + | ||
')'; | ||
} | ||
} |
Oops, something went wrong.
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.
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.
Automatons simulation? For coherence, automation systems simulation maybe.
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.
Fixed