Modelling of Hydro
Modelling of Hydro
System description
Overview
A hydro power system is an human-made structure or arrangement of structures usually built
with the main purpose of generating electric power, though it may also be used for recreation,
flood mitigation or other reasons.
This system can be composed by lakes, reaches, dams, pumps, valves, turbines, ducts which
connect the elements. Some of these elements must be controlled, either manually or
automatically, in order to generate electricity while avoiding and minimizing the chances of flood
or other accidents, such as dam breaking. For that, some constraints are usually imposed at the
levels of the lakes and reaches, as well as on the flow rater of pipes and rivers.
In this series of post, we will see how to develop a model for an academic case of a hydro-
power system, how simulations can be used to predict possible scenarios in such system, and
how automatic control techniques can be used to keep track of certain properties of the system
and avoid problems, or optimize energy production, for example.
The hydro-power system
For the sake of simplicity, we will consider a system formed by 3 lakes and 3 reaches as shown
in the figure below
A lake is basically a reservoir of water, i.e a big tank with one or more inlets and outlets, where
water can accumulate (if there is more water entering the lake than leaving it). Such lakes may
be artificial (man-made) or natural. Artificial lakes are usually created by deviating a water
course or by excavation.
The lakes are interconnected using ducts, each one containing a controllable valve, turbine or
pump. These elements can be used to change the local flow rates.
A reach, as defined by USGS, is basically a river section with similar hydraulic attributes, such
as discharge, area and slope. There are other possible definitions but we will stick to this one.
Thus, a river with length of 100 km may be interpreted as a single reach if its properties are
more or less uniform, or it may be interpreted as multiple reaches, if its properties vary
significantly. In some cases, it may be worth to split a river into multiple reaches even when its
properties are uniform, since this approach can help in the modelling process.
The following table summarizes all the components of the system as shown in the figure above.
Element Description
L Lake
Element Description
P Pump
T Turbine
R Reach
V Valve
D Dam
In Inflow
Out Outflow
Definition of variables and assumptions
To simplify the model, we can take the following assumptions:
Negligible dynamics of valves, pumps and turbines. This may be assumed considering that the
fast dynamics of such elements when compared with the flow rates from the interconnected
elements, thus the flow rates are equal to their own set points;
Since the objective is to control electricity generation, while meeting some constraints, it’s
important to define which variables of the system are controlled, which are manipulated and
which are disturbances (uncontrollable inputs).
Controlled variables
flow rates in ducts and reaches,
levels of lakes and reaches
generated/consumed electric power
Manipulated variables
opening rate of valves, in terms of flow rate reference (ui);
opening rate of turbines, in terms of flow rate reference (ui);
imposed flow rate of pumps, in terms of flow rate reference(ui);
Disturbances/ Uncontrolled variables
water inflow due to upstream section
water inflow due to tributaries
dmdt=win(t)−wout(t)
Where m is the mass of water (kg), t is the time (s), win is the mass inflow rate (kg/s) and win is
the mass outflow rate (kg/s). The above equation can be rewritten as:
d(ρhA)dt=ρqin(t)−ρqout(t)
Where ρ is the density of water, h is the water level and A is the cross-section area of the lake.
Since any liquid can be reasonably considered incompressible (no change of volume with
pressure), the density ρ can be considered constant, and thus cancelled out. The cross-section
area A may be constant (like a cube) or it may be a function of the water level. For better
generalization.
d(hA(h))dt=qin(t)−qout(t)
The above equation is an ordinary differential equation, relating the rate of change of volume
(hA(h)) with the inlet and outlet flow rates. It can be solved using numerical integration, if all the
other variables (qi) are known
H=hup−hdown
p=K⋅q⋅H
q=−sign(H)⋅A⋅2g|H|
d(hA(h))dt=qin(t)−qout(t)
Let’s consider a very simple lake in the form of a cube. Thus, the cross section area is constant.
A≠A(t)
The equation simplifies to:
dhdt=qin(t)−qout(t)A
Say the outlet is regulated by a pump, with a constant flow rate of qout, and the inflow is a
sinusoidal flow with the shape, provided by a pump.
qin(t)=Aq+BqsinπtCq
dhdt=1A[Aq+BqsinπtCq−qout]
Call A∗=Aq−qout
dhdt=1A[A∗+BqsinπtCq]
Integrate it.
∫dh=1A∫(A∗+Bqsin(πtCq))dt
h=A∗tA−BqCAπcos(πtCq)+Const
Which gives us the general solution to this problem. Now let’s fix some numerical values for
simulation.
A=1
qout=5
Aq=5
Bq=2
Cq=1
h=−2πcos(πt)+Const
Apply initial condition t=0, h0=0
Const=2π
The final analytical solution is,
h=−2πcos(πt)+2π
The equation above is used to calculate the water level profile of the lake for any time t≥0, as
shown in the Figure below.
Figure 1 - Water level profile for first case.
A(h)=Eh2
Where E is a constant value. Let’s perform the same analytic integration process that was done
above.
(Eh2)dhdt=1A[A∗+BqsinπtCq]
Integrate it.
∫(Eh2)dh=1A∫(A∗+Bqsin(πtCq))dt
h=[3AEA∗t−3AEBqCqπcos(πtCq)+Const]13
Which gives us the general solution to this problem. Now let’s fix some numerical values for
simulation.
A=1
qout=5
Aq=5
Bq=2
Cq=1
E=1
h=[3EA∗t−3EBqCqπcos(πtCq)+Const]13
Apply initial condition t=0, h0=0
0=[−3EBqCqπ+Const]13
(0)3=([−3EBqCqπ+Const]13)3
3EBqCqπ=Const
The equation above is used to calculate the water level profile of the lake for any time t≥0, as
shown in the Figure below.