DPsim
Base_Ph1_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 Ph1 {
17 class Transformer {
18 public:
31 
32  explicit Transformer(CPS::AttributeList::Ptr attributeList)
34  attributeList->create<Real>("nominal_voltage_end1")),
36  attributeList->create<Real>("nominal_voltage_end2")),
37  mRatedPower(attributeList->create<Real>("S")),
38  mRatio(attributeList->create<Complex>("ratio")),
39  mResistance(attributeList->create<Real>("R")),
40  mInductance(attributeList->create<Real>("L")){};
41 
43  void setParameters(Real nomVoltageEnd1, Real nomVoltageEnd2, Real ratioAbs,
44  Real ratioPhase, Real resistance, Real inductance) {
45  **mNominalVoltageEnd1 = nomVoltageEnd1;
46  **mNominalVoltageEnd2 = nomVoltageEnd2;
47  **mRatio = std::polar<Real>(ratioAbs, ratioPhase);
48  **mResistance = resistance;
49  **mInductance = inductance;
50  }
51 };
52 } // namespace Ph1
53 } // namespace Base
54 } // namespace CPS
const Attribute< Real >::Ptr mRatedPower
Rated Apparent Power [VA].
const Attribute< Real >::Ptr mInductance
Inductance [H].
const Attribute< Real >::Ptr mNominalVoltageEnd2
Nominal voltage of secondary side.
const Attribute< Real >::Ptr mNominalVoltageEnd1
Nominal voltage of primary side.
const Attribute< Real >::Ptr mResistance
Resistance [Ohm].
const Attribute< Complex >::Ptr mRatio
Complex transformer ratio.