Skip to content

[WIP] First try on CGMES Equipment network import #1965

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

miovd
Copy link
Contributor

@miovd miovd commented Feb 4, 2022

Please check if the PR fulfills these requirements (please use '[x]' to check the checkboxes, or submit the PR and then click the checkboxes)

  • 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 ? If so, link to this issue using '#XXX' and skip the rest
No

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
CGMES imported networks are always at STEADY_STATE_HYPOTHESIS validation level

What is the new behavior (if this is a feature change)?
CGMES imported networks are at EQUIPMENT level if they only contains equipment-related profiles and boundaries (optional). The current PR only regards flows and generators' regulation. Other PRs are to follow.

Does this PR introduce a breaking change or deprecate an API? If yes, check the following:

  • 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?)

miovd added 2 commits February 4, 2022 15:15
…detection + loads with undefined p0/q0

Signed-off-by: VEDELAGO MIORA <[email protected]>
Signed-off-by: VEDELAGO MIORA <[email protected]>
@miovd miovd force-pushed the first_eq_cgmes_import branch from dbf4d23 to 368b592 Compare February 4, 2022 14:15
@miovd miovd changed the title First try on CGMES Equipment network import [WIP] First try on CGMES Equipment network import Feb 4, 2022
miovd added 3 commits February 4, 2022 15:44
Signed-off-by: VEDELAGO MIORA <[email protected]>
Signed-off-by: VEDELAGO MIORA <[email protected]>
Signed-off-by: VEDELAGO MIORA <[email protected]>
@miovd miovd changed the title [WIP] First try on CGMES Equipment network import First try on CGMES Equipment network import Feb 9, 2022
if (context.cgmes().hasOnlyEquipmentProfile()) {
return Double.NaN;
}
return 0.0;
Copy link
Member

Choose a reason for hiding this comment

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

What is the aim of this 0.0 value ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is for default values when there is several profiles (not only EQ and boundaries) in the CGMES file

Copy link
Member

Choose a reason for hiding this comment

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

I think we could avoid checking if the input data contains only EQ to use a default value of NaN.

If we let NaN always as the default value we will be able to identify/report situations where some loads defined in the model have not been properly initialized in the SSH (and the code would be simpler).

I realize this is a change over the previous behaviour, but I think that following our current ability of using validation levels, it would be worth it. It would report the Network as not yet containing a complete set of steady state hypothesis.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Your proposal is the cleanest one for sure, but not maybe the most realistic: many IGM will have a validation level at EQ, whereas we really want to run a load flow on it after import. I can imagine that in the TYNDP files, we are far from a SSH validation level... what do you think ?

@zamarrenolm
Copy link
Member

I think we could also adjust the p0 and q0 functions in AbstractConductingEquipment to return NaN if no explicit value is given for p, q, instead of returning 0. Not only in the EnergyConsumerConversion.

@miovd miovd changed the title First try on CGMES Equipment network import [WIP] First try on CGMES Equipment network import Feb 14, 2022
@miovd miovd changed the title [WIP] First try on CGMES Equipment network import First try on CGMES Equipment network import Mar 9, 2022
@miovd
Copy link
Contributor Author

miovd commented Mar 15, 2022

This PR is to be completed with other attributes but I'm letting it in its current state for us to agree on the design

… it has to be set by the user

Signed-off-by: VEDELAGO MIORA <[email protected]>
@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

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

70.6% 70.6% Coverage
0.0% 0.0% Duplication

double targetV = control.targetValue;
Terminal terminal = parent.findRegulatingTerminal(control.cgmesTerminal);
if (voltageRegulatorOn && terminal == null) { // If regulating terminal null, regulation is made local
context.fixed(controlId, () -> "Unmapped regulating terminal and impossible to find an equivalent terminal. Regulation is made local.");
Copy link
Member

Choose a reason for hiding this comment

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

When we have a regulation on and a null terminal, I think that the good fix is to discard the regulation. Maybe in an other PR.

targetV = terminal.getVoltageLevel().getNominalV();
}
if (voltageRegulatorOn && (control.targetValue <= 0.0 || Double.isNaN(control.targetValue))) {
targetV = terminal.getVoltageLevel().getNominalV();
Copy link
Member

Choose a reason for hiding this comment

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

Here too: the good fix should be to set voltageRegulatorOn to false. Maybe in an other PR.

@@ -48,13 +49,21 @@ public Context(CgmesModel cgmes, Config config, Network network) {
// based on existing node-breaker info
nodeBreaker = cgmes.isNodeBreaker() && config.useNodeBreaker();

if (config.getMinimumValidationLevel() == ValidationLevel.EQUIPMENT) {
flowsDefaultValue = Double.NaN;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add as comment that it means active and reactive power default value. The fixSsh could be something more explicit as forceValidationLevelToSteadyStateHypothesis.

// Null terminal if it has not been defined in CGMES file
Terminal terminal = parent.findRegulatingTerminal(control.cgmesTerminal);
if (terminal == null) {
context.invalid(() -> controlId, () -> "Unmapped regulating terminal.");
Copy link
Member

Choose a reason for hiding this comment

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

Unmapped really? But here it will be forced as local terminal, no?

@miovd miovd changed the title First try on CGMES Equipment network import [WIP] First try on CGMES Equipment network import Mar 30, 2022
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.

3 participants