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

Matpower: export dclines #2932

Merged
merged 29 commits into from
May 17, 2024
Merged

Matpower: export dclines #2932

merged 29 commits into from
May 17, 2024

Conversation

marqueslanauja
Copy link
Contributor

@marqueslanauja marqueslanauja commented Mar 14, 2024

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?

What kind of change does this PR introduce?

Vsc HvdcLines are exported as dcLines.
Only Vsc hvdcLines with regulation on at both converters are exported as dcLines.
The rest of Vsc converters are exported as generators when the regulation is on and they are considered as load when the regulation is off.
Lcc converters are always considered as load.

Matpower needs a slack bus for each synchronous component. The slack must be defined in a bus with generation or with dclines to serve the roles of both a voltage angle reference and a real power slack.
Then a slack bus is defined for each synchronous component and the criteria to select it has been changed. Now the bus with highest active power generation is selected as slack instead of selecting the most meshed one.

What is the current behavior?

Vsc HvdcLines are exported as two independent generators.

What is the new behavior (if this is a feature change)?

Vsc HvdcLines are exported as dcLines
Bus numbers are preserved if the iidm model has been imported from matpower.

The status of the dcLine is imported and exported.
Disconnected hvdcLines are exported with status 0 if the connectable buses are inside the main component.
This change will be extended to all equipment in a separated PR.

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

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

marqueslanauja and others added 7 commits March 13, 2024 13:08
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
marqueslanauja and others added 9 commits April 22, 2024 09:05
Signed-off-by: José Antonio Marqués <marquesja@aia.es>

# Conflicts:
#	matpower/matpower-converter/src/main/java/com/powsybl/matpower/converter/MatpowerExporter.java
Signed-off-by: Luma <zamarrenolm@aia.es>
Signed-off-by: Luma <zamarrenolm@aia.es>
Signed-off-by: Luma <zamarrenolm@aia.es>
Signed-off-by: Luma <zamarrenolm@aia.es>
public Context(double maxGeneratorActivePowerLimit, double maxGeneratorReactivePowerLimit) {
this.maxGeneratorActivePowerLimit = maxGeneratorActivePowerLimit;
this.maxGeneratorReactivePowerLimit = maxGeneratorReactivePowerLimit;
}

private void obtainBusesOutsideMainSynchronousComponentToBeConsidered(Network network) {
Copy link
Member

Choose a reason for hiding this comment

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

obtain is not a classic wording for this:

  • getX for a direct access to data
  • findX when there is some complex data traversal for instance
  • updateX or calculateX when a method pre-calculate some data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

public Context(double maxGeneratorActivePowerLimit, double maxGeneratorReactivePowerLimit) {
this.maxGeneratorActivePowerLimit = maxGeneratorActivePowerLimit;
this.maxGeneratorReactivePowerLimit = maxGeneratorReactivePowerLimit;
}

private void obtainBusesOutsideMainSynchronousComponentToBeConsidered(Network network) {
Copy link
Member

Choose a reason for hiding this comment

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

You should better explain why you are doing all this complex topology processing. I personnally didn't understand without additionnal explanations. We have to be aware that all this processing to get synhcronous components exclusing LCC is technical debt for the code. If there is no other way to support HVDC export, why not but at least we have to document it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I simplified the code using the synchronousComponents and I documented it. Now it is easier to understand.

// according to the busId of the import process
private static OptionalInt extractBusNumber(String configuredBusId) {
String busNumber = configuredBusId.replace("BUS-", "");
return busNumber.matches("[1-9]\\d*") ? OptionalInt.of(Integer.parseInt(busNumber)) : OptionalInt.empty();
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need this ? Is it just for roundtrip tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not only for roundtrip tests. In matpower models, the bus number is the only way to identify it. We preserve the original ones if the iidm model has been created by importing a matpower model.

zamarrenolm and others added 7 commits May 6, 2024 13:29
Signed-off-by: Luma <zamarrenolm@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
…k for each synchronousComponent. Select as slack the bus with the highest generation

Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Signed-off-by: José Antonio Marqués <marquesja@aia.es>
Copy link

sonarcloud bot commented May 16, 2024

@geofjamg geofjamg merged commit 4d431b1 into main May 17, 2024
6 checks passed
@geofjamg geofjamg deleted the matpower_export_dclines branch May 17, 2024 09:57
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.

5 participants