Skip to content

Commit ac44e44

Browse files
BatteryShortCircuit extension (#3062)
* BatteryShortCircuit extension * Add test * Add some javadoc * Support for BatteryShortCircuit extension legacy version Signed-off-by: Coline PILOQUET <[email protected]> Co-authored-by: Olivier Perrin <[email protected]>
1 parent afef10f commit ac44e44

23 files changed

+758
-122
lines changed

docs/grid_model/extensions.md

+25
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,31 @@ generator.newExtension(GeneratorShortCircuitAdder.class)
162162
.add();
163163
```
164164

165+
(battery-short-circuit)=
166+
## Battery short-circuit
167+
168+
This extension models the battery data used for short-circuit calculations.
169+
Depending on the type of short-circuit study to be performed, either the transient or the sub-transient reactance should
170+
be filled. The step-up transformer reactance should be filled if the battery has a transformer that is not directly
171+
modeled on the network.
172+
173+
| Attribute | Type | Unit | Required | Default value | Description |
174+
|------------------------|--------|------|----------|---------------|-----------------------------------------------|
175+
| directTransX (X'd) | double | Ω | yes | - | Direct transient reactance of the battery |
176+
| directSubtransX (X''d) | double | Ω | no | - | Direct sub-transient reactance of the battery |
177+
| stepUpTransformerX | double | Ω | no | - | Reactance of the step-up transformer |
178+
179+
This extension is provided in the `com.powsybl:powsybl-iidm-extensions` module.
180+
181+
To add this extension to a battery, the code to be used is:
182+
```java
183+
battery.newExtension(BatteryShortCircuitAdder.class)
184+
.withDirectTransX(20)
185+
.withDirectSubtransX(14)
186+
.withStepUpTransformerX(10)
187+
.add();
188+
```
189+
165190
(identifiable-short-circuit-extension)=
166191
## Identifiable short-circuit
167192

docs/simulation/shortcircuit/outputs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ In `FortescueFaultResult`, they are:
4242

4343
This status can be:
4444
- `SUCCESS`: the computation went as planned, and the results are full considering the parameters.
45-
- `NO_SHORT_CIRCUIT_DATA`: this status should be returned if no short-circuit data are available in the network, i.e., the sub-transient or transient reactance of generators and the minimum and maximum admissible short-circuit currents.
45+
- `NO_SHORT_CIRCUIT_DATA`: this status should be returned if no short-circuit data are available in the network, i.e., the sub-transient or transient reactance of generators or batteries and the minimum and maximum admissible short-circuit currents.
4646
- `SOLVER_FAILURE`: the computation failed because of an error linked to the solver.
4747
- `FAILURE`: the computation failed for any other reason.
4848

docs/simulation/shortcircuit/parameters.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,13 @@ The default value is `true`.
4242
**study-type**
4343

4444
This property indicates the type of short-circuit study. It can be:
45-
- `SUB_TRANSIENT`: it is the first stage of the short circuit, right when the fault happens. In this case, it is the sub-transient reactance of generators that is used.
46-
This reactance can either be stored in the network or calculated from the transient reactance of generators with a coefficient defined by the parameter `sub-transient-coefficient`.
47-
- `TRANSIENT`: the second stage of the short circuit, before the system stabilizes. The transient reactance of generators will be used.
45+
- `SUB_TRANSIENT`: it is the first stage of the short circuit, right when the fault happens. In this case, it is the sub-transient reactance of generators and batteries that is used.
46+
This reactance can either be stored in the network or calculated from the transient reactance of generators or batteries with a coefficient defined by the parameter `sub-transient-coefficient`.
47+
- `TRANSIENT`: the second stage of the short circuit, before the system stabilizes. The transient reactance of generators and batteries will be used.
4848
- `STEADY_STATE`: the last stage, once all transient effects are gone.
4949

50-
The default value is `TRANSIENT`. The transient and sub-transient reactance of the generators are stored in the [short-circuit generator extension.](../../grid_model/extensions.md#generator-short-circuit)
50+
The default value is `TRANSIENT`. The transient and sub-transient reactances of the generators are stored in the [short-circuit generator extension.](../../grid_model/extensions.md#generator-short-circuit)
51+
and the ones of batteries are stored in the [short-circuit battery extension.](../../grid_model/extensions.md#battery-short-circuit)
5152

5253
**sub-transient-coefficient**
5354

@@ -75,11 +76,11 @@ The voltage drop is calculated as the ratio between the initial voltage magnitud
7576

7677
**with-loads**
7778

78-
This property indicates whether loads should be taken into account during the calculation. If `true`, the loads are modelled as an equivalent reactance, and the equivalent reactance at the fault point will be lowered. If `false`, then they will be ignored.
79+
This property indicates whether loads should be taken into account during the calculation. If `true`, the loads are modeled as an equivalent reactance, and the equivalent reactance at the fault point will be lowered. If `false`, then they will be ignored.
7980

8081
**with-shunt-compensators**
8182

82-
This property indicates if shunt compensators should be taken into account during the computation. If `true`, the shunt compensators will be modelled as an equivalent reactance.
83+
This property indicates if shunt compensators should be taken into account during the computation. If `true`, the shunt compensators will be modeled as an equivalent reactance.
8384
If `false`, then the shunt compensators will be ignored.
8485

8586
**with-vsc-converter-stations**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package com.powsybl.iidm.network.extensions;
9+
10+
import com.powsybl.iidm.network.Battery;
11+
12+
/**
13+
* The short-circuit reactances for batteries.
14+
* @author Coline Piloquet {@literal <[email protected]>}
15+
*/
16+
public interface BatteryShortCircuit extends ShortCircuitExtension<Battery> {
17+
18+
String NAME = "batteryShortCircuit";
19+
20+
@Override
21+
default String getName() {
22+
return NAME;
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package com.powsybl.iidm.network.extensions;
9+
10+
import com.powsybl.iidm.network.Battery;
11+
12+
/**
13+
* @author Coline Piloquet {@literal <[email protected]>}
14+
*/
15+
public interface BatteryShortCircuitAdder extends ShortCircuitExtensionAdder<Battery, BatteryShortCircuit, BatteryShortCircuitAdder> {
16+
17+
@Override
18+
default Class<BatteryShortCircuit> getExtensionClass() {
19+
return BatteryShortCircuit.class;
20+
}
21+
}

iidm/iidm-extensions/src/main/java/com/powsybl/iidm/network/extensions/GeneratorShortCircuit.java

+1-33
Original file line numberDiff line numberDiff line change
@@ -7,50 +7,18 @@
77
*/
88
package com.powsybl.iidm.network.extensions;
99

10-
import com.powsybl.commons.extensions.Extension;
1110
import com.powsybl.iidm.network.Generator;
1211

1312
/**
1413
*
1514
* @author Coline Piloquet {@literal <[email protected]>}
1615
*/
17-
public interface GeneratorShortCircuit extends Extension<Generator> {
16+
public interface GeneratorShortCircuit extends ShortCircuitExtension<Generator> {
1817

1918
String NAME = "generatorShortCircuit";
2019

2120
@Override
2221
default String getName() {
2322
return NAME;
2423
}
25-
26-
/**
27-
* Get the direct-axis sub-transient reactance (also known as X''d)
28-
*/
29-
double getDirectSubtransX();
30-
31-
/**
32-
* Set the direct-axis sub-transient reactance (also known as X''d)
33-
*/
34-
GeneratorShortCircuit setDirectSubtransX(double directSubtransX);
35-
36-
/**
37-
* Get the direct-axis transient reactance (also known as X'd)
38-
*/
39-
double getDirectTransX();
40-
41-
/**
42-
* Set the direct-axis transient reactance (also known as X'd)
43-
*/
44-
GeneratorShortCircuit setDirectTransX(double directTransX);
45-
46-
/**
47-
* Get the step-up transformer reactance if the generator has a non-modeled step-up transformer.
48-
*/
49-
double getStepUpTransformerX();
50-
51-
/**
52-
* Set the step-up transformer reactance
53-
*/
54-
GeneratorShortCircuit setStepUpTransformerX(double setUpTransformerX);
55-
5624
}

iidm/iidm-extensions/src/main/java/com/powsybl/iidm/network/extensions/GeneratorShortCircuitAdder.java

+1-8
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,16 @@
77
*/
88
package com.powsybl.iidm.network.extensions;
99

10-
import com.powsybl.commons.extensions.ExtensionAdder;
1110
import com.powsybl.iidm.network.Generator;
1211

1312
/**
1413
*
1514
* @author Coline Piloquet {@literal <[email protected]>}
1615
*/
17-
public interface GeneratorShortCircuitAdder extends ExtensionAdder<Generator, GeneratorShortCircuit> {
16+
public interface GeneratorShortCircuitAdder extends ShortCircuitExtensionAdder<Generator, GeneratorShortCircuit, GeneratorShortCircuitAdder> {
1817

1918
@Override
2019
default Class<GeneratorShortCircuit> getExtensionClass() {
2120
return GeneratorShortCircuit.class;
2221
}
23-
24-
GeneratorShortCircuitAdder withDirectTransX(double directTransX);
25-
26-
GeneratorShortCircuitAdder withDirectSubtransX(double direcSubtransX);
27-
28-
GeneratorShortCircuitAdder withStepUpTransformerX(double stepUpTransformerX);
2922
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package com.powsybl.iidm.network.extensions;
9+
10+
import com.powsybl.commons.extensions.Extendable;
11+
import com.powsybl.commons.extensions.Extension;
12+
13+
/**
14+
* @author Coline Piloquet {@literal <[email protected]>}
15+
*/
16+
public interface ShortCircuitExtension<T extends Extendable<T>> extends Extension<T> {
17+
18+
/**
19+
* Get the direct-axis sub-transient reactance (also known as X''d)
20+
*/
21+
double getDirectSubtransX();
22+
23+
/**
24+
* Set the direct-axis sub-transient reactance (also known as X''d)
25+
*/
26+
ShortCircuitExtension<T> setDirectSubtransX(double directSubtransX);
27+
28+
/**
29+
* Get the direct-axis transient reactance (also known as X'd)
30+
*/
31+
double getDirectTransX();
32+
33+
/**
34+
* Set the direct-axis transient reactance (also known as X'd)
35+
*/
36+
ShortCircuitExtension<T> setDirectTransX(double directTransX);
37+
38+
/**
39+
* Get the step-up transformer reactance if the generator or battery has a non-modeled step-up transformer.
40+
*/
41+
double getStepUpTransformerX();
42+
43+
/**
44+
* Set the step-up transformer reactance
45+
*/
46+
ShortCircuitExtension<T> setStepUpTransformerX(double setUpTransformerX);
47+
48+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package com.powsybl.iidm.network.extensions;
9+
10+
import com.powsybl.commons.PowsyblException;
11+
import com.powsybl.commons.extensions.Extendable;
12+
import com.powsybl.commons.extensions.ExtensionAdder;
13+
14+
/**
15+
*
16+
* @author Coline Piloquet {@literal <[email protected]>}
17+
*/
18+
public interface ShortCircuitExtensionAdder<T extends Extendable<T>,
19+
C extends ShortCircuitExtension<T>,
20+
A extends ShortCircuitExtensionAdder<T, C, ?>> extends ExtensionAdder<T, C> {
21+
22+
@Override
23+
default Class<C> getExtensionClass() {
24+
throw new PowsyblException("Not yet implemented");
25+
}
26+
27+
A withDirectTransX(double directTransX);
28+
29+
A withDirectSubtransX(double direcSubtransX);
30+
31+
A withStepUpTransformerX(double stepUpTransformerX);
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/**
2+
* Copyright (c) 2024, RTE (http://www.rte-france.com)
3+
* This Source Code Form is subject to the terms of the Mozilla Public
4+
* License, v. 2.0. If a copy of the MPL was not distributed with this
5+
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
6+
* SPDX-License-Identifier: MPL-2.0
7+
*/
8+
package com.powsybl.iidm.network.impl.extensions;
9+
10+
import com.powsybl.commons.PowsyblException;
11+
import com.powsybl.commons.extensions.AbstractExtensionAdder;
12+
import com.powsybl.commons.extensions.Extendable;
13+
import com.powsybl.iidm.network.extensions.ShortCircuitExtension;
14+
import com.powsybl.iidm.network.extensions.ShortCircuitExtensionAdder;
15+
16+
/**
17+
*
18+
* @author Coline Piloquet {@literal <[email protected]>}
19+
*/
20+
public abstract class AbstractShortCircuitExtensionAdderImpl<T extends Extendable<T>,
21+
C extends ShortCircuitExtension<T>,
22+
A extends ShortCircuitExtensionAdder<T, C, ?>>
23+
extends AbstractExtensionAdder<T, C>
24+
implements ShortCircuitExtensionAdder<T, C, A> {
25+
26+
double directTransX = 0;
27+
double directSubtransX = Double.NaN;
28+
double stepUpTransformerX = Double.NaN;
29+
30+
protected AbstractShortCircuitExtensionAdderImpl(T extendable) {
31+
super(extendable);
32+
}
33+
34+
protected abstract A self();
35+
36+
@Override
37+
protected C createExtension(T extendable) {
38+
throw new PowsyblException("Not implemented");
39+
}
40+
41+
@Override
42+
public A withDirectTransX(double directTransX) {
43+
this.directTransX = directTransX;
44+
return self();
45+
}
46+
47+
@Override
48+
public A withDirectSubtransX(double directSubtransX) {
49+
this.directSubtransX = directSubtransX;
50+
return self();
51+
}
52+
53+
@Override
54+
public A withStepUpTransformerX(double stepUpTransformerX) {
55+
this.stepUpTransformerX = stepUpTransformerX;
56+
return self();
57+
}
58+
59+
@Override
60+
public C add() {
61+
if (Double.isNaN(directTransX)) {
62+
throw new PowsyblException("Undefined directTransX");
63+
}
64+
return super.add();
65+
}
66+
}

0 commit comments

Comments
 (0)