DPsim
Loading...
Searching...
No Matches
EMT_Ph3_SynchronGeneratorTrStab.h
Go to the documentation of this file.
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
14
15namespace CPS {
16namespace EMT {
17namespace Ph3 {
23 public SharedFactory<SynchronGeneratorTrStab> {
24protected:
25 // #### Model specific variables ####
38 Matrix mStatorConductance = Matrix::Zero(3, 3);
40 // Logging
45
46public:
47 // #### Model specific variables ####
64 Logger::Level logLevel = Logger::Level::off);
67 Logger::Level logLevel = Logger::Level::off)
68 : SynchronGeneratorTrStab(name, name, logLevel) {}
69
71
76
77 // #### General Functions ####
79 void setInitialValues(Complex elecPower, Real mechPower);
81 void setFundamentalParametersPU(Real nomPower, Real nomVolt, Real nomFreq,
82 Real Ll, Real Lmd, Real Llfd, Real inertia,
83 Real D = 0);
85 void setStandardParametersSI(Real nomPower, Real nomVolt, Real nomFreq,
86 Int polePairNumber, Real Rs, Real Lpd,
87 Real inertiaJ, Real Kd = 0);
89 void setStandardParametersPU(Real nomPower, Real nomVolt, Real nomFreq,
90 Real Xpd, Real inertia, Real Rs = 0, Real D = 0);
92 void step(Real time);
94 void createSubComponents() override;
96 void initializeParentFromNodesAndTerminals(Real frequency) override;
97
98 // #### MNA Functions ####
100 void mnaParentInitialize(Real omega, Real timeStep,
101 Attribute<Matrix>::Ptr leftVector) override;
103 void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override;
104 void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override;
107 void mnaParentPreStep(Real time, Int timeStepCount) override;
109 void mnaParentPostStep(Real time, Int timeStepCount,
110 Attribute<Matrix>::Ptr &leftVector) override;
112 void mnaCompUpdateCurrent(const Matrix &leftVector) override;
114 void mnaCompUpdateVoltage(const Matrix &leftVector) override;
115
117 AttributeBase::List &prevStepDependencies,
118 AttributeBase::List &attributeDependencies,
119 AttributeBase::List &modifiedAttributes) override;
120 void
122 AttributeBase::List &attributeDependencies,
123 AttributeBase::List &modifiedAttributes,
124 Attribute<Matrix>::Ptr &leftVector) override;
125};
126} // namespace Ph3
127} // namespace EMT
128} // namespace CPS
std::vector< Ptr > List
Definition Attribute.h:123
AttributePointer< Attribute< T > > Ptr
Definition Attribute.h:249
Base synchronous generator model.
CompositePowerComp(String uid, String name, Bool hasPreStep, Bool hasPostStep, Logger::Level logLevel)
void setStandardParametersPU(Real nomPower, Real nomVolt, Real nomFreq, Real Xpd, Real inertia, Real Rs=0, Real D=0)
Initializes the machine parameters.
void mnaParentAddPostStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes, Attribute< Matrix >::Ptr &leftVector) override
const Attribute< Matrix >::Ptr mStatorVoltagePrevious
Stator R-L branch Norton companion state.
void mnaParentAddPreStepDependencies(AttributeBase::List &prevStepDependencies, AttributeBase::List &attributeDependencies, AttributeBase::List &modifiedAttributes) override
void mnaParentInitialize(Real omega, Real timeStep, Attribute< Matrix >::Ptr leftVector) override
Initializes variables of component.
void setStandardParametersSI(Real nomPower, Real nomVolt, Real nomFreq, Int polePairNumber, Real Rs, Real Lpd, Real inertiaJ, Real Kd=0)
Initializes the machine parameters.
void mnaCompUpdateCurrent(const Matrix &leftVector) override
SimPowerComp< Real >::Ptr clone(String name) override
Returns a modified copy of the component with the given suffix added to the name and without.
void mnaParentPostStep(Real time, Int timeStepCount, Attribute< Matrix >::Ptr &leftVector) override
Retrieves calculated voltage from simulation for next step.
SynchronGeneratorTrStab(String uid, String name, Logger::Level logLevel=Logger::Level::off)
void mnaParentApplyRightSideVectorStamp(Matrix &rightVector) override
const Attribute< Complex >::Ptr mEp
True after createSubComponents() runs; prevents double-construction.
void mnaCompUpdateVoltage(const Matrix &leftVector) override
Matrix parkTransformPowerInvariant(Real theta, const Matrix &fabc)
void mnaParentPreStep(Real time, Int timeStepCount) override
Complex mImpedance
Equivalent impedance for loadflow calculation.
void initializeParentFromNodesAndTerminals(Real frequency) override
void mnaParentApplySystemMatrixStamp(SparseMatrixRow &systemMatrix) override
Stamp the stator R-L Norton conductance and history current.
const Attribute< Real >::Ptr mDelta_p
Angle by which the emf Ep is leading the terminal voltage.
void setInitialValues(Complex elecPower, Real mechPower)
void createSubComponents() override
Constructs and registers MNA subcomponents without emf value; idempotent.
void setFundamentalParametersPU(Real nomPower, Real nomVolt, Real nomFreq, Real Ll, Real Lmd, Real Llfd, Real inertia, Real D=0)
Initializes the machine parameters.
Real mLpd
Absolute d-axis transient inductance.
SynchronGeneratorTrStab(String name, Logger::Level logLevel=Logger::Level::off)
Real mXpd
Absolute d-axis transient reactance X'd.
String uid()
Returns unique id.
spdlog::level::level_enum Level
Definition Logger.h:33
std::shared_ptr< SimPowerComp< VarType > > Ptr
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > Matrix
Dense matrix for real numbers.
Definition Definitions.h:79
std::string String
Definition Definitions.h:63
double Real
Definition Definitions.h:60
int Int
Definition Definitions.h:59
std::complex< Real > Complex
Definition Definitions.h:61
Eigen::SparseMatrix< Real, Eigen::RowMajor > SparseMatrixRow
Sparse matrix for real numbers (row major).
Definition Definitions.h:72