Example #1
0
  public DynamicEvent addBusFaultEvent(
      String faultBusId,
      SimpleFaultCode code,
      double startTime,
      double durationTime,
      Complex Zlg,
      Complex Zll) {
    // define an event, set the event id and event type.
    DynamicEvent event1 =
        DStabObjectFactory.createDEvent(
            "BusFault_" + code + "@" + faultBusId,
            "Bus Fault @" + faultBusId,
            DynamicEventType.BUS_FAULT,
            dstabNet);
    event1.setStartTimeSec(startTime);
    event1.setDurationSec(durationTime);

    // define a bus fault
    DStabBus faultBus = dstabNet.getDStabBus(faultBusId);
    AcscBusFault fault =
        CoreObjectFactory.createAcscBusFault("Bus Fault 3P@" + faultBusId, dstabNet);
    fault.setBus(faultBus);
    fault.setFaultCode(code);
    fault.setZLGFault(Zlg);
    fault.setZLLFault(Zll);

    // add this fault to the event, must be consist with event type definition before.
    event1.setBusFault(fault);
    return event1;
  }
Example #2
0
  @Test
  public void sampleTest() {
    AcscNetwork faultNet = CoreObjectFactory.createAcscNetwork();
    SampleCases.load_SC_5BusSystem(faultNet);
    // System.out.println(faultNet.net2String());

    assertTrue((faultNet.getBusList().size() == 5 && faultNet.getBranchList().size() == 5));

    SimpleFaultAlgorithm algo = CoreObjectFactory.createSimpleFaultAlgorithm(faultNet);
    AcscBusFault fault = CoreObjectFactory.createAcscBusFault("2", algo);
    fault.setFaultCode(SimpleFaultCode.GROUND_3P);
    fault.setZLGFault(new Complex(0.0, 0.0));
    fault.setZLLFault(new Complex(0.0, 0.0));

    algo.calculateBusFault(fault);
    // System.out.println(fault.toString(faultBus.getBaseVoltage(), faultNet.getBaseKva()));
    /*
    fault amps(1): (  0.0000 + j 32.57143) pu
    fault amps(2): (  0.0000 + j  0.0000) pu
    fault amps(0): (  0.0000 + j  0.0000) pu
    */
    assertTrue(
        TestUtilFunc.compare(
            fault.getFaultResult().getSCCurrent_012(), 0.0, 0.0, 0.0, 32.57142857157701, 0.0, 0.0));

    // System.out.println(AcscOut.faultResult2String(faultNet));
  }
 private static void setFaultInfo(
     AcscBaseFaultXmlType scFaultXml, AcscBusFault acscBusFault, double baseV, double baseKVA) {
   // set fault type
   AcscFaultCategoryEnumType faultCate = scFaultXml.getFaultCategory();
   if (faultCate == AcscFaultCategoryEnumType.FAULT_3_PHASE) {
     acscBusFault.setFaultCode(SimpleFaultCode.GROUND_3P);
   } else if (faultCate == AcscFaultCategoryEnumType.LINE_TO_GROUND) {
     acscBusFault.setFaultCode(SimpleFaultCode.GROUND_LG);
   } else if (faultCate == AcscFaultCategoryEnumType.LINE_TO_LINE) {
     acscBusFault.setFaultCode(SimpleFaultCode.GROUND_LL);
   } else if (faultCate == AcscFaultCategoryEnumType.LINE_LINE_TO_GROUND) {
     acscBusFault.setFaultCode(SimpleFaultCode.GROUND_LLG);
   }
   // set zLG and zLL
   ZXmlType zLG = scFaultXml.getZLG();
   ZXmlType zLL = scFaultXml.getZLL();
   if (zLG != null) {
     acscBusFault.setZLGFault(
         new Complex(zLG.getRe(), zLG.getIm()), toZUnit.apply(zLG.getUnit()), baseV, baseKVA);
   }
   if (zLL != null) {
     acscBusFault.setZLLFault(
         new Complex(zLL.getRe(), zLL.getIm()), toZUnit.apply(zLL.getUnit()), baseV, baseKVA);
   }
 }