DPsim
Loading...
Searching...
No Matches
SteamTurbineGovernor.h
1// SPDX-FileCopyrightText: 2026 Institute for Automation of Complex Power Systems, EONERC, RWTH Aachen University
2// SPDX-License-Identifier: MPL-2.0
3
4#pragma once
5
6#include <dpsim-models/Base/Base_Governor.h>
7#include <dpsim-models/Logger.h>
8#include <dpsim-models/SimSignalComp.h>
9
10namespace CPS {
11namespace Signal {
12
14 public SharedFactory<SteamGovernorParameters> {
15public:
17 Real R = 0;
19 Real T1 = 0;
21 Real T2 = 0;
23 Real T3 = 0;
24
26 Real dPmax = 0;
28 Real dPmin = 0;
30 Real Pmax = 0;
32 Real Pmin = 0;
33
35 Real OmRef = 0;
36
38 Real Kbc = 0;
39};
40
45class SteamTurbineGovernor : public SimSignalComp,
46 public Base::Governor,
47 public SharedFactory<SteamTurbineGovernor> {
48private:
49 std::shared_ptr<SteamGovernorParameters> mParameters;
50
51 // ### Setpoints ###
52 Real mPref = 0;
53
54 // ### State variables (previous step) ###
55 Real mDelOm_prev = 0;
56 Real mDelOm_2prev = 0;
57 Real mP1_prev = 0;
58
59 // ### State variables (current step) — loggable via .attr() ###
61 const Attribute<Real>::Ptr mDelOm;
63 const Attribute<Real>::Ptr mP1;
65 const Attribute<Real>::Ptr mP;
67 const Attribute<Real>::Ptr mPgvLim;
69 const Attribute<Real>::Ptr mPgv;
70
71 // ### Auxiliar variables computed in initializeStates ###
72 Real mCa = 0;
73 Real mCb = 0;
74
75 // ### Internal transient ###
76 Real mDerPgv = 0;
77
78public:
79 explicit SteamTurbineGovernor(const String &name)
80 : SimSignalComp(name, name), mDelOm(mAttributes->create<Real>("DelOm")),
81 mP1(mAttributes->create<Real>("P1")),
82 mP(mAttributes->create<Real>("P")),
83 mPgvLim(mAttributes->create<Real>("PgvLim")),
84 mPgv(mAttributes->create<Real>("Pgv")) {}
85
86 SteamTurbineGovernor(const String &name, CPS::Logger::Level logLevel);
87
88 void
89 setParameters(std::shared_ptr<Base::GovernorParameters> parameters) final;
90 void initializeStates(Real Pref) final;
91 Real step(Real Omega, Real dt) final;
92};
93
94} // namespace Signal
95} // namespace CPS
Base model for Governors.
AttributeList::Ptr mAttributes
Attribute List.
Real Pmin
Minimum mechanical power (pu)
Real dPmax
Maximum rate of change of Pgv (pu/s)
Real T3
Time constant T3 of the actuator.
Real Pmax
Maximum mechanical power (pu)
Real dPmin
Minimum rate of change of Pgv (pu/s)
Real T2
T2 related to the lead in the controller K(1+sT2)
Real R
Droop — the value 1/K in the controller K(1+sT2)/(1+sT1)
Real OmRef
Speed setpoint (pu); typically 1.
Real T1
T1 related to the lag in the controller K(1+sT2)/(1+sT1)
Real Kbc
Anti-windup proportional gain.
void initializeStates(Real Pref) final
Set steady-state initial values (call after setParameters, before first step)
Real step(Real Omega, Real dt) final
Step the governor and return the valve/gate opening signal Pgv.