## 3 Case Study of the Port of Aviles
### Different Modeling Approaches
#### 3.2.2 HY4 RES Modeling
\[H_{need}^{i}=E_{n}^{i}-\left(S+W\right)^{i},\;\;If>0 \tag{18}\]  
\[\text{Else }P_{S}^{i}=S_{s+w}^{i}\;,\;If>0 \tag{19}\]  
Regarding PAT operation, the PHS system only produces hydropower if there is enough water stored in the top reservoir (Equation (20)) and in reverse mode as a pump (Equation (21)). \[V_{R}^{i-1}-V_{t}^{i}\geq V_{min} \tag{20}\]  
\[V_{R}^{i-1}+V_{p}^{i}\leq V_{max} \tag{21}\]  
Figure 12: HY4 RES results for Scenario 3: hybrid energy system of microgrid module balance. where \(V_{R}^{i-1}\) corresponds to the reservoir volume at the end of the previous hour, \(V_{t}^{i}\) to the turbine volume, both in m\({}^{3}\), and \(V_{p}^{i}\) corresponds to the pumped volume in m\({}^{3}\). The turbine volume can be computed using Equation (22), based on [31; 32]:  
\[V_{t}^{i}=\frac{\alpha.H_{need}^{i}.3600.10^{3}}{9800.\eta_{t}.H_{t}} \tag{22}\]  
where the variable (\(\alpha\)) is the hydropower factor, with a value between 0 and 1; \(H_{need}^{i}\) is the required hydropower energy for energy needs, in kWh; \(\eta_{t}\) the average turbine + generator efficiency; and \(H_{t}\) is the average turbine head. In the pump mode, the feasible renewable energy for the pump (\(P_{F-S}^{i}\)) in kWh can be obtained by Equation (23):  
\[P_{F-S}^{i}=\beta\cdot P_{S}^{i} \tag{23}\]  
The grid contribution for the pump station plus the available renewable energy for the pump (\(P_{S}^{i}\)) multiplied by its factor (\(\beta\)) is less than or equal to the nominal power (\(P_{N}\)), as described by Equation (24). \[If\ \ \beta\cdot P_{S}^{i}+\gamma\cdot P_{N}\leq P_{N} \tag{24}\]  
Based on the storage capacity and power output, energy production can be estimated using Equation (25). \[E\ [\text{kWh}]=9.81\ \rho_{water}\ \text{Vres}\ H\text{head}\ \eta/(3.6\times 10^{6}) \tag{25}\]  
where  
* \(E\) is the energy stored in kWh;
* \(\rho_{water}\) is the density of water, 1000 kg/m\({}^{3}\);
* _Vres_ is the volume of water in the upper reservoir in m\({}^{3}\);
* _Hhead_ is the available head in m;
* \(\eta\) is the efficiency of the energy conversion considering losses for turbine efficiency and generator efficiency. The rated power of the PAT (in turbine mode) formerly defined limited the energy that could be produced, despite the existence of hours with an unsatisfied load above 0.2 kW. This immediately required the assistance of the grid. Also, the selected reservoir capacity proposed for this module was 10 m\({}^{3}\), while the maximum discharge flow was 39.6 m\({}^{3}\)/h (Figure 13). This volume was not ideal and limited the feasible PAT production. After the optimization, the maximum discharge flow registered was 9.7 m\({}^{3}\)/h (2.7 L/s) with a power production of 0.05 kW (1/4 of the rated power). Due to the low reservoir capacity, low installed power, and small head value, the feasible hydropower production from the PAT was substantially low: 5.5 kWh/year, corresponding to only 1% of the required PAT production to meet the leftover energy needs. This produced a total of 604.3 kWh of energy needs not ensured by the system, which eventually required assistance from the external grid in the port. This scenario benefited from grid connection as it could export more renewable excess than what it imported to ensure the fulfilment of remaining energy needs, in which the total renewable excess not consumed by the demand of pump operation of the PAT/PHS subsystem was equal to 2666.7 kWh. * _Scenario 5--HY4 RES Modeling: Solar, Wind, and Hydrokinetic Energy and BESS_: This scenario used a battery storage system to store the excess renewable energy and ensure the energy needs when these were insufficient. The optimization required a battery capacity of 15 kWh to ensure 100% of the defined demand. The maximum capacity required was mainly due to peak consumption during the first three months of the year. If the hybrid energy system module was connected to the grid, the battery capacity could be reduced and instead rely on the grid to ensure peak loads (Figure 14).