@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); }
/** * 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); } } } } }
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 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); } } }
bankInAcmc.add(iidm2eurostagId.get(shunt.getId()));
elements.append(StaticData.NEW_LINE); for (ShuntCompensator shunt : Identifiables.sort(_network.getShunts())) { elements.append(shunt.getId() + ";" + shunt.getName()); elements.append(StaticData.NEW_LINE); count++;
public static void fillMapper(StringToIntMapper<AmplSubset> mapper, Network network) { // Voltage levels network.getVoltageLevelStream().forEach(vl -> mapper.newInt(AmplSubset.VOLTAGE_LEVEL, vl.getId())); // Buses getBuses(network).forEach(b -> mapper.newInt(AmplSubset.BUS, b.getId())); // Lines fillLines(mapper, network); // Two windings transformers fillTwoWindingsTransformers(mapper, network); // Three windings transformers fillThreeWindingsTransformers(mapper, network); // Dangling lines fillDanglingLines(mapper, network); // loads network.getLoadStream().forEach(l -> mapper.newInt(AmplSubset.LOAD, l.getId())); // shunts network.getShuntCompensatorStream().forEach(sc -> mapper.newInt(AmplSubset.SHUNT, sc.getId())); // generators network.getGeneratorStream().forEach(g -> mapper.newInt(AmplSubset.GENERATOR, g.getId())); // static var compensators network.getStaticVarCompensatorStream().forEach(svc -> mapper.newInt(AmplSubset.STATIC_VAR_COMPENSATOR, svc.getId())); // HVDC lines network.getHvdcLineStream().forEach(hvdc -> mapper.newInt(AmplSubset.HVDC_LINE, hvdc.getId())); // HvdcConverterStations network.getHvdcConverterStations().forEach(conv -> mapper.newInt(conv.getHvdcType().equals(HvdcType.VSC) ? AmplSubset.VSC_CONVERTER_STATION : AmplSubset.LCC_CONVERTER_STATION, conv.getId())); }
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)); } }
PropertyBag p = new PropertyBag(SV_SHUNTCOMPENSATORSECTIONS_PROPERTIES); p.put("continuousSections", is(s.getCurrentSectionCount())); p.put("ShuntCompensator", s.getId()); shuntCompensatorSections.add(p);