DPsim
Loading...
Searching...
No Matches
HydroTurbine.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_Turbine.h>
7#include <dpsim-models/Logger.h>
8#include <dpsim-models/SimSignalComp.h>
9
10namespace CPS {
11namespace Signal {
12
14 public SharedFactory<HydroTurbineParameters> {
15public:
17 Real Tw = 0;
18};
19
25class HydroTurbine : public SimSignalComp,
26 public Base::Turbine,
27 public SharedFactory<HydroTurbine> {
28private:
29 std::shared_ptr<HydroTurbineParameters> mParameters;
30
31 // ### State variables (current step) — loggable via .attr() ###
33 const Attribute<Real>::Ptr mX1;
35 const Attribute<Real>::Ptr mPm;
36
37 // ### Staging variable for next step ###
38 Real mX1_next = 0;
39
40public:
41 HydroTurbine(const String &name,
42 CPS::Logger::Level logLevel = CPS::Logger::Level::off);
43
44 void setParameters(std::shared_ptr<Base::TurbineParameters> parameters) final;
45 void initializeStates(Real Pminit) final;
46 Real step(Real Pgv, Real dt) final;
47};
48
49} // namespace Signal
50} // namespace CPS
Base model for Turbines.
void initializeStates(Real Pminit) final
Set steady-state initial values (call after setParameters, before first step)
Real step(Real Pgv, Real dt) final
Step the turbine with valve/gate opening Pgv and return mechanical power Pm.
Real Tw
Water starting time (s)