Commit ebeedc02 authored by Markus Mirz's avatar Markus Mirz
Browse files

Merge branch 'powerflow-mmi' into 'master'

add powerflow cim example

See merge request acs/public/simulation/dpsim!147
parents f93d6a62 1ed5bb31
/**
* @author Jan Dinkelbach <jdinkelbach@eonerc.rwth-aachen.de>
* @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
*
* DPsim
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include "cps/CIM/Reader.h"
#include <DPsim.h>
using namespace std;
using namespace DPsim;
using namespace CPS;
using namespace CPS::CIM;
/*
* This example runs the powerflow for the CIGRE MV benchmark system (neglecting the tap changers of the transformers)
*/
int main(int argc, char** argv){
// Find CIM files
std::list<fs::path> filenames;
filenames = std::list<fs::path>(argv + 2, argv + argc);
String simName = argv[1];
CPS::Real system_freq = 50;
CIM::Reader reader(simName, Logger::Level::info, Logger::Level::off);
SystemTopology system = reader.loadCIM(system_freq, filenames, CPS::Domain::SP);
auto logger = DPsim::DataLogger::make(simName);
for (auto node : system.mNodes)
{
logger->addAttribute(node->name() + ".V", node->attribute("v"));
}
Simulation sim(simName, system, 1, 1, Domain::SP, Solver::Type::NRP, Logger::Level::debug, true);
sim.addLogger(logger);
sim.run();
return 0;
}
......@@ -105,7 +105,8 @@ if(WITH_CIM)
CIM/case145.cpp
CIM/case300.cpp
CIM/case9.cpp
CIM/case14.cpp
CIM/case14.cpp
CIM/powerflow-cim.cpp
CIM/WSCC_9bus_mult_decoupled.cpp
CIM/WSCC_9bus_mult_coupled.cpp
......
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