Exemple #1
0
  private boolean runLoadflow(DistNetwork distNet, SimuContext simuCtx) {
    boolean converge = true;
    if (distNet.getLoadScheduleData().getSchedulePoints() == 0) {
      setNameplateAclfNetData(distNet);
      converge = runLoadflow_internal(distNet.getAcscNet(), simuCtx.getLoadflowAlgorithm());

      if (this.xmlCaseData.getAclfAlgorithm().isDisplaySummary()) {
        IOutputTextDialog dialog = UISpringFactory.getOutputTextDialog("Loadflow Analysis Info");
        dialog.display(distNet.getAcscNet());
      }
    } else {
      double loss = 0.0;
      for (int i = 0; i < distNet.getLoadScheduleData().getSchedulePoints(); i++) {
        distNet.setPointAclfNetData(i);
        if (!runLoadflow_internal(distNet.getAcscNet(), simuCtx.getLoadflowAlgorithm()))
          converge = false;

        for (Bus b : distNet.getBusList()) {
          DistBus distBus = (DistBus) b;
          DistBusAdapter aBusApt = (DistBusAdapter) distBus.getAdapter(DistBusAdapter.class);
          aBusApt.setPointVoltage(distBus.getAcscBus().getVoltage(), i);
        }
      }

      distNet.getLoadScheduleData().setTotalLossKwHr(loss);
      if (this.xmlCaseData.getAclfAlgorithm().isDisplaySummary()) {
        IOutputTextDialog dialog =
            UISpringFactory.getOutputTextDialog("Distribution Loadflow Analysis Info");
        dialog.display(distNet);
      }
    }
    return converge;
  }
Exemple #2
0
  private void setNameplateAclfNetData(DistNetwork distNet) {
    AclfNetwork net = distNet.getAclfNet();

    for (Bus b : distNet.getBusList()) {
      DistBus bus = (DistBus) b;
      if (bus.getBusCode() == DistBusCode.GENERATOR) {
        GeneratorAptr.f(bus).setAclfBusData(net.getBaseKva());
      } else if (bus.getBusCode() == DistBusCode.SYN_MOTOR) {
        SynMotorAptr.f(bus).setAclfBusData(net.getBaseKva());
      } else if (bus.getBusCode() == DistBusCode.IND_MOTOR) {
        IndMotorAptr.f(bus).setAclfBusData(net.getBaseKva());
      } else if (bus.getBusCode() == DistBusCode.MIXED_LOAD) {
        MixedLoadAptr.f(bus).setAclfBusData(net.getBaseKva());
      }
    }

    for (Branch br : distNet.getBranchList()) {
      DistBranch branch = (DistBranch) br;
      branch.getAcscBranch().setStatus(branch.isActive());
    }
  }