Skip to content
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 43 commits into from
Nov 10, 2023
Merged

Substation automation system #811

merged 43 commits into from
Nov 10, 2023

Conversation

geofjamg
Copy link
Member

@geofjamg geofjamg commented Jul 3, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

No

What kind of change does this PR introduce?

Feature

What is the new behavior (if this is a feature change)?
We can simulate overload management systems.

Does this PR introduce a breaking change or deprecate an API?

  • The Breaking Change or Deprecated label has been added
  • The migration guide has been updated in the github wiki (What changes might users need to make in their application due to this PR?)

Other information:

geofjamg and others added 15 commits February 19, 2023 17:26
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/test/resources/debug-parameters.json
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowProvider.java
#	src/main/java/com/powsybl/openloadflow/network/LfNetworkParameters.java
#	src/main/java/com/powsybl/openloadflow/network/impl/AbstractLfBranch.java
#	src/main/java/com/powsybl/openloadflow/network/impl/Networks.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
#	src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/main/java/com/powsybl/openloadflow/ac/AcloadFlowEngine.java
#	src/main/java/com/powsybl/openloadflow/network/LfNetworkParameters.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
#	src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

89.3% 89.3% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@@ -84,6 +84,10 @@ public List<AcOuterLoop> configure(LoadFlowParameters parameters, OpenLoadFlowPa
if (parameters.isShuntCompensatorVoltageControlOn()) {
outerLoops.add(createShuntVoltageControlOuterLoop(parametersExt));
}
// automation functions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sequence of outer loops becomes to be a bit hard to follow : why this order and why not another one? And for example, what is the behavior when you have a tap changer with voltage control in incremental mode and automatons? What is the sequence? And phase shifters?

LOGGER.debug("Line '{}' is overloaded ({} A > {} A), {} switch '{}'",
branch.getId(), i1 * ib, threshold * ib, system.isSwitchOpen() ? "open" : "close",
system.getSwitchToOperate().getId());
system.getSwitchToOperate().setDisabled(system.isSwitchOpen());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you disabled a switch, I think you have to make a small connectivity analysis to be sure that nothing else is disabled. Same remark when it is enabled. See LfAction for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed


OverloadManagementSystemAdder<T> withThreshold(double threshold);

OverloadManagementSystemAdder<T> withSwitchIdToOperate(String switchId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must think about a switch or a branch side I think.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we should before correctly handle line disconnected at only one side

# Conflicts:
#	src/main/java/com/powsybl/openloadflow/DefaultAcOuterLoopConfig.java
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/main/java/com/powsybl/openloadflow/network/LfNetwork.java
#	src/main/java/com/powsybl/openloadflow/network/LfNetworkParameters.java
#	src/main/java/com/powsybl/openloadflow/network/impl/LfNetworkLoaderImpl.java
#	src/main/java/com/powsybl/openloadflow/network/impl/Networks.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
#	src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/main/java/com/powsybl/openloadflow/network/LfNetworkParameters.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
#	src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg changed the title [WIP] Automation system Substation automation system Oct 16, 2023
@geofjamg geofjamg requested a review from annetill October 16, 2023 20:09
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
}

@Override
public String getSwitchIdToOperate() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of automation system could use a switch between bus bar sections as remedial action. But most of the time, it is a switch from a line extremity. In that case, I think it is better to model it as a terminal ref (or equipment + side) for performance issue. I think it is the same idea for protection schemes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but this is something that will be in addition to switch operation and that cannot be implemented right now in OLF because we don't know open a branch at only one side during the simulation


void setEnabled(boolean enabled);

String getLineIdToMonitor();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line or Branch ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monitoredBranch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my knowledge, this kind of system are only used on lines

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MonitoredLine?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add that you look at side 1?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to configure it. This is a first and simple version.

@@ -156,7 +160,9 @@ public LfNetworkParameters(LfNetworkParameters other) {
this.secondaryVoltageControl = other.secondaryVoltageControl;
this.cacheEnabled = other.cacheEnabled;
this.asymmetrical = other.asymmetrical;
this.linePerUnitMode = other.linePerUnitMode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:-)

SubstationAutomationSystems systems = substation.getExtension(SubstationAutomationSystems.class);
if (systems != null) {
for (OverloadManagementSystem system : systems.getOverloadManagementSystems()) {
addSwitchesOperatedByAutomationSystem(network, topoConfig, system);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually say addSwitchesToOperateBy... to be coherent why the rest of the code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is an hypothetical use of the switch. This is not necessarily to operate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in remedial actions, it is hypothetical.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you wish

@geofjamg geofjamg requested a review from annetill October 20, 2023 10:53
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
# Conflicts:
#	src/main/java/com/powsybl/openloadflow/OpenLoadFlowParameters.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
#	src/test/resources/debug-parameters.json
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg requested a review from annetill October 31, 2023 12:02
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@@ -271,7 +273,8 @@ private static <E extends Enum<E>> List<Object> getEnumPossibleValues(Class<E> e
new Parameter(MAX_VOLTAGE_CHANGE_STATE_VECTOR_SCALING_MAX_DPHI_PARAM_NAME, ParameterType.DOUBLE, "Max voltage angle change for the max voltage change state vector scaling", MaxVoltageChangeStateVectorScaling.DEFAULT_MAX_DPHI),
new Parameter(LINE_PER_UNIT_MODE_PARAM_NAME, ParameterType.STRING, "Line per unit mode", LinePerUnitMode.IMPEDANCE.name(), getEnumPossibleValues(LinePerUnitMode.class)),
new Parameter(USE_LOAD_MODEL_PARAM_NAME, ParameterType.BOOLEAN, "Use load model (with voltage dependency) for simulation", LfNetworkParameters.USE_LOAD_MODE_DEFAULT_VALUE),
new Parameter(DC_APPROXIMATION_TYPE_PARAM_NAME, ParameterType.STRING, "DC approximation type", DcEquationSystemCreationParameters.DC_APPROXIMATION_TYPE_DEFAULT_VALUE.name(), getEnumPossibleValues(DcApproximationType.class))
new Parameter(DC_APPROXIMATION_TYPE_PARAM_NAME, ParameterType.STRING, "DC approximation type", DcEquationSystemCreationParameters.DC_APPROXIMATION_TYPE_DEFAULT_VALUE.name(), getEnumPossibleValues(DcApproximationType.class)),
new Parameter(SIMULATE_AUTOMATION_SYSTEMS_PARAM_NAME, ParameterType.BOOLEAN, "Automatons simulation", LfNetworkParameters.SIMULATE_AUTOMATION_SYSTEMS_DEFAULT_VALUE)
Copy link
Member

@annetill annetill Nov 2, 2023

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@gmail.com>
@geofjamg geofjamg requested a review from annetill November 3, 2023 16:05
# Conflicts:
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowParametersTest.java
#	src/test/java/com/powsybl/openloadflow/OpenLoadFlowProviderTest.java
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

90.6% 90.6% Coverage
0.0% 0.0% Duplication

@geofjamg geofjamg merged commit 515bbad into main Nov 10, 2023
6 checks passed
@geofjamg geofjamg deleted the automaton2 branch November 10, 2023 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants