Commit 60ba1062 authored by Markus Mirz's avatar Markus Mirz
Browse files

refactor initializeFromPowerflow

parent d91bfa78
......@@ -100,7 +100,7 @@ void DAESolver::initialize(Real t0) {
for (IdentifiedObject::Ptr comp : mComponents) {
auto emtComp = std::dynamic_pointer_cast<SimPowerComp<Complex> >(comp);
if (emtComp) {
emtComp->initializeFromPowerflow(mSystem.mSystemFrequency);// Set initial values of all components
emtComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);// Set initial values of all components
}
auto daeComp = std::dynamic_pointer_cast<DAEInterface>(comp);
......
......@@ -97,7 +97,7 @@ void DiakopticsSolver<VarType>::initSubnets(const std::vector<SystemTopology>& s
}
}
tComp->mnaTearSetIdx(idx);
comp->initializeFromPowerflow(mSystemFrequency);
comp->initializeFromNodesAndTerminals(mSystemFrequency);
tComp->mnaTearInitialize(2 * PI * mSystemFrequency, mTimeStep);
for (auto gndComp : tComp->mnaTearGroundComponents()) {
......@@ -248,7 +248,7 @@ void DiakopticsSolver<VarType>::initComponents() {
for (auto comp : mSubnets[net].components) {
auto pComp = std::dynamic_pointer_cast<SimPowerComp<VarType>>(comp);
if (!pComp) continue;
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
pComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);
}
// Initialize MNA specific parts of components.
......
......@@ -101,7 +101,7 @@ void MnaSolver<Real>::initializeComponents() {
auto pComp = std::dynamic_pointer_cast<SimPowerComp<Real>>(comp);
if (!pComp) continue;
pComp->checkForUnconnectedTerminals();
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
pComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);
}
// Initialize signal components.
......@@ -129,7 +129,7 @@ void MnaSolver<Complex>::initializeComponents() {
auto pComp = std::dynamic_pointer_cast<SimPowerComp<Complex>>(comp);
if (!pComp) continue;
pComp->checkForUnconnectedTerminals();
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
pComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);
}
// Initialize signal components.
......
......@@ -64,7 +64,7 @@ void PFSolver::assignMatrixNodeIndices() {
mSystem.mNodes[idx]->setMatrixNodeIndex(0, matrixNodeIndexIdx);
mSLog->info("Node {}: MatrixNodeIndex {}", mSystem.mNodes[idx]->uid(), mSystem.mNodes[idx]->matrixNodeIndex());
matrixNodeIndexIdx++;
}
}
mSLog->info("Number of simulation nodes: {:d}", matrixNodeIndexIdx);
}
......@@ -78,7 +78,7 @@ void PFSolver::initializeComponents(){
auto pComp = std::dynamic_pointer_cast<SimPowerComp<Complex>>(comp);
if (!pComp) continue;
if (mPowerFlowInit)
pComp->initializeFromPowerflow(mSystem.mSystemFrequency);
pComp->initializeFromNodesAndTerminals(mSystem.mSystemFrequency);
}
mSLog->info("-- Calculate per unit parameters for all components");
......
......@@ -95,7 +95,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
/// Setter for general parameters of inverter
void setParameters(Real sysOmega, Real sysVoltNom, Real Pref, Real Qref);
/// Setter for parameters of control loops
......
......@@ -45,7 +45,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
///
void initialize(Matrix frequencies);
......
......@@ -32,7 +32,7 @@ namespace CPS {
SimPowerComp<Complex>::Ptr clone(String name);
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency) { }
void initializeFromNodesAndTerminals(Real frequency) { }
// #### MNA section ####
/// Initializes internal variables of the component
......
......@@ -43,7 +43,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
///
......
......@@ -49,7 +49,7 @@ namespace Ph1 {
/// Initializes state variables considering the number of frequencies
void initialize(Matrix frequencies);
/// Initializes states from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes MNA specific variables
......
......@@ -123,7 +123,7 @@ namespace Ph1 {
// #### General ####
///
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
///
void initialize(Matrix frequencies);
///
......
......@@ -49,7 +49,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
///
void setSourceValue(Complex voltage);
///
......
......@@ -53,7 +53,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
......
......@@ -53,7 +53,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
......
......@@ -63,7 +63,7 @@ namespace Ph1 {
// #### General ####
/// Initialize component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
/// Set model specific parameters
void setParameters(Real activePower, Real ReactivePower, Real volt);
......
......@@ -37,7 +37,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
/// Sets model specific parameters
void setParameters(Real activePower, Real reactivePower, Real nomVolt,
Real openResistance, Real closedResistance, Bool closed = false);
......
......@@ -50,7 +50,7 @@ namespace Ph1 {
/// Initializes state variables considering the number of frequencies
void initialize(Matrix frequencies);
/// Initializes states from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes MNA specific variables
......
......@@ -34,7 +34,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
......
......@@ -46,7 +46,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes internal variables of the component
......
......@@ -76,7 +76,7 @@ namespace Ph1 {
// #### General ####
/// Initializes states from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### MNA section ####
/// Initializes MNA specific variables
......
......@@ -38,7 +38,7 @@ namespace Ph1 {
// #### General ####
/// Initializes component from power flow data
void initializeFromPowerflow(Real frequency);
void initializeFromNodesAndTerminals(Real frequency);
// #### General MNA section ####
void mnaInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
......
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