Commit 9e713702 authored by Markus Mirz's avatar Markus Mirz
Browse files

refactor powerflowinit flag


Signed-off-by: Markus Mirz's avatarMarkus Mirz <mmirz@eonerc.rwth-aachen.de>
parent 82f238c6
......@@ -74,7 +74,7 @@ int main(int argc, char* argv[]) {
simPF.setFinalTime(finalTimePF);
simPF.setDomain(Domain::SP);
simPF.setSolverType(Solver::Type::NRP);
simPF.doPowerFlowInit(false);
simPF.doInitFromNodesAndTerminals(false);
simPF.addLogger(loggerPF);
simPF.run();
......@@ -126,7 +126,6 @@ int main(int argc, char* argv[]) {
sim.setTimeStep(timeStepDP);
sim.setFinalTime(finalTimeDP);
sim.setDomain(Domain::DP);
sim.doPowerFlowInit(false);
sim.addLogger(loggerDP);
sim.addEvent(loadStepEvent);
sim.run();
......
......@@ -81,7 +81,7 @@ int main(int argc, char* argv[]) {
simPF.setFinalTime(finalTimePF);
simPF.setDomain(Domain::SP);
simPF.setSolverType(Solver::Type::NRP);
simPF.doPowerFlowInit(false);
simPF.doInitFromNodesAndTerminals(false);
simPF.addLogger(loggerPF);
simPF.run();
......@@ -140,7 +140,6 @@ int main(int argc, char* argv[]) {
sim.setFinalTime(finalTimeDP);
sim.setDomain(Domain::DP);
sim.addEvent(loadStepEvent);
sim.doPowerFlowInit(false);
sim.addLogger(loggerDP);
sim.run();
......
......@@ -75,7 +75,7 @@ int main(int argc, char* argv[]) {
simPF.setFinalTime(finalTimePF);
simPF.setDomain(Domain::SP);
simPF.setSolverType(Solver::Type::NRP);
simPF.doPowerFlowInit(false);
simPF.doInitFromNodesAndTerminals(false);
simPF.addLogger(loggerPF);
simPF.run();
......
......@@ -81,7 +81,7 @@ int main(int argc, char* argv[]) {
simPF.setFinalTime(finalTimePF);
simPF.setDomain(Domain::SP);
simPF.setSolverType(Solver::Type::NRP);
simPF.doPowerFlowInit(false);
simPF.doInitFromNodesAndTerminals(false);
simPF.addLogger(loggerPF);
simPF.run();
......
......@@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {
sim.setFinalTime(finalTime);
sim.setDomain(Domain::SP);
sim.setSolverType(Solver::Type::NRP);
sim.doPowerFlowInit(false);
sim.doInitFromNodesAndTerminals(false);
sim.addLogger(logger);
sim.run();
}
......@@ -81,7 +81,7 @@ int main(int argc, char* argv[]) {
simPF.setFinalTime(finalTimePF);
simPF.setDomain(Domain::SP);
simPF.setSolverType(Solver::Type::NRP);
simPF.doPowerFlowInit(false);
simPF.doInitFromNodesAndTerminals(false);
simPF.addLogger(loggerPF);
simPF.run();
......
......@@ -63,7 +63,7 @@ namespace DPsim {
///
Solver::List mSolvers;
///
Bool mPowerFlowInit = false;
Bool mInitFromNodesAndTerminals = true;
/// Enable recomputation of system matrix during simulation
Bool mSystemMatrixRecomputation = false;
......@@ -152,7 +152,7 @@ namespace DPsim {
CPS::Domain domain = CPS::Domain::DP,
Solver::Type solverType = Solver::Type::MNA,
CPS::Logger::Level logLevel = CPS::Logger::Level::info,
Bool powerFlowInit = false,
Bool initFromNodesAndTerminals = true,
Bool steadyStateInit = false,
Bool splitSubnets = true,
CPS::IdentifiedObject::List tearComponents = CPS::IdentifiedObject::List());
......@@ -172,7 +172,7 @@ namespace DPsim {
///
void setSolverType(Solver::Type solverType = Solver::Type::MNA) { mSolverType = solverType; }
///
void doPowerFlowInit(Bool powerFlowInit = true) { mPowerFlowInit = powerFlowInit; }
void doInitFromNodesAndTerminals(Bool f = true) { mInitFromNodesAndTerminals = f; }
///
void doSplitSubnets(Bool splitSubnets = true) { mSplitSubnets = splitSubnets; }
///
......
......@@ -50,7 +50,7 @@ namespace DPsim {
Bool mIsInInitialization = false;
/// Activates powerflow initialization
/// If this is false, all voltages are initialized with zero
Bool mPowerFlowInit = true;
Bool mInitFromNodesAndTerminals = true;
public:
typedef std::shared_ptr<Solver> Ptr;
......@@ -89,7 +89,7 @@ namespace DPsim {
/// set steady state initialization accuracy limit
void setSteadStIniAccLimit(Real v) { mSteadStIniAccLimit = v; }
/// activate powerflow initialization
void doPowerFlowInit(Bool f) { mPowerFlowInit = f; }
void doInitFromNodesAndTerminals(Bool f) { mInitFromNodesAndTerminals = f; }
// #### Simulation ####
/// Get tasks for scheduler
......
......@@ -77,7 +77,7 @@ void PFSolver::initializeComponents(){
for (auto comp : mSystem.mComponents) {
auto pComp = std::dynamic_pointer_cast<SimPowerComp<Complex>>(comp);
if (!pComp) continue;
if (mPowerFlowInit)
if (mInitFromNodesAndTerminals)
pComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);
}
......
......@@ -73,7 +73,7 @@ Simulation::Simulation(String name, SystemTopology system,
Real timeStep, Real finalTime,
Domain domain, Solver::Type solverType,
Logger::Level logLevel,
Bool powerFlowInit,
Bool initFromNodesAndTerminals,
Bool steadyStateInit,
Bool splitSubnets,
IdentifiedObject::List tearComponents) :
......@@ -84,7 +84,7 @@ Simulation::Simulation(String name, SystemTopology system,
mDomain = domain;
mSystem = system;
mSolverType = solverType;
mPowerFlowInit = powerFlowInit;
mInitFromNodesAndTerminals = initFromNodesAndTerminals;
mSteadyStateInit = steadyStateInit;
mSplitSubnets = splitSubnets;
mTearComponents = tearComponents;
......@@ -132,7 +132,7 @@ void Simulation::createSolvers() {
#endif /* WITH_SUNDIALS */
case Solver::Type::NRP:
solver = std::make_shared<PFSolverPowerPolar>(mName, mSystem, mTimeStep, mLogLevel);
solver->doPowerFlowInit(mPowerFlowInit);
solver->doInitFromNodesAndTerminals(mInitFromNodesAndTerminals);
solver->initialize();
mSolvers.push_back(solver);
break;
......
Markdown is supported
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