Commit 10424bf9 authored by Markus Mirz's avatar Markus Mirz
Browse files

Merge branch 'fix-cigre-examples' into 'master'

Fix cigre examples

See merge request !163
parents 9c783f1d 9e47b40d
...@@ -58,26 +58,31 @@ int main(int argc, char** argv){ ...@@ -58,26 +58,31 @@ int main(int argc, char** argv){
// Find CIM files // Find CIM files
std::list<fs::path> filenames; std::list<fs::path> filenames;
if (argc <= 1) { filenames = DPsim::Utils::findFiles({
filenames = DPsim::Utils::findFiles({ "Rootnet_FULL_NE_06J16h_DI.xml",
"Rootnet_FULL_NE_06J16h_DI.xml", "Rootnet_FULL_NE_06J16h_EQ.xml",
"Rootnet_FULL_NE_06J16h_EQ.xml", "Rootnet_FULL_NE_06J16h_SV.xml",
"Rootnet_FULL_NE_06J16h_SV.xml", "Rootnet_FULL_NE_06J16h_TP.xml"
"Rootnet_FULL_NE_06J16h_TP.xml" }, "Examples/CIM/grid-data/CIGRE_MV/NEPLAN/CIGRE_MV_no_tapchanger_With_LoadFlow_Results", "CIMPATH");
}, "Examples/CIM/grid-data/CIGRE_MV/NEPLAN/CIGRE_MV_no_tapchanger_With_LoadFlow_Results", "CIMPATH");
}
else {
filenames = std::list<fs::path>(argv + 1, argv + argc);
}
String simName = "CIGRE-MV-NoTap-LoadProfiles"; String simName = "CIGRE-MV-NoTap-LoadProfiles";
CPS::Real system_freq = 50; CPS::Real system_freq = 50;
CPS::Real time_begin = 0;
CPS::Real time_step = 1;
CPS::Real time_end = 300;
if (argc > 1) {
CommandLineArgs args(argc, argv);
time_step = args.timeStep;
time_end = args.duration;
}
CIM::Reader reader(simName, Logger::Level::info, Logger::Level::off); CIM::Reader reader(simName, Logger::Level::info, Logger::Level::off);
SystemTopology system = reader.loadCIM(system_freq, filenames, CPS::Domain::SP); SystemTopology system = reader.loadCIM(system_freq, filenames, CPS::Domain::SP);
CSVReader csvreader(simName, loadProfilePath, assignList, Logger::Level::info); CSVReader csvreader(simName, loadProfilePath, assignList, Logger::Level::info);
csvreader.assignLoadProfile(system, 0, 1.5, 15, CSVReader::Mode::MANUAL); csvreader.assignLoadProfile(system, time_begin, time_step, time_end, CSVReader::Mode::MANUAL);
auto logger = DPsim::DataLogger::make(simName); auto logger = DPsim::DataLogger::make(simName);
for (auto node : system.mNodes) for (auto node : system.mNodes)
...@@ -137,7 +142,7 @@ int main(int argc, char** argv){ ...@@ -137,7 +142,7 @@ int main(int argc, char** argv){
} }
} }
Simulation sim(simName, system, 1.5, 15, Domain::SP, Solver::Type::NRP, Logger::Level::info, true); Simulation sim(simName, system, time_step, time_end, Domain::SP, Solver::Type::NRP, Logger::Level::info, true);
sim.addLogger(logger); sim.addLogger(logger);
sim.run(); sim.run();
......
...@@ -66,7 +66,7 @@ int main(int argc, char** argv){ ...@@ -66,7 +66,7 @@ int main(int argc, char** argv){
"Rootnet_FULL_NE_06J16h_EQ.xml", "Rootnet_FULL_NE_06J16h_EQ.xml",
"Rootnet_FULL_NE_06J16h_SV.xml", "Rootnet_FULL_NE_06J16h_SV.xml",
"Rootnet_FULL_NE_06J16h_TP.xml" "Rootnet_FULL_NE_06J16h_TP.xml"
}, "Examples/CIM/CIGRE_MV_NoTap", "CIMPATH"); }, "Examples/CIM/grid-data/CIGRE_MV/NEPLAN/CIGRE_MV_no_tapchanger_With_LoadFlow_Results", "CIMPATH");
String simName = "Shmem_CIGRE-MV-NoTap"; String simName = "Shmem_CIGRE-MV-NoTap";
CPS::Real system_freq = 50; CPS::Real system_freq = 50;
...@@ -75,7 +75,7 @@ int main(int argc, char** argv){ ...@@ -75,7 +75,7 @@ int main(int argc, char** argv){
SystemTopology sys = reader.loadCIM(system_freq, filenames, CPS::Domain::SP); SystemTopology sys = reader.loadCIM(system_freq, filenames, CPS::Domain::SP);
CSVReader csvreader(simName, loadProfilePath, assignList, Logger::Level::info); CSVReader csvreader(simName, loadProfilePath, assignList, Logger::Level::info);
csvreader.assignLoadProfile(sys, 1, 1, args.duration, CSVReader::Mode::MANUAL); csvreader.assignLoadProfile(sys, 0, args.timeStep, args.duration, CSVReader::Mode::MANUAL);
RealTimeSimulation sim(simName, sys, args.timeStep, args.duration, args.solver.domain, args.solver.type, args.logLevel); RealTimeSimulation sim(simName, sys, args.timeStep, args.duration, args.solver.domain, args.solver.type, args.logLevel);
Interface intf("/dpsim1-villas", "/villas-dpsim1"); Interface intf("/dpsim1-villas", "/villas-dpsim1");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment