Skip to content

Commit

Permalink
Add more vector groups and more transformers to the catalogue (#289)
Browse files Browse the repository at this point in the history
- Change the `type` parameter of `TransformerParameters` to `vg` to
allow vector groups for single-phase and center-tapped transformers
- Add 15kV transformers to the catalogue (SE and FT)
- Add single-phase transformers to the catalogue (Schneider Imprego)
- Add step-up transformers to the catalogue (Cahors "Serie Jaune")
- Modify the names of the transformers in the catalogue to add voltage
levels and vector groups
- Use the correct LV side no-load voltage as defined in the datasheets
(some 400V became 410V)
  • Loading branch information
alihamdan authored Nov 29, 2024
1 parent 2c1c2f6 commit b2be2b8
Show file tree
Hide file tree
Showing 83 changed files with 1,618 additions and 1,238 deletions.
15 changes: 15 additions & 0 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ og:description: See what's new in the latest release of Roseau Load Flow !

## Unreleased

- {gh-pr}`289` Improve the `TransformerParameters` class and the transformers catalogue

- Add 15kV transformers to the catalogue (SE and FT)
- Add single-phase transformers to the catalogue (Schneider Imprego)
- Add step-up transformers to the catalogue (Cahors "Serie Jaune")
- Use the correct LV side no-load voltage as defined in the datasheets (some 400V became 410V)
- Revert {gh-pr}`282` to keep the IEC 600076 names `uhv` and `ulv` for the transformer voltages.

**BREAKING CHANGES**:

- Replace the `type` parameter of `TransformerParameters` constructors by `vg` for vector group.
- `TransformerParameters.type` now returns `three-phase`, `single-phase` or `center-tapped`. Use
`TransformerParameters.vg` to get vector group.
- Modify the names of the transformers in the catalogue to add voltage levels and vector groups

- {gh-pr}`285` {gh-issue}`279` **BREAKING CHANGE**: Add limits on assets. It is now possible to define a maximum
loading for lines and transformers. It generates some indirect consequences:

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions doc/advanced/Potential_Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ lv_bus = rlf.Bus("LVBus", phases="abcn")
rlf.VoltageSource("MVSource", bus=mv_bus, voltages=20e3)

# Create a delta-wye transformer connecting the MV and LV buses
tp = rlf.TransformerParameters.from_catalogue("SE_Minera_AA0Ak_160kVA")
tp = rlf.TransformerParameters.from_catalogue("SE Minera AA0Ak 160kVA 20kV 410V Dyn11")
rlf.Transformer("MV/LV Transformer", bus1=mv_bus, bus2=lv_bus, parameters=tp)

# Define the potential references for the MV and LV sides
Expand Down Expand Up @@ -199,7 +199,7 @@ lv_bus2 = rlf.Bus("LVBus2", phases="abcn")
rlf.VoltageSource("Source", bus=mv_bus1, voltages=20_000)

# Create a delta-wye transformer connecting the MV and LV buses
tp = rlf.TransformerParameters.from_catalogue("SE_Minera_AA0Ak_160kVA")
tp = rlf.TransformerParameters.from_catalogue("SE Minera AA0Ak 160kVA 20kV 410V Dyn11")
rlf.Transformer("MV/LV Transformer", bus1=mv_bus1, bus2=lv_bus1, parameters=tp)

# Create a common ground for the MV and LV sides
Expand Down Expand Up @@ -241,7 +241,7 @@ lv_bus2 = rlf.Bus("LVBus2", phases="abcn")
rlf.VoltageSource("Source", bus=mv_bus1, voltages=20_000)

# Create a delta-wye transformer connecting the MV and LV buses
tp = rlf.TransformerParameters.from_catalogue("SE_Minera_AA0Ak_160kVA")
tp = rlf.TransformerParameters.from_catalogue("SE Minera AA0Ak 160kVA 20kV 410V Dyn11")
rlf.Transformer("MV/LV Transformer", bus1=mv_bus1, bus2=lv_bus1, parameters=tp)

# Create separate grounds for the MV and LV sides
Expand Down
68 changes: 34 additions & 34 deletions doc/models/Transformer/Center_Tapped_Transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,20 @@ import functools as ft
import numpy as np
import roseau.load_flow as rlf

# Create a ground and set it as the reference potential
# Create a ground and set it as the reference of potentials
ground = rlf.Ground("ground")
pref = rlf.PotentialRef("pref", ground)

# Create a source bus and voltage source (MV)
source_bus = rlf.Bus("source_bus", phases="abcn")
ground.connect(source_bus)
vs = rlf.VoltageSource(id="vs", bus=source_bus, voltages=20e3 / np.sqrt(3))
source_bus = rlf.Bus("source_bus", phases="abc")
vs = rlf.VoltageSource(id="vs", bus=source_bus, voltages=20e3)

# Create a load bus and a load (MV)
load_bus = rlf.Bus(id="load_bus", phases="abc")
mv_load = rlf.PowerLoad("mv_load", load_bus, powers=[10000, 10000, 10000])

# Connect the two MV buses with a line
lp = rlf.LineParameters.from_catalogue(
name="U_AL_150", model="iec"
) # Underground, ALuminium, 150mm²
# Connect the two MV buses with an Underground ALuminium line of 150mm²
lp = rlf.LineParameters.from_catalogue(name="U_AL_150")
line = rlf.Line("line", source_bus, load_bus, parameters=lp, length=1.0, ground=ground)

# Create a low-voltage bus and a load
Expand All @@ -109,10 +106,10 @@ lv_load = rlf.PowerLoad("lv_load", lv_bus, powers=[-2000, 0])
# Create a transformer
tp = rlf.TransformerParameters.from_open_and_short_circuit_tests(
"t",
"center", # <--- Center-tapped transformer
vg="Iii0", # <--- Center-tapped transformer
sn=630e3,
up=20000.0,
us=230.0,
uhv=20000.0,
ulv=230.0,
i0=0.018,
p0=1300.0,
psc=6500.0,
Expand All @@ -126,49 +123,52 @@ en.solve_load_flow()

# The current flowing into the line from the source side
en.res_lines[["current1"]].dropna().transform([np.abs, ft.partial(np.angle, deg=True)])
# | | ('current1', 'absolute') | ('current1', 'angle') |
# |:-----------------|---------------------------:|------------------------:|
# | ('line', 'a') | 1.58451 | 45.1554 |
# | ('line', 'b') | 1.28415 | -55.5618 |
# | ('line', 'c') | 1.84471 | -178 |
# | | ('current1', 'absolute') | ('current1', 'angle') |
# |:--------------|---------------------------:|------------------------:|
# | ('line', 'a') | 1.1229 | -35.6881 |
# | ('line', 'b') | 0.559322 | -157.84 |
# | ('line', 'c') | 0.95146 | 114.464 |


# The current flowing into the transformer from the source side
en.res_transformers[["current1"]].dropna().transform(
[np.abs, ft.partial(np.angle, deg=True)]
)
# | | ('current1', 'absolute') | ('current1', 'angle') |
# |:-----------------|---------------------------:|------------------------:|
# | ('transfo', 'a') | 0.564366 | -63.5557 |
# | ('transfo', 'b') | 0.564366 | 116.444 |
# | ('transfo', 'a') | 0.564362 | -93.5552 |
# | ('transfo', 'b') | 0.564362 | 86.4448 |


# The current flowing into the line from the load side
en.res_lines[["current2"]].transform([np.abs, ft.partial(np.angle, deg=True)])
# | | ('current2', 'absolute') | ('current2', 'angle') |
# |:-----------------|---------------------------:|------------------------:|
# | ('line', 'a') | 1.22632 | 155.665 |
# | ('line', 'b') | 0.726784 | 19.6741 |
# | ('line', 'c') | 0.866034 | -60.0009 |
# | | ('current2', 'absolute') | ('current2', 'angle') |
# |:--------------|---------------------------:|------------------------:|
# | ('line', 'a') | 1.22632 | 125.666 |
# | ('line', 'b') | 0.726787 | -10.3247 |
# | ('line', 'c') | 0.866039 | -90.0003 |


# The current flowing into the transformer from the load side
en.res_transformers[["current2"]].transform([np.abs, ft.partial(np.angle, deg=True)])
# | | ('current2', 'absolute') | ('current2', 'angle') |
# |:-----------------|---------------------------:|------------------------:|
# | ('transfo', 'a') | 17.3904 | 30.0135 |
# | ('transfo', 'b') | 0 | 0 |
# | ('transfo', 'n') | 17.3904 | -149.987 |
# | ('transfo', 'a') | 17.3905 | 0.0141285 |
# | ('transfo', 'b') | 0 | 0 |
# | ('transfo', 'n') | 17.3905 | -179.986 |
# We can see the secondary phase "b" of the transformer does not carry any current as
# the load has 0VA on this phase.

# The voltages at the buses of the network
en.res_buses_voltages[["voltage"]].transform([np.abs, ft.partial(np.angle, deg=True)])
# | | ('voltage', 'absolute') | ('voltage', 'angle') |
# |:---------------------|--------------------------:|-----------------------:|
# | ('source_bus', 'an') | 11547 | 9.20565e-25 |
# | ('source_bus', 'bn') | 11547 | -120 |
# | ('source_bus', 'cn') | 11547 | 120 |
# | ('load_bus', 'ab') | 19999.8 | 29.9994 |
# | ('load_bus', 'bc') | 19999.9 | -90.0009 |
# | ('load_bus', 'ca') | 19999.7 | 149.999 |
# | ('lv_bus', 'an') | 115.006 | 30.0135 |
# | ('lv_bus', 'bn') | 114.999 | -150.001 |
# | ('source_bus', 'ab') | 20000 | 0 |
# | ('source_bus', 'bc') | 20000 | -120 |
# | ('source_bus', 'ca') | 20000 | 120 |
# | ('load_bus', 'ab') | 19999.6 | 6.9969e-05 |
# | ('load_bus', 'bc') | 19999.8 | -120 |
# | ('load_bus', 'ca') | 19999.6 | 119.999 |
# | ('lv_bus', 'an') | 115.005 | 0.0141285 |
# | ('lv_bus', 'bn') | 114.998 | -180 |
```
6 changes: 3 additions & 3 deletions doc/models/Transformer/Single_Phase_Transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ load = rlf.PowerLoad(id="load", bus=bus2, powers=[100], phases="an")
# Create the transformer
tp = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="Example_TP",
type="single", # <--- Single-phase transformer
vg="Ii0", # <--- Single-phase transformer
sn=800,
up=400,
us=400,
uhv=400,
ulv=400,
i0=0.022,
p0=17,
psc=25,
Expand Down
8 changes: 4 additions & 4 deletions doc/models/Transformer/Three_Phase_Transformer.md
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,11 @@ vs = rlf.VoltageSource(id="vs", bus=bus_mv, voltages=20e3)

# Create a MV/LV transformer
tp = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="SE_Minera_A0Ak_100_kVA",
type="Dyn11",
id="SE Minera A0Ak 100kVA",
vg="Dyn11",
sn=100.0 * 1e3,
up=20e3,
us=400.0,
uhv=20e3,
ulv=400.0,
i0=0.5 / 100,
p0=145.0,
psc=1250.0,
Expand Down
91 changes: 46 additions & 45 deletions doc/models/Transformer/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,71 +114,72 @@ method.

To define the parameters of the transformers, use the `TransformerParameters` class. It takes as
arguments the elements described in the previous section and converts them into the series
impedance and the magnetizing admittance. The `type` argument of the constructor can take the
impedance and the magnetizing admittance. The `vg` argument of the constructor can take the
following values:

- `"single"` to model a single-phase transformer
- `"center"` to model a center-tapped transformer
- Any windings (`"Dd0"`, `"Dz6"`, etc.) to model a three-phase transformer.
- `"Ii0"` or `"Ii6"` to model a single-phase transformer, in-phase or 180° phase shift respectively
- `"Iii0"` or `"Iii6"` to model a center-tapped transformer, in-phase or 180° phase shift respectively
- `"Dd0"`, `"Dyn11"`, etc. to model a three-phase transformer with different winding configurations

```python
import roseau.load_flow as rlf

# The transformer parameters for a single-phase transformer
single_phase_transformer_parameters = (
rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="single_phase_transformer_parameters",
type="single", # <--- single-phase transformer
up=rlf.Q_(20, "kV"),
us=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
transformer_params_1ph = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_1ph",
vg="Ii0", # <--- single-phase transformer
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_1ph.type == "single-phase"
# Alternatively, if you have z2 and ym already:
# single_phase_transformer_parameters = rlf.TransformerParameters(
# id="single_phase_transformer_parameters",
# type="single",
# up=rlf.Q_(20, "kV"),
# us=rlf.Q_(400, "V"),
# transformer_params_1ph = rlf.TransformerParameters(
# id="transformer_params_1ph",
# vg="Ii0",
# uhv=rlf.Q_(20, "kV"),
# ulv=rlf.Q_(400, "V"),
# sn=rlf.Q_(160, "kVA"),
# z2=rlf.Q_(0.0125+0.038j, "ohm"),
# ym=rlf.Q_(7.5e-7-5.5e-6j, "S"),
# )


# The transformer parameters for a three-phase transformer
three_phase_transformer_parameters = (
rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="three_phase_transformer_parameters",
type="Dyn11", # <--- three-phase transformer with delta primary and wye secondary
up=rlf.Q_(20, "kV"),
us=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
transformer_params_3ph = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_3ph",
vg="Dyn11", # <--- three-phase transformer with delta primary and wye secondary
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_3ph.type == "three-phase"

# The transformer parameters for a center-tapped transformer
center_tapped_transformer_parameters = (
rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="center_tapped_transformer_parameters",
type="center", # <--- center-tapped transformer
up=rlf.Q_(20, "kV"),
us=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
transformer_params_ct = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_ct",
vg="Iii0", # <--- center-tapped transformer
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_ct.type == "center-tapped"

# Available vector groups:
print(rlf.TransformerParameters.allowed_vector_groups)
# "Dd0", "Dd6", ..., "Ii0", "Ii6", "Iii0", "Iii6",
```

A catalogue of transformer parameters is available. More details [here](catalogues-transformers).
Expand Down
Loading

0 comments on commit b2be2b8

Please sign in to comment.