Skip to content

Commit

Permalink
Merge branch 'reactive_limits_refactor' into vsc_creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Seddik Yengui committed Sep 18, 2023
2 parents 07b7328 + 0090e33 commit c131251
Show file tree
Hide file tree
Showing 10 changed files with 429 additions and 68 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
/**
* Copyright (c) 2022, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

package org.gridsuite.modification.server.dto;

import java.util.List;

/**
* @author Seddik Yengui <Seddik.yengui at rte-france.com>
*/

public interface ReactiveLimitsHolderInfos {
Boolean getReactiveCapabilityCurve();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,16 @@ public void apply(Network network, Reporter subReporter) {
.allMatch(filterEquipments -> filterEquipments.getIdentifiableAttributes().isEmpty());

if (noValidEquipmentId) {
String errorMsg = "There is no valid equipment ID among the provided filter(s)";
String errorMsg = scalingInfos.getErrorType() + ": There is no valid equipment ID among the provided filter(s)";
createReport(subReporter, "invalidFilters", errorMsg, TypedValue.ERROR_SEVERITY);
throw new NetworkModificationException(scalingInfos.getErrorType(), errorMsg);
return;
}

// create report for each wrong filter
filterWithWrongEquipmentsIds.values().forEach(f -> {
var equipmentIds = String.join(", ", f.getNotFoundEquipments());

createReport(subReporter,
"filterEquipmentsNotFound",
"filterEquipmentsNotFound_" + f.getFilterName(),
String.format("Cannot find the following equipments %s in filter %s", equipmentIds, filters.get(f.getFilterId())),
TypedValue.WARN_SEVERITY);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ private static double computeTotalAmountFixedSupply(Network network, Component c
return totalAmountFixedSupply;
}

private static Component getSynchronousComponentFrom(HvdcConverterStation<?> station) {
return station.getTerminal().getBusView().getBus().getSynchronousComponent();
private static boolean inDifferentSynchronousComponent(HvdcConverterStation<?> station, int componentNum) {
Bus bus = station.getTerminal().getBusView().getBus();
return bus != null && bus.getSynchronousComponent().getNum() != componentNum;
}

private static double computeHvdcBalance(Component component) {
Expand All @@ -115,8 +116,8 @@ private static double computeHvdcBalance(Component component) {
HvdcConverterStation<?> station1 = hvdcLine.getConverterStation1();
HvdcConverterStation<?> station2 = hvdcLine.getConverterStation2();

boolean station2NotInComponent = station1.getId().equals(station.getId()) && getSynchronousComponentFrom(station2).getNum() != component.getNum();
boolean station1NotInComponent = station2.getId().equals(station.getId()) && getSynchronousComponentFrom(station1).getNum() != component.getNum();
boolean station2NotInComponent = station1.getId().equals(station.getId()) && inDifferentSynchronousComponent(station2, component.getNum());
boolean station1NotInComponent = station2.getId().equals(station.getId()) && inDifferentSynchronousComponent(station1, component.getNum());
return station1NotInComponent || station2NotInComponent;
})
.mapToDouble(station -> {
Expand Down Expand Up @@ -375,7 +376,7 @@ private double reduceGeneratorMaxPValue(Generator generator,
}
}
double genFrequencyReserve = computeGenFrequencyReserve(generator, generatorsFrequencyReserve);
return res * (1. - genFrequencyReserve / 100.);
return Math.max(generator.getMinP(), res * (1. - genFrequencyReserve / 100.));
}

@Override
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ databaseChangeLog:
file: changesets/changelog_20230702T105416Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20230629T150259Z.xml
file: changesets/changelog_20230728T141452Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20230629T150259Z.xml
Expand Down
Loading

0 comments on commit c131251

Please sign in to comment.