DPsim
|
Base class for all components that are transmitting power. More...
#include <SimPowerComp.h>
Public Types | |
typedef VarType | Type |
typedef std::shared_ptr< SimPowerComp< VarType > > | Ptr |
typedef std::vector< Ptr > | List |
![]() | |
enum | Behaviour { Initialization , MNASimulation , PFSimulation } |
typedef std::shared_ptr< TopologicalPowerComp > | Ptr |
typedef std::vector< Ptr > | List |
![]() | |
typedef std::shared_ptr< IdentifiedObject > | Ptr |
typedef std::vector< Ptr > | List |
Public Member Functions | |
SimPowerComp (String uid, String name, Logger::Level logLevel=Logger::Level::off) | |
Basic constructor that takes UID, name and log level. | |
SimPowerComp (String name, Logger::Level logLevel=Logger::Level::off) | |
Basic constructor that takes name and log level and sets the UID to name as well. | |
virtual | ~SimPowerComp () |
Destructor - does not do anything. | |
virtual SimPowerComp< VarType >::Ptr | clone (String name) |
Returns a modified copy of the component with the given suffix added to the name and without. | |
UInt | terminalNumber () |
Returns nominal number of Terminals for this component type. | |
UInt | terminalNumberConnected () |
Returns the number of connected Terminals. | |
Bool | hasUnconnectedTerminals () |
void | checkForUnconnectedTerminals () |
SimTerminal< VarType >::List | terminals () |
Return list of Terminal pointers. | |
SimTerminal< VarType >::Ptr | terminal (UInt index) |
Get pointer to Terminal. | |
TopologicalTerminal::List | topologicalTerminals () |
Returns the list of terminals as TopologicalTerminal pointers. | |
void | setTerminalNumber (UInt num) |
void | setTerminals (typename SimTerminal< VarType >::List terminals) |
void | setTerminalAt (typename SimTerminal< VarType >::Ptr terminal, UInt terminalPosition) |
Sets Terminal at index terminalPosition. | |
void | updateMatrixNodeIndices () |
Update the "cached" mMatrixNodeIndices and mMatrixNodeIndexIsGround members. | |
UInt | nodeNumber () |
Returns the actual number of Nodes / Terminals that are already set to valid Nodes. | |
SimNode< VarType >::Ptr | node (UInt index) |
Get pointer to node. | |
UInt | matrixNodeIndex (UInt nodeIndex) |
UInt | matrixNodeIndex (UInt nodeIndex, UInt phaseIndex) |
std::vector< UInt > | matrixNodeIndices (UInt index) |
TODO replace with access to mMatrixNodeIndices. | |
TopologicalNode::List | topologicalNodes () |
Get nodes as base type TopologicalNode. | |
UInt | virtualNodesNumber () |
Returns nominal number of virtual nodes for this component type. | |
Bool | hasVirtualNodes () |
Returns true if virtual node number is greater than zero. | |
Bool | hasSubComponents () |
Returns true if subcomponents included in this component. | |
SimPowerComp< VarType >::List | subComponents () |
Get list of subcomponents. | |
SimNode< VarType >::List & | virtualNodes () |
SimNode< VarType >::Ptr | virtualNode (UInt index) |
Get pointer to virtual node. | |
std::vector< UInt > | virtualMatrixNodeIndices (UInt index) |
Get vector of simulation node numbers from virtual Node. | |
UInt | virtualSimNode (UInt nodeIndex, UInt phaseIndex=0) |
Get simulation node number from virtual node. | |
const MatrixVar< VarType > & | intfCurrent () |
const MatrixVar< VarType > & | intfVoltage () |
MatrixComp | initialVoltage (UInt index) |
Complex | initialSingleVoltage (UInt index) |
Bool | terminalNotGrounded (UInt index) |
void | setIntfCurrent (MatrixVar< VarType > current) |
void | setIntfVoltage (MatrixVar< VarType > voltage) |
void | setVirtualNodeNumber (UInt num) |
void | setVirtualNodeAt (typename SimNode< VarType >::Ptr virtualNode, UInt nodeNum) |
Sets the virtual node at index nodeNum. | |
void | connect (typename SimNode< VarType >::List nodes) |
Sets all nodes and checks for nominal number of Nodes for this Component. | |
virtual void | initialize (Matrix frequencies) |
Initialize components with correct network frequencies. | |
virtual void | initializeFromNodesAndTerminals (Real frequency) |
Initializes Component variables according to power flow data stored in Nodes. | |
![]() | |
TopologicalPowerComp (String uid, String name, Logger::Level logLevel=Logger::Level::off) | |
Basic constructor that takes UID, name and log level. | |
TopologicalPowerComp (String name, Logger::Level logLevel=Logger::Level::off) | |
Basic constructor that takes name and log level and sets the UID to name as well. | |
virtual | ~TopologicalPowerComp () |
Destructor - does not do anything. | |
void | setBehaviour (Behaviour behaviour) |
Set behavior of component, e.g. initialization. | |
![]() | |
IdentifiedObject (const String &uid, const String &name) | |
IdentifiedObject (const String &name) | |
AttributeBase::Ptr | attribute (const String &name) const |
Return pointer to an attribute. | |
template<typename T> | |
Attribute< T >::Ptr | attributeTyped (const String &name) const |
Return pointer to an attribute. | |
const AttributeBase::Map & | attributes () const |
String | name () |
String | uid () |
Returns unique id. | |
String | type () |
Get component type (cross-platform) | |
virtual String | description () |
Public Attributes | |
const Attribute< MatrixVar< VarType > >::Ptr | mIntfVoltage |
Voltage between terminals. | |
const Attribute< MatrixVar< VarType > >::Ptr | mIntfCurrent |
Current through component. | |
![]() | |
const Attribute< String >::Ptr | mName |
Human readable name. | |
const Attribute< String >::Ptr | mUID |
Unique identifier. | |
Protected Attributes | |
SimTerminal< VarType >::List | mTerminals |
List of Terminals. | |
SimNode< VarType >::List | mVirtualNodes |
List of virtual nodes. | |
Matrix | mFrequencies |
List of considered network frequencies. | |
UInt | mNumFreqs = 0 |
Number of network frequencies. | |
PhaseType | mPhaseType = PhaseType::Single |
std::vector< std::shared_ptr< SimPowerComp< VarType > > > | mSubComponents |
std::vector< UInt > | mMatrixNodeIndices |
"Cached" list of simulation nodes (to avoid shared_ptr accesses during simulation) | |
std::vector< bool > | mMatrixNodeIndexIsGround |
"Cached" flags for whether the connected nodes are grounded | |
![]() | |
UInt | mNumTerminals = 0 |
Determines the number of Terminals which can be connected to network Nodes. | |
UInt | mNumVirtualNodes = 0 |
Determines the number of virtual or internal Nodes. | |
Logger::Log | mSLog |
Component logger. | |
Logger::Level | mLogLevel |
Component logger control for internal variables. | |
Behaviour | mBehaviour = Behaviour::MNASimulation |
bool | mParametersSet = false |
Flag indicating that parameters are set via setParameters() function. | |
![]() | |
AttributeList::Ptr | mAttributes = AttributeList::make() |
Attribute List. | |
Base class for all components that are transmitting power.
Definition at line 17 of file SimPowerComp.h.
typedef std::vector<Ptr> CPS::SimPowerComp< VarType >::List |
Definition at line 42 of file SimPowerComp.h.
typedef std::shared_ptr<SimPowerComp<VarType> > CPS::SimPowerComp< VarType >::Ptr |
Definition at line 41 of file SimPowerComp.h.
typedef VarType CPS::SimPowerComp< VarType >::Type |
Definition at line 40 of file SimPowerComp.h.
SimPowerComp::SimPowerComp | ( | String | uid, |
String | name, | ||
Logger::Level | logLevel = Logger::Level::off ) |
Basic constructor that takes UID, name and log level.
Definition at line 14 of file SimPowerComp.cpp.
|
inline |
Basic constructor that takes name and log level and sets the UID to name as well.
Definition at line 53 of file SimPowerComp.h.
|
inlinevirtual |
Destructor - does not do anything.
Definition at line 56 of file SimPowerComp.h.
void SimPowerComp::checkForUnconnectedTerminals | ( | ) |
Definition at line 139 of file SimPowerComp.cpp.
|
virtual |
Returns a modified copy of the component with the given suffix added to the name and without.
Reimplemented in CPS::DP::Ph1::Capacitor, CPS::DP::Ph1::CurrentSource, CPS::DP::Ph1::Inductor, CPS::DP::Ph1::NetworkInjection, CPS::DP::Ph1::PiLine, CPS::DP::Ph1::PQLoadCS, CPS::DP::Ph1::ProfileVoltageSource, CPS::DP::Ph1::ResIndSeries, CPS::DP::Ph1::Resistor, CPS::DP::Ph1::RxLine, CPS::DP::Ph1::RXLoad, CPS::DP::Ph1::Switch, CPS::DP::Ph1::SynchronGenerator4OrderPCM, CPS::DP::Ph1::SynchronGenerator4OrderTPM, CPS::DP::Ph1::SynchronGenerator6OrderPCM, CPS::DP::Ph1::SynchronGeneratorIdeal, CPS::DP::Ph1::SynchronGeneratorTrStab, CPS::DP::Ph1::Transformer, CPS::DP::Ph1::varResSwitch, CPS::DP::Ph1::VoltageSource, CPS::DP::Ph1::VoltageSourceNorton, CPS::DP::Ph1::VoltageSourceRamp, CPS::DP::Ph3::Capacitor, CPS::DP::Ph3::Inductor, CPS::DP::Ph3::Resistor, CPS::DP::Ph3::SeriesResistor, CPS::DP::Ph3::VoltageSource, CPS::EMT::Ph1::Capacitor, CPS::EMT::Ph1::CurrentSource, CPS::EMT::Ph1::Inductor, CPS::EMT::Ph1::Resistor, CPS::EMT::Ph1::Switch, CPS::EMT::Ph1::VoltageSource, CPS::EMT::Ph1::VoltageSourceNorton, CPS::EMT::Ph1::VoltageSourceRamp, CPS::EMT::Ph3::Capacitor, CPS::EMT::Ph3::ControlledCurrentSource, CPS::EMT::Ph3::ControlledVoltageSource, CPS::EMT::Ph3::CurrentSource, CPS::EMT::Ph3::Inductor, CPS::EMT::Ph3::NetworkInjection, CPS::EMT::Ph3::PiLine, CPS::EMT::Ph3::Resistor, CPS::EMT::Ph3::RxLine, CPS::EMT::Ph3::SeriesResistor, CPS::EMT::Ph3::SeriesSwitch, CPS::EMT::Ph3::SSN::Capacitor, CPS::EMT::Ph3::SSN::Full_Serial_RLC, CPS::EMT::Ph3::SSN::Inductor, CPS::EMT::Ph3::Switch, CPS::EMT::Ph3::SynchronGeneratorIdeal, CPS::EMT::Ph3::SynchronGeneratorTrStab, CPS::EMT::Ph3::Transformer, CPS::EMT::Ph3::VoltageSource, CPS::EMT::Ph3::VoltageSourceNorton, CPS::SP::Ph1::Capacitor, CPS::SP::Ph1::Inductor, CPS::SP::Ph1::NetworkInjection, CPS::SP::Ph1::PiLine, CPS::SP::Ph1::Resistor, CPS::SP::Ph1::RXLine, CPS::SP::Ph1::SolidStateTransformer, CPS::SP::Ph1::Switch, CPS::SP::Ph1::SynchronGeneratorTrStab, CPS::SP::Ph1::Transformer, CPS::SP::Ph1::varResSwitch, CPS::SP::Ph1::VoltageSource, CPS::SP::Ph3::Capacitor, CPS::SP::Ph3::Inductor, CPS::SP::Ph3::Resistor, CPS::SP::Ph3::RxLine, and CPS::SP::Ph3::VoltageSource.
Definition at line 23 of file SimPowerComp.cpp.
void SimPowerComp::connect | ( | typename SimNode< VarType >::List | nodes | ) |
Sets all nodes and checks for nominal number of Nodes for this Component.
Definition at line 265 of file SimPowerComp.cpp.
Bool SimPowerComp::hasSubComponents | ( | ) |
Returns true if subcomponents included in this component.
Definition at line 67 of file SimPowerComp.cpp.
Bool SimPowerComp::hasUnconnectedTerminals | ( | ) |
Definition at line 134 of file SimPowerComp.cpp.
Bool SimPowerComp::hasVirtualNodes | ( | ) |
Returns true if virtual node number is greater than zero.
Definition at line 63 of file SimPowerComp.cpp.
|
virtual |
Initialize components with correct network frequencies.
Reimplemented in CPS::DP::Ph1::Capacitor, CPS::DP::Ph1::Inductor, CPS::DP::Ph1::Inverter, CPS::DP::Ph1::ResIndSeries, CPS::DP::Ph1::VoltageSourceRamp, CPS::DP::Ph3::SynchronGeneratorDQ, CPS::DP::Ph3::SynchronGeneratorVBR, CPS::EMT::Ph1::VoltageSourceRamp, CPS::EMT::Ph3::SynchronGeneratorDQ, and CPS::EMT::Ph3::SynchronGeneratorVBR.
Definition at line 286 of file SimPowerComp.cpp.
|
inlinevirtual |
Initializes Component variables according to power flow data stored in Nodes.
Reimplemented in CPS::Base::ReducedOrderSynchronGenerator< VarType >, CPS::Base::ReducedOrderSynchronGenerator< Complex >, CPS::Base::ReducedOrderSynchronGenerator< Real >, CPS::DP::Ph1::AvVoltageSourceInverterDQ, CPS::DP::Ph1::Capacitor, CPS::DP::Ph1::CurrentSource, CPS::DP::Ph1::Inductor, CPS::DP::Ph1::Inverter, CPS::DP::Ph1::NetworkInjection, CPS::DP::Ph1::PiLine, CPS::DP::Ph1::PQLoadCS, CPS::DP::Ph1::ProfileVoltageSource, CPS::DP::Ph1::ResIndSeries, CPS::DP::Ph1::Resistor, CPS::DP::Ph1::RxLine, CPS::DP::Ph1::RXLoad, CPS::DP::Ph1::RXLoadSwitch, CPS::DP::Ph1::SVC, CPS::DP::Ph1::Switch, CPS::DP::Ph1::SynchronGeneratorIdeal, CPS::DP::Ph1::SynchronGeneratorTrStab, CPS::DP::Ph1::Transformer, CPS::DP::Ph1::varResSwitch, CPS::DP::Ph1::VoltageSource, CPS::DP::Ph1::VoltageSourceNorton, CPS::DP::Ph1::VoltageSourceRamp, CPS::DP::Ph3::Capacitor, CPS::DP::Ph3::Inductor, CPS::DP::Ph3::Resistor, CPS::DP::Ph3::SeriesResistor, CPS::DP::Ph3::SeriesSwitch, CPS::DP::Ph3::VoltageSource, CPS::EMT::Ph1::Capacitor, CPS::EMT::Ph1::CurrentSource, CPS::EMT::Ph1::Inductor, CPS::EMT::Ph1::Resistor, CPS::EMT::Ph1::Switch, CPS::EMT::Ph1::VoltageSource, CPS::EMT::Ph1::VoltageSourceNorton, CPS::EMT::Ph1::VoltageSourceRamp, CPS::EMT::Ph3::AvVoltageSourceInverterDQ, CPS::EMT::Ph3::Capacitor, CPS::EMT::Ph3::ControlledCurrentSource, CPS::EMT::Ph3::ControlledVoltageSource, CPS::EMT::Ph3::CurrentSource, CPS::EMT::Ph3::Inductor, CPS::EMT::Ph3::NetworkInjection, CPS::EMT::Ph3::PiLine, CPS::EMT::Ph3::Resistor, CPS::EMT::Ph3::RxLine, CPS::EMT::Ph3::RXLoad, CPS::EMT::Ph3::SeriesResistor, CPS::EMT::Ph3::SeriesSwitch, CPS::EMT::Ph3::SSN::Capacitor, CPS::EMT::Ph3::SSN::Full_Serial_RLC, CPS::EMT::Ph3::SSN::Inductor, CPS::EMT::Ph3::Switch, CPS::EMT::Ph3::SynchronGeneratorDQ, CPS::EMT::Ph3::SynchronGeneratorIdeal, CPS::EMT::Ph3::SynchronGeneratorTrStab, CPS::EMT::Ph3::SynchronGeneratorVBR, CPS::EMT::Ph3::Transformer, CPS::EMT::Ph3::VoltageSource, CPS::EMT::Ph3::VoltageSourceNorton, CPS::SP::Ph1::AvVoltageSourceInverterDQ, CPS::SP::Ph1::Capacitor, CPS::SP::Ph1::Inductor, CPS::SP::Ph1::Load, CPS::SP::Ph1::NetworkInjection, CPS::SP::Ph1::PiLine, CPS::SP::Ph1::Resistor, CPS::SP::Ph1::RXLine, CPS::SP::Ph1::SolidStateTransformer, CPS::SP::Ph1::Switch, CPS::SP::Ph1::SynchronGeneratorTrStab, CPS::SP::Ph1::Transformer, CPS::SP::Ph1::varResSwitch, CPS::SP::Ph1::VoltageSource, CPS::SP::Ph3::Capacitor, CPS::SP::Ph3::Inductor, CPS::SP::Ph3::Resistor, CPS::SP::Ph3::RxLine, and CPS::SP::Ph3::VoltageSource.
Definition at line 147 of file SimPowerComp.h.
Complex SimPowerComp::initialSingleVoltage | ( | UInt | index | ) |
Definition at line 107 of file SimPowerComp.cpp.
MatrixComp SimPowerComp::initialVoltage | ( | UInt | index | ) |
Definition at line 102 of file SimPowerComp.cpp.
const MatrixVar< VarType > & SimPowerComp::intfCurrent | ( | ) |
Definition at line 92 of file SimPowerComp.cpp.
const MatrixVar< VarType > & SimPowerComp::intfVoltage | ( | ) |
Definition at line 97 of file SimPowerComp.cpp.
UInt SimPowerComp::matrixNodeIndex | ( | UInt | nodeIndex | ) |
Definition at line 45 of file SimPowerComp.cpp.
UInt SimPowerComp::matrixNodeIndex | ( | UInt | nodeIndex, |
UInt | phaseIndex ) |
Definition at line 50 of file SimPowerComp.cpp.
std::vector< UInt > SimPowerComp::matrixNodeIndices | ( | UInt | index | ) |
TODO replace with access to mMatrixNodeIndices.
Definition at line 55 of file SimPowerComp.cpp.
SimNode< VarType >::Ptr SimPowerComp::node | ( | UInt | index | ) |
Get pointer to node.
Definition at line 37 of file SimPowerComp.cpp.
UInt SimPowerComp::nodeNumber | ( | ) |
Returns the actual number of Nodes / Terminals that are already set to valid Nodes.
Definition at line 212 of file SimPowerComp.cpp.
void SimPowerComp::setIntfCurrent | ( | MatrixVar< VarType > | current | ) |
Definition at line 117 of file SimPowerComp.cpp.
void SimPowerComp::setIntfVoltage | ( | MatrixVar< VarType > | voltage | ) |
Definition at line 122 of file SimPowerComp.cpp.
void SimPowerComp::setTerminalAt | ( | typename SimTerminal< VarType >::Ptr | terminal, |
UInt | terminalPosition ) |
Sets Terminal at index terminalPosition.
Definition at line 183 of file SimPowerComp.cpp.
void SimPowerComp::setTerminalNumber | ( | UInt | num | ) |
Definition at line 163 of file SimPowerComp.cpp.
void SimPowerComp::setTerminals | ( | typename SimTerminal< VarType >::List | terminals | ) |
Sets all Terminals of the component and checks if the number of Terminals is too large fir this component type.
Definition at line 171 of file SimPowerComp.cpp.
void SimPowerComp::setVirtualNodeAt | ( | typename SimNode< VarType >::Ptr | virtualNode, |
UInt | nodeNum ) |
Sets the virtual node at index nodeNum.
Definition at line 240 of file SimPowerComp.cpp.
void SimPowerComp::setVirtualNodeNumber | ( | UInt | num | ) |
Definition at line 228 of file SimPowerComp.cpp.
SimPowerComp< VarType >::List SimPowerComp::subComponents | ( | ) |
Get list of subcomponents.
Definition at line 72 of file SimPowerComp.cpp.
SimTerminal< VarType >::Ptr SimPowerComp::terminal | ( | UInt | index | ) |
Get pointer to Terminal.
Definition at line 146 of file SimPowerComp.cpp.
Bool SimPowerComp::terminalNotGrounded | ( | UInt | index | ) |
Definition at line 112 of file SimPowerComp.cpp.
UInt SimPowerComp::terminalNumber | ( | ) |
Returns nominal number of Terminals for this component type.
Definition at line 27 of file SimPowerComp.cpp.
UInt SimPowerComp::terminalNumberConnected | ( | ) |
Returns the number of connected Terminals.
Definition at line 128 of file SimPowerComp.cpp.
SimTerminal< VarType >::List SimPowerComp::terminals | ( | ) |
Return list of Terminal pointers.
Definition at line 32 of file SimPowerComp.cpp.
|
virtual |
Get nodes as base type TopologicalNode.
Implements CPS::TopologicalPowerComp.
Definition at line 218 of file SimPowerComp.cpp.
|
virtual |
Returns the list of terminals as TopologicalTerminal pointers.
Implements CPS::TopologicalPowerComp.
Definition at line 154 of file SimPowerComp.cpp.
void SimPowerComp::updateMatrixNodeIndices | ( | ) |
Update the "cached" mMatrixNodeIndices and mMatrixNodeIndexIsGround members.
Definition at line 199 of file SimPowerComp.cpp.
std::vector< UInt > SimPowerComp::virtualMatrixNodeIndices | ( | UInt | index | ) |
Get vector of simulation node numbers from virtual Node.
Definition at line 82 of file SimPowerComp.cpp.
SimNode< VarType >::Ptr SimPowerComp::virtualNode | ( | UInt | index | ) |
Get pointer to virtual node.
Definition at line 256 of file SimPowerComp.cpp.
SimNode< VarType >::List & SimPowerComp::virtualNodes | ( | ) |
Definition at line 77 of file SimPowerComp.cpp.
UInt SimPowerComp::virtualNodesNumber | ( | ) |
Returns nominal number of virtual nodes for this component type.
Definition at line 59 of file SimPowerComp.cpp.
UInt SimPowerComp::virtualSimNode | ( | UInt | nodeIndex, |
UInt | phaseIndex = 0 ) |
Get simulation node number from virtual node.
Definition at line 87 of file SimPowerComp.cpp.
|
protected |
List of considered network frequencies.
Definition at line 25 of file SimPowerComp.h.
const Attribute<MatrixVar<VarType>>::Ptr CPS::SimPowerComp< VarType >::mIntfCurrent |
Current through component.
Definition at line 47 of file SimPowerComp.h.
const Attribute<MatrixVar<VarType>>::Ptr CPS::SimPowerComp< VarType >::mIntfVoltage |
Voltage between terminals.
Definition at line 45 of file SimPowerComp.h.
|
protected |
"Cached" flags for whether the connected nodes are grounded
Definition at line 37 of file SimPowerComp.h.
|
protected |
"Cached" list of simulation nodes (to avoid shared_ptr accesses during simulation)
Definition at line 35 of file SimPowerComp.h.
|
protected |
Number of network frequencies.
Definition at line 27 of file SimPowerComp.h.
|
protected |
Definition at line 29 of file SimPowerComp.h.
|
protected |
List of subcomponents DEPRECATED: Delete or move into CompositePowerComp
Definition at line 33 of file SimPowerComp.h.
|
protected |
List of Terminals.
Definition at line 21 of file SimPowerComp.h.
|
protected |
List of virtual nodes.
Definition at line 23 of file SimPowerComp.h.