public void addConverterAt( String dcTopologicalNode, HvdcConverterStation c, PropertyBag cc) { // Check there are only one converter at that node if (converters.containsKey(dcTopologicalNode)) { String reason = String.format( "Unsupported modeling. More than one Converter at DCTopologicalNode %s: %s, %s", dcTopologicalNode, c.getId(), converters.get(dcTopologicalNode).getId()); context.invalid("HvdcConverterStation", reason); // TODO what to do? overwrite, preserve first, throw an exception ? } converters.put(dcTopologicalNode, c); // We also need to take note of some parameters of the converter // for building the HvdcLine (operatingMode, ratedUdc. ...). // We keep a reference to the original property bag for the CGMES converter. cgmesConverters.put(c, cc); }
protected boolean isPMode(HvdcConverterStation vscConv, HvdcLine hvdcLine) { Objects.requireNonNull(vscConv); Objects.requireNonNull(hvdcLine); HvdcConverterStation side1Conv = hvdcLine.getConverterStation1(); HvdcConverterStation side2Conv = hvdcLine.getConverterStation2(); if ((hvdcLine.getConvertersMode().equals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER)) && (vscConv.getId().equals(side1Conv.getId()))) { return true; } if ((hvdcLine.getConvertersMode().equals(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER)) && (vscConv.getId().equals(side2Conv.getId()))) { return true; } return false; }
public static boolean isPMode(HvdcConverterStation vscConv, HvdcLine hvdcLine) { Objects.requireNonNull(vscConv); Objects.requireNonNull(hvdcLine); HvdcConverterStation side1Conv = hvdcLine.getConverterStation1(); HvdcConverterStation side2Conv = hvdcLine.getConverterStation2(); if ((hvdcLine.getConvertersMode().equals(HvdcLine.ConvertersMode.SIDE_1_RECTIFIER_SIDE_2_INVERTER)) && (vscConv.getId().equals(side1Conv.getId()))) { return true; } if ((hvdcLine.getConvertersMode().equals(HvdcLine.ConvertersMode.SIDE_1_INVERTER_SIDE_2_RECTIFIER)) && (vscConv.getId().equals(side2Conv.getId()))) { return true; } return false; }
private HashMap<String, HvdcLine> getHvdcLinesMap() { HashMap<String, HvdcLine> lineMap = new HashMap<>(); network.getHvdcLines().forEach(line -> { if (line.getConverterStation1() != null) { lineMap.put(line.getConverterStation1().getId(), line); } if (line.getConverterStation2() != null) { lineMap.put(line.getConverterStation2().getId(), line); } }); return lineMap; }
private EsgLoad createConverterStationAdditionalLoad(HvdcLine hvdcLine, HvdcConverterStation convStation) { double ploss = computeLosses(hvdcLine, convStation); ConnectionBus rectConvBus = ConnectionBus.fromTerminal(convStation.getTerminal(), config, fakeNodes); String fictionalLoadId = "fict_" + convStation.getId(); addToDictionary(fictionalLoadId, dictionary, EurostagNamingStrategy.NameType.LOAD); return createLoad(rectConvBus, fictionalLoadId, ploss, 0); }
@Override protected void writeRootElementAttributes(HvdcLine l, Network parent, NetworkXmlWriterContext context) throws XMLStreamException { XmlUtil.writeDouble("r", l.getR(), context.getWriter()); XmlUtil.writeDouble("nominalV", l.getNominalV(), context.getWriter()); context.getWriter().writeAttribute("convertersMode", l.getConvertersMode().name()); XmlUtil.writeDouble("activePowerSetpoint", l.getActivePowerSetpoint(), context.getWriter()); XmlUtil.writeDouble("maxP", l.getMaxP(), context.getWriter()); context.getWriter().writeAttribute("converterStation1", l.getConverterStation1().getId()); context.getWriter().writeAttribute("converterStation2", l.getConverterStation2().getId()); }
@Override public void convert() { Objects.requireNonNull(iconverter1); Objects.requireNonNull(iconverter2); double p = activePowerSetpoint(); double maxP = p * 1.2; missing("maxP", maxP); context.network().newHvdcLine() .setId(iidmId()) .setName(iidmName()) .setEnsureIdUnicity(false) .setR(r()) .setNominalV(ratedUdc()) .setActivePowerSetpoint(p) .setMaxP(maxP) .setConvertersMode(decodeMode()) .setConverterStationId1(iconverter1.getId()) .setConverterStationId2(iconverter2.getId()) .add(); }
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 createACDCVscConverters(EsgNetwork esgNetwork) { //creates 2 DC nodes, for each hvdc line (one node per converter station) for (HvdcLine hvdcLine : Identifiables.sort(network.getHvdcLines())) { // skip lines with converter stations not in the main connected component if (config.isExportMainCCOnly() && (!EchUtil.isInMainCc(hvdcLine.getConverterStation1(), config.isNoSwitch()) || !EchUtil.isInMainCc(hvdcLine.getConverterStation2(), config.isNoSwitch()))) { LOGGER.warn("skipped HVDC line {}: at least one converter station is not in main component", hvdcLine.getId()); continue; } HvdcConverterStation convStation1 = hvdcLine.getConverterStation1(); HvdcConverterStation convStation2 = hvdcLine.getConverterStation2(); //create two dc nodes, one for each conv. station Esg8charName hvdcNodeName1 = new Esg8charName(addToDictionary("DC_" + convStation1.getId(), dictionary, EurostagNamingStrategy.NameType.NODE)); Esg8charName hvdcNodeName2 = new Esg8charName(addToDictionary("DC_" + convStation2.getId(), dictionary, EurostagNamingStrategy.NameType.NODE)); double dcVoltage = EchUtil.getHvdcLineDcVoltage(hvdcLine); esgNetwork.addDCNode(new EsgDCNode(new Esg2charName("DC"), hvdcNodeName1, dcVoltage, 1)); esgNetwork.addDCNode(new EsgDCNode(new Esg2charName("DC"), hvdcNodeName2, dcVoltage, 1)); //create a dc link, representing the hvdc line //Eurostag model requires a resistance of 1 ohm (not hvdcLine.getR()) float r = 1.0f; esgNetwork.addDCLink(new EsgDCLink(hvdcNodeName1, hvdcNodeName2, '1', r, EsgDCLink.LinkStatus.ON)); //create the two converter stations EsgACDCVscConverter esgConv1 = createACDCVscConverter(network.getVscConverterStation(convStation1.getId()), hvdcLine, hvdcNodeName1); EsgACDCVscConverter esgConv2 = createACDCVscConverter(network.getVscConverterStation(convStation2.getId()), hvdcLine, hvdcNodeName2); esgNetwork.addACDCVscConverter(esgConv1); esgNetwork.addACDCVscConverter(esgConv2); //Create one load on the node to which converters stations are connected esgNetwork.addLoad(createConverterStationAdditionalLoad(hvdcLine, convStation1)); esgNetwork.addLoad(createConverterStationAdditionalLoad(hvdcLine, convStation2)); } }
String id = hvdcStation.getId(); Terminal t = hvdcStation.getTerminal(); int busNum = AmplUtil.getBusNum(mapper, t);