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

add small capacitance and load step to DP_Slack_PiLine_PQLoad

parent e24e25bd
......@@ -89,10 +89,10 @@ int main(int argc, char** argv){
Scenarios::CIGREMV::logPVAttributes(logger, pv);
// // load step sized relative to nominal load at N11
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::CIGREMV::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 = Scenarios::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::CIGREMV::createEventAddPowerConsumption("N11", 2-timeStep, 1500.0e3, systemDP, Domain::DP);
std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("N11", 2-timeStep, 1500.0e3, systemDP, Domain::DP);
Simulation sim(simName, systemDP, timeStep, finalTime, Domain::DP, Solver::Type::MNA, Logger::Level::debug, true);
......
......@@ -85,7 +85,7 @@ int main(int argc, char** argv){
auto pv = systemEMT.component<CPS::SimPowerComp<Real>>("pv_N11");
Scenarios::CIGREMV::logPVAttributes(logger, pv);
std::shared_ptr<SwitchEvent3Ph> loadStepEvent = Scenarios::CIGREMV::createEventAddPowerConsumption3Ph("N11", 2-timeStep, 1500.0e3, systemEMT, Domain::EMT);
std::shared_ptr<SwitchEvent3Ph> loadStepEvent = Scenarios::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);
......
......@@ -18,6 +18,7 @@
using namespace DPsim;
using namespace CPS;
using namespace CPS::CIM;
int main(int argc, char* argv[]) {
......@@ -27,6 +28,7 @@ int main(int argc, char* argv[]) {
Real qLoadNom = 50e3;
Real lineResistance = 0.05;
Real lineInductance = 0.1;
Real lineCapacitance = 0.1e-6;
Real finalTime = 2.0;
// ----- POWERFLOW FOR INITIALIZATION -----
......@@ -45,7 +47,7 @@ int main(int argc, char* argv[]) {
extnetPF->modifyPowerFlowBusType(PowerflowBusType::VD);
auto linePF = SP::Ph1::PiLine::make("PiLine", Logger::Level::debug);
linePF->setParameters(lineResistance, lineInductance, 0);
linePF->setParameters(lineResistance, lineInductance, lineCapacitance);
linePF->setBaseVoltage(Vnom);
auto loadPF = SP::Ph1::Shunt::make("Load", Logger::Level::debug);
......@@ -90,7 +92,7 @@ int main(int argc, char* argv[]) {
extnetDP->setParameters(Complex(Vnom,0));
auto lineDP = DP::Ph1::PiLine::make("PiLine", Logger::Level::debug);
lineDP->setParameters(lineResistance, lineInductance);
lineDP->setParameters(lineResistance, lineInductance, lineCapacitance);
auto loadDP = DP::Ph1::RXLoad::make("Load", Logger::Level::debug);
loadDP->setParameters(pLoadNom, qLoadNom, Vnom);
......@@ -113,6 +115,9 @@ int main(int argc, char* argv[]) {
loggerDP->addAttribute("v1", n1DP->attribute("v"));
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);
// Simulation
Simulation sim(simNameDP, Logger::Level::debug);
sim.setSystem(systemDP);
......@@ -121,6 +126,7 @@ int main(int argc, char* argv[]) {
sim.setDomain(Domain::DP);
sim.doPowerFlowInit(false);
sim.addLogger(loggerDP);
sim.addEvent(loadStepEvent);
sim.run();
}
......@@ -116,7 +116,7 @@ int main(int argc, char* argv[]) {
Scenarios::CIGREMV::logPVAttributes(loggerDP, pv);
// load step sized in absolute terms
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::CIGREMV::createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// std::shared_ptr<SwitchEvent> loadStepEvent = Scenarios::createEventAddPowerConsumption("n2", 1-timeStepDP, 1000.0e3, systemDP, Domain::DP);
// Simulation
Simulation sim(simNameDP, Logger::Level::debug);
......
......@@ -147,7 +147,31 @@ namespace CIGREMV {
}
}
std::shared_ptr<DPsim::SwitchEvent> createEventAddPowerConsumption(String nodeName, Real eventTime, Real additionalActivePower, SystemTopology& system, Domain domain) {
void logPVAttributes(DPsim::DataLogger::Ptr logger, CPS::TopologicalPowerComp::Ptr pv) {
// state variables
logger->addAttribute(pv->name() + "_state_" + "theta", pv->attribute("theta"));
logger->addAttribute(pv->name() + "_state_" + "phipll", pv->attribute("phipll"));
logger->addAttribute(pv->name() + "_state_" + "p", pv->attribute("p"));
logger->addAttribute(pv->name() + "_state_" + "q", pv->attribute("q"));
logger->addAttribute(pv->name() + "_state_" + "phid", pv->attribute("phid"));
logger->addAttribute(pv->name() + "_state_" + "phiq", pv->attribute("phiq"));
logger->addAttribute(pv->name() + "_state_" + "gammad", pv->attribute("gammad"));
logger->addAttribute(pv->name() + "_state_" + "gammaq", pv->attribute("gammaq"));
// input variables
logger->addAttribute(pv->name() + "_input_" + "Vcdq", pv->attribute("Vcdq"));
logger->addAttribute(pv->name() + "_input_" + "Ircdq", pv->attribute("Ircdq"));
// output variables
logger->addAttribute(pv->name() + "_output_" + "Vsdq", pv->attribute("Vsdq"));
// interface variables
logger->addAttribute(pv->name() + "_v_intf", pv->attribute("v_intf"));
logger->addAttribute(pv->name() + "_i_intf", pv->attribute("i_intf"));
}
}
std::shared_ptr<DPsim::SwitchEvent> createEventAddPowerConsumption(String nodeName, Real eventTime, Real additionalActivePower, SystemTopology& system, Domain domain) {
// TODO: use base classes ph1
if (domain == CPS::Domain::DP) {
......@@ -180,32 +204,7 @@ namespace CIGREMV {
return nullptr;
}
}
void logPVAttributes(DPsim::DataLogger::Ptr logger, CPS::TopologicalPowerComp::Ptr pv) {
// state variables
logger->addAttribute(pv->name() + "_state_" + "theta", pv->attribute("theta"));
logger->addAttribute(pv->name() + "_state_" + "phipll", pv->attribute("phipll"));
logger->addAttribute(pv->name() + "_state_" + "p", pv->attribute("p"));
logger->addAttribute(pv->name() + "_state_" + "q", pv->attribute("q"));
logger->addAttribute(pv->name() + "_state_" + "phid", pv->attribute("phid"));
logger->addAttribute(pv->name() + "_state_" + "phiq", pv->attribute("phiq"));
logger->addAttribute(pv->name() + "_state_" + "gammad", pv->attribute("gammad"));
logger->addAttribute(pv->name() + "_state_" + "gammaq", pv->attribute("gammaq"));
// input variables
logger->addAttribute(pv->name() + "_input_" + "Vcdq", pv->attribute("Vcdq"));
logger->addAttribute(pv->name() + "_input_" + "Ircdq", pv->attribute("Ircdq"));
// output variables
logger->addAttribute(pv->name() + "_output_" + "Vsdq", pv->attribute("Vsdq"));
// interface variables
logger->addAttribute(pv->name() + "_v_intf", pv->attribute("v_intf"));
logger->addAttribute(pv->name() + "_i_intf", pv->attribute("i_intf"));
}
}
}
}
}
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