DPsim
Loading...
Searching...
No Matches
SP_Ph1_Shunt.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#include <dpsim-models/SimPowerComp.h>
11#include <dpsim-models/Solver/PFSolverInterfaceBranch.h>
12
13namespace CPS {
14
15namespace SP {
16namespace Ph1 {
17
18class Shunt : public SimPowerComp<Complex>,
19 public SharedFactory<Shunt>,
21public:
23 const Attribute<Real>::Ptr mConductance;
25 const Attribute<Real>::Ptr mSusceptance;
27 const Attribute<Real>::Ptr mConductancePerUnit;
29 const Attribute<Real>::Ptr mSusceptancePerUnit;
30
31private:
33 Real mBaseVoltage;
34
35public:
37 Shunt(String uid, String name, Logger::Level logLevel = Logger::Level::off);
38
40 Shunt(String name, Logger::Level logLevel = Logger::Level::off)
41 : Shunt(name, name, logLevel) {}
42
43 // #### General ####
45 void setParameters(Real conductance, Real susceptance);
46
47 // #### Powerflow section ####
49 void setBaseVoltage(Real baseVoltage);
51 void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega);
53 void pfApplyAdmittanceMatrixStamp(SparseMatrixCompRow &Y);
54};
55} // namespace Ph1
56} // namespace SP
57} // namespace CPS
String uid()
Returns unique id.
Common base class of all Component templates.
const Attribute< Real >::Ptr mConductance
Conductance [S].
const Attribute< Real >::Ptr mSusceptance
Susceptance [S].
void setBaseVoltage(Real baseVoltage)
Set base voltage.
void pfApplyAdmittanceMatrixStamp(SparseMatrixCompRow &Y)
Stamps admittance matrix.
Shunt(String uid, String name, Logger::Level logLevel=Logger::Level::off)
Defines UID, name, component parameters and logging level.
const Attribute< Real >::Ptr mSusceptancePerUnit
Susceptance [pu].
const Attribute< Real >::Ptr mConductancePerUnit
Conductance [pu].
void calculatePerUnitParameters(Real baseApparentPower, Real baseOmega)
Initializes component from power flow data.
void setParameters(Real conductance, Real susceptance)
Set shunt specific parameters.
Shunt(String name, Logger::Level logLevel=Logger::Level::off)
Defines name and logging level.
SimPowerComp(String uid, String name, Logger::Level logLevel=Logger::Level::off)