**1. Introduction**

Water and its managemen<sup>t</sup> is one of the more important current and future global challenges. Its variability can cause cloudbursts, making sewers to overflow, while the scarcity of water in other components involves public services and reduces irrigation [1]. Hence, an efficient managemen<sup>t</sup> of water irrigation networks is crucial for facing future challenges related to the energy-water nexus, considering the importance of irrigation in the whole planet [2]. The development of the modernization of irrigation systems in agriculture (replacing open channel with pressurized irrigation) has considerably increased energy consumption in recent years [3]. Nevertheless, the establishment of drip irrigation has made more efficient systems in water consumption but not in energy demand.

Spain is not an exception: The annual irrigation volume consumed in Spain is 16.344 km3/year [4] and the global irrigation consumption in pressure systems approaches 3925 km3/year [5]. Consequently, the theoretical energy recoverable could be a significant amount.

In Spain, the drip irrigated area (*i.e.*, 1.7 of 3.54 million of hectares are irrigated by pressure systems) [6] represents 17.56% of the world's surface irrigated by localized drip (approximately 9 million hectares) [7]. The high energy consumption and the rising cost of tariff have reduced profits or even the viability of farms [8]. The need to study strategies to decrease the energy consumption in these installations is pointed out in the consulted references. Regarding this issue, Coehlo *et al.* established the need to study the recovery in water distribution systems for increasing the energy efficiency, since the energy consumption in water networks involves 7% of the global energy consumption [9]. The objectives of this recovery are: to reduce the energy footprint of water in irrigation system and to lessen greenhouse emissions compared with other non-renewable energy sources.

Water-energy nexus analysis has become a crucial issue in recent years [3,10–13]. Baki *et al.* [10] studied water-energy interactions in water systems in Athens. Okadera *et al.* [11] and Herath *et al.* [12] analyzed water footprints of hydroelectricity. Water managemen<sup>t</sup> improvement in irrigation networks have also been analyzed in [14], where a 40% irrigation reduction volume was achieved.

Sustainable social and economic growth based on renewable energy sources forces water networks to work as multipurpose systems [15], where power generation is not the first objective but an important complementary one [16].

Some studies and prototypes of recovering energy with small turbines can be found in the literature for power less than 100 kW [17–22]. The previous publications of Carravetta *et al.* [17,18] compare the feasible regulation systems for pump as turbines (PATs). These authors [19,20] determined performance of PATs installed in drinking systems. The efficiency oscillates between 0.4 and 0.6. Ramos *et al.* [21,22] proposed new design solutions to energy production in water pipe systems. These solutions are focused on the installing of PATs with electrical or hydraulic regulation within network. Additionally, to the previous referenced authors, the variability of the flow along time is studied as an objective in the present research. Here, a deep analysis of theoretical recovery energy in the network is proposed (*i.e.*, distinguishing values of dissipated energy, necessary energy and losses in lines and consumption points).

Particularly in irrigation networks, some studies of recovering energy in open channels flow [23–25] and preliminary studies in pressure pipe systems are described. These show the importance to analyze these networks in terms of recovery energy. An example of these studies is the network of Alqueva in Portugal [26]. In that contribution, authors analyzed the recovery energy with average steady state flows. A discretized analysis in short time intervals is proposed for determining the theoretical energy recoverable in a part of the Alqueva distribution network. This analysis was made with average consumption demands.

The present research determines the variability of flows and pressure in any point or line on the network depending on irrigation habits. This advantage (determining instant values of flows and pressure) allows performing the analysis of energy recovery in any point on the network. The methodology obtains the data pairs of flow (Q) and head (H) of the working area of the hypothetical installed machine.

Furthermore, the methodology determines the variation of flow in a network based on the habits of irrigation in order to perform energy analyses. The application of this methodology in irrigation networks aims to complement previous studies for PATs efficiency in dinking supply networks, extending its use.

The variation of flow is based on random demand of the users and the real irrigation allocations. Depending on these parameters, the proposed methodology estimates the energy dissipated by friction losses, the energy required for irrigation, and the recoverable energy in the irrigation network. The discretization of the flows leads managers to analyze power generation depending on irrigation time periods. Accordingly, the present analysis has the following objectives:


### **2. Methods and Materials**

### *2.1. Methodology for Determining the Flow*

In this section, the proposed methodology to determine the time-dependent flow throughout the year is described. In order to analyze any pressurized irrigation network from the energy point of view, the flow and pressure along pipelines are determinant variables. The requirements of the minimum pressure at any consumption point are also fundamental. Pressures are different depending on the location of irrigation points. Therefore, the spatial and timing distribution of these consumptions are important aspects to take into consideration.

The flows are variable over any irrigation campaign, depending on many factors such as distribution of crops in the irrigation area, crop maturity, weather conditions, soil characteristics, efficiency of drippers (ranging from 0.90 to 0.95), and the habits of farmers, among others.

Traditionally, the Clement methodology has been used for irrigation network sizing [27–29]. This methodology allows determining the maximum flow circulating in a network line. This maximum flow rate is calculated by assuming a binomial distribution flow. The mathematical expectation and standard deviation of the binomial probability distribution depends on the opening point of consumption. Clement assumed that this probability was uniform and equal over time. This uniform probability consideration can lead to underestimating the flows. Consequently, the Clement methodology cannot be used for analyzing potential energy recovery. Probability of irrigation at any point is non-uniform, and depends on the habits of irrigation farmers. Therefore, it varies throughout the day, week, and month. This underestimation leads to the proposal of different methodologies for estimating flows in irrigation networks. The most common are those that use statistical methods [27–29], or models based on the random opening of irrigation points by means of computer simulations [30–33]. A new methodology considering both strategies is here proposed.

Flow and energy implications are therefore separately considered and described.

The majority of water distribution networks only have water meters in each irrigation point for billing and controlling the consumed volumes. Unfortunately, it is not usual that the irrigation network has readings of flows and pressures at any time. For this reason, the proposed methodology simulates the operation of any irrigation network based on the random generation of consumption in irrigation points.

The day, start, and duration of irrigations (as function of the habits of the farmers) are considered in this research as factors for irrigation probability and flows. Furthermore, the real consumption probability weights (obtained from historical archives of the irrigation entities) can be assigned to consumptions, and the network can be very precisely simulated.

Hence, for any day of the year, consumptions can be estimated in any irrigation point by following these steps (Figure 1).

1. Estimation of cumulative volume consumed by the irrigation point

The decision to irrigate depends on the balance (VNa) between the previous irrigated volume and the consumption assigned (needs) of the irrigation point (Input 1). If the volume of cumulative consumption is positive, automatically the methodology indicates that this is not an irrigation day. Only when this volume is negative, irrigation is possible. If the volume of cumulative consumption is negative, the methodology determines the irrigation probability.

2. The determination of the irrigation probability (PI)

To randomly determine if crops are irrigated or not during a particular day, two types of weight functions are assigned. These functions are obtained from interviews with farmers. According to Figure 1, Input 2 determines the irrigation weekly pattern (*wdj*), prioritizing the irrigation days per week. Input 3 determines the maximum days between irrigations for each month of the year (*i*). If in previous days no irrigation has been performed, watering is forced.

**Figure 1.** Schematic description of the methodology for flow estimation.

The methodology generates a random number (*RN*) between zero and one associated with an irrigation probability. If *RNj* ď P*I* irrigation is assigned to this consumption point.

$$P\_I = \frac{w\_{dj}}{\sum\_{n=1}^{n=i-j+1} w\_{dn}} \tag{1}$$

where:

> *i* = numbers of days inside of interval;

*j* = day of decision making;

*wdj* = pattern to irrigate one particular day inside the interval;

ř *<sup>n</sup>*"*i*´*j*`1 *<sup>n</sup>*"1*wdn* = total addition of patterns.

3. The determination of the irrigation duration

The methodology allows determining the estimated time based on irrigation habits of farmers to satisfy irrigation needs (Input 1). This value depends on irrigation amount and type of crop.

### 4. The start of irrigation

The irrigation duration randomly determines the start of irrigation as a function of the daily probability curves of irrigation time (Input 4). When the methodology determines that a consumption point has to be irrigated, the start time of irrigation is determined. Therefore, the cumulative probability must be used for starting irrigation. This curve is defined by twenty-four sections (one per hour). When no irrigation exists, the irrigate weight ( *wh*) in this interval is assigned to be zero.

The probability in the time interval (*ph*) is:

$$p\_h = \frac{w\_h}{\frac{\sum\_{h=2}^{h} w\_h}{\sum\_{h=0}^{h} w\_h}} \tag{2}$$

where *wh* is the defined pattern (Input 2) to irrigate one particular hour inside the interval.

The cumulative probability (*pcm*) is:

$$p\_{\mathbf{c}} = \sum\_{h=0}^{h=m} p\_{h} \ (\mathfrak{m} = 0, \dots, 23) \tag{3}$$

where *m* is the number of intervals in one day.

A new *RN* is generated, ranging from 0 to 1. It is compared with the values of cumulative probability (*pcm*) and the start irrigation period is established. For this particular time period, the methodology selects within this period the start interval from zero to value equal to 60 Δ*t* (where Δ*t* is the time interval in which the simulated flow is discretized). When this step is completed, the day and hour of starting irrigation is known.

5. Determination of irrigation volume

The irrigation supply (agronomic known parameter, which depends on: framework plantation, number of dripper per plant and flow of the dripper) and the duration (Input 4) are known and the irrigation volume can be calculated for that day.

6. Calculation of cumulative consumption

When the irrigation volume is known, the methodology updates the water volume available for the plant.

7. The pressure and flow modeled for each node in the network

They are calculated for every irrigation points and each day using Epanet Toolkit. Epanet is public domain software [34] that models water distribution in pipe systems. Different elements can be represented: pipe networks composed by pipes, nodes (junctions), pumps, valves, and storage tanks or reservoirs. The model can simulate extended-period hydraulic analysis by simulating by sort of pipes systems, computing friction and minor losses, representing various types of valves, junctions, tanks and pumps, considering multiple patterns at nodes consumption with time variation, and system operation on simple tank level, timer controls or complex rule-based controls.
