Skip to content

Commit

Permalink
Merge 0620b55 into a20e5b4
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvlecl committed Nov 2, 2018
2 parents a20e5b4 + 0620b55 commit faa34aa
Show file tree
Hide file tree
Showing 180 changed files with 1,711 additions and 1,696 deletions.
2 changes: 1 addition & 1 deletion EU2Mod_MB/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<artifactId>EU2Mod_MB</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion case-projector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<artifactId>case-projector</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,9 @@ public String getVersion() {
return "1.0.0";
}

@Override
public LoadFlowResult run(LoadFlowParameters parameters) throws Exception {
Boolean wres = runAmplTask(network.getStateManager().getWorkingStateId(), parameters).join();
return new LoadFlowResultImpl(wres, new HashMap<>(), null);
}

@Override
public CompletableFuture<LoadFlowResult> runAsync(String workingStateId, LoadFlowParameters parameters) {
public CompletableFuture<LoadFlowResult> run(String workingStateId, LoadFlowParameters parameters) {
return runAmplTask(workingStateId, parameters)
.thenApply(x -> new LoadFlowResultImpl(x, new HashMap<>(), null));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import com.google.auto.service.AutoService;
import com.powsybl.commons.config.ComponentDefaultConfig;
import com.powsybl.iidm.network.StateManagerConstants;
import com.powsybl.tools.Command;
import com.powsybl.tools.Tool;
import com.powsybl.tools.ToolRunningContext;
import com.powsybl.computation.local.LocalComputationManager;
import com.powsybl.iidm.import_.Importers;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.StateManager;
import com.powsybl.loadflow.LoadFlowFactory;
import com.powsybl.simulation.SimulatorFactory;
import org.apache.commons.cli.CommandLine;
Expand Down Expand Up @@ -88,6 +88,6 @@ public void run(CommandLine line, ToolRunningContext context) throws Exception {
caseProjectorConfig = new CaseProjectorConfig(caseProjectorConfig.getAmplHomeDir(), Paths.get(line.getOptionValue("generators-domains-file")), caseProjectorConfig.isDebug());
}
new CaseProjector(network, LocalComputationManager.getDefault(), loadFlowFactory, simulatorFactory, caseProjectorConfig)
.project(StateManager.INITIAL_STATE_ID).join();
.project(StateManagerConstants.INITIAL_STATE_ID).join();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public List<CommandExecution> before(Path workingDir) throws IOException {
.program(config.getAmplHomeDir().resolve("ampl").toString())
.args("projector.run")
.build();
return Arrays.asList(new CommandExecution(command, 1, 0));
return Collections.singletonList(new CommandExecution(command, 1, 0));
}

@Override
Expand Down Expand Up @@ -128,7 +128,7 @@ protected static CompletableFuture<Boolean> project(ComputationManager computati
LoadFlowParameters loadFlowParameters = LoadFlowParameters.load();
LoadFlowParameters loadFlowParameters2 = LoadFlowParameters.load().setNoGeneratorReactiveLimits(true);

return loadFlow.runAsync(workingStateId, loadFlowParameters)
return loadFlow.run(workingStateId, loadFlowParameters)
.thenComposeAsync(loadFlowResult -> {
LOGGER.debug("Pre-projector load flow metrics: {}", loadFlowResult.getMetrics());
if (!loadFlowResult.isOk()) {
Expand All @@ -140,7 +140,7 @@ protected static CompletableFuture<Boolean> project(ComputationManager computati
if (!Boolean.TRUE.equals(ok)) {
throw new StopException("Projector failed");
}
return loadFlow.runAsync(workingStateId, loadFlowParameters2);
return loadFlow.run(workingStateId, loadFlowParameters2);
}, computationManager.getExecutor())
.thenApplyAsync(loadFlowResult -> {
LOGGER.debug("Post-projector load flow metrics: {}", loadFlowResult.getMetrics());
Expand Down Expand Up @@ -168,17 +168,17 @@ protected static void reintegrateLfState(Network network, String workingStateId,
for (Generator g : network.getGenerators()) {
Terminal t = g.getTerminal();
if (!onlyVoltage) {
if (!Float.isNaN(t.getP())) {
float oldTargetP = g.getTargetP();
float newTargetP = -t.getP();
if (!Double.isNaN(t.getP())) {
double oldTargetP = g.getTargetP();
double newTargetP = -t.getP();
if (oldTargetP != newTargetP) {
g.setTargetP(newTargetP);
LOGGER.debug("LF result reintegration: targetP {} -> {}", oldTargetP, newTargetP);
}
}
if (!Float.isNaN(t.getQ())) {
float oldTargetQ = g.getTargetQ();
float newTargetQ = -t.getQ();
if (!Double.isNaN(t.getQ())) {
double oldTargetQ = g.getTargetQ();
double newTargetQ = -t.getQ();
if (oldTargetQ != newTargetQ) {
g.setTargetQ(newTargetQ);
LOGGER.debug("LF result reintegration: targetQ {} -> {}", oldTargetQ, newTargetQ);
Expand All @@ -187,9 +187,9 @@ protected static void reintegrateLfState(Network network, String workingStateId,
}
Bus b = t.getBusView().getBus();
if (b != null) {
if (!Float.isNaN(b.getV())) {
float oldV = g.getTargetV();
float newV = b.getV();
if (!Double.isNaN(b.getV())) {
double oldV = g.getTargetV();
double newV = b.getV();
if (oldV != newV) {
g.setTargetV(newV);
LOGGER.debug("LF result reintegration: targetV {} -> {}", oldV, newV);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ printf {(s,n) in SHUNTCC}
###########################################################################

printf '#"num" "bus" "v_regul" "targetV(pu)" "Q(MVar)"\n'
> projector_results_svc.txt;
> projector_results_static_var_compensators.txt;
printf {(s,n) in SVCCC}
"%i %i %s %f %f\n",
s,n,
if (s,n) in SVC_V then "true" else "false",
V[n],
if (s,n) in SVC_V then -100*svc_b[s,n]*V[n]^2 # signe '-' car homogene a une consommation de reactif
else if (s,n) in SVC_FIXE then svc_Q0[s,n]
> projector_results_svc.txt;
> projector_results_static_var_compensators.txt;


###########################################################################
Expand All @@ -184,7 +184,7 @@ printf {(s,n) in SVCCC}
###########################################################################

printf '#"num" "bus" "P(MW)" "Q(MVar)"\n'
> projector_results_lcc.txt;
> projector_results_lcc_converter_stations.txt;


###########################################################################
Expand All @@ -194,11 +194,11 @@ printf '#"num" "bus" "P(MW)" "Q(MVar)"\n'
###########################################################################

printf '#"num" "bus" "v_regul" "targetV(pu)" "targetQ(MVar)" "P(MW)" "Q(MVar)"\n'
> projector_results_vsc.txt;
> projector_results_vsc_converter_stations.txt;
printf {(sc,n) in VSCCONV}
"%i %i %s %f %f %f %f\n",
sc,n,vscconv_vregul[sc,n],V[n],vscconv_Q[sc,n],vscconv_P[sc,n],vscconv_Q[sc,n]
> projector_results_vsc.txt;
> projector_results_vsc_converter_stations.txt;


###########################################################################
Expand Down
2 changes: 1 addition & 1 deletion case-repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
8 changes: 7 additions & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<artifactId>distribution</artifactId>
Expand Down Expand Up @@ -174,6 +174,12 @@
<version>${project.version}</version>
</dependency>

<!-- load-flow validation -->
<dependency>
<groupId>com.powsybl</groupId>
<artifactId>powsybl-loadflow-validation</artifactId>
</dependency>

</dependencies>

<build>
Expand Down
7 changes: 2 additions & 5 deletions dymola-integration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<groupId>eu.itesla_project</groupId>
<artifactId>itesla-parent</artifactId>
<version>0.1-SNAPSHOT</version>
<version>0.4.0-SNAPSHOT</version>
</parent>

<artifactId>dymola-integration</artifactId>
Expand Down Expand Up @@ -94,10 +94,7 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<fork>true</fork>
<compilerArgs>
<arg>-XDignore.symbol.file</arg>
</compilerArgs>
<compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit faa34aa

Please sign in to comment.