diff --git a/code_generation/data/attribute_classes/input.json b/code_generation/data/attribute_classes/input.json index 098bf92dc5..e621f65d0d 100644 --- a/code_generation/data/attribute_classes/input.json +++ b/code_generation/data/attribute_classes/input.json @@ -223,7 +223,7 @@ }, { "data_type": "double", - "names": ["uk", "pk", "i0", "p0"], + "names": ["uk", "pk", "i0", "p0", "i0_zero_sequence", "p0_zero_sequence"], "description": "short circuit and open testing parameters" }, { diff --git a/docs/user_manual/components.md b/docs/user_manual/components.md index ce113af7e6..79cd04d955 100644 --- a/docs/user_manual/components.md +++ b/docs/user_manual/components.md @@ -87,12 +87,12 @@ In this case, the attribute `from_status` and `to_status` is always 1. #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ------------- | --------- | ---- | ------------------------------ | :------: | :------: | :-------------: | | `from_node` | `int32_t` | - | ID of node at from-side | ✔ | ❌ | a valid node ID | | `to_node` | `int32_t` | - | ID of node at to-side | ✔ | ❌ | a valid node ID | -| `from_status` | `int8_t` | - | connection status at from-side | ✔ | ✔ | `0` or `1` | -| `to_status` | `int8_t` | - | connection status at to-side | ✔ | ✔ | `0` or `1` | +| `from_status` | `int8_t` | - | connection status at from-side | ✔ | ✔ | `0` or `1` | +| `to_status` | `int8_t` | - | connection status at to-side | ✔ | ✔ | `0` or `1` | #### Steady state output @@ -128,17 +128,17 @@ If `i_n` is not provided, `loading` of line will be a `nan` value. #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ------ | --------- | ---------- | -------------------------------------------------- | :---------------------------------------: | :------: | :--------------------------------: | -| `r1` | `double` | ohm (Ω) | positive-sequence serial resistance | ✔ | ❌ | `r1` and `x1` cannot be both `0.0` | -| `x1` | `double` | ohm (Ω) | positive-sequence serial reactance | ✔ | ❌ | `r1` and `x1` cannot be both `0.0` | -| `c1` | `double` | farad (F) | positive-sequence shunt capacitance | ✔ | ❌ | | -| `tan1` | `double` | - | positive-sequence shunt loss factor (tan δ) | ✔ | ❌ | | +| `r1` | `double` | ohm (Ω) | positive-sequence serial resistance | ✔ | ❌ | `r1` and `x1` cannot be both `0.0` | +| `x1` | `double` | ohm (Ω) | positive-sequence serial reactance | ✔ | ❌ | `r1` and `x1` cannot be both `0.0` | +| `c1` | `double` | farad (F) | positive-sequence shunt capacitance | ✔ | ❌ | | +| `tan1` | `double` | - | positive-sequence shunt loss factor (tan δ) | ✔ | ❌ | | | `r0` | `double` | ohm (Ω) | zero-sequence serial resistance | ✨ only for asymmetric calculations | ❌ | `r0` and `x0` cannot be both `0.0` | | `x0` | `double` | ohm (Ω) | zero-sequence serial reactance | ✨ only for asymmetric calculations | ❌ | `r0` and `x0` cannot be both `0.0` | | `c0` | `double` | farad (F) | zero-sequence shunt capacitance | ✨ only for asymmetric calculations | ❌ | | | `tan0` | `double` | - | zero-sequence shunt loss factor (tan δ) | ✨ only for asymmetric calculations | ❌ | | -| `i_n` | `double` | ampere (A) | rated current | ❌ | ❌ | `> 0` | +| `i_n` | `double` | ampere (A) | rated current | ❌ | ❌ | `> 0` | ```{note} In case of short circuit calculations, the zero-sequence parameters are required only if any of the faults in any of the @@ -185,38 +185,53 @@ An example of usage of transformer is given in [Transformer Examples](../example #### Input -| name | data type | unit | description | required | update | valid values | -| ------------------ | ----------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-----------------------------------------------------: | :------: | :--------------------------------------------------------------------: | -| `u1` | `double` | volt (V) | rated voltage at from-side | ✔ | ❌ | `> 0` | -| `u2` | `double` | volt (V) | rated voltage at to-side | ✔ | ❌ | `> 0` | -| `sn` | `double` | volt-ampere (VA) | rated power | ✔ | ❌ | `> 0` | -| `uk` | `double` | - | relative short circuit voltage, `0.1` means 10% | ✔ | ❌ | `>= pk / sn` and `> 0` and `< 1` | -| `pk` | `double` | watt (W) | short circuit (copper) loss | ✔ | ❌ | `>= 0` | -| `i0` | `double` | - | relative no-load current | ✔ | ❌ | `>= p0 / sn` and `< 1` | -| `p0` | `double` | watt (W) | no-load (iron) loss | ✔ | ❌ | `>= 0` | -| `winding_from` | {py:class}`WindingType ` | - | from-side winding type | ✔ | ❌ | | -| `winding_to` | {py:class}`WindingType ` | - | to-side winding type | ✔ | ❌ | | -| `clock` | `int8_t` | - | clock number of phase shift. Even number is not possible if one side is Y(N) winding and the other side is not Y(N) winding. Odd number is not possible, if both sides are Y(N) winding or both sides are not Y(N) winding. | ✔ | ❌ | `>= -12` and `<= 12` | -| `tap_side` | {py:class}`BranchSide ` | - | side of tap changer | ✔ | ❌ | | -| `tap_pos` | `int8_t` | - | current position of tap changer | ❌ default `tap_nom`, if no `tap_nom` default `0` | ✔ | `(tap_min <= tap_pos <= tap_max)` or `(tap_min >= tap_pos >= tap_max)` | -| `tap_min` | `int8_t` | - | position of tap changer at minimum voltage | ✔ | ❌ | | -| `tap_max` | `int8_t` | - | position of tap changer at maximum voltage | ✔ | ❌ | | -| `tap_nom` | `int8_t` | - | nominal position of tap changer | ❌ default `0` | ❌ | `(tap_min <= tap_nom <= tap_max)` or `(tap_min >= tap_nom >= tap_max)` | -| `tap_size` | `double` | volt (V) | size of each tap of the tap changer | ✔ | ❌ | `>= 0` | -| `uk_min` | `double` | - | relative short circuit voltage at minimum tap | ❌ default same as `uk` | ❌ | `>= pk_min / sn` and `> 0` and `< 1` | -| `uk_max` | `double` | - | relative short circuit voltage at maximum tap | ❌ default same as `uk` | ❌ | `>= pk_max / sn` and `> 0` and `< 1` | -| `pk_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap | ❌ default same as `pk` | ❌ | `>= 0` | -| `pk_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap | ❌ default same as `pk` | ❌ | `>= 0` | -| `r_grounding_from` | `double` | ohm (Ω) | grounding resistance at from-side, if relevant | ❌ default `0` | ❌ | | -| `x_grounding_from` | `double` | ohm (Ω) | grounding reactance at from-side, if relevant | ❌ default `0` | ❌ | | -| `r_grounding_to` | `double` | ohm (Ω) | grounding resistance at to-side, if relevant | ❌ default `0` | ❌ | | -| `x_grounding_to` | `double` | ohm (Ω) | grounding reactance at to-side, if relevant | ❌ default `0` | ❌ | | +| name | data type | unit | description | required | update | valid values | +| ------------------ | ----------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------: | :------: | :--------------------------------------------------------------------: | +| `u1` | `double` | volt (V) | rated voltage at from-side | ✔ | ❌ | `> 0` | +| `u2` | `double` | volt (V) | rated voltage at to-side | ✔ | ❌ | `> 0` | +| `sn` | `double` | volt-ampere (VA) | rated power | ✔ | ❌ | `> 0` | +| `uk` | `double` | - | relative short circuit voltage, `0.1` means 10% | ✔ | ❌ | `>= pk / sn` and `> 0` and `< 1` | +| `pk` | `double` | watt (W) | short circuit (copper) loss | ✔ | ❌ | `>= 0` | +| `i0` | `double` | - | relative no-load (magnetizing) current | ✔ | ❌ | `>= p0 / sn` and `< 1` | +| `p0` | `double` | watt (W) | no-load (iron / magnetizing) loss | ✔ | ❌ | `>= 0` | +| `i0_zero_sequence` | `double` | - | zero-sequence relative no-load (magnetizing) current | ❌ default `i0` | ❌ | `>= p0_zero_sequence / sn` and `< 1` | +| `p0_zero_sequence` | `double` | watt (W) | zero-sequence no-load (iron / magnetizing) loss | ❌ default `p0 + pk * (i0_zero_sequence^2 - i0^2)` | ❌ | `>= 0` | +| `winding_from` | {py:class}`WindingType ` | - | from-side winding type | ✔ | ❌ | | +| `winding_to` | {py:class}`WindingType ` | - | to-side winding type | ✔ | ❌ | | +| `clock` | `int8_t` | - | clock number of phase shift. Even number is not possible if one side is Y(N) winding and the other side is not Y(N) winding. Odd number is not possible, if both sides are Y(N) winding or both sides are not Y(N) winding. | ✔ | ❌ | `>= -12` and `<= 12` | +| `tap_side` | {py:class}`BranchSide ` | - | side of tap changer | ✔ | ❌ | | +| `tap_pos` | `int8_t` | - | current position of tap changer | ❌ default `tap_nom`, if no `tap_nom` default `0` | ✔ | `(tap_min <= tap_pos <= tap_max)` or `(tap_min >= tap_pos >= tap_max)` | +| `tap_min` | `int8_t` | - | position of tap changer at minimum voltage | ✔ | ❌ | | +| `tap_max` | `int8_t` | - | position of tap changer at maximum voltage | ✔ | ❌ | | +| `tap_nom` | `int8_t` | - | nominal position of tap changer | ❌ default `0` | ❌ | `(tap_min <= tap_nom <= tap_max)` or `(tap_min >= tap_nom >= tap_max)` | +| `tap_size` | `double` | volt (V) | size of each tap of the tap changer | ✔ | ❌ | `>= 0` | +| `uk_min` | `double` | - | relative short circuit voltage at minimum tap | ❌ default same as `uk` | ❌ | `>= pk_min / sn` and `> 0` and `< 1` | +| `uk_max` | `double` | - | relative short circuit voltage at maximum tap | ❌ default same as `uk` | ❌ | `>= pk_max / sn` and `> 0` and `< 1` | +| `pk_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap | ❌ default same as `pk` | ❌ | `>= 0` | +| `pk_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap | ❌ default same as `pk` | ❌ | `>= 0` | +| `r_grounding_from` | `double` | ohm (Ω) | grounding resistance at from-side, if relevant | ❌ default `0` | ❌ | | +| `x_grounding_from` | `double` | ohm (Ω) | grounding reactance at from-side, if relevant | ❌ default `0` | ❌ | | +| `r_grounding_to` | `double` | ohm (Ω) | grounding resistance at to-side, if relevant | ❌ default `0` | ❌ | | +| `x_grounding_to` | `double` | ohm (Ω) | grounding reactance at to-side, if relevant | ❌ default `0` | ❌ | | ```{note} It can happen that `tap_min > tap_max`. In this case the winding voltage is decreased if the tap position is increased. ``` +```{note} +By default, PGM uses the same magnetization current (and thus impedance) for positive- and zero-sequence circuit. +This is typically not the case for 3-leg core-type transformers. +Due to lack of iron-core pass for zero-sequence flux, +the zero-sequence magnetization current is usually significantly higher than positive sequence. +If you want to do asymmetrical calculation with 3-leg core-type transformers, +please set the attribute `i0_zero_sequence`. +If the transformer specification does not provide such an attribute, +a good guess will be `i0_zero_sequence = 1.0`. +See [OpenDSS Documentation](https://opendss.epri.com/3-PhaseTransformerModeling.html) +for detailed explanation. +``` + #### Electric Model `transformer` is described by a $\pi$ model, where $Z_{\text{series}}$ can be computed as @@ -448,14 +463,14 @@ In reality such switches may not exist. #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ---------- | --------- | ---- | --------------------------- | :------: | :------: | :-------------: | | `node_1` | `int32_t` | - | ID of node at side 1 | ✔ | ❌ | a valid node ID | | `node_2` | `int32_t` | - | ID of node at side 2 | ✔ | ❌ | a valid node ID | | `node_3` | `int32_t` | - | ID of node at side 3 | ✔ | ❌ | a valid node ID | -| `status_1` | `int8_t` | - | connection status at side 1 | ✔ | ✔ | `0` or `1` | -| `status_2` | `int8_t` | - | connection status at side 2 | ✔ | ✔ | `0` or `1` | -| `status_3` | `int8_t` | - | connection status at side 3 | ✔ | ✔ | `0` or `1` | +| `status_1` | `int8_t` | - | connection status at side 1 | ✔ | ✔ | `0` or `1` | +| `status_2` | `int8_t` | - | connection status at side 2 | ✔ | ✔ | `0` or `1` | +| `status_3` | `int8_t` | - | connection status at side 3 | ✔ | ✔ | `0` or `1` | #### Steady state output @@ -495,51 +510,51 @@ An example of usage of three-winding transformer is given in #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | --------------- | ----------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------- | :-----------------------------------------------------: | :------: | :--------------------------------------------------------------------: | -| `u1` | `double` | volt (V) | rated voltage at side 1 | ✔ | ❌ | `> 0` | -| `u2` | `double` | volt (V) | rated voltage at side 2 | ✔ | ❌ | `> 0` | -| `u3` | `double` | volt (V) | rated voltage at side 3 | ✔ | ❌ | `> 0` | -| `sn_1` | `double` | volt-ampere (VA) | rated power at side 1 | ✔ | ❌ | `> 0` | -| `sn_2` | `double` | volt-ampere (VA) | rated power at side 2 | ✔ | ❌ | `> 0` | -| `sn_3` | `double` | volt-ampere (VA) | rated power at side 3 | ✔ | ❌ | `> 0` | -| `uk_12` | `double` | - | relative short circuit voltage across side 1-2, `0.1` means 10% | ✔ | ❌ | `>= pk_12 / min(sn_1, sn_2)` and `> 0` and `< 1` | -| `uk_13` | `double` | - | relative short circuit voltage across side 1-3, `0.1` means 10% | ✔ | ❌ | `>= pk_13 / min(sn_1, sn_3)` and `> 0` and `< 1` | -| `uk_23` | `double` | - | relative short circuit voltage across side 2-3, `0.1` means 10% | ✔ | ❌ | `>= pk_23 / min(sn_2, sn_3)` and `> 0` and `< 1` | -| `pk_12` | `double` | watt (W) | short circuit (copper) loss across side 1-2 | ✔ | ❌ | `>= 0` | -| `pk_13` | `double` | watt (W) | short circuit (copper) loss across side 1-3 | ✔ | ❌ | `>= 0` | -| `pk_23` | `double` | watt (W) | short circuit (copper) loss across side 2-3 | ✔ | ❌ | `>= 0` | -| `i0` | `double` | - | relative no-load current with respect to side 1 | ✔ | ❌ | `>= p0 / sn` and `< 1` | -| `p0` | `double` | watt (W) | no-load (iron) loss | ✔ | ❌ | `>= 0` | -| `winding_1` | {py:class}`WindingType ` | - | side 1 winding type | ✔ | ❌ | | -| `winding_2` | {py:class}`WindingType ` | - | side 2 winding type | ✔ | ❌ | | -| `winding_3` | {py:class}`WindingType ` | - | side 3 winding type | ✔ | ❌ | | -| `clock_12` | `int8_t` | - | clock number of phase shift across side 1-2, odd number is only allowed for Dy(n) or Y(N)d configuration. | ✔ | ❌ | `>= -12` and `<= 12` | -| `clock_13` | `int8_t` | - | clock number of phase shift across side 1-3, odd number is only allowed for Dy(n) or Y(N)d configuration. | ✔ | ❌ | `>= -12` and `<= 12` | -| `tap_side` | {py:class}`Branch3Side ` | - | side of tap changer | ✔ | ❌ | `side_1` or `side_2` or `side_3` | +| `u1` | `double` | volt (V) | rated voltage at side 1 | ✔ | ❌ | `> 0` | +| `u2` | `double` | volt (V) | rated voltage at side 2 | ✔ | ❌ | `> 0` | +| `u3` | `double` | volt (V) | rated voltage at side 3 | ✔ | ❌ | `> 0` | +| `sn_1` | `double` | volt-ampere (VA) | rated power at side 1 | ✔ | ❌ | `> 0` | +| `sn_2` | `double` | volt-ampere (VA) | rated power at side 2 | ✔ | ❌ | `> 0` | +| `sn_3` | `double` | volt-ampere (VA) | rated power at side 3 | ✔ | ❌ | `> 0` | +| `uk_12` | `double` | - | relative short circuit voltage across side 1-2, `0.1` means 10% | ✔ | ❌ | `>= pk_12 / min(sn_1, sn_2)` and `> 0` and `< 1` | +| `uk_13` | `double` | - | relative short circuit voltage across side 1-3, `0.1` means 10% | ✔ | ❌ | `>= pk_13 / min(sn_1, sn_3)` and `> 0` and `< 1` | +| `uk_23` | `double` | - | relative short circuit voltage across side 2-3, `0.1` means 10% | ✔ | ❌ | `>= pk_23 / min(sn_2, sn_3)` and `> 0` and `< 1` | +| `pk_12` | `double` | watt (W) | short circuit (copper) loss across side 1-2 | ✔ | ❌ | `>= 0` | +| `pk_13` | `double` | watt (W) | short circuit (copper) loss across side 1-3 | ✔ | ❌ | `>= 0` | +| `pk_23` | `double` | watt (W) | short circuit (copper) loss across side 2-3 | ✔ | ❌ | `>= 0` | +| `i0` | `double` | - | relative no-load (magnetizing) current with respect to side 1 | ✔ | ❌ | `>= p0 / sn` and `< 1` | +| `p0` | `double` | watt (W) | no-load (iron / magnetizing) loss | ✔ | ❌ | `>= 0` | +| `winding_1` | {py:class}`WindingType ` | - | side 1 winding type | ✔ | ❌ | | +| `winding_2` | {py:class}`WindingType ` | - | side 2 winding type | ✔ | ❌ | | +| `winding_3` | {py:class}`WindingType ` | - | side 3 winding type | ✔ | ❌ | | +| `clock_12` | `int8_t` | - | clock number of phase shift across side 1-2, odd number is only allowed for Dy(n) or Y(N)d configuration. | ✔ | ❌ | `>= -12` and `<= 12` | +| `clock_13` | `int8_t` | - | clock number of phase shift across side 1-3, odd number is only allowed for Dy(n) or Y(N)d configuration. | ✔ | ❌ | `>= -12` and `<= 12` | +| `tap_side` | {py:class}`Branch3Side ` | - | side of tap changer | ✔ | ❌ | `side_1` or `side_2` or `side_3` | | `tap_pos` | `int8_t` | - | current position of tap changer | ❌ default `tap_nom`, if no `tap_nom` default `0` | ✔ | `(tap_min <= tap_pos <= tap_max)` or `(tap_min >= tap_pos >= tap_max)` | -| `tap_min` | `int8_t` | - | position of tap changer at minimum voltage | ✔ | ❌ | | -| `tap_max` | `int8_t` | - | position of tap changer at maximum voltage | ✔ | ❌ | | -| `tap_nom` | `int8_t` | - | nominal position of tap changer | ❌ default `0` | ❌ | `(tap_min <= tap_nom <= tap_max)` or `(tap_min >= tap_nom >= tap_max)` | -| `tap_size` | `double` | volt (V) | size of each tap of the tap changer | ✔ | ❌ | `> 0` | -| `uk_12_min` | `double` | - | relative short circuit voltage at minimum tap, across side 1-2 | ❌ default same as `uk_12` | ❌ | `>= pk_12_min / min(sn_1, sn_2)` and `> 0` and `< 1` | -| `uk_12_max` | `double` | - | relative short circuit voltage at maximum tap, across side 1-2 | ❌ default same as `uk_12` | ❌ | `>= pk_12_max / min(sn_1, sn_2)` and `> 0` and `< 1` | -| `pk_12_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 1-2 | ❌ default same as `pk_12` | ❌ | `>= 0` | -| `pk_12_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 1-2 | ❌ default same as `pk_12` | ❌ | `>= 0` | -| `uk_13_min` | `double` | - | relative short circuit voltage at minimum tap, across side 1-3 | ❌ default same as `uk_13` | ❌ | `>= pk_13_min / min(sn_1, sn_3)` and `> 0` and `< 1` | -| `uk_13_max` | `double` | - | relative short circuit voltage at maximum tap, across side 1-3 | ❌ default same as `uk_13` | ❌ | `>= pk_13_max / min(sn_1, sn_3)` and `> 0` and `< 1` | -| `pk_13_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 1-3 | ❌ default same as `pk_13` | ❌ | `>= 0` | -| `pk_13_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 1-3 | ❌ default same as `pk_13` | ❌ | `>= 0` | -| `uk_23_min` | `double` | - | relative short circuit voltage at minimum tap, across side 2-3 | ❌ default same as `uk_23` | ❌ | `>= pk_23_min / min(sn_2, sn_3)` and `> 0` and `< 1` | -| `uk_23_max` | `double` | - | relative short circuit voltage at maximum tap, across side 2-3 | ❌ default same as `uk_23` | ❌ | `>= pk_23_max / min(sn_2, sn_3)` and `> 0` and `< 1` | -| `pk_23_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 2-3 | ❌ default same as `pk_23` | ❌ | `>= 0` | -| `pk_23_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 2-3 | ❌ default same as `pk_23` | ❌ | `>= 0` | -| `r_grounding_1` | `double` | ohm (Ω) | grounding resistance at side 1, if relevant | ❌ default `0` | ❌ | | -| `x_grounding_1` | `double` | ohm (Ω) | grounding reactance at side 1, if relevant | ❌ default `0` | ❌ | | -| `r_grounding_2` | `double` | ohm (Ω) | grounding resistance at side 2, if relevant | ❌ default `0` | ❌ | | -| `x_grounding_2` | `double` | ohm (Ω) | grounding reactance at side 2, if relevant | ❌ default `0` | ❌ | | -| `r_grounding_3` | `double` | ohm (Ω) | grounding resistance at side 3, if relevant | ❌ default `0` | ❌ | | -| `x_grounding_3` | `double` | ohm (Ω) | grounding reactance at side 3, if relevant | ❌ default `0` | ❌ | | +| `tap_min` | `int8_t` | - | position of tap changer at minimum voltage | ✔ | ❌ | | +| `tap_max` | `int8_t` | - | position of tap changer at maximum voltage | ✔ | ❌ | | +| `tap_nom` | `int8_t` | - | nominal position of tap changer | ❌ default `0` | ❌ | `(tap_min <= tap_nom <= tap_max)` or `(tap_min >= tap_nom >= tap_max)` | +| `tap_size` | `double` | volt (V) | size of each tap of the tap changer | ✔ | ❌ | `> 0` | +| `uk_12_min` | `double` | - | relative short circuit voltage at minimum tap, across side 1-2 | ❌ default same as `uk_12` | ❌ | `>= pk_12_min / min(sn_1, sn_2)` and `> 0` and `< 1` | +| `uk_12_max` | `double` | - | relative short circuit voltage at maximum tap, across side 1-2 | ❌ default same as `uk_12` | ❌ | `>= pk_12_max / min(sn_1, sn_2)` and `> 0` and `< 1` | +| `pk_12_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 1-2 | ❌ default same as `pk_12` | ❌ | `>= 0` | +| `pk_12_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 1-2 | ❌ default same as `pk_12` | ❌ | `>= 0` | +| `uk_13_min` | `double` | - | relative short circuit voltage at minimum tap, across side 1-3 | ❌ default same as `uk_13` | ❌ | `>= pk_13_min / min(sn_1, sn_3)` and `> 0` and `< 1` | +| `uk_13_max` | `double` | - | relative short circuit voltage at maximum tap, across side 1-3 | ❌ default same as `uk_13` | ❌ | `>= pk_13_max / min(sn_1, sn_3)` and `> 0` and `< 1` | +| `pk_13_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 1-3 | ❌ default same as `pk_13` | ❌ | `>= 0` | +| `pk_13_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 1-3 | ❌ default same as `pk_13` | ❌ | `>= 0` | +| `uk_23_min` | `double` | - | relative short circuit voltage at minimum tap, across side 2-3 | ❌ default same as `uk_23` | ❌ | `>= pk_23_min / min(sn_2, sn_3)` and `> 0` and `< 1` | +| `uk_23_max` | `double` | - | relative short circuit voltage at maximum tap, across side 2-3 | ❌ default same as `uk_23` | ❌ | `>= pk_23_max / min(sn_2, sn_3)` and `> 0` and `< 1` | +| `pk_23_min` | `double` | watt (W) | short circuit (copper) loss at minimum tap, across side 2-3 | ❌ default same as `pk_23` | ❌ | `>= 0` | +| `pk_23_max` | `double` | watt (W) | short circuit (copper) loss at maximum tap, across side 2-3 | ❌ default same as `pk_23` | ❌ | `>= 0` | +| `r_grounding_1` | `double` | ohm (Ω) | grounding resistance at side 1, if relevant | ❌ default `0` | ❌ | | +| `x_grounding_1` | `double` | ohm (Ω) | grounding reactance at side 1, if relevant | ❌ default `0` | ❌ | | +| `r_grounding_2` | `double` | ohm (Ω) | grounding resistance at side 2, if relevant | ❌ default `0` | ❌ | | +| `x_grounding_2` | `double` | ohm (Ω) | grounding reactance at side 2, if relevant | ❌ default `0` | ❌ | | +| `r_grounding_3` | `double` | ohm (Ω) | grounding resistance at side 3, if relevant | ❌ default `0` | ❌ | | +| `x_grounding_3` | `double` | ohm (Ω) | grounding reactance at side 3, if relevant | ❌ default `0` | ❌ | | ```{note} It can happen that `tap_min > tap_max`. @@ -566,10 +581,10 @@ The reference direction for power flows is mentioned in {hoverxreftooltip}`user_ #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | -------- | --------- | ---- | ----------------------------- | :------: | :------: | :-------------: | | `node` | `int32_t` | - | ID of the coupled node | ✔ | ❌ | a valid node ID | -| `status` | `int8_t` | - | connection status to the node | ✔ | ✔ | `0` or `1` | +| `status` | `int8_t` | - | connection status to the node | ✔ | ✔ | `0` or `1` | #### Steady state output @@ -737,7 +752,7 @@ The state estimator uses the data to evaluate the state of the grid with the hig #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ----------------- | --------- | ---- | ------------------------- | :------: | :------: | :---------------: | | `measured_object` | `int32_t` | - | ID of the measured object | ✔ | ❌ | a valid object ID | @@ -847,9 +862,9 @@ However, such mixing of sensor types is allowed as long as they are on different ##### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ------------------------ | ----------------------------------------------------------------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------: | :------: | :--------------------------------------------------: | -| `measured_terminal_type` | {py:class}`MeasuredTerminalType ` | - | indicate if it measures an `appliance` or a `branch` | ✔ | ❌ | the terminal type should match the `measured_object` | +| `measured_terminal_type` | {py:class}`MeasuredTerminalType ` | - | indicate if it measures an `appliance` or a `branch` | ✔ | ❌ | the terminal type should match the `measured_object` | | `power_sigma` | `double` | volt-ampere (VA) | standard deviation of the measurement error. Usually this is the absolute measurement error range divided by 3. See {hoverxreftooltip}`user_manual/components:Power Sensor Concrete Types`. | ✨ in certain cases for state estimation. See the explanation for [concrete types](#power-sensor-concrete-types) below. | ✔ | `> 0` | #### Power Sensor Concrete Types @@ -864,10 +879,10 @@ They share similar attributes: the meaning of `RealValueInput` is different, as ##### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ------------ | ---------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------: | :------: | :----------: | -| `p_measured` | `RealValueInput` | watt (W) | measured active power | ✨ only for state estimation | ✔ | | -| `q_measured` | `RealValueInput` | volt-ampere-reactive (var) | measured reactive power | ✨ only for state estimation | ✔ | | +| `p_measured` | `RealValueInput` | watt (W) | measured active power | ✨ only for state estimation | ✔ | | +| `q_measured` | `RealValueInput` | volt-ampere-reactive (var) | measured reactive power | ✨ only for state estimation | ✔ | | | `p_sigma` | `RealValueInput` | watt (W) | standard deviation of the active power measurement error. Usually this is the absolute measurement error range divided by 3. | ❌ see the explanation below. | ✔ | `> 0` | | `q_sigma` | `RealValueInput` | volt-ampere-reactive (var) | standard deviation of the reactive power measurement error. Usually this is the absolute measurement error range divided by 3. | ❌ see the explanation below. | ✔ | `> 0` | @@ -875,13 +890,13 @@ Valid combinations of `power_sigma`, `p_sigma` and `q_sigma` are: | `power_sigma` | `p_sigma` | `q_sigma` | result | | :-----------: | :-------: | :-------: | :------: | -| ✔ | ✔ | ✔ | ✔ | -| ✔ | ✔ | | ❌ | -| ✔ | | ✔ | ❌ | -| ✔ | | | ✔ | -| | ✔ | ✔ | ✔ | -| | ✔ | | ❌ | -| | | ✔ | ❌ | +| ✔ | ✔ | ✔ | ✔ | +| ✔ | ✔ | | ❌ | +| ✔ | | ✔ | ❌ | +| ✔ | | | ✔ | +| | ✔ | ✔ | ✔ | +| | ✔ | | ❌ | +| | | ✔ | ❌ | | | | | ❌ | ```{note} @@ -1057,14 +1072,14 @@ A fault can only happen at a `node`. #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | -------------- | --------------------------------------------------------- | ------- | --------------------------------------------------- | :-----------------------------------------------------------------------------------------------------: | :------: | :---------------: | -| `status` | `int8_t` | - | whether the fault is active | ✔ | ✔ | `0` or `1` | +| `status` | `int8_t` | - | whether the fault is active | ✔ | ✔ | `0` or `1` | | `fault_type` | {py:class}`FaultType ` | - | the type of the fault | ✨ only for short circuit | ✔ | | | `fault_phase` | {py:class}`FaultPhase ` | - | the phase(s) of the fault | ❌ default `FaultPhase.default_value` (see [below](#fault-types-fault-phases-and-default-values)) | ✔ | | -| `fault_object` | `int32_t` | - | ID of the component where the short circuit happens | ✔ | ✔ | A valid `node` ID | -| `r_f` | `double` | ohm (Ω) | short circuit resistance | ❌ default `0.0` | ✔ | | -| `x_f` | `double` | ohm (Ω) | short circuit reactance | ❌ default `0.0` | ✔ | | +| `fault_object` | `int32_t` | - | ID of the component where the short circuit happens | ✔ | ✔ | A valid `node` ID | +| `r_f` | `double` | ohm (Ω) | short circuit resistance | ❌ default `0.0` | ✔ | | +| `x_f` | `double` | ohm (Ω) | short circuit reactance | ❌ default `0.0` | ✔ | | ```{note} Multiple faults may exist within one calculation. @@ -1116,10 +1131,10 @@ Which object types are supported as `regulated_object` is regulator type-depende #### Input -| name | data type | unit | description | required | update | valid values | +| name | data type | unit | description | required | update | valid values | | ------------------ | --------- | ---- | ----------------------------------------- | :------: | :------: | :-------------------------: | | `regulated_object` | `int32_t` | - | ID of the regulated object | ✔ | ❌ | a valid regulated object ID | -| `status` | `int8_t` | - | connection status to the regulated object | ✔ | ✔ | `0` or `1` | +| `status` | `int8_t` | - | connection status to the regulated object | ✔ | ✔ | `0` or `1` | ### Transformer tap regulator diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/input.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/input.hpp index 76bed343cf..15b6d7bfbf 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/input.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/input.hpp @@ -195,6 +195,8 @@ struct TransformerInput { double pk{nan}; // short circuit and open testing parameters double i0{nan}; // short circuit and open testing parameters double p0{nan}; // short circuit and open testing parameters + double i0_zero_sequence{nan}; // short circuit and open testing parameters + double p0_zero_sequence{nan}; // short circuit and open testing parameters WindingType winding_from{static_cast(na_IntS)}; // winding type at each side WindingType winding_to{static_cast(na_IntS)}; // winding type at each side IntS clock{na_IntS}; // clock number diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_gen/input.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_gen/input.hpp index 1d0c729170..a5fb7aef33 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_gen/input.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_gen/input.hpp @@ -188,7 +188,7 @@ struct get_attributes_list { template<> struct get_attributes_list { - static constexpr std::array value{ + static constexpr std::array value{ // all attributes including base class meta_data_gen::get_meta_attribute<&TransformerInput::id>(offsetof(TransformerInput, id), "id"), @@ -203,6 +203,8 @@ struct get_attributes_list { meta_data_gen::get_meta_attribute<&TransformerInput::pk>(offsetof(TransformerInput, pk), "pk"), meta_data_gen::get_meta_attribute<&TransformerInput::i0>(offsetof(TransformerInput, i0), "i0"), meta_data_gen::get_meta_attribute<&TransformerInput::p0>(offsetof(TransformerInput, p0), "p0"), + meta_data_gen::get_meta_attribute<&TransformerInput::i0_zero_sequence>(offsetof(TransformerInput, i0_zero_sequence), "i0_zero_sequence"), + meta_data_gen::get_meta_attribute<&TransformerInput::p0_zero_sequence>(offsetof(TransformerInput, p0_zero_sequence), "p0_zero_sequence"), meta_data_gen::get_meta_attribute<&TransformerInput::winding_from>(offsetof(TransformerInput, winding_from), "winding_from"), meta_data_gen::get_meta_attribute<&TransformerInput::winding_to>(offsetof(TransformerInput, winding_to), "winding_to"), meta_data_gen::get_meta_attribute<&TransformerInput::clock>(offsetof(TransformerInput, clock), "clock"), diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp index 381a03516e..7d29b56795 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp @@ -18,6 +18,14 @@ namespace power_grid_model { class Transformer : public Branch { + private: + struct TransformerParams { + DoubleComplex y_series{}; + DoubleComplex y_shunt{}; + DoubleComplex y0_shunt{}; + double k{1.0}; + }; + public: using InputType = TransformerInput; using UpdateType = TransformerUpdate; @@ -33,6 +41,10 @@ class Transformer : public Branch { pk_{transformer_input.pk}, i0_{transformer_input.i0}, p0_{transformer_input.p0}, + i0_zero_sequence_{is_nan(transformer_input.i0_zero_sequence) ? i0_ : transformer_input.i0_zero_sequence}, + p0_zero_sequence_{is_nan(transformer_input.p0_zero_sequence) + ? p0_ + pk_ * (i0_zero_sequence_ * i0_zero_sequence_ - i0_ * i0_) + : transformer_input.p0_zero_sequence}, winding_from_{transformer_input.winding_from}, winding_to_{transformer_input.winding_to}, clock_{transformer_input.clock}, @@ -120,6 +132,8 @@ class Transformer : public Branch { double pk_; double i0_; double p0_; + double i0_zero_sequence_; + double p0_zero_sequence_; WindingType winding_from_; WindingType winding_to_; IntS clock_; @@ -156,7 +170,7 @@ class Transformer : public Branch { } // calculate transformer parameter - std::tuple transformer_params() const { + TransformerParams transformer_params() const { double const base_y_to = base_i_to_ * base_i_to_ / base_power_1p; // off nominal tap ratio auto const [u1, u2] = [this]() { @@ -192,29 +206,39 @@ class Transformer : public Branch { z_series.imag(uk_sign * (z_series_imag_squared > 0.0 ? std::sqrt(z_series_imag_squared) : 0.0)); // y series y_series = (1.0 / z_series) / base_y_to; + // shunt DoubleComplex y_shunt; - // Y = I0_2 / (U2/sqrt3) = i0 * (S / sqrt3 / U2) / (U2/sqrt3) = i0 * S * / U2 / U2 + // Y = I0 / (U2/sqrt3) = i0 * (S / sqrt3 / U2) / (U2/sqrt3) = i0 * S * / U2 / U2 double const y_shunt_abs = i0_ * sn_ / u2 / u2; // G = P0 / (U2^2) y_shunt.real(p0_ / u2 / u2); - auto const y_shunt_imag_squared = y_shunt_abs * y_shunt_abs - y_shunt.real() * y_shunt.real(); y_shunt.imag(y_shunt_imag_squared > 0.0 ? -std::sqrt(y_shunt_imag_squared) : 0.0); - - // y shunt y_shunt = y_shunt / base_y_to; + + // shunt zero sequence + DoubleComplex y0_shunt; + // Y0 = I0_0 / (U2/sqrt3) = i0_zero_sequence_ * (S / sqrt3 / U2) / (U2/sqrt3) = i0_zero_sequence_ * S / U2 / + // U2 + double const y0_shunt_abs = i0_zero_sequence_ * sn_ / u2 / u2; + // G0 = P0_0 / (U2^2) + y0_shunt.real(p0_zero_sequence_ / u2 / u2); + auto const y0_shunt_imag_squared = y0_shunt_abs * y0_shunt_abs - y0_shunt.real() * y0_shunt.real(); + y0_shunt.imag(y0_shunt_imag_squared > 0.0 ? -std::sqrt(y0_shunt_imag_squared) : 0.0); + y0_shunt = y0_shunt / base_y_to; + // return - return std::make_tuple(y_series, y_shunt, k); + return TransformerParams{.y_series = y_series, .y_shunt = y_shunt, .y0_shunt = y0_shunt, .k = k}; } // branch param BranchCalcParam sym_calc_param() const final { - auto const [y_series, y_shunt, k] = transformer_params(); + auto const [y_series, y_shunt, y0_shunt, k] = transformer_params(); return calc_param_y_sym(y_series, y_shunt, k * std::exp(1.0i * (clock_ * deg_30))); } BranchCalcParam asym_calc_param() const final { - auto const [y_series, y_shunt, k] = transformer_params(); + auto const [y_series, y_shunt, y0_shunt, k] = transformer_params(); // positive sequence auto const param1 = calc_param_y_sym(y_series, y_shunt, k * std::exp(1.0i * (clock_ * deg_30))); // negative sequence @@ -230,19 +254,37 @@ class Transformer : public Branch { } DoubleComplex const z0_series = 1.0 / y_series + 3.0 * (z_grounding_to_ + z_grounding_from_ / k / k); DoubleComplex const y0_series = 1.0 / z0_series; - param0 = calc_param_y_sym(y0_series, y_shunt, k * std::exp(1.0i * phase_shift_0)); + param0 = calc_param_y_sym(y0_series, y0_shunt, k * std::exp(1.0i * phase_shift_0)); } - // YNd - if (winding_from_ == WindingType::wye_n && winding_to_ == WindingType::delta && from_status()) { - DoubleComplex const z0_series = 1.0 / y_series + 3.0 * z_grounding_from_ / k / k; - DoubleComplex const y0_series = 1.0 / z0_series; - param0.yff() = (y0_series + y_shunt) / k / k; + // YN* + else if (winding_from_ == WindingType::wye_n && from_status()) { + // ground path always possible via magnetization branch + DoubleComplex y0 = y0_shunt; + if (winding_to_ == WindingType::delta) { + // additional path via zk + y0 += y_series; + } + if (y0 != DoubleComplex{0.0, 0.0}) { + // avoid division by zero + DoubleComplex const z0 = 1.0 / y0 + 3.0 * z_grounding_from_ / k / k; + y0 = 1.0 / z0; + param0.yff() = y0 / k / k; + } } - // Dyn - if (winding_from_ == WindingType::delta && winding_to_ == WindingType::wye_n && to_status()) { - DoubleComplex const z0_series = 1.0 / y_series + 3.0 * z_grounding_to_; - DoubleComplex const y0_series = 1.0 / z0_series; - param0.ytt() = (y0_series + y_shunt); + // *yn + else if (winding_to_ == WindingType::wye_n && to_status()) { + // ground path always possible via magnetization branch + DoubleComplex y0 = y0_shunt; + if (winding_from_ == WindingType::delta) { + // additional path via zk + y0 += y_series; + } + if (y0 != DoubleComplex{0.0, 0.0}) { + // avoid division by zero + DoubleComplex const z0 = 1.0 / y0 + 3.0 * z_grounding_to_; + y0 = 1.0 / z0; + param0.ytt() = y0; + } } // ZN* // Zero sequence impedance of zigzag winding is approximately 10% of positive sequence impedance diff --git a/power_grid_model_c/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h b/power_grid_model_c/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h index ce739b0eef..6af6842d3b 100644 --- a/power_grid_model_c/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h +++ b/power_grid_model_c/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h @@ -122,6 +122,8 @@ PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_uk; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_pk; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_i0; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_p0; +PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_i0_zero_sequence; +PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_p0_zero_sequence; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_winding_from; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_winding_to; PGM_API extern PGM_MetaAttribute const* const PGM_def_input_transformer_clock; diff --git a/power_grid_model_c/power_grid_model_c/src/dataset_definitions.cpp b/power_grid_model_c/power_grid_model_c/src/dataset_definitions.cpp index 00a190c4a8..758c3c62ac 100644 --- a/power_grid_model_c/power_grid_model_c/src/dataset_definitions.cpp +++ b/power_grid_model_c/power_grid_model_c/src/dataset_definitions.cpp @@ -111,6 +111,8 @@ PGM_MetaAttribute const* const PGM_def_input_transformer_uk = PGM_meta_get_attri PGM_MetaAttribute const* const PGM_def_input_transformer_pk = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "pk"); PGM_MetaAttribute const* const PGM_def_input_transformer_i0 = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "i0"); PGM_MetaAttribute const* const PGM_def_input_transformer_p0 = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "p0"); +PGM_MetaAttribute const* const PGM_def_input_transformer_i0_zero_sequence = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "i0_zero_sequence"); +PGM_MetaAttribute const* const PGM_def_input_transformer_p0_zero_sequence = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "p0_zero_sequence"); PGM_MetaAttribute const* const PGM_def_input_transformer_winding_from = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "winding_from"); PGM_MetaAttribute const* const PGM_def_input_transformer_winding_to = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "winding_to"); PGM_MetaAttribute const* const PGM_def_input_transformer_clock = PGM_meta_get_attribute_by_name(nullptr, "input", "transformer", "clock"); diff --git a/tests/cpp_unit_tests/test_transformer.cpp b/tests/cpp_unit_tests/test_transformer.cpp index 6b6417911b..b9d65c0085 100644 --- a/tests/cpp_unit_tests/test_transformer.cpp +++ b/tests/cpp_unit_tests/test_transformer.cpp @@ -418,6 +418,7 @@ TEST_CASE("Test Transfomer - Test grounding - Dyn11") { .pk = 100e3, .i0 = 0.015, .p0 = 30.0e4, + .i0_zero_sequence = 1.0, .winding_from = WindingType::delta, .winding_to = WindingType::wye_n, .clock = 11, @@ -462,6 +463,18 @@ TEST_CASE("Test Transfomer - Test grounding - Dyn11") { } DoubleComplex const y_1_shunt = (y_shunt_real + 1i * y_shunt_imag) / base_y_to; + double const p0_zero_sequence = + input.p0 + input.pk * (input.i0_zero_sequence * input.i0_zero_sequence - input.i0 * input.i0); + double const y0_shunt_abs = input.i0_zero_sequence * input.sn / input.u2 / input.u2; + double const y0_shunt_real = p0_zero_sequence / input.u2 / input.u2; + double y0_shunt_imag; + if (y0_shunt_real > y0_shunt_abs) { + y0_shunt_imag = 0.0; + } else { + y0_shunt_imag = -std::sqrt(y0_shunt_abs * y0_shunt_abs - y0_shunt_real * y0_shunt_real); + } + DoubleComplex const y_0_shunt = (y0_shunt_real + 1i * y0_shunt_imag) / base_y_to; + DoubleComplex const tap_ratio_1 = k * std::exp(1.0i * (deg_30 * input.clock)); DoubleComplex const y_1_tt = (1.0 / z_1_series) + 0.5 * y_1_shunt; @@ -485,7 +498,7 @@ TEST_CASE("Test Transfomer - Test grounding - Dyn11") { DoubleComplex const y_0_ff = low_admittance; DoubleComplex const y_0_ft = 0.0; DoubleComplex const y_0_tf = 0.0; - DoubleComplex const y_0_tt = (1.0 / (z_1_series + 3.0 * z_grounding_to)) + y_1_shunt; + DoubleComplex const y_0_tt = (1.0 / (1.0 / (1.0 / z_1_series + y_0_shunt) + 3.0 * z_grounding_to)); // Sequence admittances -> phase addmitance ComplexTensor y_ff_diagonal; @@ -707,7 +720,7 @@ TEST_CASE("Test Transformer - Dyn11 - tap_max and tap_min flipped") { DoubleComplex const y_0_ff = low_admittance; DoubleComplex const y_0_ft = 0.0; DoubleComplex const y_0_tf = 0.0; - DoubleComplex const y_0_tt = (1.0 / (z_1_series + 3.0 * z_grounding_to)) + y_1_shunt; + DoubleComplex const y_0_tt = (1.0 / (1.0 / (1.0 / z_1_series + y_1_shunt) + 3.0 * z_grounding_to)); // Sequence admittances -> phase addmitance ComplexTensor y_ff_diagonal; diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json b/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json new file mode 100644 index 0000000000..a51b553229 --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json @@ -0,0 +1,21 @@ +{ + "version": "1.0", + "type": "asym_output", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 1, "energized": 1, "u_pu": [1, 1, 1], "u": [5773.5026918962576, 5773.5026918962576, 5773.5026918962576], "u_angle": [-2.6439876230271684e-44, -2.0943951023931953, 2.0943951023931953], "p": [881329.20767572254, 1037364.8940881646, 1081305.8982361141], "q": [226203.41305523555, 85377.466355255776, 290921.30803535768]}, + {"id": 2, "energized": 1, "u_pu": [1.0141430605715689, 0.96656989153700335, 1.0110998975479204], "u": [5855.1576901778626, 5580.4938706947623, 5837.5879802689487], "u_angle": [0.001939888439272864, -2.1247815189679589, 2.0324414694676975], "p": [-799999.99999999849, -1000000.0000000008, -1199999.9999999972], "q": [7.4587508688682828e-10, 1.7304176386161853e-09, 5.1725865757671641e-09]} + ], + "transformer": [ + {"id": 4, "energized": 1, "loading": 0.30705253328631577, "p_from": [881329.20767572254, 1037364.8940881646, 1081305.8982361141], "q_from": [226203.41305523555, 85377.466355255761, 290921.30803535768], "i_from": [157.59846030784894, 180.28437829560764, 193.9477496411763], "s_from": [909895.13482607121, 1040872.3433965337, 1119757.8546405528], "p_to": [-799999.99999999849, -1000000.0000000008, -1199999.9999999972], "q_to": [7.4606055156303146e-10, 1.7076212935884444e-09, 5.1782885887484745e-09], "i_to": [136.63167455626581, 179.19560941574917, 205.56435364331952], "s_to": [799999.99999999849, 1000000.0000000008, 1199999.9999999972]} + ], + "asym_load": [ + {"id": 6, "energized": 1, "p": [799999.99999999988, 1000000, 1200000], "q": [0, 0, 0], "i": [136.63167455626603, 179.19560941574903, 205.56435364331998], "s": [799999.99999999988, 1000000, 1200000], "pf": [1, 1, 1]} + ], + "source": [ + {"id": 7, "energized": 1, "p": [881329.20767572254, 1037364.8940881646, 1081305.8982361141], "q": [226203.41305523555, 85377.466355255761, 290921.30803535774], "i": [157.59846030784894, 180.28437829560764, 193.9477496411763], "s": [909895.13482607121, 1040872.3433965337, 1119757.8546405528], "pf": [0.96860525344405857, 0.99663027908213619, 0.96566047181979187]} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json.license b/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/asym_output.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/input.json b/tests/data/power_flow/zero_sequence_yyn_transformer/input.json new file mode 100644 index 0000000000..cc4a4de743 --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/input.json @@ -0,0 +1,21 @@ +{ + "version": "1.0", + "type": "input", + "is_batch": false, + "attributes": {}, + "data": { + "node": [ + {"id": 1, "u_rated": 10000}, + {"id": 2, "u_rated": 10000} + ], + "transformer": [ + {"id": 4, "from_node": 1, "to_node": 2, "from_status": 1, "to_status": 1, "u1": 10000, "u2": 10000, "sn": 10000000, "uk": 0.10000000000000001, "pk": 0, "i0": 0.050000000000000003, "p0": 0, "i0_zero_sequence": 1, "winding_from": 0, "winding_to": 1, "clock": 12, "tap_side": 0, "tap_pos": 0, "tap_min": 0, "tap_max": 0, "tap_nom": 0, "tap_size": 0} + ], + "asym_load": [ + {"id": 6, "node": 2, "status": 1, "type": 0, "p_specified": [800000, 1000000, 1200000], "q_specified": [0, 0, 0]} + ], + "source": [ + {"id": 7, "node": 1, "status": 1, "u_ref": 1, "sk": 1.0000000000000001e+50, "rx_ratio": 0, "z01_ratio": 1} + ] + } +} \ No newline at end of file diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/input.json.license b/tests/data/power_flow/zero_sequence_yyn_transformer/input.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/input.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0 diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/params.json b/tests/data/power_flow/zero_sequence_yyn_transformer/params.json new file mode 100644 index 0000000000..6a2809e23c --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/params.json @@ -0,0 +1,7 @@ +{ + "calculation_method": [ + "newton_raphson" + ], + "rtol": 1e-07, + "atol": 1e-07 +} \ No newline at end of file diff --git a/tests/data/power_flow/zero_sequence_yyn_transformer/params.json.license b/tests/data/power_flow/zero_sequence_yyn_transformer/params.json.license new file mode 100644 index 0000000000..7601059167 --- /dev/null +++ b/tests/data/power_flow/zero_sequence_yyn_transformer/params.json.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: Contributors to the Power Grid Model project + +SPDX-License-Identifier: MPL-2.0