Commit a5d2f21b authored by Markus Mirz's avatar Markus Mirz
Browse files

rename TopologicalComponent

parent 106977eb
......@@ -97,7 +97,7 @@ namespace CIM {
/// as given in the component constructors (0 for the first node, -1 or GND for ground).
std::map<String, TopologicalNode::Ptr> mPowerflowNodes;
/// Maps the RID of a ConductingEquipment to a PowerflowEquipment
std::map<String, TopologicalComponent::Ptr> mPowerflowEquipment;
std::map<String, TopologicalPowerComp::Ptr> mPowerflowEquipment;
/// Maps the RID of a Terminal to a PowerflowTerminal
std::map<String, TopologicalTerminal::Ptr> mPowerflowTerminals;
///
......@@ -129,28 +129,28 @@ namespace CIM {
/// Returns simulation node index which belongs to mRID.
Matrix::Index mapTopologicalNode(String mrid);
/// Maps CIM components to CPowerSystem components.
TopologicalComponent::Ptr mapComponent(BaseClass* obj);
TopologicalPowerComp::Ptr mapComponent(BaseClass* obj);
/// Returns an RX-Line.
/// The voltage should be given in kV and the angle in degree.
/// TODO: Introduce different models such as PI and wave model.
TopologicalComponent::Ptr mapACLineSegment(IEC61970::Base::Wires::ACLineSegment* line);
TopologicalPowerComp::Ptr mapACLineSegment(IEC61970::Base::Wires::ACLineSegment* line);
/// Returns a transformer, either ideal or with RL elements to model losses.
TopologicalComponent::Ptr mapPowerTransformer(IEC61970::Base::Wires::PowerTransformer *trans);
TopologicalPowerComp::Ptr mapPowerTransformer(IEC61970::Base::Wires::PowerTransformer *trans);
/// Returns an IdealVoltageSource with voltage setting according to load flow data
/// at machine terminals. The voltage should be given in kV and the angle in degree.
/// TODO: Introduce real synchronous generator models here.
TopologicalComponent::Ptr mapSynchronousMachine(IEC61970::Base::Wires::SynchronousMachine* machine);
TopologicalPowerComp::Ptr mapSynchronousMachine(IEC61970::Base::Wires::SynchronousMachine* machine);
/// Returns an PQload with voltage setting according to load flow data.
/// Currently the only option is to create an RL-load.
/// The voltage should be given in kV and the angle in degree.
/// TODO: Introduce real PQload model here.
TopologicalComponent::Ptr mapEnergyConsumer(IEC61970::Base::Wires::EnergyConsumer* consumer);
TopologicalPowerComp::Ptr mapEnergyConsumer(IEC61970::Base::Wires::EnergyConsumer* consumer);
/// Adds CIM files to list of files to be parsed.
/// Returns an external grid injection.
TopologicalComponent::Ptr mapExternalNetworkInjection(IEC61970::Base::Wires::ExternalNetworkInjection* extnet);
TopologicalPowerComp::Ptr mapExternalNetworkInjection(IEC61970::Base::Wires::ExternalNetworkInjection* extnet);
/// Returns a shunt
TopologicalComponent::Ptr mapEquivalentShunt(IEC61970::Base::Equivalents::EquivalentShunt *shunt);
TopologicalPowerComp::Ptr mapEquivalentShunt(IEC61970::Base::Equivalents::EquivalentShunt *shunt);
public:
///
enum GeneratorType{Static, Transient};
......
......@@ -26,7 +26,7 @@
namespace CPS {
/// Base class for all components that are transmitting power.
template <typename VarType>
class SimPowerComp : public TopologicalComponent {
class SimPowerComp : public TopologicalPowerComp {
protected:
/// List of Terminals
......
......@@ -47,7 +47,7 @@ namespace CPS {
/// by a solver to split the network into subnetworks
IdentifiedObject::List mTearComponents;
/// Map of network components connected to network nodes
std::map<TopologicalNode::Ptr, TopologicalComponent::List> mComponentsAtNode;
std::map<TopologicalNode::Ptr, TopologicalPowerComp::List> mComponentsAtNode;
// #### Deprecated ####
// Better use mFrequencies
......
......@@ -32,7 +32,7 @@
namespace CPS {
/// Base class for all electrical components that are
/// connected to nodes via terminals
class TopologicalComponent : public IdentifiedObject {
class TopologicalPowerComp : public IdentifiedObject {
public:
enum Behaviour { Initialization, Simulation };
protected:
......@@ -49,19 +49,19 @@ namespace CPS {
Bool mBehaviour = Behaviour::Simulation;
public:
typedef std::shared_ptr<TopologicalComponent> Ptr;
typedef std::shared_ptr<TopologicalPowerComp> Ptr;
typedef std::vector<Ptr> List;
/// Basic constructor that takes UID, name and log level
TopologicalComponent(String uid, String name, Logger::Level logLevel = Logger::Level::off)
TopologicalPowerComp(String uid, String name, Logger::Level logLevel = Logger::Level::off)
: IdentifiedObject(uid, name), mLogLevel(logLevel) {
mSLog = Logger::get(name, logLevel);
}
/// Basic constructor that takes name and log level and sets the UID to name as well
TopologicalComponent(String name, Logger::Level logLevel = Logger::Level::off)
: TopologicalComponent(name, name, logLevel) { }
TopologicalPowerComp(String name, Logger::Level logLevel = Logger::Level::off)
: TopologicalPowerComp(name, name, logLevel) { }
/// Destructor - does not do anything
virtual ~TopologicalComponent() { }
virtual ~TopologicalPowerComp() { }
/// Returns nodes connected to this component
virtual TopologicalNode::List topologicalNodes() = 0;
......
......@@ -85,7 +85,7 @@ Real Reader::unitValue(Real value, UnitMultiplier mult) {
return value;
}
TopologicalComponent::Ptr Reader::mapComponent(BaseClass* obj) {
TopologicalPowerComp::Ptr Reader::mapComponent(BaseClass* obj) {
if (ACLineSegment *line = dynamic_cast<ACLineSegment*>(obj))
return mapACLineSegment(line);
if (EnergyConsumer *consumer = dynamic_cast<EnergyConsumer*>(obj))
......@@ -166,7 +166,7 @@ void Reader::parseFiles() {
// Check if object is already in equipment list
if (mPowerflowEquipment.find(idObj->mRID) == mPowerflowEquipment.end()) {
TopologicalComponent::Ptr comp = mapComponent(obj);
TopologicalPowerComp::Ptr comp = mapComponent(obj);
if (comp)
mPowerflowEquipment.insert(std::make_pair(comp->uid(), comp));
}
......@@ -269,7 +269,7 @@ SystemTopology Reader::systemTopology() {
TopologicalNode::Ptr node=term->topologicalNodes();
//TopologicalNode::Ptr node = powercomp->topologicalTerminals().back()->topologicalNodes();
if (system.mComponentsAtNode.find(node) == system.mComponentsAtNode.end()) {
TopologicalComponent::List complist;
TopologicalPowerComp::List complist;
complist.push_back(powercomp);
system.mComponentsAtNode.insert(std::make_pair(node, complist));
}
......@@ -299,7 +299,7 @@ Matrix::Index Reader::mapTopologicalNode(String mrid) {
return search->second->matrixNodeIndex();
}
TopologicalComponent::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
TopologicalPowerComp::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
mSLog->info(" Found EnergyConsumer {}", consumer->name);
if (mDomain == Domain::EMT) {
if (mPhase == PhaseType::ABC) {
......@@ -335,7 +335,7 @@ TopologicalComponent::Ptr Reader::mapEnergyConsumer(EnergyConsumer* consumer) {
}
}
TopologicalComponent::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
TopologicalPowerComp::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
mSLog->info(" Found ACLineSegment {} r={} x={} bch={} gch={}", line->name,
(float) line->r.value,
(float) line->x.value,
......@@ -405,7 +405,7 @@ TopologicalComponent::Ptr Reader::mapACLineSegment(ACLineSegment* line) {
}
TopologicalComponent::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
TopologicalPowerComp::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
if (trans->PowerTransformerEnd.size() != 2) {
mSLog->warn("PowerTransformer {} does not have exactly two windings, ignoring", trans->name);
return nullptr;
......@@ -525,7 +525,7 @@ TopologicalComponent::Ptr Reader::mapPowerTransformer(PowerTransformer* trans) {
}
}
TopologicalComponent::Ptr Reader::mapSynchronousMachine(SynchronousMachine* machine) {
TopologicalPowerComp::Ptr Reader::mapSynchronousMachine(SynchronousMachine* machine) {
mSLog->info(" Found Synchronous machine {}", machine->name);
if (mGeneratorType == GeneratorType::Transient) {
......@@ -610,7 +610,7 @@ TopologicalComponent::Ptr Reader::mapSynchronousMachine(SynchronousMachine* mach
}
}
TopologicalComponent::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInjection* extnet) {
TopologicalPowerComp::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInjection* extnet) {
mSLog->info("Found External Network Injection {}", extnet->name);
if (mDomain == Domain::EMT) {
if (mPhase == PhaseType::ABC) {
......@@ -633,7 +633,7 @@ TopologicalComponent::Ptr Reader::mapExternalNetworkInjection(ExternalNetworkInj
return nullptr; // DP network injection not considered yet
}
TopologicalComponent::Ptr Reader::mapEquivalentShunt(EquivalentShunt* shunt){
TopologicalPowerComp::Ptr Reader::mapEquivalentShunt(EquivalentShunt* shunt){
mSLog->info("Found shunt {}", shunt->name);
Real baseVoltage = 0;
......@@ -732,7 +732,7 @@ void Reader::processTopologicalNode(IEC61970::Base::Topology::TopologicalNode* t
// Insert Equipment if it does not exist in the map and add reference to Terminal.
// This could be optimized because the Equipment is searched twice.
if (mPowerflowEquipment.find(equipment->mRID) == mPowerflowEquipment.end()) {
TopologicalComponent::Ptr comp = mapComponent(equipment);
TopologicalPowerComp::Ptr comp = mapComponent(equipment);
if (comp) {
mPowerflowEquipment.insert(std::make_pair(equipment->mRID, comp));
} else {
......
......@@ -23,7 +23,7 @@ using namespace CPS;
template <typename VarType>
SimPowerComp<VarType>::SimPowerComp(String uid, String name, Logger::Level logLevel)
: TopologicalComponent(uid, name, logLevel) {
: TopologicalPowerComp(uid, name, logLevel) {
addAttribute<MatrixVar<VarType>>("v_intf", &mIntfVoltage, Flags::read);
addAttribute<MatrixVar<VarType>>("i_intf", &mIntfCurrent, Flags::read);
mTerminals.clear();
......
......@@ -247,9 +247,9 @@ Graph::Graph SystemTopology::topologyGraph() {
if (!comp) // TODO: this is a bug in the CIM::Reader!
continue;
TopologicalComponent::Ptr topoComp;
TopologicalPowerComp::Ptr topoComp;
if (!(topoComp = std::dynamic_pointer_cast<TopologicalComponent>(comp)))
if (!(topoComp = std::dynamic_pointer_cast<TopologicalPowerComp>(comp)))
continue;
c = g.addNode(topoComp->uid());
......
......@@ -84,8 +84,8 @@ void MnaSolver<VarType>::initialize() {
// Some components feature a different behaviour for simulation and initialization
for (auto comp : mSystem.mComponents) {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Simulation);
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalPowerComp>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalPowerComp::Behaviour::Simulation);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp) sigComp->setBehaviour(SimSignalComp::Behaviour::Simulation);
......@@ -394,8 +394,8 @@ void MnaSolver<VarType>::steadyStateInitialization() {
Matrix prevLeftSideVector = Matrix::Zero(2 * mNumNodes, 1);
for (auto comp : mSystem.mComponents) {
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalComponent>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalComponent::Behaviour::Initialization);
auto powerComp = std::dynamic_pointer_cast<CPS::TopologicalPowerComp>(comp);
if (powerComp) powerComp->setBehaviour(TopologicalPowerComp::Behaviour::Initialization);
auto sigComp = std::dynamic_pointer_cast<CPS::SimSignalComp>(comp);
if (sigComp) sigComp->setBehaviour(SimSignalComp::Behaviour::Initialization);
......
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