@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()); }
/** * 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; } }
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; double b = stepSize * shunt.getCurrentSectionCount();
@Override public void visitShuntCompensator(ShuntCompensator sc) { terminals.add(sc.getTerminal()); }
List<String> skipped = new ArrayList<>(); for (ShuntCompensator sc : network.getShuntCompensators()) { Terminal t = sc.getTerminal(); Bus bus = AmplUtil.getBus(t); String busId = null; skipped.add(sc.getId()); continue; String id = sc.getId(); int num = mapper.getInt(AmplSubset.SHUNT, id); int vlNum = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, t.getVoltageLevel().getId()); double zb = vb * vb / AmplConstants.SB; double b1 = 0; double b2 = sc.getMaximumB() * zb; double minB = Math.min(b1, b2); double maxB = Math.max(b1, b2); double b = sc.getCurrentB() * zb; int points = sc.getMaximumSectionCount() < 1 ? 0 : sc.getMaximumSectionCount() - 1; formatter.writeCell(variantIndex) .writeCell(num) .writeCell(actionNum) .writeCell(id) .writeCell(sc.getName()) .writeCell(t.getP()) .writeCell(t.getQ()) .writeCell(sc.getCurrentSectionCount());
powerFlows.add(createPowerFlowProperties(cgmes, s.getTerminal())); for (ShuntCompensator s : n.getShuntCompensators()) { PropertyBag p = new PropertyBag(SV_SHUNTCOMPENSATORSECTIONS_PROPERTIES); p.put("continuousSections", is(s.getCurrentSectionCount())); p.put("ShuntCompensator", s.getId()); shuntCompensatorSections.add(p);
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; }
Terminal terminal = sh.getTerminal(); if (terminal.isConnected() && Double.isNaN(terminal.getQ()) && terminal.getBusView().getBus().isInMainConnectedComponent()) { double v = terminal.getBusView().getBus().getV(); double q = -sh.getCurrentB() * v * v; LOGGER.debug("Shunt {}, setting q = {}", sh, q); terminal.setQ(q);
@Override public void createModelicaName(ModExportContext modContext, DDBManager ddbManager, SimulatorInst modelicaSim) { String modelicaName = DEFAULT_CAPACITOR_PREFIX + "_" + parseName(this.capacitor.getId()); modelicaName = WordUtils.uncapitalize(modelicaName.substring(0, 1)) + modelicaName.substring(1); modelicaName = StaticData.PREF_CAP + modelicaName; modContext.dictionary.add(capacitor, modelicaName); super.setModelicaName(modelicaName); }
while (itrS.hasNext()) { ShuntCompensator shunt = itrS.next(); shuntSusceptanceB += shunt.getCurrentB() * zBase;
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()); } }
public ConnectCapacitorRecord(ConnectBusInfo busInfo, ShuntCompensator shunt) { super(busInfo.getBus().getId(), shunt.getId()); this.isConnected = busInfo.isConnected(); // this.busInfo = busInfo; this.node1 = busInfo.getBus(); this.node2 = shunt; }
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; }
/** * 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); } } } } }
bankInAcmc.add(iidm2eurostagId.get(shunt.getId()));
Terminal t = s.getTerminal(); if (t.getBusView().getBus() != null) { if (!Double.isNaN(t.getQ())) {
if (equipIds != null && !equipIds.contains(sc.getId())) { continue; sc.getTerminal().getVoltageLevel().getSubstation().getGeographicalTags())) { continue; .contains(sc.getTerminal().getVoltageLevel().getSubstation().getCountry().toString())) { continue; attributes.add(new Attribute(sc.getId() + "_Q")); attributes.add(new Attribute(sc.getId() + "_V")); attributes.add(new Attribute(sc.getId() + "_STATUS"));