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); }
protected double computeLosses(HvdcLine hvdcLine, HvdcConverterStation convStation, double activeSetPoint) { double cableLossesEnd = EchUtil.isPMode(convStation, hvdcLine) ? 0.0 : 1.0; double ploss = Math.abs(activeSetPoint * convStation.getLossFactor() / 100.0) + cableLossesEnd * (hvdcLine.getR() - 0.25) * Math.pow(activeSetPoint / hvdcLine.getNominalV(), 2); //Eurostag model requires a fixed resistance of 1 ohm at 640 kV quivalent to 0.25 ohm at 320 kV return ploss; }
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); }
@Override public void visitHvdcConverterStation(HvdcConverterStation<?> converterStation) { terminals.add(converterStation.getTerminal()); } });
if (hvdcStation.getHvdcType().equals(HvdcType.VSC)) { String id = hvdcStation.getId(); Terminal t = hvdcStation.getTerminal(); int busNum = AmplUtil.getBusNum(mapper, t); int conBusNum = AmplUtil.getConnectableBusNum(mapper, t);
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())); }
if (hvdcStation.getHvdcType().equals(HvdcType.LCC)) { Terminal t = hvdcStation.getTerminal(); int busNum = AmplUtil.getBusNum(mapper, t); int conBusNum = AmplUtil.getConnectableBusNum(mapper, t);
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; }
/** * Return true if the given {@link HvdcLine} should be kept in the network, false otherwise */ protected boolean test(HvdcLine hvdcLine) { Objects.requireNonNull(hvdcLine); VoltageLevel vl1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel(); VoltageLevel vl2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel(); return test(vl1) && test(vl2); } }
String id = hvdcLine.getId(); int num = mapper.getInt(AmplSubset.HVDC_LINE, id); HvdcType type = hvdcLine.getConverterStation1().getHvdcType(); AmplSubset subset = type.equals(HvdcType.VSC) ? AmplSubset.VSC_CONVERTER_STATION : AmplSubset.LCC_CONVERTER_STATION; formatter.writeCell(variantIndex) .writeCell(num) .writeCell(type.equals(HvdcType.VSC) ? 1 : 2) .writeCell(mapper.getInt(subset, hvdcLine.getConverterStation1().getId())) .writeCell(mapper.getInt(subset, hvdcLine.getConverterStation2().getId())) .writeCell(hvdcLine.getR()) .writeCell(hvdcLine.getNominalV())
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; }
@Override protected void reduce(HvdcLine hvdcLine) { VoltageLevel vl1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel(); VoltageLevel vl2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel(); if (getPredicate().test(vl1) || getPredicate().test(vl2)) { throw new UnsupportedOperationException("Reduction of HVDC lines is not supported"); } else { hvdcLine.remove(); } observers.forEach(o -> o.hvdcLineRemoved(hvdcLine)); }
double pac = activeSetPoint - Math.abs(activeSetPoint * EchUtil.getPStation(hline).getLossFactor() / 100.0);
private static void checkRemovability(Substation substation, HvdcConverterStation station) { HvdcLine hvdcLine = substation.getNetwork().getHvdcLine(station); if (hvdcLine != null) { Substation s1 = hvdcLine.getConverterStation1().getTerminal().getVoltageLevel().getSubstation(); Substation s2 = hvdcLine.getConverterStation2().getTerminal().getVoltageLevel().getSubstation(); if ((s1 != substation) || (s2 != substation)) { throw createIsolationException(substation); } } }
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; }
@Override public void convert() { Objects.requireNonNull(converterType); double lossFactor = p.asDouble("lossFactor", 0); HvdcConverterStation c = null; if (converterType.equals(HvdcType.VSC)) { boolean xxxvoltageRegulatorOn = p.asBoolean("voltageRegulatorOn", false); c = voltageLevel().newVscConverterStation() .setId(iidmId()) .setName(iidmName()) .setEnsureIdUnicity(false) .setLossFactor((float) lossFactor) .setVoltageRegulatorOn(xxxvoltageRegulatorOn) .add(); } else if (converterType.equals(HvdcType.LCC)) { c = voltageLevel().newLccConverterStation() .setId(iidmId()) .setName(iidmName()) .setEnsureIdUnicity(false) .setBus(terminalConnected() ? busId() : null) .setConnectableBus(busId()) .setLossFactor((float) lossFactor) .setPowerFactor((float) 0.8) .add(); } Objects.requireNonNull(c); context.dc().map(p, c); convertedTerminals(c.getTerminal()); }
@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(); }