DPsim
TurbineGovernor.cpp
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 #include <dpsim-models/MathUtils.h>
10 #include <dpsim-models/Signal/TurbineGovernor.h>
11 
12 using namespace CPS;
13 using namespace CPS::Signal;
14 
15 void TurbineGovernor::setParameters(Real Ta, Real Tb, Real Tc, Real Fa, Real Fb,
16  Real Fc, Real K, Real Tsr, Real Tsm) {
17  mTa = Ta;
18  mTb = Tb;
19  mTc = Tc;
20  mFa = Fa;
21  mFb = Fb;
22  mFc = Fc;
23 
24  mK = K;
25  mTsr = Tsr;
26  mTsm = Tsm;
27 
28  SPDLOG_LOGGER_INFO(mSLog,
29  "Turbine parameters: \n"
30  "Ta: {:e}\nTb: {:e}\nTc: {:e}\n"
31  "Fa: {:e}\nFb: {:e}\nFc: {:e}\n",
32  mTa, mTb, mTc, mFa, mFb, mFc);
33 
34  SPDLOG_LOGGER_INFO(mSLog,
35  "Governor parameters: \n"
36  "K: {:e}\nTsr: {:e}\nTsm: {:e}\n",
37  mK, mTsr, mTsm);
38 }
39 
40 void TurbineGovernor::initialize(Real PmRef, Real Tm_init) {
41  mTm = Tm_init;
42  T1 = (1 - mFa) * PmRef;
43  T2 = mFa * PmRef;
44 
45  SPDLOG_LOGGER_INFO(mSLog,
46  "Turbine initial values: \n"
47  "init_Tm: {:e}\ninit_T1: {:e}\ninit_T2: {:e}\n",
48  mTm, T1, T2);
49 
50  mVcv = PmRef;
51  mpVcv = 0;
52  Psm_in = PmRef;
53 
54  SPDLOG_LOGGER_INFO(mSLog,
55  "Governor initial values: \n"
56  "init_Vcv: {:e}\ninit_pVcv: {:e}\ninit_Psm_in: {:e}\n",
57  mVcv, mpVcv, Psm_in);
58 }
59 
60 Real TurbineGovernor::step(Real Om, Real OmRef, Real PmRef, Real dt) {
61  // ### Governing ###
62  // Modelled according to V. Sapucaia-Gunzenhauser, "Modeling and Simulation of Rotating Machines", p.45
63 
64  // Input of speed relay
65  Psr_in = PmRef + (OmRef - Om) * mK;
66 
67  // Input of servor motor
68  Psm_in = Math::StateSpaceEuler(Psm_in, -1 / mTsr, 1 / mTsr, dt, Psr_in);
69 
70  // rate of change of valve
71  // including limiter with upper bound 0.1pu/s and lower bound -1.0pu/s
72  mpVcv = (Psm_in - mVcv) / mTsm;
73  if (mpVcv >= 0.1)
74  mpVcv = 0.1;
75  else if (mpVcv <= -1)
76  mpVcv = -1;
77 
78  // valve position
79  // including limiter with upper bound 1 and lower bound 0
80  mVcv = mVcv + dt * mpVcv;
81  if (mVcv >= 1)
82  mVcv = 1;
83  else if (mVcv <= 0)
84  mVcv = 0;
85 
86  // ### Turbine ###
87  // Simplified Single Reheat Tandem-Compound Steam Turbine
88  // Modelled according to V. Sapucaia-Gunzenhauser, "Modeling and Simulation of Rotating Machines", p.44
89 
90  T1 = Math::StateSpaceEuler(T1, -1 / mTb, 1 / mTb, dt, mVcv);
91  T2 = mVcv * mFa;
92  mTm = (mFb + mFc) * T1 + T2;
93 
94  return mTm;
95 }
Real Psm_in
Input of servor motor.
Real mVcv
Valve position.
Real mFb
Fraction of total turbine power generated by IP section.
Real mTsm
Time constant of servo motor.
Real mTb
Time constant of reheater.
Real mTa
Time constant of main inlet volume and steam chest.
Real mFc
Fraction of total turbine power generated by LP section.
Real mTc
Time constant of cross over piping and LP inlet volumes.
Real mpVcv
Valve position changing rate.
Real step(Real mOm, Real mOmRef, Real PmRef, Real dt)
Performs an step to update field voltage value.
Real mTsr
Time constant of speed relay.
Real mFa
Fraction of total turbine power generated by HP section.
Real mTm
Mechanical Torque in pu (output of steam turbine)
Real Psr_in
Input of speed realy.
void setParameters(Real Ta, Real Tb, Real Tc, Real Fa, Real Fb, Real Fc, Real K, Real Tsr, Real Tsm)
Initializes exciter parameters.
Logger::Log mSLog
Component logger.