11 #include <dpsim-models/AttributeList.h>
12 #include <dpsim-models/Definitions.h>
13 #include <dpsim-models/Signal/Exciter.h>
14 #include <dpsim-models/Signal/TurbineGovernor.h>
31 enum class StateType { perUnit, statorReferred, rotorReferred };
36 void addGovernor(Real Ta, Real Tb, Real Tc, Real Fa, Real Fb, Real Fc, Real K,
37 Real Tsr, Real Tsm, Real Tm_init, Real PmRef);
39 void addExciter(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf,
134 Complex mInitElecPower = 0;
135 Complex mInitTermVoltage = 0;
136 Real mInitMechPower = 0;
269 Real mInitTerminalVoltage = 0;
270 Real mInitVoltAngle = 0;
274 :
mRs(attributeList->create<Real>(
"Rs", 0)),
275 mLl(attributeList->create<Real>(
"Ll", 0)),
276 mLd(attributeList->create<Real>(
"Ld", 0)),
277 mLq(attributeList->create<Real>(
"Lq", 0)),
278 mLd_t(attributeList->create<Real>(
"Ld_t", 0)),
279 mLq_t(attributeList->create<Real>(
"Lq_t", 0)),
280 mLd_s(attributeList->create<Real>(
"Ld_s", 0)),
281 mLq_s(attributeList->create<Real>(
"Lq_s", 0)),
282 mTd0_t(attributeList->create<Real>(
"Td0_t", 0)),
283 mTq0_t(attributeList->create<Real>(
"Tq0_t", 0)),
284 mTd0_s(attributeList->create<Real>(
"Td0_s", 0)),
285 mTq0_s(attributeList->create<Real>(
"Tq0_s", 0)),
286 mDelta(attributeList->create<Real>(
"delta_r", 0)),
287 mMechTorque(attributeList->create<Real>(
"T_m", 0)),
288 mInertia(attributeList->create<Real>(
"inertia", 0)),
289 mOmMech(attributeList->create<Real>(
"w_r", 0)),
292 mMechPower(attributeList->create<Real>(
"P_mech", 0)),
293 mElecTorque(attributeList->create<Real>(
"T_e", 0)){};
296 void setBaseParameters(Real nomPower, Real nomVolt, Real nomFreq);
298 void setBaseParameters(Real nomPower, Real nomVolt, Real nomFreq,
302 void calcStateSpaceMatrixDQ();
304 Real calcHfromJ(Real J, Real omegaNominal, Int polePairNumber);
312 Real nomFreq, Real nomFieldCur,
313 Int poleNumber, Real Rs, Real Ll,
314 Real Lmd, Real Lmq, Real Rfd,
315 Real Llfd, Real Rkd, Real Llkd,
316 Real Rkq1, Real Llkq1, Real Rkq2,
317 Real Llkq2, Real inertia);
322 Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber,
323 Real nomFieldCur, Real Rs, Real Ld, Real Lq, Real Ld_t, Real Lq_t,
324 Real Ld_s, Real Lq_s, Real Ll, Real Td0_t, Real Tq0_t, Real Td0_s,
325 Real Tq0_s, Real inertia);
328 void setFundamentalPerUnitParameters(Int poleNumber, Real Rs, Real Ll,
329 Real Lmd, Real Lmq, Real Rfd, Real Llfd,
330 Real Rkd, Real Llkd, Real Rkq1,
331 Real Llkq1, Real Rkq2, Real Llkq2,
335 void applyFundamentalPerUnitParameters();
338 void setAndApplyFundamentalPerUnitParameters(Int poleNumber, Real Rs, Real Ll,
339 Real Lmd, Real Lmq, Real Rfd,
340 Real Llfd, Real Rkd, Real Llkd,
341 Real Rkq1, Real Llkq1, Real Rkq2,
342 Real Llkq2, Real inertia);
345 void setOperationalPerUnitParameters(Int poleNumber, Real inertia, Real Rs,
346 Real Ld, Real Lq, Real Ll, Real Ld_t,
347 Real Lq_t, Real Ld_s, Real Lq_s,
348 Real Td0_t, Real Tq0_t, Real Td0_s,
352 void calculateFundamentalFromOperationalParameters();
355 void setInitialValues(Real initActivePower, Real initReactivePower,
356 Real initTerminalVolt, Real initVoltAngle,
Base synchronous generator model.
Matrix mIsr
Vector of stator and rotor currents.
StateType
State type of machine variables.
Real mNomFreq
nominal frequency fn [Hz]
Real mTimeStep
Simulation time step.
Real mDetLd
Determinant of d-axis inductance matrix.
Real mSystemOmega
Simulation angular system speed.
const Attribute< Real >::Ptr mLq_t
Transient q-axis inductance [H].
Real mRkq1
q-axis damper resistance 1 Rkq1 [Ohm]
Real mRcomp
Compensation Resistance.
Real mLmd
d-axis mutual inductance Lmd [H]
Real mBase_I
base stator current peak
Bool mHasExciter
Determines if Exciter is activated.
Real mLf
field winding inductance Lf [H]
Real mLad
Inductance to calculate magnetizing flux linkage from winding flux linkages.
std::shared_ptr< Signal::Exciter > mExciter
Signal component modelling voltage regulator and exciter.
const Attribute< Real >::Ptr mMechTorque
mechanical torque
Bool mCompensationOn
Determines if compensation elements are used.
const Attribute< Real >::Ptr mTq0_s
Subtransient time constant of q-axis [s].
Matrix mFluxToCurrentMat
Calculates currents from fluxes.
Real mLmq
q-axis mutual inductance Lmq [H]
SynchronGenerator(CPS::AttributeList::Ptr attributeList)
Constructor.
Real mLkq1
q-axis damper inductance 1 Lkq1 [H]
Real mBase_ifd
base field current
Real mBase_vfd
base field voltage
Real mBase_I_RMS
base stator current RMS
void setNumericalMethod(NumericalMethod method)
Switch to determine the integration method for the machine model.
Real mLkd
d-axis damper inductance Lkd [H]
Real mLlfd
field leakage inductance Llfd [H]
Int mPoleNumber
mNumber of poles
Bool mInitialValuesSet
Flag to remember when initial values are set.
Matrix mFluxStateSpaceMat
Flux state space matrix excluding omega term.
const Attribute< Real >::Ptr mTq0_t
Transient time constant of q-axis [s].
Real mLlkd
d-axis damper leakage inductance Llkd [H]
ParameterType
Machine parameters type.
const Attribute< Real >::Ptr mMechPower
mechanical Power Pm [W]
Real mNomVolt
nominal voltage Vn [V] (phase-to-phase RMS)
Matrix mVsr
Vector of stator and rotor voltages.
Matrix mPsisr
Vector of stator and rotor fluxes.
Real mBase_L
base stator inductance
const Attribute< Real >::Ptr mLq
q-axis inductance Lq [H]
Real mBase_Z
base stator impedance
void addExciter(Real Ta, Real Ka, Real Te, Real Ke, Real Tf, Real Kf, Real Tr)
Add voltage regulator and exciter.
const Attribute< Real >::Ptr mRs
stator resistance Rs [Ohm]
Matrix mResistanceMat
resistance matrix
Real mLkq2
q-axis damper inductance 2 Lkq2 [H]
Real mDetLq
Determinant of q-axis inductance matrix.
void addGovernor(Real Ta, Real Tb, Real Tc, Real Fa, Real Fb, Real Fc, Real K, Real Tsr, Real Tsm, Real Tm_init, Real PmRef)
Add governor and turbine.
const Attribute< Real >::Ptr mElecReactivePower
Reactive part of the electrical power.
const Attribute< Real >::Ptr mElecActivePower
Active part of the electrical power.
std::shared_ptr< Signal::TurbineGovernor > mTurbineGovernor
Signal component modelling governor control and steam turbine.
Matrix mOmegaFluxMat
Omega-flux matrix for state space system.
Real mLlkq1
q-axis damper leakage inductance 1 Llkq1 [H]
Matrix mIdq0
dq0 current calculated from terminal current
const Attribute< Real >::Ptr mLq_s
Subtransient q-axis inductance [H].
void setBaseAndFundamentalPerUnitParameters(Real nomPower, Real nomVolt, Real nomFreq, Real nomFieldCur, Int poleNumber, Real Rs, Real Ll, Real Lmd, Real Lmq, Real Rfd, Real Llfd, Real Rkd, Real Llkd, Real Rkq1, Real Llkq1, Real Rkq2, Real Llkq2, Real inertia)
Initializes the base and fundamental machine parameters in per unit.
Real mRkd
d-axis damper resistance Rkd [Ohm]
StateType mStateType
specifies if the machine parameters are transformed to per unit
Real mNomFieldCur
nominal field current Ifn [A]
Real mRfd
field resistance Rfd [Ohm]
Real mNomOmega
nominal angular frequency wn [Hz]
Real mLaq
Inductance to calculate magnetizing flux linkage from winding flux linkages.
Real mBase_OmElec
base electrical angular frequency
Matrix mVdq0
dq0 voltage calculated from terminal voltage
const Attribute< Real >::Ptr mLl
leakage inductance Ll [H]
const Attribute< Real >::Ptr mTd0_s
Subtransient time constant of d-axis [s].
Real mBase_OmMech
base mechanical angular frequency
Real mBase_Zfd
base field impedance
virtual ~SynchronGenerator()
Destructor - does nothing.
const Attribute< Real >::Ptr mDelta
rotor angle delta
Real mRkq2
q-axis damper resistance 2 Rkq2 [Ohm]
Real mLfd
field inductance Lfd [H]
const Attribute< Real >::Ptr mTd0_t
Transient time constant of d-axis [s].
Int mNumDampingWindings
Number of damping windings in q.
Real mBase_V
base stator voltage (phase-to-ground peak)
const Attribute< Real >::Ptr mLd
d-axis inductance Ld [H]
Matrix mInvInductanceMat
Inverse of the inductance matrix.
Real mBase_Psi
base flux linkage
Real mNomPower
nominal power Pn [VA]
void setBaseAndOperationalPerUnitParameters(Real nomPower, Real nomVolt, Real nomFreq, Int poleNumber, Real nomFieldCur, Real Rs, Real Ld, Real Lq, Real Ld_t, Real Lq_t, Real Ld_s, Real Lq_s, Real Ll, Real Td0_t, Real Tq0_t, Real Td0_s, Real Tq0_s, Real inertia)
Real mBase_Lfd
base field inductance
const Attribute< Real >::Ptr mOmMech
rotor speed omega_r
Bool mHasTurbineGovernor
Determines if Turbine and Governor are activated.
const Attribute< Real >::Ptr mLd_t
Transient d-axis inductance [H].
Real mLlkq2
q-axis damper leakage inductance 2 Llkq2 [H]
const Attribute< Real >::Ptr mLd_s
Subtransient d-axis inductance [H].
Matrix mInductanceMat
Inductance matrix which is numerically equal to the reactance matrix in per unit.
const Attribute< Real >::Ptr mInertia
inertia constant H [s] for per unit or moment of inertia J [kg*m^2]
const Attribute< Real >::Ptr mElecTorque
electrical torque
Real mBase_V_RMS
base stator voltage (phase-to-ground RMS)