From 460e52991531a62b87bb8c265986a93748c7c8df Mon Sep 17 00:00:00 2001 From: p-arvy Date: Wed, 4 Dec 2024 19:26:56 +0100 Subject: [PATCH] Adapt iidm importer to V2 of extended AMPL exporter Signed-off-by: p-arvy --- open-reac/README.md | 2 +- open-reac/pom.xml | 2 +- .../src/main/resources/openreac/iidm_importer.mod | 5 +++++ .../src/main/resources/openreac/reactiveopf.dat | 14 +++++++------- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/open-reac/README.md b/open-reac/README.md index fed9aedf..88108609 100644 --- a/open-reac/README.md +++ b/open-reac/README.md @@ -75,7 +75,7 @@ each serving a specific function: 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 -[extended version of PowSyBl AMPL export](https://github.com/powsybl/powsybl-core/blob/main/ampl-converter/src/main/java/com/powsybl/ampl/converter/version/ExtendedAmplExporter.java), which is the default version. +[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. #### 3.2 Configuration of the run diff --git a/open-reac/pom.xml b/open-reac/pom.xml index 000f5892..8cb4b082 100644 --- a/open-reac/pom.xml +++ b/open-reac/pom.xml @@ -22,7 +22,7 @@ OpenReac optimizer - 6.5.0-RC1 + 6.6.0-SNAPSHOT 1.12.1 diff --git a/open-reac/src/main/resources/openreac/iidm_importer.mod b/open-reac/src/main/resources/openreac/iidm_importer.mod index eb902755..6828df1d 100644 --- a/open-reac/src/main/resources/openreac/iidm_importer.mod +++ b/open-reac/src/main/resources/openreac/iidm_importer.mod @@ -108,6 +108,7 @@ param unit_Qp {UNIT}; param unit_vregul {UNIT} symbolic; # Does unit do voltage regulation, or PQ bus? param unit_vregul_bus {UNIT} integer; # Bus regulated by unit, if it does voltage regulation param unit_Vc {UNIT}; # Voltage set point (in case of voltage regulation) +param unit_condenser {UNIT} symbolic; # Is unit a condenser param unit_Pc {UNIT}; # Active power set point param unit_Qc {UNIT}; # Rective power set point (in case no voltage regulation) param unit_fault {UNIT}; @@ -418,6 +419,7 @@ check {(t,cs,n) in VSCCONV}: vscconv_qP[t,cs,n] <= vscconv_QP[t,cs,n]; set LCCCONV dimen 3; # [variant, num, bus] param lccconv_possiblebus {LCCCONV} integer; param lccconv_substation {LCCCONV} integer; +param lccconv_q0 {LCCCONV}; # Load target q of lcc converter station param lccconv_loss_factor {LCCCONV}; param lccconv_power_factor{LCCCONV}; param lccconv_fault {LCCCONV}; @@ -441,7 +443,10 @@ param hvdc_conv2 {HVDC} integer; param hvdc_r {HVDC}; param hvdc_Vnom {HVDC}; param hvdc_convertersMode {HVDC} symbolic; +param hvdc_ac_emul {HVDC} symbolic; # Is the line emulating in AC param hvdc_targetP {HVDC}; +param hvdc_p0 {HVDC}; # Active power offset of ac emulation +param hvdc_k {HVDC}; param hvdc_Pmax {HVDC}; param hvdc_fault {HVDC}; param hvdc_curative {HVDC}; diff --git a/open-reac/src/main/resources/openreac/reactiveopf.dat b/open-reac/src/main/resources/openreac/reactiveopf.dat index 95248550..ed1564f6 100644 --- a/open-reac/src/main/resources/openreac/reactiveopf.dat +++ b/open-reac/src/main/resources/openreac/reactiveopf.dat @@ -25,8 +25,8 @@ param: SUBSTATIONS: substation_horizon substation_fodist substation_Vnomi substa param: BUS: bus_substation bus_CC bus_SC bus_V0 bus_angl0 bus_injA bus_injR bus_slack bus_fault bus_curative bus_id := include ampl_network_buses.txt; # ampl_network_generators.txt -#"variant" "num" "bus" "con. bus" "substation" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "v regul." "v regul. bus" "targetV (pu)" "targetP (MW)" "targetQ (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" -param: UNIT: unit_potentialbus unit_substation unit_Pmin unit_Pmax unit_qP unit_qp0 unit_qp unit_QP unit_Qp0 unit_Qp unit_vregul unit_vregul_bus unit_Vc unit_Pc unit_Qc unit_fault unit_curative unit_id unit_name unit_P0 unit_Q0 := include ampl_network_generators.txt; +#"variant" "num" "bus" "con. bus" "substation" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "v regul." "v regul. bus" "targetV (pu)" "condenser" "targetP (MW)" "targetQ (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +param: UNIT: unit_potentialbus unit_substation unit_Pmin unit_Pmax unit_qP unit_qp0 unit_qp unit_QP unit_Qp0 unit_Qp unit_vregul unit_vregul_bus unit_Vc unit_condenser unit_Pc unit_Qc unit_fault unit_curative unit_id unit_name unit_P0 unit_Q0 := include ampl_network_generators.txt; # ampl_network_loads.txt #"variant" "num" "bus" "substation" "p (MW)" "q (MVar)" "fault" "curative" "id" "description" "p (MW)" "q (MVar)" @@ -41,7 +41,7 @@ param: SHUNT: shunt_possiblebus shunt_substation shunt_valmin shunt_valmax shunt param: SVC: svc_possiblebus svc_substation svc_bmin svc_bmax svc_vregul svc_vregul_bus svc_targetV svc_targetQ svc_fault svc_curative svc_id svc_description svc_P0 svc_Q0 := include ampl_network_static_var_compensators.txt; # ampl_network_batteries.txt -#"variant" "num" "bus" "con. bus" "substation" "p0 (MW)" "q0 (MW)" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +#"variant" "num" "bus" "con. bus" "substation" "p0 (MW)" "q0 (MVar)" "minP (MW)" "maxP (MW)" "minQmaxP (MVar)" "minQ0 (MVar)" "minQminP (MVar)" "maxQmaxP (MVar)" "maxQ0 (MVar)" "maxQminP (MVar)" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" param: BATTERY: battery_possiblebus battery_substation battery_p0 battery_q0 battery_Pmin battery_Pmax battery_qP battery_qp0 battery_qp battery_QP battery_Qp0 battery_Qp battery_fault battery_curative battery_id battery_name battery_P0 battery_Q0 := include ampl_network_batteries.txt; # ampl_network_tct.txt @@ -62,13 +62,13 @@ param: DEPH: deph_tap0 deph_table deph_fault deph_curative deph_id := include am param: VSCCONV: vscconv_possiblebus vscconv_substation vscconv_Pmin vscconv_Pmax vscconv_qP vscconv_qp0 vscconv_qp vscconv_QP vscconv_Qp0 vscconv_Qp vscconv_vregul vscconv_targetV vscconv_targetQ vscconv_lossFactor vscconv_fault vscconv_curative vscconv_id vscconv_description vscconv_P0 vscconv_Q0 := include ampl_network_vsc_converter_stations.txt; # ampl_network_lcc_converter_stations.txt -#"variant" "num" "bus" "con. bus" "substation" "lossFactor (%PDC)" "powerFactor" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" -param: LCCCONV: lccconv_possiblebus lccconv_substation lccconv_loss_factor lccconv_power_factor lccconv_fault lccconv_curative lccconv_id lccconv_description lccconv_P0 lccconv_Q0 := include ampl_network_lcc_converter_stations.txt; +#"variant" "num" "bus" "con. bus" "substation" "q0 (MVar)" "lossFactor (%PDC)" "powerFactor" "fault" "curative" "id" "description" "P (MW)" "Q (MVar)" +param: LCCCONV: lccconv_possiblebus lccconv_substation lccconv_q0 lccconv_loss_factor lccconv_power_factor lccconv_fault lccconv_curative lccconv_id lccconv_description lccconv_P0 lccconv_Q0 := include ampl_network_lcc_converter_stations.txt; #ampl_network_hvdc.txt -#"variant" "num" "type" "converterStation1" "converterStation2" "r (ohm)" "nomV (KV)" "convertersMode" "targetP (MW)" "maxP (MW)" "fault" "curative" "id" "description" +#"variant" "num" "type" "converterStation1" "converterStation2" "r (ohm)" "nomV (KV)" "convertersMode" "ac emul." "targetP (MW)" "P offset (MW)" "k (MW/rad)" "maxP (MW)" "fault" "curative" "id" "description" #ampl_network_hvdc.txt -param: HVDC: hvdc_type hvdc_conv1 hvdc_conv2 hvdc_r hvdc_Vnom hvdc_convertersMode hvdc_targetP hvdc_Pmax hvdc_fault hvdc_curative hvdc_id hvdc_description := include ampl_network_hvdc.txt; +param: HVDC: hvdc_type hvdc_conv1 hvdc_conv2 hvdc_r hvdc_Vnom hvdc_convertersMode hvdc_ac_emul hvdc_targetP hvdc_p0 hvdc_k hvdc_Pmax hvdc_fault hvdc_curative hvdc_id hvdc_description := include ampl_network_hvdc.txt; # ampl_network_branches.txt #"variant" "num" "bus1" "bus2" "3wt num" "sub.1" "sub.2" "r (pu)" "x (pu)" "g1 (pu)" "g2 (pu)" "b1 (pu)" "b2 (pu)" "cst ratio (pu)" "ratio tc" "phase tc" "p1 (MW)" "p2 (MW)" "q1 (MVar)" "q2 (MVar)" "patl1 (A)" "patl2 (A)" "merged" "fault" "curative" "id" "description"