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

Computing Hvdc line loss in AC emulation #1062

Merged
merged 24 commits into from
Jul 18, 2024
Merged

Conversation

SylvestreSakti
Copy link
Contributor

@SylvestreSakti SylvestreSakti commented Jul 10, 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?
No

What kind of change does this PR introduce?
The computation of power loss due to resistance in HVDC line in AC emulation has been added.

What is the current behavior?
The resistance R of an HVDC line is not taken into account, the result of this approximation is that active power transit in the HVDC line can be overestimated.

What is the new behavior (if this is a feature change)?
The power loss formula has been introduced in the computation of power in AC emulation and is given in the figure below.
image

The Joule loss is minor compared to the power transit so its derivative has been neglected in the computation of the Jacobian matrix.

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

  • Yes
  • No

Other information:

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
… Emulation

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@@ -52,6 +54,7 @@ public LfHvdcImpl(String id, LfBus bus1, LfBus bus2, LfNetwork network, HvdcLine
this.id = Objects.requireNonNull(id);
this.bus1 = bus1;
this.bus2 = bus2;
this.r = hvdcLine.getR() / PerUnit.zb(hvdcLine.getNominalV()); // Storing R directly in per unit
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 remain consistent with other treatment. P0 is not "stored" in per-unit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we had this question of consistency with two possible options :

  • Being consistent with the other treatments so introducing an additional property nominalV in LfHvdc
  • Changing the other treatment to "store" directly p0 and droop in per unit (but it may need some other modifications and maybe another PR)

I don't know which one is the best, but the easiest seems to be the first option

@@ -55,6 +58,20 @@ protected double rawP(double p0, double k, double ph1, double ph2) {
return p0 + k * (ph1 - ph2);
}

protected double rawPWithLoss(double rawP, double loss1, double loss2, double v, double r) {
Copy link
Member

Choose a reason for hiding this comment

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

We already have in powsybl-core the method in HvdcUtils.getHvdcLineLosses(...). Can we imagine reusing it here because it is what we use when the hvdc is operated in active power set point mode.

Copy link
Contributor Author

@SylvestreSakti SylvestreSakti Jul 10, 2024

Choose a reason for hiding this comment

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

Thank you for the idea to reuse it (The formula is simpler with the approximation that the rectifier's output is at nominal voltage. When testing, there is no difference in the obtained results).
image

But for the moment I can't use this method because it is private

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
…-core

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@@ -78,6 +81,17 @@ protected double getVscLossMultiplier() {
return (1 - lossFactor1) * (1 - lossFactor2);
}

// FIXME: This method is a copy of HvdcUtils.getHvdcLineLosses() from powsybl-core but it cannot be used yet because this static method is private
protected static double getHvdcLineLosses(double rectifierPDc, double nominalV, double r) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks, should be fixed soon with powsybl/powsybl-core#3098, that should be included in powsbl-core 6.4.1.

Copy link
Member

Choose a reason for hiding this comment

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

You can upgrade the version, powsybl-core 6.4.1 available.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, the code now uses the method getHvdcLineLosses().

SylvestreSakti and others added 6 commits July 10, 2024 17:25
…the losses

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@SylvestreSakti SylvestreSakti changed the title Draft: Computing Hvdc line loss in AC emulation Computing Hvdc line loss in AC emulation Jul 15, 2024
if (isController(rawP)) {
return rawP;
} else {
double rectifierPDc = (1 - lossFactor1) * rawP;
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 try to put more commun code in the abstract?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some modifications have been done, especially by creating a method getAbsActivePowerWithLosses() that computes the absolute value of the active power taking into account loss of converters (in the correct order depending on the direction of the transit) and the line loss.

@@ -450,6 +481,7 @@ void testAcEmuWithOperationalLimits() {
Network network = HvdcNetworkFactory.createHvdcLinkedByTwoLinesAndSwitch(HvdcConverterStation.HvdcType.VSC);
// without limit p=195
network.getHvdcLine("hvdc23")
.setR(0d) //Removing resistance to ignore cable loss
Copy link
Member

Choose a reason for hiding this comment

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

As a general comment, if unit tests changed because we improve/fix something, we prefer to fix them than to retry to code the old behavior.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, then the values of the tests have been updated with the new behavior (that have been verified). A new test had been added for the case without R to have an independant test ignoring line loss.

…ionTerm.java

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@SylvestreSakti SylvestreSakti changed the title Computing Hvdc line loss in AC emulation Draft: Computing Hvdc line loss in AC emulation Jul 15, 2024
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@SylvestreSakti SylvestreSakti changed the title Draft: Computing Hvdc line loss in AC emulation Computing Hvdc line loss in AC emulation Jul 15, 2024
SylvestreSakti and others added 3 commits July 15, 2024 17:05
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
@@ -78,6 +83,15 @@ protected double getVscLossMultiplier() {
return (1 - lossFactor1) * (1 - lossFactor2);
}

protected double getAbsActivePowerWithLosses(double boundedP, double lossRectifier, double lossInverter) {
Copy link
Member

@annetill annetill Jul 16, 2024

Choose a reason for hiding this comment

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

Just a detail here: rectifier and inverter terms seems to be used only for hvdc operating in active power set point (where you have which converter station is rectifier and which one is inverter). That is why, we prefer "controller" (see isController) for Ac Emulation because we only rely on sign of P0 + K delta angle.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for this detail, I understand now. The orders of the losses are important in this formula so the name are important. On one side there is the "controller", and which name on the other side ? What about "controlled" station ?

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 that in a previous version, I used controller vs non controller :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright :)

@@ -1284,6 +1284,7 @@ void testVSCLossAcEmulation() {
// but other converter station keeps its voltage control capability.
// remedial action re-enables the ac emulation of the hvdc line.
Network network = HvdcNetworkFactory.createHvdcLinkedByTwoLinesAndSwitch(HvdcConverterStation.HvdcType.VSC);
network.getHvdcLine("hvdc23");
Copy link
Member

Choose a reason for hiding this comment

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

Line to be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it had to be removed.

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
return (isController(rawP) ? 1 : getVscLossMultiplier()) * boundedP;
double boundedP = boundedP(rawP(ph1, ph2));
// if converterStation1 is controller, then p1 is positive, otherwise it is negative
return isController(boundedP) ? boundedP : -getAbsActivePowerWithLosses(boundedP, lossFactor1, lossFactor2);
Copy link
Member

Choose a reason for hiding this comment

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

Why did you change the check isController from rawP to boundedP?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because isController() only checks the sign of the power transit. I thought there was no need to store rawP instead of directly checking the sign of boundedP.

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 it is equivalent but as Didier is not here (these lines about boundedP are from him) maybe keep former lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it is equivalent (unless bounds of P are negative which they shouldn't). But I modified in order to keep the former lines.

Signed-off-by: PRABAKARAN Sylvestre <sylvestre.prabakaran@rte-france.com>
Copy link

sonarcloud bot commented Jul 16, 2024

Copy link
Member

@annetill annetill left a comment

Choose a reason for hiding this comment

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

Thanks for your first contribution!

@annetill annetill merged commit f785efd into main Jul 18, 2024
7 checks passed
@annetill annetill deleted the hvdc-line-loss-ac-emulation branch July 18, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants