private static double getI(TwoWindingsTransformer phaseShifter) { return phaseShifter.getTerminal1().getI(); }
/** * This implementation takes the current value to be checked from the Network. */ @Override public void checkCurrent(Branch branch, Branch.Side side, Consumer<LimitViolation> consumer) { checkCurrent(branch, side, branch.getTerminal(side).getI(), consumer); }
private static void addBranchSideData(LinkedHashMap<String, Double> branchesData, String branchId, Terminal terminal, double currentLimit) { branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), HistoDbAttr.I.name()), terminal.getI()); branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), HistoDbAttr.P.name()), terminal.getP()); branchesData.put(getAttributeKey(branchId, terminal.getVoltageLevel().getId(), "IMAX"), currentLimit); }
@Override public void checkCurrent(Branch branch, Branch.Side side, double value, Consumer<LimitViolation> consumer) { Branch.Overload overload = LimitViolationUtils.checkTemporaryLimits(branch, side, limitReduction, value); if (currentLimitTypes.contains(Security.CurrentLimitType.TATL) && (overload != null)) { consumer.accept(new LimitViolation(branch.getId(), branch.getName(), LimitViolationType.CURRENT, overload.getPreviousLimitName(), overload.getTemporaryLimit().getAcceptableDuration(), overload.getPreviousLimit(), limitReduction, branch.getTerminal(side).getI(), side)); } else if (currentLimitTypes.contains(Security.CurrentLimitType.PATL)) { checkPermanentLimit(branch, side, value, consumer); } }
private void update(Terminal t) { if (t.getBusView().getBus() != null) { p = t.getP(); q = t.getQ(); v = t.getBusView().getBus().getV(); i = t.getI(); } }
if (branch != null) { double newLimit = getNewUpperLimit(violation, margin); if (branch.getTerminal1().getI() == violation.getValue()) { LOGGER.debug("State {}: changing current limit 1 of branch {}: {} -> {}", stateId, network.getStateManager().setWorkingState(stateId); } else if (branch.getTerminal2().getI() == violation.getValue()) { LOGGER.debug("State {}: changing current limit 2 of branch {}: {} -> {}", stateId,
private static void extractLinesData(Network network, NetworkData networkData) { for (Line line : network.getLines()) { if (line.getTerminal1().getVoltageLevel().getNominalV() >= 110) { networkData.addLineData(new LineData(line.getId(), (line.getTerminal1().getBusBreakerView().getBus() != null) ? line.getTerminal1().getBusBreakerView().getBus().getId() : line.getTerminal1().getBusBreakerView().getConnectableBus().getId(), (line.getTerminal2().getBusBreakerView().getBus() != null) ? line.getTerminal2().getBusBreakerView().getBus().getId() : line.getTerminal2().getBusBreakerView().getConnectableBus().getId(), line.getTerminal1().getI(), line.getTerminal2().getI(), (line.getCurrentLimits1() != null) ? line.getCurrentLimits1().getPermanentLimit() : Float.NaN, (line.getCurrentLimits2() != null) ? line.getCurrentLimits2().getPermanentLimit() : Float.NaN) ); } } }
LoadFlow loadFlow = loadFlowFactory.create(network, computationManager, 0); runLoadFlow(loadFlow, tmpStateId); if (phaseShifter.getTerminal1().getI() >= phaseShifter.getCurrentLimits1().getPermanentLimit()) { throw new PowsyblException("Phase shifter already overloaded");
@Override public void onPostContingencyResult(RunningContext context, PostContingencyResult postContingencyResult) { String workingStateId = context.getNetwork().getVariantManager().getWorkingVariantId(); for (LimitViolation limitViolation : postContingencyResult.getLimitViolationsResult().getLimitViolations()) { if (limitViolation.getLimitType() == LimitViolationType.CURRENT) { Branch branch = context.getNetwork().getBranch(limitViolation.getSubjectId()); context.getNetwork().getVariantManager().setWorkingVariant(context.getInitialStateId()); limitViolation.addExtension(CurrentExtension.class, new CurrentExtension(branch.getTerminal(limitViolation.getSide()).getI())); double preContingencyValue = branch.getTerminal(limitViolation.getSide()).getP(); context.getNetwork().getVariantManager().setWorkingVariant(workingStateId); double postContingencyValue = branch.getTerminal(limitViolation.getSide()).getP(); limitViolation.addExtension(ActivePowerExtension.class, new ActivePowerExtension(preContingencyValue, postContingencyValue)); } } } }