Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sophie Frasnedo <[email protected]>
  • Loading branch information
So-Fras committed Nov 29, 2024
1 parent 6377365 commit a022b28
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ OpenReac is a reactive optimal power flow that gives a set of hypotheses for vol
---
maxdepth: 2
hidden: true
gettingStarted.md
optimizer/index
---
gettingStarted.md
optimizer/index.md
```

2 changes: 1 addition & 1 deletion docs/optimizer/acOptimalPowerflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Then, the following values will be variable in the optimization:
- $\boldsymbol{Q_{i,vsc}}$ the reactive power produced by voltage source converter stations $vsc$ of bus $i$.
- $\boldsymbol{b_{i,g}}$ (resp. $\boldsymbol{b_{i,svc}}$) the susceptance of shunt $s$ (resp. of static var compensator $svc$) of bus $i$.
- $\boldsymbol{\rho_{ij}}$ the transformer ratio of the ratio tap changer on branch $ij$,
specified as variable by the user (see [3.2](#32-configuration-of-the-run)).
specified as variable by the user (see [Configuration of the run](inputs.md#configuration-of-the-run)).

Please note that:
- Units with active power specified in `ampl_network_generators.txt` that is less than the configurable parameter `Pnull` **are excluded from the optimization**,
Expand Down
8 changes: 4 additions & 4 deletions docs/optimizer/divisionOfCode.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

The code of the reactive OPF is divided into several files, each serving a specific function:

- `reactiveopf.dat` defines the network data files imported (files with *ampl_* prefix), and the files used to configure the run (files with *param_* prefix).
- `reactiveopf.dat` defines the network data files imported (files with *ampl_* prefix), and the files used to configure the run (files with *param_* prefix).
See [Inputs](inputs.md).

- `iidm_importer.mod`, `or_param_importer.mod` and `commons.mod` define the sets and parameters of the optimization.

- `connected_component.mod`, `dcopf.mod` and `acopf.mod` define the optimization problems solved in `reactiveopf.run`.
- `connected_component.mod`, `dcopf.mod` and `acopf.mod` define the optimization problems solved in `reactiveopf.run`.
See [Slack bus and main connex components](slackBusMainConnexComponent.md), [DC optimal power flow](dcOptimalPowerflow.md) and [AC optimal power flow](acOptimalPowerflow.md), respectively.

- `connected_component.run`, `dcopf.run`, `acopf_preprocessing.run` and `acopf.run` orchestrate the optimization and its post-process.

- `reactiveopfoutput.mod` exports result files if the execution of `reactiveopf.run` is successful.
- `reactiveopfoutput.mod` exports result files if the execution of `reactiveopf.run` is successful.
See [Outputs](outputs.md#in-case-of-convergence).

- `reactiveopfexit.run` contains the code executed when the process fails.
- `reactiveopfexit.run` contains the code executed when the process fails.
Refer to section [8.2](outputs.md#in-case-of-inconsistency).

- `reactiveopf.run` executes the AMPL process of OpenReac, calling the previous scripts.
Expand Down
4 changes: 2 additions & 2 deletions docs/optimizer/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Overview
# OpenReac

The reactive optimal power flow (OPF) is implemented with AMPL.
Its goal is to compute voltage values on each point of the network as well as control values for reactive equipment and controllers of the grid (voltage set point of generating units, shunts, transformer ratios...).
Expand All @@ -13,14 +13,14 @@ Please notice that this reactive OPF does **not** decide active power of generat
---
maxdepth: 2
hidden: true
---
divisionOfCode.md
inputs.md
preprocessing.md
slackBusMainConnexComponent.md
dcOptimalPowerflow.md
acOptimalPowerflow.md
outputs.md
---
```

17 changes: 9 additions & 8 deletions docs/optimizer/inputs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +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 [extended version of PowSyBl AMPL export](inv:powsyblcore:*:*:#the-extendedamplexporter), which is the default version.
These files are obtained by using the [PowSyBl AMPL export](inv:powsyblcore:*:*:#grid_exchange_formats/ampl/export), which is the default version.

## Configuration of the run

The user can configure the run with the dedicated Java interface
(see [OpenReacParameters](../open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java)).
(see [OpenReacParameters](https://github.com/powsybl/powsybl-optimizer/blob/main/open-reac/src/main/java/com/powsybl/openreac/parameters/input/OpenReacParameters.java)).
Specifically, the user can set various parameters and thresholds used in the preprocessing and modeling of the reactive OPF.
These are specified in the file `param_algo.txt`:

Expand All @@ -17,10 +17,10 @@ These are specified in the file `param_algo.txt`:
| `log_level_ampl` | Level of display for AMPL prints | INFO | {DEBUG, INFO, WARNING, ERROR} |
| `log_level_knitro` | Level of display for solver prints (see [AMPL documentation](https://dev.ampl.com/ampl/options.html)) | $1$ | {0, 1, 2} |
| `objective_choice` | Choice of the objective function for the ACOPF (see [AC optimal powerflow](acOptimalPowerflow.md)) | $0$ | {0, 1, 2} |
| `ratio_voltage_target` | Ratio to calculate target V of buses when `objective_choice` is set to $1$ (see [AC optimal powerflow](acOptimalPowerflow.md)) | $0.5$ | $\[0; 1\]$ |
| `coeff_alpha` | Weight to favor more/less minimization of active power produced by generators or deviation between them and target values (see [AC optimal powerflow](acOptimalPowerflow.md)) | $1$ | $\[0; 1\]$ |
| `Pnull` | Threshold of active and reactive powers considered as null | $0.01$ (MW) | $\[0; 1\]$ |
| `Znull` | Threshold of impedance considered as null (see [Zero impedance threshold](preprocessing.md#zero-impedance-threshold)) | $10^{-5}$ (p.u.) | $\[0; 0.1\]$ |
| `ratio_voltage_target` | Ratio to calculate target V of buses when `objective_choice` is set to $1$ (see [AC optimal powerflow](acOptimalPowerflow.md)) | $0.5$ | $[0; 1]$ |
| `coeff_alpha` | Weight to favor more/less minimization of active power produced by generators or deviation between them and target values (see [AC optimal powerflow](acOptimalPowerflow.md)) | $1$ | $[0; 1]$ |
| `Pnull` | Threshold of active and reactive powers considered as null | $0.01$ (MW) | $[0; 1]$ |
| `Znull` | Threshold of impedance considered as null (see [Zero impedance threshold](preprocessing.md#zero-impedance-threshold)) | $10^{-5}$ (p.u.) | $[0; 0.1]$ |
| `epsilon_nominal_voltage` | Threshold to ignore voltage levels with nominal voltage lower than it | $1$ (kV) | $\mathbb{R}^{+}$ |
| `min_plausible_low_voltage_limit` | Consistency bound for low voltage limit of voltage levels (see [Voltage level limit consistency](preprocessing.md#voltage-level-limit-consistency)) | $0.5$ (p.u.) | $\mathbb{R}^{+}$ |
| `max_plausible_high_voltage_limit` | Consistency bound for high voltage limit of voltage levels (see [Voltage level limit consistency](preprocessing.md#voltage-level-limit-consistency)) | $1.5$ (p.u.) | [`min_plausible_low_voltage_limit`; $\infty$] |
Expand All @@ -46,7 +46,7 @@ This is done using the following files:
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|
| `param_transformers.txt` | Ratio tap changers with a variable transformation ratio (real variable) | Transformation ratios are fixed |
| `param_shunt.txt` | Shunts with a continuous variable susceptance and which can be modified and/or connected (only if possible bus is defined in `ampl_network_shunts.txt`) | Shunt susceptances are fixed |
| `param_generators_reactive.txt` | Generators with a constant reactive power production. If this value is not consistent (> PQmax), the reactive power production stays variable | Coherent reactive power productions (see [4.5](#45-pq-units-domain)) are variable |
| `param_generators_reactive.txt` | Generators with a constant reactive power production. If this value is not consistent (> PQmax), the reactive power production stays variable | Coherent reactive power productions (see [P/Q unit domain](preprocessing.md#pq-unit-domain)) are variable |
| `param_buses_with_reactive_slack.txt` | Buses with attached reactive slacks if configurable parameter buses_with_reactive_slacks = "CONFIGURED" | Only buses with no reactive power production have reactive slacks attached |

All of these files share the same format: 2 columns #"num" "id".
Expand All @@ -58,4 +58,5 @@ If so, empty files will be created during execution.

In addition to the elements specified in section [Configuration of the run](#configuration-of-the-run), the user may choose to override the voltage limits of specified voltage levels. These values must be defined in `ampl_network_substations_override.txt` and are employed to establish the new voltage limits as specified in section [Voltage level limit consistency](preprocessing.md#voltage-level-limit-consistency).

Format of `ampl_network_substations_override.txt`: 4 columns #"num" "minV (pu)" "maxV (pu)" "id"
Format of `ampl_network_substations_override.txt`: 4 columns
\#"num" "minV (pu)" "maxV (pu)" "id"
6 changes: 3 additions & 3 deletions docs/optimizer/preprocessing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

Before solving the reactive ACOPF described in [AC optimal powerflow](acOptimalPowerflow.md), the following pre-processing blocks are executed to ensure the consistency of the values used in the optimization.

##Voltage level limit consistency
## Voltage level limit consistency

To ensure consistent voltage level limits for the buses, the configurable domain [`min_plausible_low_voltage_limit`; `max_plausible_high_voltage_limit`] is used (see [Configuration of the run](inputs.md#configuration-of-the-run)).

Let $V_{s}^{min}$ (resp. $V_{s}^{max}$) be the low (resp. high) voltage limit of substation $s$ specified in `ampl_network_substations.txt` (or in `ampl_network_substations_override.txt` if an override is given for $s$) and $V_{s}^{min,c}$ (resp. $V_{s}^{max,c}$) its associated corrected low (resp. high) limit. Then, the limits are calculated as follows:
- $V_{s}^{min,c} = \max(V_{s}^{min},$ min_plausible_low_voltage_limit)
- $V_{s}^{max,c} = \min(V_{s}^{max},$ max_plausible_low_voltage_limit)

## Zero-impedance branches
## Zero-impedance threshold

Branches with an impedance magnitude, **calculated in per unit**, lower than the configurable threshold `Znull` (see section [Configuration of the run](inputs.md#configuration-of-the-run)) are considered as non-impedant.
These branches will have their reactance replaced by the threshold `Znull` (in p.u.), **even if the reactance specified in `ampl_network_branches.txt` is negative**.

## Impedance of transformers

In the calculations of the ACOPF (see [AC optimal powerflow](acOptimalPowerflow.md)), the transformers with an impedance (specified in `ampl_network_branches.txt`) considered as null (see [Zero-impedance branches](preprocessing.md#zero-impedance-branches)) **are treated as lines**. Then, the transformation ratios/phase shifts are ignored, as well as the impedance specified in the tap changer table `ampl_network_tct.txt`.
In the calculations of the ACOPF (see [AC optimal powerflow](acOptimalPowerflow.md)), the transformers with an impedance (specified in `ampl_network_branches.txt`) considered as null (see [Zero-impedance threshold](#zero-impedance-threshold)) **are treated as lines**. Then, the transformation ratios/phase shifts are ignored, as well as the impedance specified in the tap changer table `ampl_network_tct.txt`.

For phase shifters transformers considered as impedant, the reactance values from the tap changer table (in `ampl_network_tct.txt`) replace the reactance specified in `ampl_network_branches.txt`. The resistance is then calculated proportionally.
For the ratio tap changers, the impedance stays as specified in `ampl_network_branches.txt`. **Please notice there is no specified handling for cases where resistance and/or reactance is negative or if there is both a ratio tap changer and a phase shift transformer on the same branch.**
Expand Down

0 comments on commit a022b28

Please sign in to comment.