DPsim
TopologicalTerminal.h
1 /* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2  * EONERC, RWTH Aachen University
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7  *********************************************************************************/
8 
9 #pragma once
10 
11 #include <dpsim-models/IdentifiedObject.h>
12 #include <dpsim-models/PtrFactory.h>
13 #include <dpsim-models/TopologicalNode.h>
14 
15 namespace CPS {
16 
18 public:
19  typedef std::shared_ptr<TopologicalTerminal> Ptr;
20  typedef std::vector<Ptr> List;
22  PhaseType mPhaseType;
24  MatrixComp mPower;
26  TopologicalTerminal(String uid, String name,
27  PhaseType phase = PhaseType::Single);
29  virtual ~TopologicalTerminal() {}
31  virtual TopologicalNode::Ptr topologicalNodes() = 0;
33  MatrixComp power() const;
35  Complex singlePower();
37  void setPower(Complex power);
39  void setPower(MatrixComp power);
41  void setPhaseType(PhaseType type);
43  Real singleActivePower();
45  Real singleReactivePower();
47  Complex initialSingleVoltage();
49  MatrixComp initialVoltage();
51  UInt matrixNodeIndex();
53  std::vector<UInt> matrixNodeIndices();
54 };
55 } // namespace CPS
String uid()
Returns unique id.
String type()
Get component type (cross-platform)
virtual TopologicalNode::Ptr topologicalNodes()=0
Returns reference to TopologicalNode.
MatrixComp power() const
Returns Power as complex matrix, where the size depends on the number of phases.
PhaseType mPhaseType
Determines the connection between Component and Node.
MatrixComp mPower
Power through the Terminal.
Complex singlePower()
Returns single complex number for power.