Commit f34cc4aa authored by Jan Dinkelbach's avatar Jan Dinkelbach
Browse files

move scenarios header

parent da654450
#include "cps/CIM/Reader.h"
#include <DPsim.h>
#include <cps/CSVReader.h>
#include "../Examples.h"
using namespace std;
using namespace DPsim;
......@@ -11,7 +12,7 @@ int main(int argc, char** argv){
// Simulation parameters
String simName = "DP_CIGRE_MV_withDG";
Scenarios::CIGREMV::ScenarioConfig scenario;
Examples::CIGREMV::ScenarioConfig scenario;
std::list<fs::path> filenames;
Real timeStep;
Real finalTime;
......@@ -44,7 +45,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simNamePF);
CIM::Reader reader(simNamePF, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemPF = reader.loadCIM(scenario.systemFrequency, filenames, Domain::SP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
Examples::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
// define logging
auto loggerPF = DPsim::DataLogger::make(simNamePF);
......@@ -63,7 +64,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simName);
CIM::Reader reader2(simName, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemDP = reader2.loadCIM(scenario.systemFrequency, filenames, CPS::Domain::DP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemDP, scenario, Domain::DP);
Examples::CIGREMV::addInvertersToCIGREMV(systemDP, scenario, Domain::DP);
reader2.initDynamicSystemTopologyWithPowerflow(systemPF, systemDP);
auto logger = DPsim::DataLogger::make(simName);
......@@ -89,7 +90,7 @@ int main(int argc, char** argv){
// log output of PV connected at N11
String pv_name = "pv_N11";
auto pv = systemDP.component<CPS::SimPowerComp<Complex>>(pv_name);
Scenarios::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVAttributes(logger, pv);
Simulation sim(simName, systemDP, timeStep, finalTime, Domain::DP, Solver::Type::MNA, Logger::Level::debug, true);
......
#include <DPsim.h>
#include <cps/CSVReader.h>
#include "../Examples.h"
using namespace std;
using namespace DPsim;
......@@ -9,7 +10,7 @@ using namespace CPS::CIM;
int main(int argc, char** argv){
// Simulation parameters
Scenarios::CIGREMV::ScenarioConfig scenario;
Examples::CIGREMV::ScenarioConfig scenario;
std::list<fs::path> filenames;
Real timeStep;
Real finalTime;
......@@ -41,7 +42,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simNamePF);
CIM::Reader reader(simNamePF, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemPF = reader.loadCIM(scenario.systemFrequency, filenames, Domain::SP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
Examples::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
// define logging
auto loggerPF = DPsim::DataLogger::make(simNamePF);
......@@ -60,7 +61,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simName);
CIM::Reader reader2(simName, Logger::Level::info, Logger::Level::debug);
SystemTopology systemDP = reader2.loadCIM(scenario.systemFrequency, filenames, CPS::Domain::DP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemDP, scenario, Domain::DP);
Examples::CIGREMV::addInvertersToCIGREMV(systemDP, scenario, Domain::DP);
reader.initDynamicSystemTopologyWithPowerflow(systemPF, systemDP);
auto logger = DPsim::DataLogger::make(simName);
......@@ -86,13 +87,13 @@ int main(int argc, char** argv){
// log output of PV connected at N11
String pv_name = "pv_N11";
auto pv = systemDP.component<CPS::SimPowerComp<Complex>>(pv_name);
Scenarios::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVAttributes(logger, pv);
// // load step sized relative to nominal load at N11
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("N11", 2-timeStep, 5*systemPF.component<CPS::SP::Ph1::Load>("LOAD-H-11")->attribute<CPS::Real>("P")->get(), systemDP, Domain::DP);
// std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("N11", 2-timeStep, 5*systemPF.component<CPS::SP::Ph1::Load>("LOAD-H-11")->attribute<CPS::Real>("P")->get(), systemDP, Domain::DP);
// load step sized in absolute terms
std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("N11", 2-timeStep, 1500.0e3, systemDP, Domain::DP);
std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("N11", 2-timeStep, 1500.0e3, systemDP, Domain::DP);
Simulation sim(simName, systemDP, timeStep, finalTime, Domain::DP, Solver::Type::MNA, Logger::Level::debug, true);
......
#include "cps/CIM/Reader.h"
#include <DPsim.h>
#include <cps/CSVReader.h>
#include "../Examples.h"
using namespace std;
using namespace DPsim;
......@@ -11,7 +12,7 @@ int main(int argc, char** argv){
// Simulation parameters
String simName = "EMT_CIGRE_MV_withDG";
Scenarios::CIGREMV::ScenarioConfig scenario;
Examples::CIGREMV::ScenarioConfig scenario;
std::list<fs::path> filenames;
Real timeStep;
Real finalTime;
......@@ -41,7 +42,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simNamePF);
CIM::Reader reader(simNamePF, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemPF = reader.loadCIM(scenario.systemFrequency, filenames, Domain::SP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
Examples::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
// define logging
auto loggerPF = DPsim::DataLogger::make(simNamePF);
......@@ -60,7 +61,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simName);
CIM::Reader reader2(simName, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemEMT = reader2.loadCIM(scenario.systemFrequency, filenames, CPS::Domain::EMT, PhaseType::ABC);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemEMT, scenario, Domain::EMT);
Examples::CIGREMV::addInvertersToCIGREMV(systemEMT, scenario, Domain::EMT);
reader2.initDynamicSystemTopologyWithPowerflow(systemPF, systemEMT);
auto logger = DPsim::DataLogger::make(simName);
......@@ -83,7 +84,7 @@ int main(int argc, char** argv){
// log output of PV connected at N11
auto pv = systemEMT.component<CPS::SimPowerComp<Real>>("pv_N11");
Scenarios::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVAttributes(logger, pv);
Simulation sim(simName, systemEMT, timeStep, finalTime, Domain::EMT, Solver::Type::MNA, Logger::Level::debug, true);
......
#include "cps/CIM/Reader.h"
#include <DPsim.h>
#include <cps/CSVReader.h>
#include "../Examples.h"
using namespace std;
using namespace DPsim;
......@@ -10,7 +11,7 @@ using namespace CPS::CIM;
int main(int argc, char** argv){
// Simulation parameters
Scenarios::CIGREMV::ScenarioConfig scenario;
Examples::CIGREMV::ScenarioConfig scenario;
std::list<fs::path> filenames;
Real timeStep;
Real finalTime;
......@@ -41,7 +42,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simNamePF);
CIM::Reader reader(simNamePF, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemPF = reader.loadCIM(scenario.systemFrequency, filenames, Domain::SP);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
Examples::CIGREMV::addInvertersToCIGREMV(systemPF, scenario, Domain::SP);
// define logging
auto loggerPF = DPsim::DataLogger::make(simNamePF);
......@@ -60,7 +61,7 @@ int main(int argc, char** argv){
Logger::setLogDir("logs/" + simName);
CIM::Reader reader2(simName, Logger::Level::debug, Logger::Level::debug);
SystemTopology systemEMT = reader2.loadCIM(scenario.systemFrequency, filenames, CPS::Domain::EMT, PhaseType::ABC);
Scenarios::CIGREMV::addInvertersToCIGREMV(systemEMT, scenario, Domain::EMT);
Examples::CIGREMV::addInvertersToCIGREMV(systemEMT, scenario, Domain::EMT);
reader2.initDynamicSystemTopologyWithPowerflow(systemPF, systemEMT);
auto logger = DPsim::DataLogger::make(simName);
......@@ -83,9 +84,9 @@ int main(int argc, char** argv){
// log output of PV connected at N11
auto pv = systemEMT.component<CPS::SimPowerComp<Real>>("pv_N11");
Scenarios::CIGREMV::logPVAttributes(logger, pv);
Examples::CIGREMV::logPVAttributes(logger, pv);
std::shared_ptr<SwitchEvent3Ph> loadStepEvent = Scenarios::createEventAddPowerConsumption3Ph("N11", 2-timeStep, 1500.0e3, systemEMT, Domain::EMT);
std::shared_ptr<SwitchEvent3Ph> loadStepEvent = Examples::createEventAddPowerConsumption3Ph("N11", 2-timeStep, 1500.0e3, systemEMT, Domain::EMT);
Simulation sim(simName, systemEMT, timeStep, finalTime, Domain::EMT, Solver::Type::MNA, Logger::Level::debug, true);
sim.addEvent(loadStepEvent);
......
#include "cps/CIM/Reader.h"
#include <DPsim.h>
#include <cps/CSVReader.h>
#include "../Examples.h"
using namespace std;
using namespace DPsim;
......@@ -28,13 +29,13 @@ int main(int argc, char** argv){
Real timeStep = 1;
Real finalTime = 2;
String simName = "PF_CIGRE_MV_withDG";
Scenarios::CIGREMV::ScenarioConfig scenario;
Examples::CIGREMV::ScenarioConfig scenario;
Logger::setLogDir("logs/" + simName);
// read original network topology
CIM::Reader reader(simName, Logger::Level::debug, Logger::Level::debug);
SystemTopology system = reader.loadCIM(scenario.systemFrequency, filenames, Domain::SP);
Scenarios::CIGREMV::addInvertersToCIGREMV(system, scenario, Domain::SP);
Examples::CIGREMV::addInvertersToCIGREMV(system, scenario, Domain::SP);
auto loggerPF = DPsim::DataLogger::make(simName);
for (auto node : system.mNodes)
......
......@@ -15,6 +15,7 @@
*********************************************************************************/
#include <DPsim.h>
#include "../Examples.h"
using namespace DPsim;
using namespace CPS;
......@@ -116,7 +117,7 @@ int main(int argc, char* argv[]) {
loggerDP->addAttribute("v2", n2DP->attribute("v"));
// load step sized in absolute terms
std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("n2", 1-timeStepDP, 100e3, systemDP, Domain::DP);
std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("n2", 1-timeStepDP, 100e3, systemDP, Domain::DP);
// Simulation
Simulation sim(simNameDP, Logger::Level::debug);
......
......@@ -15,6 +15,7 @@
*********************************************************************************/
#include <DPsim.h>
#include "../Examples.h"
using namespace DPsim;
using namespace CPS;
......@@ -22,7 +23,7 @@ using namespace CPS::CIM;
int main(int argc, char* argv[]) {
Scenarios::SGIB::ScenarioConfig scenario;
Examples::SGIB::ScenarioConfig scenario;
Real finalTime = 2.0;
// ----- POWERFLOW FOR INITIALIZATION -----
......@@ -113,10 +114,10 @@ int main(int argc, char* argv[]) {
loggerDP->addAttribute("v1", n1DP->attribute("v"));
loggerDP->addAttribute("v2", n2DP->attribute("v"));
Scenarios::CIGREMV::logPVAttributes(loggerDP, pv);
Examples::CIGREMV::logPVAttributes(loggerDP, pv);
// load step sized in absolute terms
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// std::shared_ptr<SwitchEvent> loadStepEvent = Examples::createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// Simulation
Simulation sim(simNameDP, Logger::Level::debug);
......
......@@ -14,7 +14,7 @@
namespace CPS {
namespace CIM {
namespace Scenarios {
namespace Examples {
namespace SGIB {
......
......@@ -31,7 +31,6 @@
#ifdef WITH_CIM
#include <cps/CIM/Reader.h>
#include <cps/CIM/Scenarios.h>
#endif
#ifdef WITH_OPENMP
......
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