This note reformulates the hydropower-control study around the current OpenHPL library from USN/OpenSimHub. OpenHPL is an equation-based Modelica library that contains hydraulic components, turbine and generator models, power-system interfaces, and governor models. The purpose here is to identify the mathematical structure behind those components before reducing them for FCR/LFC analysis.
A representative chain is
$$\text{Reservoir}\to\text{Pipe/PenstockKP}\to\text{SurgeTank}\to\text{Francis}\to\text{shaft}\to\text{Generator}\to\text{Grid}.$$The main OpenHPL packages used in this chain are Waterway, ElectroMech.Turbines, ElectroMech.Generators, ElectroMech.PowerSystem, Controllers, and Interfaces.
OpenHPL components are assembled through conservation laws and constitutive equations. The complete plant may therefore be written as
$$F(\dot x,x,z,u,\theta)=0,$$or, after separating differential and algebraic equations,
$$\dot x=f(x,z,u,\theta),\qquad 0=g(x,z,u,\theta).$$The state vector is not fixed a priori. It depends on which OpenHPL variants are selected. A simple waterway may have only a few lumped states; PenstockKP contributes pressure and mass-flow states in every finite-volume cell.
OpenHPL's Reservoir can be constant-level, externally level-driven, inflow-driven, or dynamically drained. In its simple hydrostatic form,
With reservoir dynamics, the library uses mass and momentum balances. In compact form,
$$\frac{dm}{dt}=\dot m_i-\dot m_o,$$with a momentum balance that includes pressure force, gravity, friction and inflow/outflow momentum terms.
The recommended detailed elastic model is PenstockKP. Its conservative state is
and the governing PDE is written as
$$\frac{\partial U}{\partial t}+\frac{\partial F(U)}{\partial x}=S(U).$$For $N$ finite-volume cells, OpenHPL forms a semi-discrete ODE system
$$\dot U_j=-\frac{F_{j+1/2}-F_{j-1/2}}{\Delta x}+S_j,$$with compressibility and optional pipe-wall elasticity. Thus a detailed penstock can contribute roughly $2N$ hydraulic states before boundary constraints are considered.
The Francis turbine model couples hydraulic and rotational variables. The shaft power is based on an Euler-turbine balance. In simplified notation,
$$P_s=\dot m\,\omega R_1 c_{u1}-\dot m\,\omega R_2 c_{u2},$$with runner losses and guide-vane geometry added explicitly. The turbine therefore maps hydraulic pressure, flow and guide-vane position to mechanical power and torque.
For the OpenHPL simple generator, the rotating kinetic energy is
$$K=\frac12J\omega^2,$$and the energy balance is
$$\frac{dK}{dt}=P_s-P_f-P_g.$$This provides the rotor-frequency dynamic state. More detailed synchronous-generator models are also available.
The physical plant and the governor should be distinguished conceptually. The plant is an acausal multi-domain DAE. The governor reads frequency and power-reference signals and outputs guide-vane position. The two are coupled through
$$y_g\longrightarrow \text{Francis guide vane}\longrightarrow P_m\longrightarrow \omega,$$and feedback
$$\omega\longrightarrow f\longrightarrow \text{Governor}.$$A schematic full state vector can be written as
$$x=\begin{bmatrix}x_{res}&p_1&\cdots&p_N&\dot m_1&\cdots&\dot m_N&x_{st}&\omega&x_g\end{bmatrix}^T.$$The important conclusion is that OpenHPL does not imply a five-state plant. Five states may be a reduced control-oriented approximation; the detailed nonlinear model can have many more states.
The analytical path used in the following notes is
$$F(\dot x,x,z,u)=0\to(x^\star,z^\star,u^\star)\to E\Delta\dot x=A\Delta x+B\Delta u\to G(s),$$followed by droop/FCR and secondary-control studies.