DPsim
Base_Ph3_Transformer.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/AttributeList.h>
12 #include <dpsim-models/Definitions.h>
13 
14 namespace CPS {
15 namespace Base {
16 namespace Ph3 {
17 class Transformer {
18 protected:
26  Matrix mResistance;
28  Matrix mInductance;
29 
30 public:
33 
34  explicit Transformer(CPS::AttributeList::Ptr attributeList)
35  : mRatio(attributeList->create<Complex>("ratio")){};
36 
38  void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratedPower,
39  Real ratioAbs, Real ratioPhase, Matrix resistance,
40  Matrix inductance) {
41  mNominalVoltageEnd1 = nomVoltageEnd1;
42  mNominalVoltageEnd2 = nomVoltageEnd2;
43  mRatedPower = ratedPower;
44  **mRatio = std::polar<Real>(ratioAbs, ratioPhase);
45  mResistance = resistance;
46  mInductance = inductance;
47  }
48 };
49 } // namespace Ph3
50 } // namespace Base
51 } // namespace CPS
Real mNominalVoltageEnd1
Nominal voltage of primary side.
Real mNominalVoltageEnd2
Nominal voltage of secondary side.
const Attribute< Complex >::Ptr mRatio
Transformer ratio.
Matrix mResistance
Resistance [Ohm].
Matrix mInductance
Inductance [H].
Real mRatedPower
Rated Apparent Power [VA].