DPsim
Loading...
Searching...
No Matches
HydroTurbineGovernor.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<HydroGovernorParameters> {
15public:
17 Real R = 0;
19 Real T1 = 0;
21 Real T2 = 0;
23 Real T3 = 0;
25 Real Pmax = 0;
27 Real Pmin = 0;
29 Real OmRef = 0;
30};
31
37class HydroTurbineGovernor : public SimSignalComp,
38 public Base::Governor,
39 public SharedFactory<HydroTurbineGovernor> {
40private:
41 std::shared_ptr<HydroGovernorParameters> mParameters;
42
43 // ### Setpoints ###
44 Real mPref = 0;
45
46 // ### State variables (previous step) ###
47 Real mDelOm_prev = 0;
48 Real mX1_prev = 0;
49 Real mX2_prev = 0;
50
51 // ### State variables (current step) — loggable via .attr() ###
53 const Attribute<Real>::Ptr mDelOm;
55 const Attribute<Real>::Ptr mX1;
57 const Attribute<Real>::Ptr mX2;
59 const Attribute<Real>::Ptr mPgv;
60
61 // ### Auxiliary variables computed in initializeStates ###
62 Real mCa = 0;
63 Real mCb = 0;
64
65public:
66 HydroTurbineGovernor(const String &name,
67 CPS::Logger::Level logLevel = CPS::Logger::Level::off);
68
69 void
70 setParameters(std::shared_ptr<Base::GovernorParameters> parameters) final;
71 void initializeStates(Real Pref) final;
72 Real step(Real Omega, Real dt) final;
73};
74
75} // namespace Signal
76} // namespace CPS
Base model for Governors.
Real T3
Time constant of the second PT1 block (lag, denominator)
Real Pmin
Minimum mechanical power (pu)
Real T2
Time constant of the lead numerator.
Real OmRef
Speed setpoint (pu); typically 1.
Real T1
Time constant of the first PT1 block (lag, denominator)
Real Pmax
Maximum mechanical power (pu)
Real step(Real Omega, Real dt) final
Step the governor and return the valve/gate opening signal Pgv.
void initializeStates(Real Pref) final
Set steady-state initial values (call after setParameters, before first step)