-
Notifications
You must be signed in to change notification settings - Fork 47
PV node: feature #185 #1220
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
base: main
Are you sure you want to change the base?
PV node: feature #185 #1220
Changes from all commits
a1f0e28
8223f34
14385e9
7018653
f0e3e3d
f941c6a
75e2712
74855cc
6bd31b2
87968f6
e910ac0
f427319
17e9f31
a39d17e
3b5a694
5d60a9b
a29ba67
b63dbb8
eb9e104
e22d164
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ Physically a node can be a busbar, a joint, or other similar component. | |
| | `q` | `RealValueOutput` | volt-ampere-reactive (var) | reactive power injection | | ||
|
|
||
| ```{note} | ||
| The `p` and `q` output of injection follows the `generator` reference direction as mentioned in | ||
| The `p` and `q` output of injection follows the `generator` reference direction as mentioned in | ||
| {hoverxreftooltip}`user_manual/data-model:Reference Direction` | ||
| ``` | ||
|
|
||
|
|
@@ -256,7 +256,7 @@ $$ | |
|
|
||
| where $z_{\text{base,transformer}} = 1 / y_{\text{base,transformer}} = {u_{\text{2}}}^2 / s_{\text{n}}$. | ||
|
|
||
| ### Generic Branch | ||
| ### Generic Branch | ||
|
|
||
| * type name: `generic_branch` | ||
|
|
||
|
|
@@ -992,7 +992,7 @@ per method on how the variances are taken into account for both the global and l | |
| individual phases. | ||
|
|
||
| ```{note} | ||
| The combination of `i_measured=0` and `i_angle_measured=nπ/2` renders the current sensor invalid for PGM. | ||
| The combination of `i_measured=0` and `i_angle_measured=nπ/2` renders the current sensor invalid for PGM. | ||
| See [State estimate sensor transformations](calculations.md#state-estimate-sensor-transformations). | ||
| ``` | ||
|
|
||
|
|
@@ -1245,3 +1245,78 @@ node_1 --- transformer_4 --- node_2 --- line_5 --- node_3 | |
| source_6 | load_7 | ||
| transformer_tap_regulator_8 | ||
| ``` | ||
|
|
||
| ### Voltage Regulator | ||
|
|
||
| * type name: `voltage_regulator` | ||
| * base: {hoverxreftooltip}`user_manual/components:regulator` | ||
|
|
||
| `voltage_regulator` defines a regulator for voltage-controlled generators in the grid. | ||
| A voltage regulator adjusts the reactive power output of a generator to maintain the voltage at its connection node at a specified setpoint. | ||
|
|
||
| The voltage regulator changes the reactive power output of the generator it regulates to achieve the reference voltage `u_ref` at the generator's node. | ||
| If `q_min` and `q_max` are provided, the reactive power is constrained within this range (i.e., `q_min <= q <= q_max` or `q_min >= q >= q_max`). | ||
| If these limits are not provided, the reactive power can take any value needed to maintain the voltage setpoint. | ||
|
|
||
| ```{warning} | ||
| Voltage regulation is only supported by the [Newton-Raphson](#newton-raphson-power-flow) method as an experimental feature. | ||
| ``` | ||
|
|
||
| ```{note} | ||
| The `regulated_object` must reference a generator (`sym_gen` or `asym_gen`) or a load (`sym_load` or `asym_load`). | ||
| Each generator or load can have at most one voltage regulator. | ||
| When multiple voltage-regulated generators are connected to the same node, they should all specify the same `u_ref` value to avoid conflicting voltage setpoints. | ||
| ``` | ||
|
|
||
| ```{warning} | ||
| Reactive power limit checking is not yet fully implemented. When `q_min` and `q_max` are specified, the intended behavior is that if the required reactive power to maintain `u_ref` exceeds these limits, the voltage regulator should operate at the limit and the voltage may deviate from `u_ref`. | ||
| ``` | ||
|
|
||
| #### Input | ||
|
|
||
| | name | data type | unit | description | required | update | valid values | | ||
| | -------- | --------- | -------------------------- | --------------------------------------------------- | :--------------------------: | :------: | :----------: | | ||
| | `u_ref` | `double` | - | reference voltage in per-unit at the generator node | ✨ only for power flow | ✔ | `> 0` | | ||
| | `q_min` | `double` | volt-ampere-reactive (var) | minimum reactive power limit of the generator | ❌ | ✔ | | | ||
| | `q_max` | `double` | volt-ampere-reactive (var) | maximum reactive power limit of the generator | ❌ | ✔ | | | ||
|
|
||
| #### Steady state output | ||
|
|
||
| | name | data type | unit | description | | ||
| | ----------------- | ----------------- | -------------------------- | -------------------------------------------------------------------- | | ||
| | `q` | `RealValueOutput` | volt-ampere-reactive (var) | reactive power provided by the voltage regulator | | ||
| | `limit_violated` | `int8_t` | - | reactive power limit violation indicator (not yet fully implemented) | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated to this PR but maybe we should add such a flag to the tap regulator as well. Relates to #1215
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this comment does not relate to SOPTIM |
||
|
|
||
| #### Short circuit output | ||
|
|
||
| A `voltage_regulator` has no short circuit output. | ||
|
|
||
| #### Electric Model | ||
|
|
||
| The voltage regulator controls the generator to behave as a **PV node** in power flow calculations: | ||
|
|
||
| $$ | ||
| \begin{eqnarray} | ||
| & P_{\text{gen}} = P_{\text{specified}} \\ | ||
| & |U_{\text{node}}| = U_{\text{ref}} \\ | ||
| & Q_{\text{gen}} = \text{calculated to satisfy } U_{\text{ref}} | ||
| \end{eqnarray} | ||
| $$ | ||
|
|
||
| When `q_min` and `q_max` are provided, the reactive power should be constrained: | ||
|
|
||
| $$ | ||
| Q_{\text{min}} \leq Q_{\text{gen}} \leq Q_{\text{max}} | ||
| $$ | ||
|
|
||
| When fully implemented, if the reactive power constraints are violated, the generator will operate at the limit and the node becomes a PQ node: | ||
|
|
||
| $$ | ||
| \begin{eqnarray} | ||
| & P_{\text{gen}} = P_{\text{specified}} \\ | ||
| & Q_{\text{gen}} = Q_{\text{min}} \text{ or } Q_{\text{max}} \\ | ||
| & |U_{\text{node}}| = \text{calculated from power flow} | ||
| \end{eqnarray} | ||
| $$ | ||
|
|
||
| In this case, `limit_violated` will indicate which limit was exceeded, and the actual voltage at the node may differ from `u_ref`. | ||
|
Comment on lines
+1312
to
+1322
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since this is not fully implemented yet, do we want to explicitly mention the current behavior with a big warning note that this is temporary behavior?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, you may add this as an experimental feature temporarily. That way, it's fine if things will change but we can already merge it and it can already be tested by users, but we do not settle on final results yet.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, could you describe how to implement an experimental feature - otherwise we would prefer a warn-message.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. a warning-note!
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have a function See e.g. #1062 in which we removed the experimental feature flag for current sensors: ( https://github.com/PowerGridModel/power-grid-model/pull/1062/changes#diff-cc6d6a55667a569640705486e5990498b32f2a3ecf9fec770922a5b69a71920a ) You can add a similar check that searches for voltage regulators in power flow calculations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. using experimental feature |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,14 +24,15 @@ | |
| #include "component/three_winding_transformer.hpp" | ||
| #include "component/transformer.hpp" | ||
| #include "component/transformer_tap_regulator.hpp" | ||
| #include "component/voltage_regulator.hpp" | ||
| #include "component/voltage_sensor.hpp" | ||
|
|
||
| namespace power_grid_model { | ||
|
|
||
| using AllComponents = | ||
| ComponentList<Node, Line, AsymLine, Link, GenericBranch, Transformer, ThreeWindingTransformer, Shunt, Source, | ||
| SymGenerator, AsymGenerator, SymLoad, AsymLoad, SymPowerSensor, AsymPowerSensor, SymVoltageSensor, | ||
| AsymVoltageSensor, SymCurrentSensor, AsymCurrentSensor, Fault, TransformerTapRegulator>; | ||
| AsymVoltageSensor, SymCurrentSensor, AsymCurrentSensor, Fault, TransformerTapRegulator, VoltageRegulator>; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also Nice to add a check in In this case it should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
|
||
| using AllExtraRetrievableTypes = | ||
| ExtraRetrievableTypes<Base, Node, Branch, Branch3, Appliance, GenericLoadGen, GenericLoad, GenericGenerator, | ||
|
|
||
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.
probably good to explicitly mention that only Newton-Raphson calculation method is supported
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.
done