continue; if (l.getTerminal1().getBusView().getBus() != null) { if ((regions == null || !Collections.disjoint(regions, l.getTerminal1().getVoltageLevel().getSubstation().getGeographicalTags())) if (l.getTerminal2().getBusView().getBus() != null) { if ((regions == null || !Collections.disjoint(regions, l.getTerminal2().getVoltageLevel().getSubstation().getGeographicalTags()))
if (twt.getTerminal1().getBusView().getConnectableBus() == lvBus) { hvVl = twt.getTerminal2().getVoltageLevel(); hvBus = twt.getTerminal2().getBusBreakerView().getConnectableBus(); } else if (twt.getTerminal2().getBusView().getConnectableBus() == lvBus) { hvVl = twt.getTerminal1().getVoltageLevel(); hvBus = twt.getTerminal1().getBusBreakerView().getConnectableBus(); if (twt.getTerminal2().getBusView().getConnectableBus().getId().equals(lvBus.getId())) { otherSideSv = transformerModel.toSv1(new StateVariable(-sv.p, -sv.q, sv.u, sv.theta)); } else if (twt.getTerminal1().getBusView().getConnectableBus().getId().equals(lvBus.getId())) { otherSideSv = transformerModel.toSv2(new StateVariable(-sv.p, -sv.q, sv.u, sv.theta)); } else {
if (dl.getTerminal().getBusView().getBus() != null) { String str = idDL + dl.getId(); numberBusIdMap.put(busNumber, str); if (t.getLeg1().getTerminal().getBusView().getBus() != null && t.getLeg2().getTerminal().getBusView().getBus() != null && t.getLeg3().getTerminal().getBusView().getBus() != null) { String str = idT3W + t.getId(); numberBusIdMap.put(busNumber, str); if (dl.getTerminal().getBusView().getBus() != null) { String str = idDL + dl.getId(); numberBranchIdMap.put(branchNumber, str); if (l.getTerminal1().getBusView().getBus() != null && l.getTerminal2().getBusView().getBus() != null) { String str = idL + l.getId(); numberBranchIdMap.put(branchNumber, str); if (t.getTerminal1().getBusView().getBus() != null && t.getTerminal2().getBusView().getBus() != null) { String str = idT2W + t.getId(); if (t.getLeg1().getTerminal().getBusView().getBus() != null && t.getLeg2().getTerminal().getBusView().getBus() != null && t.getLeg3().getTerminal().getBusView().getBus() != null) { String str = idT3W + t.getId() + "_1"; numberBranchIdMap.put(branchNumber, str);
double angle = 0; if (generator.getTerminal().getBusView().getBus() != null) { if (!Double.isNaN(generator.getTerminal().getBusView().getBus().getV())) { voltage = generator.getTerminal().getBusView().getBus().getV(); if (!Double.isNaN(generator.getTerminal().getBusView().getBus().getAngle())) { angle = generator.getTerminal().getBusView().getBus().getAngle();
double angle = 0; if (generator.getTerminal().getBusView().getBus() != null) { if (!Double.isNaN(generator.getTerminal().getBusView().getBus().getV())) { voltage = generator.getTerminal().getBusView().getBus().getV(); if (!Double.isNaN(generator.getTerminal().getBusView().getBus().getAngle())) { angle = generator.getTerminal().getBusView().getBus().getAngle();
connectedBus = vscConv.getTerminal().getBusView().getConnectableBus(); if (connectedBus == null) { throw new RuntimeException("VSCConverter " + vscConv.getId() + " : connected bus not found!");
Load hvAux = n.getLoad(hvAuxId); if (hvAux != null && hvAux.getTerminal().getBusBreakerView().getConnectableBus() == hvGenConnectableBus) { if (hvAux.getTerminal().getBusView().getBus() != null) { if (!Double.isNaN(hvAux.getTerminal().getP())) { hvAuxPf.p = hvAux.getTerminal().getP(); if (hvGen.getTerminal().getBusView().getBus() != null) { // it means that we can use the generator to balance the auxiliary difference if (tg.lh.pl > lvAuxPf.p) { lvAuxPf.p = tg.lh.pl;
Network n = s.getNetwork(); double hvNomV = hvVl.getNominalV(); Bus hvGenBus = hvT.getBusView().getBus(); Bus hvGenConnectableBus = hvT.getBusBreakerView().getConnectableBus(); if (hvGenConnectableBus == null) {
Bus otherBus = otherT.getBusView().getBus(); if (otherBus != null && !Double.isNaN(otherBus.getV())) {
Bus b = t.getBusView().getBus(); if (b != null) { if (!Double.isNaN(b.getV())) {
Bus bus1 = line.getTerminal1().getBusView().getBus(); Bus bus2 = line.getTerminal2().getBusView().getBus(); Bus connectableBus1 = line.getTerminal1().getBusView().getConnectableBus(); Bus connectableBus2 = line.getTerminal2().getBusView().getConnectableBus();
@Override public void dumpDtaFile(Path workingDir, String fileName, Network network, Map<String, Character> parallelIndexes, String eurostagVersion, Map<String, String> iidm2eurostagId, SimulationParameters simulationParameters) { Objects.requireNonNull(workingDir); Objects.requireNonNull(fileName); Objects.requireNonNull(network); Objects.requireNonNull(parallelIndexes); Objects.requireNonNull(eurostagVersion); Objects.requireNonNull(iidm2eurostagId); LOGGER.info("exporting dynamic data for network: {}", network.getId()); //uses the first connected generator that is available in the iidm2eurostag map Generator generator = network.getGeneratorStream() .filter(gen -> (iidm2eurostagId.containsKey(gen.getId())) && (gen.getTerminal().isConnected())) .findFirst() .orElseThrow(() -> new RuntimeException("could not find a suitable generator in network: " + network + ", to be used in: " + fileName)); Bus bus = generator.getTerminal().getBusBreakerView().getConnectableBus(); if ((bus == null) || (!iidm2eurostagId.containsKey(bus.getId()))) { bus = generator.getTerminal().getBusView().getConnectableBus(); if ((bus == null) || (!iidm2eurostagId.containsKey(bus.getId()))) { throw new RuntimeException("suitable node not found"); } } DynamicDatabaseMockUtils mockUtils = new DynamicDatabaseMockUtils(); String mappedGenName = mockUtils.formatString8(iidm2eurostagId.get(generator.getId())); String mappedNodeName = mockUtils.formatString8(iidm2eurostagId.get(bus.getId())); LOGGER.info("generator: iidm {}, eurostag {}", generator.getId(), mappedGenName); LOGGER.info("node: iidm {}, eurostag {}", bus.getId(), mappedNodeName); mockUtils.copyDynamicDataFiles(MINIMAL_DTA_TEMPLATE, workingDir, fileName, ImmutableMap.of("NODENAME", mappedNodeName, "MINIMALI", mappedGenName), MOCK_REG_FILES_PREFIXES); }
Bus bus1 = twt.getTerminal1().getBusView().getBus(); Bus bus2 = twt.getTerminal2().getBusView().getBus(); Bus connectableBus1 = twt.getTerminal1().getBusView().getConnectableBus(); Bus connectableBus2 = twt.getTerminal2().getBusView().getConnectableBus();