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

Fix P/Q targets of converter stations in optimization #94

Merged
merged 67 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b767132
Divide OpenReacRunnerTest into several TUs
p-arvy Nov 27, 2024
8da89b0
Add TUs for ACOPF indicators
p-arvy Nov 27, 2024
50548d2
Add tests on equipment bounds in optimization of OpenReac
p-arvy Dec 4, 2024
802dd1d
Improve tests on ouput indicators of OpenReac
p-arvy Dec 4, 2024
81908d8
Clean
p-arvy Dec 4, 2024
f6746be
Add resources
p-arvy Dec 4, 2024
28047a0
Merge branch 'refs/heads/main' into refactor-open-reac-tests
p-arvy Dec 4, 2024
84e5da6
Clean
p-arvy Dec 12, 2024
a54206b
Clean code adding new TUs
p-arvy Dec 12, 2024
cd043e8
Clean
p-arvy Dec 12, 2024
1f1c0dd
Merge branch 'refs/heads/main' into refactor-open-reac-tests
p-arvy Dec 12, 2024
3a3b1fd
Merge branch 'refs/heads/main' into refactor-open-reac-tests
p-arvy Dec 13, 2024
d78e93d
Clean
p-arvy Dec 30, 2024
724d6fe
Put computer and time indicators as DEBUG indicators
p-arvy Dec 17, 2024
abfc91b
Clean
p-arvy Dec 19, 2024
2afbe89
Add indicators test for OpenReac
p-arvy Dec 12, 2024
e11a2f6
Add tests for bounds
p-arvy Dec 12, 2024
6f4612b
Add TUs on Q bounds
p-arvy Dec 13, 2024
8aa0e87
Small clean
p-arvy Dec 13, 2024
1044424
Update resources
p-arvy Dec 17, 2024
7070e0e
Clean
p-arvy Dec 19, 2024
f5149f3
Clean after rebase
p-arvy Dec 30, 2024
ac830a4
Add indicators test for OpenReac
p-arvy Dec 12, 2024
d08278b
line opened on one side
p-arvy Sep 17, 2024
2bd4228
wip
p-arvy Nov 27, 2024
68edf3a
Add RTC on opened branch and associated TUs
p-arvy Nov 27, 2024
75a1d48
Fix indicators on opened branches
p-arvy Dec 16, 2024
2e2f102
Add TUs on opened branches
p-arvy Dec 16, 2024
4785e96
Add resources for branches tests
p-arvy Dec 16, 2024
da38e46
Clean
p-arvy Dec 16, 2024
cc66e6a
Small clean
p-arvy Dec 16, 2024
e01c18d
Update TUs
p-arvy Dec 18, 2024
287b62b
Clean
p-arvy Dec 19, 2024
2063122
Add doc
p-arvy Dec 19, 2024
9d951c1
Improve comment
p-arvy Dec 30, 2024
bb65393
Wip
p-arvy Dec 18, 2024
6e7a9c9
Clean
p-arvy Dec 18, 2024
1f9960c
Add comments/doc
p-arvy Dec 30, 2024
8fdccf6
Update doc
p-arvy Dec 30, 2024
db3f852
Add 6 points diagrams for generators
p-arvy Dec 18, 2024
4d14b8b
wip
p-arvy Dec 20, 2024
f4c4212
wip
p-arvy Dec 30, 2024
4023c03
Upadte TUs
p-arvy Jan 2, 2025
5be4007
wip
p-arvy Jan 2, 2025
1c0daf1
wip
p-arvy Jan 2, 2025
c6a999c
wip
p-arvy Jan 3, 2025
49fa11a
Add doc
p-arvy Jan 3, 2025
ebaeb80
Small clean
p-arvy Jan 3, 2025
ad7f77e
Add resources
p-arvy Jan 3, 2025
f995fc5
Small clean
p-arvy Jan 3, 2025
f2b0a18
Clean comments
p-arvy Jan 3, 2025
43ff404
remove useless check
p-arvy Jan 3, 2025
73363fd
Update comments
p-arvy Jan 3, 2025
425c8dd
Bump powsybl-core to 6.6.0
flo-dup Dec 20, 2024
5e60302
Bump powsybl-open-loadflow to 1.14.1
flo-dup Dec 20, 2024
03dbaf6
Adapt iidm importer to V2 of extended AMPL exporter
p-arvy Dec 4, 2024
92fdf34
Update README
p-arvy Jan 2, 2025
11992ac
Fix targetP/Q used by VSC/LCC converter stations
p-arvy Jan 2, 2025
4c34378
Fix sign in dcopf and add comments
p-arvy Jan 3, 2025
2a51cb7
Update TUs
p-arvy Jan 2, 2025
0664d26
Add TUs
p-arvy Jan 2, 2025
2979dd6
Add resources for TUs
p-arvy Jan 3, 2025
3d139fa
Add doc
p-arvy Jan 3, 2025
c040dee
revert
p-arvy Jan 3, 2025
6aa3b1e
small clean
p-arvy Jan 3, 2025
e39fa12
small revert
p-arvy Jan 3, 2025
8c469e5
Merge branch 'main' into fix-vsc-lcc-targets-in-acopf
So-Fras Jan 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/optimizer/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
## Network data

Files with the prefix `ampl_` contain the data and the parameters of the network on which the reactive OPF is executed.
These files are obtained by using the [V2 of the extended version of PowSyBl AMPL export](https://github.com/powsybl/powsybl-core/blob/main/ampl-converter/src/main/java/com/powsybl/ampl/converter/version/ExtendedAmplExporterV2.java), which is the default version.

These files are obtained by using the [V2 of the extended version of PowSyBl AMPL export](https://github.com/powsybl/powsybl-core/blob/main/ampl-converter/src/main/java/com/powsybl/ampl/converter/version/ExtendedAmplExporterV2.java), which is the default version.

Note that from release `0.10.0` of OpenReac, the active target of VSC and LCC converter stations is calculated using HVDC line active set point
and the converter mode, both specified in `ampl_network_hvdc.txt`. The losses related to rectifier/inverter conversion, and HVDC line **are ignored**.


## Configuration of the run

Expand Down
6 changes: 3 additions & 3 deletions open-reac/src/main/resources/openreac/acopf.mod
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Act_Dir[qq,k,n]
# Loads
+ sum{(c,k) in LOADCC} load_PFix[1,c,k] # Fixed value
# VSC converters
+ sum{(v,k) in VSCCONVON} vscconv_P0[1,v,k] # Fixed value
+ sum{(v,k) in VSCCONVON} vscconv_targetP[v] # Fixed value
# LCC converters
+ sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k] # Fixed value
+ sum{(l,k) in LCCCONVON} lccconv_targetP[l] # Fixed value
= 0; # No slack variables for active power. If data are really too bad, may not converge.


Expand Down Expand Up @@ -220,7 +220,7 @@ sum{(qq,k,n) in BRANCHCC} base100MVA * V[k] * Red_Tran_Rea_Dir[qq,k,n]
# VSC converters
- sum{(v,k) in VSCCONVON} vscconv_qvar[v,k]
# LCC converters
+ sum{(l,k) in LCCCONVON} lccconv_Q0[1,l,k] # Fixed value
+ sum{(l,k) in LCCCONVON} lccconv_q0[1,l,k] # Fixed value
# Slack variables
+ if k in BUSCC_SLACK then
(- base100MVA * V[k]^2 * slack1_shunt_B[k] # Homogeneous to a generation of reactive power (condensator)
Expand Down
41 changes: 36 additions & 5 deletions open-reac/src/main/resources/openreac/commons.mod
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,56 @@ set BATTERYCC := setof {(1,b,n) in BATTERY : n in BUSCC} (b,n);
# Warning: units with Ptarget=0 are considered as out of order
set UNITON := {(g,n) in UNITCC : abs(unit_Pc[1,g,n]) >= Pnull};

# Active and reactive targets of converter stations
# Warning: the losses are ignored
set LCCCONV_NUM := setof{(t,lcc,bus) in LCCCONV}lcc;
set VSCCONV_NUM := setof{(t,vsc,bus) in VSCCONV}vsc;
param lccconv_targetP {LCCCONV_NUM};
param vscconv_targetP {VSCCONV_NUM};
for {(1,h) in HVDC} {
# case of VSC converter stations
if (hvdc_type[1,h] == 1) then {
if (hvdc_convertersMode[1,h] == "SIDE_1_RECTIFIER_SIDE_2_INVERTER") then {
let vscconv_targetP[hvdc_conv1[1,h]] := hvdc_targetP[1,h];
let vscconv_targetP[hvdc_conv2[1,h]] := -hvdc_targetP[1,h];
} else {
let vscconv_targetP[hvdc_conv1[1,h]] := -hvdc_targetP[1,h];
let vscconv_targetP[hvdc_conv2[1,h]] := hvdc_targetP[1,h];
}
}
# case of LCC converter stations
if (hvdc_type[1,h] == 2) then {
if (hvdc_convertersMode[1,h] == "SIDE_1_RECTIFIER_SIDE_2_INVERTER") then {
let lccconv_targetP[hvdc_conv1[1,h]] := hvdc_targetP[1,h];
let lccconv_targetP[hvdc_conv2[1,h]] := -hvdc_targetP[1,h];
} else {
let lccconv_targetP[hvdc_conv1[1,h]] := -hvdc_targetP[1,h];
let lccconv_targetP[hvdc_conv2[1,h]] := hvdc_targetP[1,h];
}
}
}
check {lcc in LCCCONV_NUM}: lccconv_targetP[lcc] != NaN;
check {vsc in VSCCONV_NUM}: vscconv_targetP[vsc] != NaN;

#
# VSC converter stations
#
set VSCCONVON := setof{(t,v,n) in VSCCONV:
n in BUSCC
and abs(vscconv_P0[t,v,n] ) <= PQmax
and abs(vscconv_targetP[v]) <= PQmax
and abs(vscconv_Pmin[t,v,n]) <= PQmax
and abs(vscconv_Pmax[t,v,n]) <= PQmax
and vscconv_P0[t,v,n] >= vscconv_Pmin[t,v,n]
and vscconv_P0[t,v,n] <= vscconv_Pmax[t,v,n]
and vscconv_targetP[v] >= vscconv_Pmin[t,v,n]
and vscconv_targetP[v] <= vscconv_Pmax[t,v,n]
} (v,n);

#
# LCC converter stations
#
set LCCCONVON := setof{(t,l,n) in LCCCONV:
n in BUSCC
and abs(lccconv_P0[1,l,n]) <= PQmax
and abs(lccconv_Q0[1,l,n]) <= PQmax
and abs(lccconv_targetP[l]) <= PQmax
and abs(lccconv_q0[1,l,n]) <= PQmax
} (l,n);


Expand Down
6 changes: 3 additions & 3 deletions open-reac/src/main/resources/openreac/connected_component.run
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ if 1 in LOG_INFO then {
let temp1 := sum{(c,n) in LOADCC} load_PFix[1,c,n];
let temp2 := sum{(g,n) in UNITON} unit_Pc[1,g,n];
let temp2 := temp2 + sum{(b,n) in BATTERYCC} battery_p0[1,b,n];
let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n])+(sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k]);
let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv])+(sum{(l,k) in LCCCONVON} lccconv_targetP[l]);
let global_initial_losses_ratio := (temp2-temp1-temp3)/(temp1+temp3);

printf{LOG_INFO} "HVDC injections (homogeneous to loads):\n";
for {(v,n) in VSCCONVON}
printf{LOG_INFO} "VSC converter %Q in %Q: P0=%.1fMW is fixed, Q is variable\n",
vscconv_id[1,v,n],substation_id[1,bus_substation[1,n]],vscconv_P0[1,v,n];
vscconv_id[1,v,n],substation_id[1,bus_substation[1,n]],vscconv_targetP[v];
for {(l,n) in LCCCONVON}
printf{LOG_INFO} "LCC converter %Q in %Q: P0=%.1fMW is fixed, Q0=%.1fMvar is fixed\n",
lccconv_id[1,l,n],substation_id[1,bus_substation[1,n]],lccconv_P0[1,l,n],lccconv_Q0[1,l,n];
lccconv_id[1,l,n],substation_id[1,bus_substation[1,n]],lccconv_targetP[l],lccconv_q0[1,l,n];
printf{LOG_INFO} "Sum of HVDC conv. H: %.0f MW\n", temp3;
printf{LOG_INFO} "Sum of loads C: %.0f MW\n", temp1;
printf{LOG_INFO} "Sum of generations P: %.0f MW\n", temp2;
Expand Down
4 changes: 2 additions & 2 deletions open-reac/src/main/resources/openreac/dcopf.mod
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ subject to ctr_balance{PROBLEM_DCOPF, n in BUSCC}:
+ sum{(c,n) in LOADCC} load_PFix[1,c,n]
+ sum{(qq,n,m) in BRANCHCC} activeflow[qq,n,m] # active power flow outgoing on branch qq at bus n
- sum{(qq,m,n) in BRANCHCC} activeflow[qq,m,n] # active power flow entering in bus n on branch qq
+ sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n]
+ sum{(l,n) in LCCCONVON} lccconv_P0[1,l,n]
+ sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv]
+ sum{(l,n) in LCCCONVON} lccconv_targetP[l]
=
balance_pos[n] - balance_neg[n];

Expand Down
2 changes: 1 addition & 1 deletion open-reac/src/main/resources/openreac/dcopf.run
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ for {(g,n) in UNITON : abs(P_dcopf[g,n]-unit_Pc[1,g,n]) >= temp2*0.99}
let temp1 := sum{(c,n) in LOADCC} load_PFix[1,c,n];
let temp2 := sum{(g,n) in UNITON} P_dcopf[g,n];
let temp2 := temp2 + sum{(b,n) in BATTERYCC} battery_p0[1,b,n];
let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_P0[1,vscconv,n])+(sum{(l,k) in LCCCONVON} lccconv_P0[1,l,k]);
let temp3 := (sum{(vscconv,n) in VSCCONVON} vscconv_targetP[vscconv])+(sum{(l,k) in LCCCONVON} lccconv_targetP[l]);
printf{LOG_INFO} "Sum of HVDC conv. H: %.0f MW\n", temp3;
printf{LOG_INFO} "Sum of loads C: %.0f MW\n", temp1;
printf{LOG_INFO} "Sum of generations P: %.0f MW\n", temp2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ printf{(v,n) in VSCCONVON} "%i;%i;%i;%Q;%.3f;%.1f;%.1f;%.1f;\n",
vscconv_vregul[1,v,n],
V[n],
vscconv_qvar[v,n],
vscconv_P0[1,v,n],
vscconv_targetP[v],
vscconv_qvar[v,n]
> (fileOut);
close (fileOut);
Expand Down
Loading
Loading