-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
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>
00ec727
to
f6c740b
Compare
@@ -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 |
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.
Can you remain consistent with other treatment. P0 is not "stored" in per-unit.
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.
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) { |
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.
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.
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.
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) { |
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.
Thanks, should be fixed soon with powsybl/powsybl-core#3098, that should be included in powsbl-core 6.4.1.
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.
You can upgrade the version, powsybl-core 6.4.1 available.
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.
Thanks, the code now uses the method getHvdcLineLosses().
…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>
if (isController(rawP)) { | ||
return rawP; | ||
} else { | ||
double rectifierPDc = (1 - lossFactor1) * rawP; |
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.
Can you try to put more commun code in the abstract?
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.
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 |
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.
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.
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.
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>
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>
@@ -78,6 +83,15 @@ protected double getVscLossMultiplier() { | |||
return (1 - lossFactor1) * (1 - lossFactor2); | |||
} | |||
|
|||
protected double getAbsActivePowerWithLosses(double boundedP, double lossRectifier, double lossInverter) { |
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.
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.
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.
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 ?
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.
I think that in a previous version, I used controller vs non controller :-)
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.
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"); |
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.
Line to be removed?
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.
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); |
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.
Why did you change the check isController from rawP to boundedP?
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.
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.
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.
I think it is equivalent but as Didier is not here (these lines about boundedP are from him) maybe keep former lines.
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.
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>
|
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.
Thanks for your first contribution!
Please check if the PR fulfills these requirements
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)?
![image](https://private-user-images.githubusercontent.com/38729191/347381731-9115d7d7-c090-4c00-86ee-1e81f6f4da73.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjMxODk1OTYsIm5iZiI6MTcyMzE4OTI5NiwicGF0aCI6Ii8zODcyOTE5MS8zNDczODE3MzEtOTExNWQ3ZDctYzA5MC00YzAwLTg2ZWUtMWU4MWY2ZjRkYTczLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA5VDA3NDEzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIwZmMxOTlhNzBiNDJmNmZmYWUzMTI4M2M5NDUyNGI5MjIyZGExZWM2Y2ZkZGIwMDhiNjBlOWYwMzczYmU4OTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.ACcoe0TU7ZZZ2CPWH9e-nmKx0j1hPcFnJzhuBuIn4do)
The power loss formula has been introduced in the computation of power in AC emulation and is given in the figure below.
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?
Other information: