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