# Using Optimisation Meta-Heuristics for the Roughness Estimation Problem in River Flow Analysis
## 3 Hydrodynamic River Flows Analysis
### Mathematical Formulation and Software Settings for Implementing the Model  
The simulations run for this piece of research are based on the'steady 1D case' computational model, which is mathematically described with the energy equation below  
\[z_{1}+h_{1}+\alpha_{1}\frac{v_{1}^{2}}{2g}=z_{2}+h_{2}+\alpha_{2}\frac{v_{2}^{ 2}}{2g}+h_{e}, \tag{2}\]  
where  
* \(z\) indicates the bottom elevation of the river;
* \(h\) is the river's water depth;
* \(v\) is the water's mean velocity in the channel cross-section at hand;
* the so-called St. Venant coefficient \(\alpha\) is a correction factor that takes into consideration undesired effects due to e.g., non-uniformity of the water's velocity in the considered profile of the river;
* \(g\) is the universal gravitational constant. It is worth pointing out that Equation (2) represents the case of gradually-varying flows with suitable hydrostatic pressure distribution. This model is implemented in the latest version of HEC-RAS, i.e., version 5.0.7 (as at the time of writing this article), which allows for setting the geometric data of the river in the convenient form of 'geo-referenced' files. Typically, these files follow the DEM (Digital Elevation Model) file format, as graphically shown in Figure 1. Setting the geometry for the simulation is an important step, which has to be concluded with implementing adequate upstream and downstream boundary conditions. The coordinate of the cross-sections of the river must be too defined by entering both the river station and elevation points from the left to the right bank in sequence along the river. A different number \(\varsigma\) of cross-sections are allocated along the the two rivers in this research:  
* \(\varsigma=20\) is used for the Paglia river--located as displayed in Figure 1a;
* \(\varsigma=40\) is used for the Aniene river--located as displayed Figure 1b;  
From this setting, it can be immediately noticed that estimating the Manning's coefficients for the Paglia and Aniene rivers with the method described in Section 2 results in optimising Equation (1) at \(n=60\) and \(n=120\) dimension values, respectively. After having defined the geometry, the river's discharge data need to be made available with the platform-specific file format to finalise the 1D steady model in HEC-RAS. At this point, the model can be used. Internally, HEC-RAS uses an empirical Manning's equation to simulate the relation between the river discharge, hydraulic resistance, river geometry, and friction energy loss. This has the form reported in Equation (3)  
\[Q=K\cdot S_{f}^{1/2}, \tag{3}\]  
where \(Q\) is the flow rate, or discharge, and \(K\) is the conveyance of the channel. HEC-RAS also deals with possible changes in the channel's geometry by assessing energy losses by using 'contraction' or 'expansion' coefficients. These are multiplicative factors for the change in the'velocity head' [32]. To compute the 'head loss' between two sections, Equation (4) is used, while the water surface is calculated through the energy equation reported in Equation (5) [32]. The analytical expression of the energy head loss \(h_{e}\) is as follows  
\[h_{e}=L\cdot S_{f}+C\left(\frac{\alpha_{1}v_{1}^{2}}{2g}+\frac{\alpha_{2}v_{2 }^{2}}{2g}\right), \tag{4}\]  
Figure 1: DEM images displaying the cross-sections for the two rivers Paglia (**a**) and Aniene (**b**). where \(S_{f}\) is the energy slope, \(g\) is the gravitational acceleration, \(C\) is the expansion/contraction coefficient, \(L\) is defined in Equation (6); \(\alpha_{1}\) and \(\alpha_{2}\) are the velocity weighting coefficients, while \(v_{1}\) and \(v_{2}\) the average velocities. The water surface level \(h\) is formally described by  
\[h=Z+y+\frac{\alpha v^{2}}{2g}. \tag{5}\]  
where \(Z\) is the river's bed elevation, \(y\) is the depth of flow, \(\alpha\) is the kinetic energy correlation coefficient, and \(v\) is the average velocity. Note that, in these equations, the subscripts 1 and 2 denote two different cross-sections in the same channel reach.