Commit 106977eb authored by Markus Mirz's avatar Markus Mirz
Browse files

rename Node class

parent c667bca7
......@@ -40,7 +40,7 @@ namespace Signal {
Complex mSrcCur1Ref;
Complex mSrcCur2Ref;
std::shared_ptr<DP::Node> mNode1, mNode2;
std::shared_ptr<DP::SimNode> mNode1, mNode2;
std::shared_ptr<DP::Ph1::Resistor> mRes1, mRes2;
std::shared_ptr<DP::Ph1::CurrentSource> mSrc1, mSrc2;
Attribute<Complex>::Ptr mSrcCur1, mSrcCur2;
......@@ -58,12 +58,12 @@ namespace Signal {
public:
typedef std::shared_ptr<DecouplingLine> Ptr;
DecouplingLine(String name, Node<Complex>::Ptr node1, Node<Complex>::Ptr node2,
DecouplingLine(String name, SimNode<Complex>::Ptr node1, SimNode<Complex>::Ptr node2,
Real resistance, Real inductance, Real capacitance, Logger::Level logLevel = Logger::Level::info);
DecouplingLine(String name, Logger::Level logLevel = Logger::Level::info);
void setParameters(Node<Complex>::Ptr node1, Node<Complex>::Ptr node2, Real resistance, Real inductance, Real capacitance);
void setParameters(SimNode<Complex>::Ptr node1, SimNode<Complex>::Ptr node2, Real resistance, Real inductance, Real capacitance);
void initialize(Real omega, Real timeStep);
void step(Real time, Int timeStepCount);
void postStep();
......
......@@ -40,7 +40,7 @@ namespace Signal {
Real mSrcCur1Ref;
Real mSrcCur2Ref;
std::shared_ptr<EMT::Node> mNode1, mNode2;
std::shared_ptr<EMT::SimNode> mNode1, mNode2;
std::shared_ptr<EMT::Ph1::Resistor> mRes1, mRes2;
std::shared_ptr<EMT::Ph1::CurrentSource> mSrc1, mSrc2;
Attribute<Complex>::Ptr mSrcCur1, mSrcCur2;
......@@ -60,7 +60,7 @@ namespace Signal {
DecouplingLineEMT(String name, Logger::Level logLevel = Logger::Level::info);
void setParameters(Node<Real>::Ptr node1, Node<Real>::Ptr node2,
void setParameters(SimNode<Real>::Ptr node1, SimNode<Real>::Ptr node2,
Real resistance, Real inductance, Real capacitance);
void initialize(Real omega, Real timeStep);
void step(Real time, Int timeStepCount);
......
......@@ -25,9 +25,9 @@
namespace CPS {
template <typename VarType>
class Node : public TopologicalNode,
public std::enable_shared_from_this<Node<VarType>>,
public SharedFactory<Node<VarType>> {
class SimNode : public TopologicalNode,
public std::enable_shared_from_this<SimNode<VarType>>,
public SharedFactory<SimNode<VarType>> {
protected:
///
std::vector<UInt> mMatrixNodeIndex = { 0 };
......@@ -41,30 +41,30 @@ namespace CPS {
Task::List mMnaTasks;
public:
typedef VarType Type;
typedef std::shared_ptr<Node<VarType>> Ptr;
typedef std::shared_ptr<SimNode<VarType>> Ptr;
typedef std::vector<Ptr> List;
///
static Ptr GND;
/// This very general constructor is used by other constructors.
Node(String name, String uid, std::vector<UInt> matrixNodeIndex,
SimNode(String name, String uid, std::vector<UInt> matrixNodeIndex,
PhaseType phaseType, std::vector<Complex> initialVoltage);
/// Create ground node if no parameters are given.
Node(PhaseType phaseType = PhaseType::Single);
SimNode(PhaseType phaseType = PhaseType::Single);
/// Create named node and optionally assigns an initial voltage.
/// This should be the constructor called by users in examples.
Node(String name, PhaseType phaseType = PhaseType::Single,
SimNode(String name, PhaseType phaseType = PhaseType::Single,
std::vector<Complex> initialVoltage = { 0, 0, 0 })
: Node(name, name, { 0, 0, 0 }, phaseType, initialVoltage) { }
: SimNode(name, name, { 0, 0, 0 }, phaseType, initialVoltage) { }
/// Create node with name and node number.
/// This is mostly used by functions.
Node(String uid, String name, UInt matrixNodeIndex,
SimNode(String uid, String name, UInt matrixNodeIndex,
PhaseType phaseType = PhaseType::Single, std::vector<Complex> initialVoltage = { 0, 0, 0 })
: Node(uid, name, { matrixNodeIndex, matrixNodeIndex + 1, matrixNodeIndex + 2 }, phaseType, initialVoltage) {}
: SimNode(uid, name, { matrixNodeIndex, matrixNodeIndex + 1, matrixNodeIndex + 2 }, phaseType, initialVoltage) {}
/// Create node with default name and node number.
/// This is mostly used by functions.
Node(UInt matrixNodeIndex, PhaseType phaseType = PhaseType::Single)
: Node("N" + std::to_string(matrixNodeIndex), "N" + std::to_string(matrixNodeIndex), matrixNodeIndex, phaseType) { }
SimNode(UInt matrixNodeIndex, PhaseType phaseType = PhaseType::Single)
: SimNode("N" + std::to_string(matrixNodeIndex), "N" + std::to_string(matrixNodeIndex), matrixNodeIndex, phaseType) { }
/// Initialize state matrices with size according to phase type and frequency number
void initialize(Matrix frequencies);
......@@ -120,7 +120,7 @@ namespace CPS {
///
class MnaPostStepHarm : public Task {
public:
MnaPostStepHarm(Node& node, std::vector<Attribute<Matrix>::Ptr> leftVectors) :
MnaPostStepHarm(SimNode& node, std::vector<Attribute<Matrix>::Ptr> leftVectors) :
Task(node.mName + ".MnaPostStepHarm"),
mNode(node), mLeftVectors(leftVectors) {
for (UInt i = 0; i < mLeftVectors.size(); i++)
......@@ -129,33 +129,33 @@ namespace CPS {
}
void execute(Real time, Int timeStepCount);
private:
Node& mNode;
SimNode& mNode;
std::vector< Attribute<Matrix>::Ptr > mLeftVectors;
};
};
namespace SP {
typedef CPS::Node<Complex> Node;
typedef CPS::SimNode<Complex> SimNode;
}
namespace DP {
typedef CPS::Node<Complex> Node;
typedef CPS::SimNode<Complex> SimNode;
}
namespace EMT {
typedef CPS::Node<Real> Node;
typedef CPS::SimNode<Real> SimNode;
}
template<typename VarType>
typename Node<VarType>::Ptr Node<VarType>::GND = Node<VarType>::make();
typename SimNode<VarType>::Ptr SimNode<VarType>::GND = SimNode<VarType>::make();
template<>
void Node<Real>::mnaUpdateVoltage(Matrix& leftVector);
void SimNode<Real>::mnaUpdateVoltage(Matrix& leftVector);
template<>
void Node<Complex>::mnaUpdateVoltage(Matrix& leftVector);
void SimNode<Complex>::mnaUpdateVoltage(Matrix& leftVector);
template<>
void Node<Complex>::mnaInitializeHarm(std::vector<Attribute<Matrix>::Ptr> leftVector);
void SimNode<Complex>::mnaInitializeHarm(std::vector<Attribute<Matrix>::Ptr> leftVector);
template<>
void Node<Complex>::setVoltage(Complex newVoltage);
void SimNode<Complex>::setVoltage(Complex newVoltage);
}
......@@ -32,7 +32,7 @@ namespace CPS {
/// List of Terminals
typename Terminal<VarType>::List mTerminals;
/// List of virtual nodes
typename Node<VarType>::List mVirtualNodes;
typename SimNode<VarType>::List mVirtualNodes;
/// Voltage between terminals
MatrixVar<VarType> mIntfVoltage;
/// Current through component
......@@ -100,7 +100,7 @@ namespace CPS {
/// Returns the actual number of Nodes / Terminals that are already set to valid Nodes.
UInt nodeNumber();
/// Get pointer to node
typename Node<VarType>::Ptr node(UInt index) {
typename SimNode<VarType>::Ptr node(UInt index) {
if (index >= mTerminals.size()) {
throw SystemError("Node not available for " + mUID);
}
......@@ -123,9 +123,9 @@ namespace CPS {
/// Returns true if virtual node number is greater than zero.
Bool hasVirtualNodes() { return mNumVirtualNodes > 0; }
///
typename Node<VarType>::List& virtualNodes() { return mVirtualNodes; }
typename SimNode<VarType>::List& virtualNodes() { return mVirtualNodes; }
/// Get pointer to virtual node
typename Node<VarType>::Ptr virtualNode(UInt index);
typename SimNode<VarType>::Ptr virtualNode(UInt index);
/// Get vector of simulation node numbers from virtual Node
std::vector<UInt> virtualMatrixNodeIndices(UInt index) { return virtualNode(index)->matrixNodeIndices(); }
/// Get simulation node number from virtual node
......@@ -149,9 +149,9 @@ namespace CPS {
///
void setVirtualNodeNumber(UInt num);
/// Sets the virtual node at index nodeNum.
void setVirtualNodeAt(typename Node<VarType>::Ptr virtualNode, UInt nodeNum);
void setVirtualNodeAt(typename SimNode<VarType>::Ptr virtualNode, UInt nodeNum);
/// Sets all nodes and checks for nominal number of Nodes for this Component.
void connect(typename Node<VarType>::List nodes);
void connect(typename SimNode<VarType>::List nodes);
// #### Calculations ####
/// Initialize components with correct network frequencies
......
......@@ -28,7 +28,7 @@ namespace CPS {
class Terminal : public TopologicalTerminal, public SharedFactory<Terminal<VarType>> {
protected:
MatrixVar<VarType> mCurrent;
std::weak_ptr<Node<VarType>> mNode;
std::weak_ptr<SimNode<VarType>> mNode;
public:
typedef std::shared_ptr<Terminal<VarType>> Ptr;
......@@ -38,11 +38,11 @@ namespace CPS {
///
Terminal(String uid, String name) : TopologicalTerminal(uid, name) { }
///
typename Node<VarType>::Ptr node() {
typename SimNode<VarType>::Ptr node() {
return mNode.lock();
}
///
void setNode(typename Node<VarType>::Ptr node) {
void setNode(typename SimNode<VarType>::Ptr node) {
mNode = node;
setPhaseType(node->phaseType());
}
......
......@@ -100,10 +100,10 @@ namespace CPS {
/// Adds node and initializes frequencies
void addNode(TopologicalNode::Ptr topNode) {
auto nodeComplex = std::dynamic_pointer_cast<Node<Complex>>(topNode);
auto nodeComplex = std::dynamic_pointer_cast<SimNode<Complex>>(topNode);
if (nodeComplex) nodeComplex->initialize(mFrequencies);
auto nodeReal = std::dynamic_pointer_cast<Node<Real>>(topNode);
auto nodeReal = std::dynamic_pointer_cast<SimNode<Real>>(topNode);
if (nodeReal) nodeReal->initialize(mFrequencies);
mNodes.push_back(topNode);
......@@ -111,10 +111,10 @@ namespace CPS {
/// Adds node at specified position and initializes frequencies
void addNodeAt(TopologicalNode::Ptr topNode, UInt index) {
auto node = std::dynamic_pointer_cast<Node<Complex>>(topNode);
auto node = std::dynamic_pointer_cast<SimNode<Complex>>(topNode);
if (node) node->initialize(mFrequencies);
auto nodeReal = std::dynamic_pointer_cast<Node<Real>>(topNode);
auto nodeReal = std::dynamic_pointer_cast<SimNode<Real>>(topNode);
if (nodeReal) nodeReal->initialize(mFrequencies);
if (index > mNodes.capacity())
......@@ -215,7 +215,7 @@ namespace CPS {
///
template <typename VarType>
int checkTopologySubnets(std::unordered_map<typename CPS::Node<VarType>::Ptr, int>& subnet);
int checkTopologySubnets(std::unordered_map<typename CPS::SimNode<VarType>::Ptr, int>& subnet);
///
template <typename VarType>
......
......@@ -674,13 +674,13 @@ void Reader::writeSvVoltageFromStaticSysTopology(SystemTopology& sysStatic, Syst
for (; nodeDyn != sysDynamic.mNodes.end() && nodeSt != sysStatic.mNodes.end(); ++nodeDyn, ++nodeSt) {
if ((*nodeDyn)->name() == (*nodeSt)->name()) {
(*nodeDyn)->setInitialVoltage(
std::dynamic_pointer_cast<CPS::Node<CPS::Complex>>((*nodeSt))->singleVoltage());
std::dynamic_pointer_cast<CPS::SimNode<CPS::Complex>>((*nodeSt))->singleVoltage());
}
else {
for (auto node : sysStatic.mNodes) {
if ((*nodeDyn)->name() == node->name())
(*nodeDyn)->setInitialVoltage(
std::dynamic_pointer_cast<CPS::Node<CPS::Complex>>(node)->singleVoltage());
std::dynamic_pointer_cast<CPS::SimNode<CPS::Complex>>(node)->singleVoltage());
}
}
}
......@@ -690,7 +690,7 @@ void Reader::writeSvVoltageFromStaticSysTopology(SystemTopology& sysStatic, Syst
for (auto node : sysStatic.mNodes) {
if ((*nodeDyn)->name() == node->name())
(*nodeDyn)->setInitialVoltage(
std::dynamic_pointer_cast<CPS::Node<CPS::Complex>>(node)->singleVoltage());
std::dynamic_pointer_cast<CPS::SimNode<CPS::Complex>>(node)->singleVoltage());
}
}
}
......@@ -701,7 +701,7 @@ template<typename VarType>
void Reader::processTopologicalNode(IEC61970::Base::Topology::TopologicalNode* topNode) {
// Add this node to global node list and assign simulation node incrementally.
int matrixNodeIndex = Int(mPowerflowNodes.size());
mPowerflowNodes[topNode->mRID] = Node<VarType>::make(topNode->mRID, topNode->name, matrixNodeIndex, mPhase);
mPowerflowNodes[topNode->mRID] = SimNode<VarType>::make(topNode->mRID, topNode->name, matrixNodeIndex, mPhase);
if (mPhase == PhaseType::ABC) {
mSLog->info("TopologicalNode {} phase A as simulation node {} ", topNode->mRID, mPowerflowNodes[topNode->mRID]->matrixNodeIndex(PhaseType::A));
......@@ -716,7 +716,7 @@ void Reader::processTopologicalNode(IEC61970::Base::Topology::TopologicalNode* t
// This could be optimized because the Terminal is searched twice.
auto cpsTerm = Terminal<VarType>::make(term->mRID);
mPowerflowTerminals.insert(std::make_pair(term->mRID, cpsTerm));
cpsTerm->setNode(std::dynamic_pointer_cast<Node<VarType>>(mPowerflowNodes[topNode->mRID]));
cpsTerm->setNode(std::dynamic_pointer_cast<SimNode<VarType>>(mPowerflowNodes[topNode->mRID]));
if (!term->sequenceNumber.initialized)
term->sequenceNumber = 1;
......
......@@ -354,11 +354,11 @@ void DP::Ph1::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency)
mSubCtrledVoltageSource->setParameters(mIntfVoltage);
//
mSubCtrledVoltageSource->connect({ Node::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->connect({ SimNode::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->setVirtualNodeAt(mVirtualNodes[0], 0);
mSubResistorF->connect({ mVirtualNodes[1], mVirtualNodes[2] });
mSubInductorF->connect({ mVirtualNodes[2], mVirtualNodes[3] });
mSubCapacitorF->connect({ mVirtualNodes[3], Node::GND });
mSubCapacitorF->connect({ mVirtualNodes[3], SimNode::GND });
mSubResistorC->connect({ mVirtualNodes[3], mTerminals[0]->node() });
//
......
......@@ -93,7 +93,7 @@ void DP::Ph1::PQLoadCS::initializeFromPowerflow(Real frequency) {
mSubCurrentSource->setParameters(current);
mCurrentSourceRef = mSubCurrentSource->attribute<Complex>("I_ref");
// A positive power should result in a positive current to ground.
mSubCurrentSource->connect({ mTerminals[0]->node(), Node::GND });
mSubCurrentSource->connect({ mTerminals[0]->node(), SimNode::GND });
mSubCurrentSource->initializeFromPowerflow(frequency);
updateIntfValues();
......
......@@ -78,13 +78,13 @@ void DP::Ph1::PiLine::initializeFromPowerflow(Real frequency) {
if (mParallelCond >= 0) {
mSubParallelResistor0 = std::make_shared<DP::Ph1::Resistor>(mName + "_con0", mLogLevel);
mSubParallelResistor0->setParameters(2./mParallelCond);
mSubParallelResistor0->connect(Node::List{ Node::GND, mTerminals[0]->node() });
mSubParallelResistor0->connect(SimNode::List{ SimNode::GND, mTerminals[0]->node() });
mSubParallelResistor0->initialize(mFrequencies);
mSubParallelResistor0->initializeFromPowerflow(frequency);
mSubParallelResistor1 = std::make_shared<DP::Ph1::Resistor>(mName + "_con1", mLogLevel);
mSubParallelResistor1->setParameters(2./mParallelCond);
mSubParallelResistor1->connect(Node::List{ Node::GND, mTerminals[1]->node() });
mSubParallelResistor1->connect(SimNode::List{ SimNode::GND, mTerminals[1]->node() });
mSubParallelResistor1->initialize(mFrequencies);
mSubParallelResistor1->initializeFromPowerflow(frequency);
}
......@@ -92,13 +92,13 @@ void DP::Ph1::PiLine::initializeFromPowerflow(Real frequency) {
if (mParallelCap >= 0) {
mSubParallelCapacitor0 = std::make_shared<DP::Ph1::Capacitor>(mName + "_cap0", mLogLevel);
mSubParallelCapacitor0->setParameters(mParallelCap/2.);
mSubParallelCapacitor0->connect(Node::List{ Node::GND, mTerminals[0]->node() });
mSubParallelCapacitor0->connect(SimNode::List{ SimNode::GND, mTerminals[0]->node() });
mSubParallelCapacitor0->initialize(mFrequencies);
mSubParallelCapacitor0->initializeFromPowerflow(frequency);
mSubParallelCapacitor1 = std::make_shared<DP::Ph1::Capacitor>(mName + "_cap1", mLogLevel);
mSubParallelCapacitor1->setParameters(mParallelCap/2.);
mSubParallelCapacitor1->connect(Node::List{ Node::GND, mTerminals[1]->node() });
mSubParallelCapacitor1->connect(SimNode::List{ SimNode::GND, mTerminals[1]->node() });
mSubParallelCapacitor1->initialize(mFrequencies);
mSubParallelCapacitor1->initializeFromPowerflow(frequency);
}
......
......@@ -77,7 +77,7 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) {
mConductance = 1.0 / mResistance;
mSubResistor = std::make_shared<DP::Ph1::Resistor>(mName + "_res", mLogLevel);
mSubResistor->setParameters(mResistance);
mSubResistor->connect({ Node::GND, mTerminals[0]->node() });
mSubResistor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubResistor->initialize(mFrequencies);
mSubResistor->initializeFromPowerflow(frequency);
}
......@@ -92,7 +92,7 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) {
mSubInductor = std::make_shared<DP::Ph1::Inductor>(mName + "_ind", mLogLevel);
mSubInductor->setParameters(mInductance);
mSubInductor->connect({ Node::GND, mTerminals[0]->node() });
mSubInductor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubInductor->initialize(mFrequencies);
mSubInductor->initializeFromPowerflow(frequency);
} else if (mReactance < 0) {
......@@ -100,7 +100,7 @@ void DP::Ph1::RXLoad::initializeFromPowerflow(Real frequency) {
mSubCapacitor = std::make_shared<DP::Ph1::Capacitor>(mName + "_cap", mLogLevel);
mSubCapacitor->setParameters(mCapacitance);
mSubCapacitor->connect({ Node::GND, mTerminals[0]->node() });
mSubCapacitor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubCapacitor->initialize(mFrequencies);
mSubCapacitor->initializeFromPowerflow(frequency);
}
......
......@@ -60,7 +60,7 @@ void DP::Ph1::RxLine::initializeFromPowerflow(Real frequency) {
mInitialResistor = std::make_shared<DP::Ph1::Resistor>(mName + "_snubber_res", mLogLevel);
mInitialResistor->setParameters(1e6);
mInitialResistor->connect({ Node::GND, mTerminals[1]->node() });
mInitialResistor->connect({ SimNode::GND, mTerminals[1]->node() });
mInitialResistor->initializeFromPowerflow(frequency);
mSLog->info(
......
......@@ -55,7 +55,7 @@ void DP::Ph1::SynchronGeneratorIdeal::initializeFromPowerflow(Real frequency) {
mSubVoltageSource = DP::Ph1::VoltageSource::make(mName + "_src", mLogLevel);
mSubVoltageSource->setParameters(0);
mSubVoltageSource->connect({ Node::GND, node(0) });
mSubVoltageSource->connect({ SimNode::GND, node(0) });
mSubVoltageSource->setVirtualNodeAt(mVirtualNodes[0], 0);
mSubVoltageSource->initialize(mFrequencies);
mSubVoltageSource->initializeFromPowerflow(frequency);
......
......@@ -149,7 +149,7 @@ void DP::Ph1::SynchronGeneratorTrStab::initializeFromPowerflow(Real frequency) {
// Create sub voltage source for emf
mSubVoltageSource = DP::Ph1::VoltageSource::make(mName + "_src", mLogLevel);
mSubVoltageSource->setParameters(mEp);
mSubVoltageSource->connect({Node::GND, mVirtualNodes[0]});
mSubVoltageSource->connect({SimNode::GND, mVirtualNodes[0]});
mSubVoltageSource->setVirtualNodeAt(mVirtualNodes[1], 0);
mSubVoltageSource->initialize(mFrequencies);
mSubVoltageSource->initializeFromPowerflow(frequency);
......
......@@ -102,7 +102,7 @@ void DP::Ph1::Transformer::initializeFromPowerflow(Real frequency) {
// Create parallel sub components
mSubSnubResistor = std::make_shared<DP::Ph1::Resistor>(mName + "_snub_res", mLogLevel);
mSubSnubResistor->setParameters(snubberResistance);
mSubSnubResistor->connect({ node(1), DP::Node::GND });
mSubSnubResistor->connect({ node(1), DP::SimNode::GND });
mSubSnubResistor->initialize(mFrequencies);
mSubSnubResistor->initializeFromPowerflow(frequency);
......
......@@ -405,7 +405,7 @@ void DP::Ph3::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency)
// Create sub voltage source for emf
mSubCtrledVoltageSource = DP::Ph3::ControlledVoltageSource::make(mName + "_src", mLogLevel);
mSubCtrledVoltageSource->connect({ Node::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->connect({ SimNode::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->setVirtualNodeAt(mVirtualNodes[0], 0);
mSubCtrledVoltageSource->setParameters(mIntfVoltage);
mSubCtrledVoltageSource->initializeFromPowerflow(frequency);
......
......@@ -417,11 +417,11 @@ void EMT::Ph3::AvVoltageSourceInverterDQ::initializeFromPowerflow(Real frequency
mSubCtrledVoltageSource->setParameters(vsInit.real());
//
mSubCtrledVoltageSource->connect({ Node::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->connect({ SimNode::GND, mVirtualNodes[1] });
mSubCtrledVoltageSource->setVirtualNodeAt(mVirtualNodes[0], 0);
mSubResistorF->connect({ mVirtualNodes[1], mVirtualNodes[2] });
mSubInductorF->connect({ mVirtualNodes[2], mVirtualNodes[3] });
mSubCapacitorF->connect({ mVirtualNodes[3], Node::GND });
mSubCapacitorF->connect({ mVirtualNodes[3], SimNode::GND });
mSubResistorC->connect({ mVirtualNodes[3], mTerminals[0]->node() });
//
......
......@@ -101,13 +101,13 @@ void EMT::Ph3::PiLine::initializeFromPowerflow(Real frequency) {
if (mParallelCond(0,0) > 0) {
mSubParallelResistor0 = std::make_shared<EMT::Ph3::Resistor>(mName + "_con0", mLogLevel);
mSubParallelResistor0->setParameters(2. * mParallelCond.inverse());
mSubParallelResistor0->connect(Node::List{ Node::GND, mTerminals[0]->node() });
mSubParallelResistor0->connect(SimNode::List{ SimNode::GND, mTerminals[0]->node() });
mSubParallelResistor0->initialize(mFrequencies);
mSubParallelResistor0->initializeFromPowerflow(frequency);
mSubParallelResistor1 = std::make_shared<EMT::Ph3::Resistor>(mName + "_con1", mLogLevel);
mSubParallelResistor1->setParameters(2. * mParallelCond.inverse());
mSubParallelResistor1->connect(Node::List{ Node::GND, mTerminals[1]->node() });
mSubParallelResistor1->connect(SimNode::List{ SimNode::GND, mTerminals[1]->node() });
mSubParallelResistor1->initialize(mFrequencies);
mSubParallelResistor1->initializeFromPowerflow(frequency);
}
......@@ -115,13 +115,13 @@ void EMT::Ph3::PiLine::initializeFromPowerflow(Real frequency) {
if (mParallelCap(0,0) > 0) {
mSubParallelCapacitor0 = std::make_shared<EMT::Ph3::Capacitor>(mName + "_cap0", mLogLevel);
mSubParallelCapacitor0->setParameters(mParallelCap / 2.);
mSubParallelCapacitor0->connect(Node::List{ Node::GND, mTerminals[0]->node() });
mSubParallelCapacitor0->connect(SimNode::List{ SimNode::GND, mTerminals[0]->node() });
mSubParallelCapacitor0->initialize(mFrequencies);
mSubParallelCapacitor0->initializeFromPowerflow(frequency);
mSubParallelCapacitor1 = std::make_shared<EMT::Ph3::Capacitor>(mName + "_cap1", mLogLevel);
mSubParallelCapacitor1->setParameters(mParallelCap / 2.);
mSubParallelCapacitor1->connect(Node::List{ Node::GND, mTerminals[1]->node() });
mSubParallelCapacitor1->connect(SimNode::List{ SimNode::GND, mTerminals[1]->node() });
mSubParallelCapacitor1->initialize(mFrequencies);
mSubParallelCapacitor1->initializeFromPowerflow(frequency);
}
......
......@@ -95,7 +95,7 @@ void EMT::Ph3::RXLoad::initializeFromPowerflow(Real frequency) {
mConductance = mResistance.inverse();
mSubResistor = std::make_shared<EMT::Ph3::Resistor>(mName + "_res", mLogLevel);
mSubResistor->setParameters(mResistance);
mSubResistor->connect({ Node::GND, mTerminals[0]->node() });
mSubResistor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubResistor->initialize(mFrequencies);
mSubResistor->initializeFromPowerflow(frequency);
}
......@@ -110,7 +110,7 @@ void EMT::Ph3::RXLoad::initializeFromPowerflow(Real frequency) {
mSubInductor = std::make_shared<EMT::Ph3::Inductor>(mName + "_ind", mLogLevel);
mSubInductor->setParameters(mInductance);
mSubInductor->connect({ Node::GND, mTerminals[0]->node() });
mSubInductor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubInductor->initialize(mFrequencies);
mSubInductor->initializeFromPowerflow(frequency);
}
......@@ -119,7 +119,7 @@ void EMT::Ph3::RXLoad::initializeFromPowerflow(Real frequency) {
mSubCapacitor = std::make_shared<EMT::Ph3::Capacitor>(mName + "_cap", mLogLevel);
mSubCapacitor->setParameters(mCapacitance);
mSubCapacitor->connect({ Node::GND, mTerminals[0]->node() });
mSubCapacitor->connect({ SimNode::GND, mTerminals[0]->node() });
mSubCapacitor->initialize(mFrequencies);
mSubCapacitor->initializeFromPowerflow(frequency);
}
......
......@@ -86,7 +86,7 @@ void EMT::Ph3::RxLine::initializeFromPowerflow(Real frequency) {
0, 1e6, 0,
0, 0, 1e6;
mInitialResistor->setParameters(defaultSnubRes);
mInitialResistor->connect({ Node::GND, mTerminals[1]->node() });
mInitialResistor->connect({ SimNode::GND, mTerminals[1]->node() });
mInitialResistor->initializeFromPowerflow(frequency);
mSLog->info(
......
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