DPsim
SP_Ph1_SolidStateTransformer.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/CompositePowerComp.h>
12 #include <dpsim-models/SP/SP_Ph1_Load.h>
13 #include <dpsim-models/Solver/MNAInterface.h>
14 
15 namespace CPS {
16 namespace SP {
17 namespace Ph1 {
18 /* \brief Ideal solid state transformer
19  * Modelled as two loads at each side.
20  * Demands Pref, Q1 from side 1, and generate Pref, Q2 to side 2.
21  * Depends on the actual condition, values can be negative
22  */
23 class SolidStateTransformer : public CompositePowerComp<Complex>,
24  public SharedFactory<SolidStateTransformer> {
25 private:
27  std::shared_ptr<SP::Ph1::Load> mSubLoadSide1;
29  std::shared_ptr<SP::Ph1::Load> mSubLoadSide2;
30 
32  Real mP2 = std::numeric_limits<double>::infinity();
34  Real mNominalVoltageEnd1;
36  Real mNominalVoltageEnd2;
37  // Per Unit values
39  Real mPref_perUnit;
41  Real mP2_perUnit;
43  Real mQ1ref_perUnit;
45  Real mQ2ref_perUnit;
46 
47 public:
54 
56  SolidStateTransformer(String uid, String name,
57  Logger::Level logLevel = Logger::Level::off);
59  SolidStateTransformer(String name,
60  Logger::Level logLevel = Logger::Level::off)
61  : SolidStateTransformer(name, name, logLevel){};
63  SimPowerComp<Complex>::Ptr clone(String name);
64 
65  // #### Power Flow Section ####
67  void initializeFromNodesAndTerminals(Real frequency);
69  void setParameters(Real nomV1, Real nomV2, Real Pref, Real Q1ref, Real Q2ref);
71  void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega);
73  Complex getNodalInjection(CPS::TopologicalNode::Ptr node);
74 
75  // // #### MNA Section ####
76  // /// Initializes internal variables of the component
77  // void mnaCompInitialize(Real omega, Real timeStep, Attribute<Matrix>::Ptr leftVector);
78  // /// Stamps system matrix
79  // void mnaCompApplySystemMatrixStamp(SparseMatrixRow& systemMatrix);
80  // /// Updates internal current variable of the component
81  // void mnaCompUpdateCurrent(const Matrix& leftVector);
82  // /// Updates internal voltage variable of the component
83  // void mnaCompUpdateVoltage(const Matrix& leftVector);
84 };
85 
86 } // namespace Ph1
87 } // namespace SP
88 } // namespace CPS
Base class for composite power components.
String uid()
Returns unique id.
const Attribute< Real >::Ptr mQ2ref
Reactive power at secondary side [var].
const Attribute< Real >::Ptr mQ1ref
Reactive power at primary side [var].
void initializeFromNodesAndTerminals(Real frequency)
Initializes component.
const Attribute< Real >::Ptr mPref
Power [watt].
SimPowerComp< Complex >::Ptr clone(String name)
Returns a modified copy of the component with the given suffix added to the name and without.
Base class for all components that are transmitting power.
Definition: SimPowerComp.h:17
SimNode< Complex >::Ptr node(UInt index)
Get pointer to node.