Skip to content
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

Add voltage init alert threshold on shunt compensator activation #65

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

<properties>
<gridsuite-dependencies.version>31</gridsuite-dependencies.version>
<powsybl-open-reac.version>0.7.0</powsybl-open-reac.version>
<powsybl-open-reac.version>0.8.0</powsybl-open-reac.version>
<mockito-inline.version>3.11.1</mockito-inline.version>
<liquibase-hibernate-package>org.gridsuite.voltageinit.server</liquibase-hibernate-package>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public class VoltageInitParametersInfos {

double reactiveSlacksThreshold;

double shuntCompensatorActivationThreshold;

boolean updateBusVoltage;

public VoltageInitParametersEntity toEntity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public class VoltageInitParametersEntity {
@Column(name = "reactiveSlacksThreshold")
private double reactiveSlacksThreshold;

@Column(name = "shuntCompensatorActivationThreshold")
private double shuntCompensatorActivationThreshold;

@Column(name = "updateBusVoltage")
private boolean updateBusVoltage;

Expand Down Expand Up @@ -110,6 +113,7 @@ public void assignAttributes(@NonNull VoltageInitParametersInfos voltageInitPara
variableShuntCompensators = FilterEquipmentsEmbeddable.toEmbeddableFilterEquipments(voltageInitParametersInfos.getVariableShuntCompensators());
name = voltageInitParametersInfos.getName();
reactiveSlacksThreshold = voltageInitParametersInfos.getReactiveSlacksThreshold();
shuntCompensatorActivationThreshold = voltageInitParametersInfos.getShuntCompensatorActivationThreshold();
updateBusVoltage = voltageInitParametersInfos.isUpdateBusVoltage();
}

Expand Down Expand Up @@ -141,6 +145,7 @@ public VoltageInitParametersInfos toVoltageInitParametersInfos() {
.variableTwoWindingsTransformers(FilterEquipmentsEmbeddable.fromEmbeddableFilterEquipments(this.getVariableTwoWindingsTransformers()))
.variableShuntCompensators(FilterEquipmentsEmbeddable.fromEmbeddableFilterEquipments(this.getVariableShuntCompensators()))
.reactiveSlacksThreshold(this.getReactiveSlacksThreshold())
.shuntCompensatorActivationThreshold(this.getShuntCompensatorActivationThreshold())
.updateBusVoltage(this.isUpdateBusVoltage())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ public OpenReacParameters buildOpenReacParameters(VoltageInitRunContext context,
parameters.addConstantQGenerators(toEquipmentIdsList(context.getNetworkUuid(), context.getVariantId(), voltageInitParameters.getConstantQGenerators()))
.addVariableTwoWindingsTransformers(toEquipmentIdsList(context.getNetworkUuid(), context.getVariantId(), voltageInitParameters.getVariableTwoWindingsTransformers()))
.addVariableShuntCompensators(toEquipmentIdsList(context.getNetworkUuid(), context.getVariantId(), voltageInitParameters.getVariableShuntCompensators()));

parameters.setShuntCompensatorActivationAlertThreshold(voltageInitParameters.getShuntCompensatorActivationThreshold());
});

logVoltageLimitsModifications(reportNode, network, parameters.getSpecificVoltageLimits());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet author="lecuyerfra (generated)" id="1715784245416-5">
<addColumn tableName="voltage_init_parameters">
<column defaultValueNumeric="0.0" name="shunt_compensator_activation_threshold" type="float(53)"/>
</addColumn>
</changeSet>
</databaseChangeLog>
3 changes: 3 additions & 0 deletions src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ databaseChangeLog:
- include:
file: changesets/changelog_20240407T230420Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20240515T144349Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20240529T153656Z.xml
relativeToChangelogFile: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ private VoltageInitParametersEntity buildVoltageInitParametersEntity() {
.filterName("vtwFilter2")
.build()))
.reactiveSlacksThreshold(100.)
.shuntCompensatorActivationThreshold(100.)
.build().toEntity();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ private static Consumer<VoltageLimitOverride> assertVoltageLimitOverride(final S

private ListAssert<VoltageLimitOverride> testsBuildSpecificVoltageLimitsCommon(List<VoltageLimitEntity> voltageLimits, String reportFilename) throws Exception {
final VoltageInitParametersEntity voltageInitParameters = entityManager.persistFlushFind(
new VoltageInitParametersEntity(null, null, "", voltageLimits, null, null, null, 100., false)
new VoltageInitParametersEntity(null, null, "", voltageLimits, null, null, null, 100., 0., false)
);
final VoltageInitRunContext context = new VoltageInitRunContext(NETWORK_UUID, VARIANT_ID_1, null, REPORT_UUID, null, "", "", voltageInitParameters.getId());
context.setReportNode(ReportNode.newRootReportNode().withMessageTemplate(COMPUTATION_TYPE, COMPUTATION_TYPE).build());
Expand Down Expand Up @@ -187,7 +187,7 @@ void testsBuildSpecificVoltageLimitsWithLimitModifications() throws Exception {
.hasSize(8)
//There should (not?) be relative overrides since voltage limit modification are applied
.anyMatch(VoltageLimitOverride::isRelative)
//VLGEN has both it limits set so it should now be impacted by modifications override
//VLGEN has both it limits set, so it should now be impacted by modifications override
.satisfiesOnlyOnce(assertVoltageLimitOverride("VLGEN", VoltageLimitType.LOW_VOLTAGE_LIMIT, -1.))
.satisfiesOnlyOnce(assertVoltageLimitOverride("VLGEN", VoltageLimitType.HIGH_VOLTAGE_LIMIT, -2.))
//Because of the modification setting the voltage limits attributed to VLLOAD should now respectively be 43. and 86.
Expand Down Expand Up @@ -256,7 +256,7 @@ void testsBuildSpecificVoltageLimitsWithFourSubstationStudy() throws Exception {
final VoltageLimitEntity vl3 = new VoltageLimitEntity(null, 70.0, 700.0, 0, VoltageLimitParameterType.DEFAULT, List.of(new FilterEquipmentsEmbeddable(filterUuidS4VL2, filterIdS4VL2)));
final VoltageLimitEntity vl4 = new VoltageLimitEntity(null, -20.0, 10.0, 0, VoltageLimitParameterType.MODIFICATION, List.of(new FilterEquipmentsEmbeddable(filterUuidS3VL1, filterIdS3VL1)));
final VoltageInitParametersEntity voltageInitParameters = entityManager.persistFlushFind(
new VoltageInitParametersEntity(null, null, "", List.of(vl1, vl2, vl3, vl4), null, null, null, 100., false)
new VoltageInitParametersEntity(null, null, "", List.of(vl1, vl2, vl3, vl4), null, null, null, 100., 0., false)
);

final VoltageInitRunContext context = new VoltageInitRunContext(networkUuid, variantId, null, REPORT_UUID, null, "", "", voltageInitParameters.getId());
Expand Down
Loading