Skip to content

Commit

Permalink
Merge 56731d5 into 47bf1a5
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvlecl committed Nov 2, 2018
2 parents 47bf1a5 + 56731d5 commit 202572d
Show file tree
Hide file tree
Showing 150 changed files with 1,290 additions and 1,262 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.0</version>
<version>0.2.0</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.0</version>
<version>0.2.0</version>
</parent>

<artifactId>case-projector</artifactId>
Expand Down
Original file line number Diff line number Diff line change
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.0</version>
<version>0.2.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
9 changes: 7 additions & 2 deletions 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.0</version>
<version>0.2.0</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 All @@ -198,4 +204,3 @@
</plugins>
</build>
</project>

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.0</version>
<version>0.2.0</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
2 changes: 1 addition & 1 deletion dymola-proxyservice/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ installDir=./installbins
rm -rf $installDir
mkdir -p $installDir/share $installDir/share/java
mvn -f pom.xml org.apache.maven.plugins:maven-dependency-plugin:2.8:copy-dependencies -DoutputDirectory=$installDir/share/java -DexcludeArtifactIds="slf4j-jdk14,slf4j-log4j12"
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -Dartifact=eu.itesla_project:dymola-proxyservice:0.1.0 -DoutputDirectory=$installDir/share/java
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -Dartifact=eu.itesla_project:dymola-proxyservice:0.2.0 -DoutputDirectory=$installDir/share/java

cp src/main/scripts/service.bat $installDir
cp src/main/scripts/logback-cmdline.xml $installDir/share/java
Expand Down
2 changes: 1 addition & 1 deletion dymola-proxyservice/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.0</version>
<version>0.2.0</version>
</parent>

<artifactId>dymola-proxyservice</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion entsoe-case-repository/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.0</version>
<version>0.2.0</version>
</parent>

<artifactId>entsoe-case-repository</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
import com.google.common.collect.Sets;
import com.google.common.jimfs.Configuration;
import com.google.common.jimfs.Jimfs;
import eu.itesla_project.cases.CaseType;
import com.powsybl.commons.datasource.DataSource;
import com.powsybl.entsoe.util.EntsoeGeographicalCode;
import com.powsybl.iidm.import_.Importer;
import com.powsybl.iidm.network.Country;
import com.powsybl.iidm.network.Network;
import com.powsybl.entsoe.util.EntsoeGeographicalCode;
import eu.itesla_project.cases.CaseType;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.junit.After;
Expand All @@ -34,8 +34,9 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;

import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;

/**
*
Expand Down Expand Up @@ -94,6 +95,11 @@ public InputStream newInputStream(String suffix, String ext) throws IOException
public InputStream newInputStream(String fileName) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public Set<String> listNames(String s) throws IOException {
throw new UnsupportedOperationException();
}
}

private static void createFile(Path dir, String fileName) throws IOException {
Expand Down Expand Up @@ -178,13 +184,13 @@ public void testLoad() throws Exception {
// check that, when cim and ucte is forbidden for france, xml is loaded
caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "CIM1");
caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "UCTE");
assertTrue(caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR).equals(Collections.singletonList(xmlNetwork)));
assertEquals(Collections.singletonList(xmlNetwork), caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR));
}

@Test
public void testDataAvailable() throws Exception {
assertTrue(caseRepository.dataAvailable(CaseType.SN, EnumSet.of(Country.FR), Interval.parse("2016-01-01T00:00:00+01:00/2016-01-14T01:00:00+01:00"))
.equals(Sets.newHashSet(DateTime.parse("2016-01-01T00:15:00+01:00"), DateTime.parse("2016-01-01T00:45:00+01:00"))));
assertEquals(Sets.newTreeSet(Arrays.asList(DateTime.parse("2016-01-01T00:15:00+01:00"), DateTime.parse("2016-01-01T00:45:00+01:00"))),
caseRepository.dataAvailable(CaseType.SN, EnumSet.of(Country.FR), Interval.parse("2016-01-01T00:00:00+01:00/2016-01-14T01:00:00+01:00")));
}

@Test
Expand All @@ -193,7 +199,7 @@ public void testLoadXiidm() throws Exception {
// file suffix .xiidm
caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "CIM1");
caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "UCTE");
assertTrue(caseRepository.load(DateTime.parse("2016-02-02T01:15:00+01:00"), CaseType.SN, Country.FR).equals(Collections.singletonList(xmlNetwork)));
assertEquals(Collections.singletonList(xmlNetwork), caseRepository.load(DateTime.parse("2016-02-02T01:15:00+01:00"), CaseType.SN, Country.FR));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Arrays;
import java.util.Collections;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

Expand Down Expand Up @@ -53,10 +54,10 @@ public void testLoad() throws Exception {
moduleConfig.setStringListProperty("forbiddenFormats_FR", Collections.singletonList("CIM1"));
moduleConfig.setStringListProperty("forbiddenFormats_BE", Collections.singletonList("CIM1"));
config = EntsoeCaseRepositoryConfig.load(platformConfig, Arrays.asList("CIM1", "UCTE"));
assertTrue(config.getRootDir().toString().equals("/config"));
assertTrue(config.getForbiddenFormatsByGeographicalCode().size() == 2);
assertTrue(config.getForbiddenFormatsByGeographicalCode().get(EntsoeGeographicalCode.FR).equals(Collections.singleton("CIM1")));
assertTrue(config.getForbiddenFormatsByGeographicalCode().get(EntsoeGeographicalCode.BE).equals(Collections.singleton("CIM1")));
assertEquals("/config", config.getRootDir().toString());
assertEquals(2, config.getForbiddenFormatsByGeographicalCode().size());
assertEquals(Collections.singleton("CIM1"), config.getForbiddenFormatsByGeographicalCode().get(EntsoeGeographicalCode.FR));
assertEquals(Collections.singleton("CIM1"), config.getForbiddenFormatsByGeographicalCode().get(EntsoeGeographicalCode.BE));
assertTrue(config.getForbiddenFormatsByGeographicalCode().get(EntsoeGeographicalCode.D2).isEmpty());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

Expand Down Expand Up @@ -95,6 +97,11 @@ public InputStream newInputStream(String suffix, String ext) throws IOException
public InputStream newInputStream(String fileName) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public Set<String> listNames(String s) throws IOException {
throw new UnsupportedOperationException();
}
}

private static void createFile(Path dir, String fileName) throws IOException {
Expand Down Expand Up @@ -172,13 +179,13 @@ public void testLoad() throws Exception {
assertTrue(caseRepository.load(DateTime.parse("2013-01-13T00:15:00+01:00"), CaseType.SN, Country.BE).isEmpty());

// check that cim network is loaded instead of uct network
assertTrue(caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR).equals(Collections.singletonList(cimNetwork)));
assertEquals(Collections.singletonList(cimNetwork), caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR));

// check that if cim is vorbidden for france, uct is loaded
caseRepository.getConfig().getForbiddenFormatsByGeographicalCode().put(EntsoeGeographicalCode.FR, "CIM1");
assertTrue(caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR).equals(Collections.singletonList(uctNetwork)));
assertEquals(Collections.singletonList(uctNetwork), caseRepository.load(DateTime.parse("2013-01-14T00:15:00+01:00"), CaseType.SN, Country.FR));

assertTrue(caseRepository.load(DateTime.parse("2013-01-15T00:15:00+01:00"), CaseType.SN, Country.DE).size() == 4);
assertEquals(4, caseRepository.load(DateTime.parse("2013-01-15T00:15:00+01:00"), CaseType.SN, Country.DE).size());
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion eurostag-ech-export/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.0</version>
<version>0.2.0</version>
</parent>

<artifactId>eurostag-ech-export</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ public static boolean isInMainCc(Branch branch, boolean noswitch) {
* Multiplying the line's nominalV by 2 corresponds to the fact that iIDM refers to the cable-ground voltage
* while Eurostag regulations to the cable-cable voltage
*/
public static float getHvdcLineDcVoltage(HvdcLine line) {
public static double getHvdcLineDcVoltage(HvdcLine line) {
Objects.requireNonNull(line);
return line.getNominalV() * 2.0f;
return line.getNominalV() * 2.0;
}

public static boolean isPMode(HvdcConverterStation vscConv, HvdcLine hvdcLine) {
Expand Down

0 comments on commit 202572d

Please sign in to comment.