@Override public void visitShuntCompensator(ShuntCompensator sc) { terminals.add(sc.getTerminal()); }
@Override protected void writeRootElementAttributes(ShuntCompensator sc, VoltageLevel vl, NetworkXmlWriterContext context) throws XMLStreamException { XmlUtil.writeDouble("bPerSection", sc.getbPerSection(), context.getWriter()); context.getWriter().writeAttribute("maximumSectionCount", Integer.toString(sc.getMaximumSectionCount())); context.getWriter().writeAttribute("currentSectionCount", Integer.toString(sc.getCurrentSectionCount())); writeNodeOrBus(null, sc.getTerminal(), context); writePQ(null, sc.getTerminal(), context.getWriter()); }
private Void readShunt(String[] tokens) { int num = Integer.parseInt(tokens[1]); int busNum = Integer.parseInt(tokens[2]); double q = readDouble(tokens[4]); int sections = Integer.parseInt(tokens[5]); String id = mapper.getId(AmplSubset.SHUNT, num); ShuntCompensator sc = network.getShuntCompensator(id); if (sc == null) { throw new AmplException("Invalid shunt compensator id '" + id + "'"); } sc.setCurrentSectionCount(Math.max(0, Math.min(sc.getMaximumSectionCount(), sections))); Terminal t = sc.getTerminal(); t.setQ(q); busConnection(t, busNum); return null; }
private static void addShuntCompensators(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) { for (ShuntCompensator sc : network.getShuntCompensators()) { Terminal.BusBreakerView view = sc.getTerminal().getBusBreakerView(); double q = sc.getCurrentB() * Math.pow(sc.getTerminal().getVoltageLevel().getNominalV(), 2); if (view.getBus() != null) { addConnectedShunt(view, q, sc.getId(), balanceMainCC, balanceOtherCC); } else { addDisonnectedShunt(view, q, sc.getId(), balanceMainCC, balanceOtherCC); } } }
this.busInfo = busInfo; double nominalV = shunt.getTerminal().getVoltageLevel().getNominalV(); int numSteps = shunt.getMaximumSectionCount(); double stepSize = nominalV * nominalV * shunt.getMaximumB() / numSteps;
/** * Export IIDM shunts to Modelica capacitors * @param writerMo * @param modContext * @param modelicaModelsList * @param modelicaSim * @throws IOException */ private void exportCapacitors(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException { if ((shuntsList.size() != 0) && (!shuntsList.isEmpty())) { LOGGER.info("EXPORTING SHUNTS"); this.addRecord(writerMo, null); this.addRecord(writerMo, "// CAPACITORS"); for (ShuntCompensator shunt : shuntsList) { LOGGER.info("Exporting shunt " + shunt.getId()); ConnectBusInfo busInfo = findBus(shunt.getTerminal(), shunt.getId()); CapacitorRecord shuntRecord = ModelConverter.getModelicaRecord(shunt, busInfo, modContext, _ddbManager, modelicaSim); this.addRecord(shuntRecord, writerMo, modContext, _ddbManager, modelicaSim); } shuntsList = null; } }
/** * Export IIDM shunts connect to Modelica capacitors connect */ private void exportConnectCapacitors(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException { if ((connectCapacitorsList.size() != 0) && (!connectCapacitorsList.isEmpty())) { LOGGER.info("EXPORTING CONNECT CAPACITORS"); this.addRecord(writerMo, null); this.addRecord(writerMo, "// Connecting Capacitors"); for (ShuntCompensator capacitor : connectCapacitorsList) { LOGGER.info("\t Exporting capacitor connect " + capacitor.getId()); ConnectBusInfo busInfo = findBus(capacitor.getTerminal(), capacitor.getId()); if (!Double.isNaN(busInfo.getBus().getV())) { if (busInfo.isConnected()) { ConnectRecord capacitorConnect = ModelConverter.getModelicaRecord(busInfo, capacitor, modContext, _ddbManager, modelicaSim); this.addRecord(capacitorConnect, writerMo, modContext, _ddbManager, modelicaSim); } } } } }
private void createShunt(VoltageLevel voltageLevel, cim1.model.ShuntCompensator sc) { LOGGER.trace("Create shunt compensator {}", namingStrategy.getId(sc)); cim1.model.Terminal t = sc.getTerminals().get(0); cim1.model.TopologicalNode tn = t.getTopologicalNode(); int sectionCount = (int) sc.getSvShuntCompensatorSections().getContinuousSections(); sectionCount = Math.abs(sectionCount); // RTE Convergence CIM export bug (SVC) float bPerSection = sc.getBPerSection(); if (bPerSection == 0) { bPerSection = Float.MIN_VALUE; LOGGER.warn("Fix {} susceptance per section: 0 -> {}", sc.getId(), bPerSection); } ShuntCompensator shunt = voltageLevel.newShuntCompensator() .setId(namingStrategy.getId(sc)) .setName(namingStrategy.getName(sc)) .setEnsureIdUnicity(false) .setBus(t.isConnected() ? namingStrategy.getId(tn) : null) .setConnectableBus(namingStrategy.getId(tn)) .setCurrentSectionCount(sectionCount) .setbPerSection(bPerSection) .setMaximumSectionCount(Math.max(sc.getMaximumSections(), sectionCount)) .add(); addTerminalMapping(tn, shunt.getTerminal()); cim1.model.SvPowerFlow svfp = t.getSvPowerFlow(); if (svfp != null) { shunt.getTerminal().setQ(svfp.getQ()); } }
sc.getTerminal().getVoltageLevel().getSubstation().getGeographicalTags())) { continue; .contains(sc.getTerminal().getVoltageLevel().getSubstation().getCountry().toString())) { continue;
private void createBanks(EsgNetwork esgNetwork) { for (ShuntCompensator sc : Identifiables.sort(network.getShunts())) { // skip shunts not in the main connected component if (config.isExportMainCCOnly() && !EchUtil.isInMainCc(sc, config.isNoSwitch())) { LOGGER.warn("not in main component, skipping ShuntCompensator: {}", sc.getId()); continue; } ConnectionBus bus = ConnectionBus.fromTerminal(sc.getTerminal(), config, fakeNodes); //...number of steps in service int ieleba = bus.isConnected() ? sc.getCurrentSectionCount() : 0; // not really correct, because it can be connected with zero section, EUROSTAG should be modified... double vnom = sc.getTerminal().getVoltageLevel().getNominalV(); double plosba = 1000 * vnom * vnom * 0.; // no active lost in the iidm shunt compensator. Expressed in kw double rcapba = vnom * vnom * sc.getbPerSection(); int imaxba = sc.getMaximumSectionCount(); EsgCapacitorOrReactorBank.RegulatingMode xregba = EsgCapacitorOrReactorBank.RegulatingMode.NOT_REGULATING; esgNetwork.addCapacitorsOrReactorBanks(new EsgCapacitorOrReactorBank(new Esg8charName(dictionary.getEsgId(sc.getId())), new Esg8charName(dictionary.getEsgId(bus.getId())), ieleba, plosba, rcapba, imaxba, xregba)); } }
@Override protected ShuntCompensator readRootElementAttributes(ShuntCompensatorAdder adder, NetworkXmlReaderContext context) { double bPerSection = XmlUtil.readDoubleAttribute(context.getReader(), "bPerSection"); int maximumSectionCount = XmlUtil.readIntAttribute(context.getReader(), "maximumSectionCount"); int currentSectionCount = XmlUtil.readIntAttribute(context.getReader(), "currentSectionCount"); adder.setbPerSection(bPerSection) .setMaximumSectionCount(maximumSectionCount) .setCurrentSectionCount(currentSectionCount); readNodeOrBus(adder, context); ShuntCompensator sc = adder.add(); readPQ(null, sc.getTerminal(), context.getReader()); return sc; }
Terminal terminal = sh.getTerminal(); if (terminal.isConnected() && Double.isNaN(terminal.getQ())
Terminal t = s.getTerminal(); if (t.getBusView().getBus() != null) { if (!Double.isNaN(t.getQ())) {
convertedTerminal(terminalId(), shunt.getTerminal(), 1, f);
List<String> skipped = new ArrayList<>(); for (ShuntCompensator sc : network.getShuntCompensators()) { Terminal t = sc.getTerminal(); Bus bus = AmplUtil.getBus(t); String busId = null;
entityType = 4; entityNum = mapper.getInt(AmplSubset.SHUNT, attrId.getEquipmentId()); nomV = shunt.getTerminal().getVoltageLevel().getNominalV(); } else { VoltageLevel vl = network.getVoltageLevel(attrId.getEquipmentId());
.setMaximumSectionCount(1) .add(); shunt1.getTerminal() .setQ(25.0); ShuntCompensator shunt2 = vl1.newShuntCompensator() .setMaximumSectionCount(1) .add(); shunt2.getTerminal() .setQ(25.0); LccConverterStation cs1 = vl1.newLccConverterStation() .setMaximumSectionCount(1) .add(); shunt3.getTerminal() .setQ(12.5); ShuntCompensator shunt4 = vl2.newShuntCompensator() .setMaximumSectionCount(1) .add(); shunt4.getTerminal() .setQ(12.5); LccConverterStation cs2 = vl2.newLccConverterStation()
sc.getTerminal().setP(Float.NaN).setQ(Float.NaN);
powerFlows.add(createPowerFlowProperties(cgmes, s.getTerminal()));
.setCurrentSectionCount(1) .add(); shBrussels380.getTerminal().setQ(-59.058144); DanglingLine be3 = vlBrussels380.newDanglingLine() .setId("_78736387-5f60-4832-b3fe-d50daf81b0a6") .setCurrentSectionCount(1) .add(); shBrussels110.getTerminal().setQ(-330.75); Bus busBrussels21 = vlBrussels21.getBusBreakerView().newBus() .setId("_f96d552a-618d-4d0c-a39a-2dea3c411dee")