## 2 Materials and Methods
### Strategic Energy Management Optimization
#### 2.1.3 HOMER Model  
HOMER(r) 3.16.2 Pro is extensively utilized in the energy industry to assist with planning, designing, and evaluating microgrid projects, particularly those which integrate renewable energy sources [32; 33].  
This research aimed to evaluate the technical and performance viability of the system to be implemented by optimizing components towards the best combination that would minimize the energy derived from the grid and meet water-energy nexus requirements (Figure 4).  
Figure 3: HY4 RES model with microgrid definition.  
The model used solar radiation to generate electricity. Solar PV will be one of most important renewables in the future. The electricity generated by solar PV is calculated as follows:  
\[P_{PV}=Y_{PV}f_{PV}(\frac{G_{T}}{G_{T,STC}})[1+\alpha_{P}(T_{c}-T_{c,STC})] \tag{11}\]  
where  
\(Y_{PV}\) = power output during standard test conditions in kW.  
\(f_{PV}\) = derating factor of solar PV.  
\(G_{T}\) = incident solar irradiance in kW/m\({}^{2}\)  
\(G_{T,STC}\) = incident solar irradiance under standard test conditions, which is 1 kW/m\({}^{2}\).  
\(\alpha_{P}\) = temperature coefficient of power.  
\(T_{c}\) = cell temperature of solar PV in \({}^{\circ}\)C.  
\(T_{c,STC}\) = cell temperature under standard test conditions, which is 25 \({}^{\circ}\)C.  
In ports, another renewable energy system is wind energy. Many innovative wind turbine models are on the rise to harness wind energy on a micro scale. The wind turbine considered for our case study simulation was a generic micro wind turbine predefined by the model. It first calculated the wind speed at hub height using Equation (12):  
\[U_{hub}=U_{nenm}.\frac{\ln(\frac{Z_{hub}}{Z_{0}})}{\ln(\frac{Z_{norm}}{Z_{0}})} \tag{12}\]  
where  
\(U_{hub}\) = wind speed at the hub height of the wind turbine in m/s.  
\(U_{nenm}\) = wind speed at the anemometer height in m/s.  
\(Z_{hub}\) = hub height of the wind turbine in m.  
\(Z_{0}\) = surface roughness length in m.  
\(Z_{nenm}\) = anemometer height in m.  
The model considered the wind turbine's power curve to calculate the power generated by the wind turbine. To obtain the power generated under real conditions, the model used the following equation:  
\[P_{WTG}=\left(\frac{\rho}{\rho_{0}}\right).P_{WTG,STP} \tag{13}\]  
where  
\(P_{WTG}\) = output power of wind turbine in kW.  
\(P_{WTG,STP}\) = output power of wind turbine under standard conditions, in kW.  
\(\rho\) = actual air density in kg/m\({}^{3}\).  
\(\rho\) = air density at STP, which is 1.225 kg/m\({}^{3}\).  
Hydropower is one of the oldest techniques of energy generation. For this research, this power was too small, meaning that it was impossible to consider this element. However,  
Figure 4: HOMER® model with the microgrid definition.  
these turbines were represented by PATs. The calculation for the water turbines was conducted as follows:  
\[P_{hyd}=\text{${}_{hyd}$-$}\rho_{water}\text{-$g$-$}\text{$h$_{net}$}.\dot{Q}_{ turbine} \tag{14}\]  
where  
\(P_{hyd}=\text{hydro}\) turbine power output in kW.  
\(\text{${}_{hyd}$}=\text{efficiency}\) of hydro turbine in %.  
\(\rho_{water}=\text{water}\) density, which is 1000 kg/m\({}^{3}\).  
\(g=\text{acceleration}\) due to gravity, which is 9.81 m/s\({}^{2}\).  
\(h_{net}=\text{effective}\) head in m.  
\(\dot{Q}_{turbine}=\text{hydro}\) turbine flow rate in m\({}^{3}\)/s.  
After the definition of the hybrid solution and the respective restrictions imposed for each operational model, the obtained results first showed the influence of the behavior and functioning of the system in terms of energy (production/need) and, secondly, surplus and deficit aspects.