Energy Balance in Wastewater Systems with Energy Recovery: A Portuguese Case Study

: This paper presents and discusses the application of a novel energy balance scheme for assessing energy efﬁciency in wastewater systems. The energy balance is demonstrated with a Portuguese real-life case study, using mathematical modelling to estimate the different energy components and to compute two energy efﬁciency indices. The total inﬂow intrinsic energy can represent a signiﬁcant amount (>95%) of the total energy used in systems mainly composed of gravity sewers. The total input energy is signiﬁcantly (four-times) higher in the wet season than in the dry season, mostly due to undue inﬂows (e.g., direct rainfall and inﬁltration). The potential for energy recovery strongly depends on the available head and ﬂow rate at the delivery point, being 0.01 kWh/m 3 in the current case, with a project payback period of 4 years. The energy balance components and the respective energy efﬁciency indices strongly depend on the considered reference elevation. Thus, a unique regional reference elevation is recommended in the calculations.


Introduction
Energy efficiency in the water industry is often regarded as an operational issue focused mostly on pumping and treatment equipment or processes improvement, simply regarded as a management efficiency target to be achieved [1]. However, due to the worldwide energy crisis and to the need of reducing greenhouse gas (GHG) emissions, there is an increasing motivation to minimize the energy requirements in sustainable water use [2]. Climate change is challenging the water sector to optimize energy use and limit GHG emissions in the current daily operations. The number of examples of energy efficiency improvement measures in water production and treatment is rapidly growing [3,4].
Aware of the need to reduce energy consumption and the associated costs, water utilities are currently looking for innovative ways to improve energy efficiency in their services by improving equipment efficiency, optimizing pump scheduling and changing the system layout [5], as well as recovering the excessive energy whenever feasible [6,7]. However, a significant potential for water-energy saving can be found when analysing the system as a whole, since energy is dissipated not only in pumping stations but also in the system layout, pipes and water losses, among others. There remains a need to adapt and explore alternative approaches, mainly to wastewater and stormwater systems, to assess the inefficiencies associated with the sewer inflow and network layout.
The energy balance should account for all inputs and/or generation of energy supply versus energy outputs based on energy consumption by energy use [8]. The energy balance compares the total energy that enters the system boundaries with the total energy that leaves the boundaries. Many authors have suggested the development of energy balances in the urban water cycle [5,[9][10][11], but for wastewater systems, this concept has hardly been developed and explored.
Carrying out energy balances in the entire water system allows the understanding of which components are energy-intensive and, therefore, allows the identification of measures to increase the energy efficiency. Energy balances assessment also supports the tactical and operational levels of management. At the tactical level, these provide a diagnosis of the system, enable the comparison between systems and help to prioritize interventions in subsystems. At the operational level, critical subsystems can have their service improved by specific actions, such as changes in pumping operation according to demand profiles (e.g., daily pumping schedules, adoption of speed controllers). Therefore, mapping energy consumption through an energy-balance scheme for the water systems is useful to identify critical components requiring action and to plan interventions to improve the energy efficiency [12].
Water supply systems, which are mostly pressurized pipes, have a significant potential for energy recovery [13] through the installation of turbines and pumps operating as turbines in locations with excessive pressures (e.g., near pressure or flow control valves, at the inlet of storage tanks) [14,15]. Given the nature of wastewater systems, the inlet or the outlet of wastewater treatment plants (WWTP) are preferentially used as potential sites to install an energy recovery solution to generate electricity in the wastewater system fields and thermal energy applications [16].
The assessment of the energy recovery potential for water supply systems requires the identification of the locations where energy is dissipated, the estimation of available hydraulic power and the development of technical and economic feasibility studies [17][18][19][20]. However, in wastewater systems, the use of energy recovery devices (herein, referred to as turbines) is more difficult not only due to the nature of the fluid, which contains solid materials and has corrosive properties, but also due to the existence of typical low heads with high flow rates. Whenever the installation of a turbine is already planned during the infrastructure construction, this will significantly reduce the capital costs and optimize the hydraulic design of the system [21].
The development of energy recovery feasibility studies involves key steps: the identification of potential locations; the identification of the most suitable turbine and the prediction of its performance, given specific head and flow values; the simulation of the energy recovery during a period of time; and a cost-benefit analysis [20]. The Archimedes screw was originally developed to pump water from a low to a high-level section. This equipment is composed of a helical array of simple blades wound on a central cylinder. Recently, this equipment has been used in the reverse mode (inverted Archimedes screw) serving as a turbine-the Archimedes screw turbine-to generate energy for low heads and high flow rates [20,22].
A novel energy balance tailored for wastewater systems was proposed by the authors of [23]. This balance has a different structure and several new components compared to water supply systems [5] and irrigation systems [24], and allows the identification of the main system inefficiencies and the potential for energy recovery. This energy balance aims to understand the energy transformation processes occurring in the integrated wastewater system, highlighting the most energy-consuming subsystems. This approach can be applied in three assessment levels (macro, meso and micro-level) depending on available information of the wastewater system in terms of the physical characteristics and flow rates.
The current paper aims to apply and discuss the energy balance developed for wastewater systems at the micro-level, using mathematical simulations to describe the flow throughout the system. A real Portuguese case study, composed of several systems, is used. The main innovative features are the detailed application of the micro-level energy balance to a wastewater system, supported by a hydraulic model to calculate the different energy balance components, the discussion of the main energy consumption components and the specific energy indices, and the analysis of the potential for energy recovery at the downstream manhole of the system.

Energy Balance for Wastewater Systems
The energy balance scheme specific for wastewater systems proposed by the authors of [23] was applied herein. Mathematical modelling was used to calculate the different components of the balance, allowing a micro-level energy efficiency assessment. This energy balance allows the identification of the main energy inefficiencies of the wastewater system and the analysis of different measures to reduce water-energy consumption and to recover energy. The proposed balance only focuses on the transport component of wastewater systems, including raising and gravity sewers. WWTP were not included herein, although the methodology can be extended to incorporate other components, such as treatment and heat recovery processes. Figure 1 shows the schematic representation of the different inputs and outputs of energy components associated with the energy balance calculation. The referred energy balance is depicted in Table 1 for typical wastewater systems. The energy balance can be applied at three assessment levels (macro, meso, and microlevel) depending on the available data (network inventory data, flow measurements or energy measurements) and the time horizon (day, month, year). Thus, the energy balance can be calculated by utilities with different maturity levels, systems, layouts and operation modes.
First, a macro-level assessment provides a global overview of the major components of energy consumption in the system. The external energy and the energy associated with undue inflows and authorized inflows can be estimated annually. This assessment is significant, as it allows for a preliminary evaluation of energy consumption in the system. The macro assessment can also be used when wastewater utilities do not have hydraulic models or have limited data. The light grey boxes refers to the macro-level components, the dark grey boxes refers to the meso-level additional components to those in macro-level and the micro-level corresponds to all energy balance components (white and grey boxes). Second, a meso-level assessment is an intermediate level that requires additional data and can also be applied by utilities that do not have hydraulic models. The calculations consist of the elevation-associated energy and the dissipated energy components in a disaggregated way, including the pump inefficiencies, friction losses and local head losses. If results from energy audits are available, then the computation of the dissipated energy associated with the pumping equipment will be more accurate. When these results are not available, the estimation of the pumping station efficiency can be carried out in a simplified way.
Finally, the third proposed assessment is the micro-level assessment, which requires a calibrated hydraulic model of the network and provides a detailed assessment of the energy consumption in every component of the energy balance, typically applied at the subsystem level. The adopted level of simplification in the mathematical model depends on several factors, mainly the modelling purpose and scope, the required and available data, and the loading conditions of the system. The simplifications of the data, network and structures of the drainage system must guarantee a reasonable description of the real operational conditions. Data requirements of a mathematical model are significant and should be complemented with fieldwork to define and characterize the magnitude and relevant characteristics of the system [25]. There is a wide variety of software suitable for the mathematical modelling of stormwater drainage systems, such as SWMM, Mike Urban, Mike Flood, Info Sewer and Sewer Cad, among others. Any of these can be used for computing the energy balance components. This approach can only be applied by wastewater utilities with a high maturity level, since they need to have hydraulic models already implemented and calibrated. Otherwise, simplified approaches should be preferentially used [23].
The results obtained by the micro-level assessment allow the identification of the main inefficiencies of the system and the establishment of improvement measures at the tactical level of planning. The current paper focuses on the micro-level. A detailed description of this assessment is provided in Section 2.2. Macro-and meso-level assessments, as well as their application results, have been further described by the authors of [23].

Micro-Level Assessment Description and Formulation
The total energy used in the system for transport and treatment is the sum of the total inflow intrinsic energy and external energy. Total inflow intrinsic energy refers to the energy associated with the free surface flow, which is composed of kinetic and potential energy. External energy refers to the energy supplied by the pumping stations. Both energy components are divided into two parts: the energy associated with authorized or due inflows and the energy associated with undue inflows.
From the perspective of the energy outflows, the total inflow intrinsic energy includes the system downstream energy, the recovered energy, the dissipated energy due to inefficiencies in the energy recovery equipment or pipe friction and local head losses and, finally, the energy associated with exceedance volumes (not connected to energy-consuming component or potentially inflowing to energy-consuming components). The external energy can also be divided into the elevation-associated energy (necessary energy to pump the wastewater volume between the water level in the pumping well and the elevation in the downstream delivery point) and the dissipated energy due to the inefficiencies in electromechanical equipment or due to pipe friction and local head losses. A more detailed description of the energy balance has been provided by [23]. The required data and the formulas for calculating each component of the energy balance are presented in Table 2.
Regarding the remaining components of the energy balance presented in Table 1, the energy at the final section of the system, E IDE (typically the connection to a WWTP or an interceptor sewer), was calculated by applying Equation (3) at the final node of the system (kWh), and E EDL , the energy dissipated by friction losses and local head losses, was calculated by applying Equation (6) to each pumping station. In the micro-level application, the percentage of the energy associated with authorized or due flows, E I AI and E EAI , can be estimated by the hydraulic model considering the dry weather inflow. Similarly, the energy associated with undue inflows, E IU I and E EU I , can be estimated using a proportion of the runoff volume entering the system (wet weather inflow). Concerning the components of the energy associated with exceedance volumes (E IEV and E IEV ), these can be estimated by considering the discharged and flooded volumes obtained by the model. Detailed procedures to calculate the latter components without the use of a hydraulic model have been described by [23].
As mentioned, the full application of the micro-level assessment requires a calibrated hydraulic model of the drainage system to allow the reliable simulation of the system behaviour and the calculation of the energy balance components.
Total energy used for system processes Total inflow intrinsic energy External energy Recovered energy Dissipated energy due to pipe friction and local head losses Dissipated energy due to inefficiencies in energy recovery equipment Total dissipated energy associated with inflow intrinsic energy Dissipated energy due to inefficiencies in electromechanical equipment Total dissipated energy associated with external energy The parameters presented in the formulas are H = hydraulic head (m); p = the pressure (Pa); γ = the water specific weight (9800 N/m 3 ); v = mean flow velocity (m/s); g = gravity acceleration (m/s 2 ); z = the node elevation(m) (z corresponds to the elevation of the level of water with respect to the zero elevation, z 0 . The zero elevation, z 0 , can typically be assumed as the minimum elevation of the system or the elevation of the delivery point [11,12]. However, a discussion regarding the selection of this reference is presented in Section 4.2); E T = total energy used for systems processes; E I = total inflow intrinsic energy (kWh); E EE = external energy (kWh); Q i,j = flow inflowing to node

Energy Recovery and Economic Viability
The application of the micro-level assessment allows the estimation of the potential of energy recovery. For this purpose, the available hydraulic power can be estimated by Equation (12), and the potential energy recovery by Equation (13): in which P h is the available hydraulic power (W), E is the potential energy recovery (kWh) and ∆t is the operating time (h) in the period of analysis. The energy recovery can be carried out by installing turbines adequate for low heads and high flow rates (e.g., water wheels, Archimedes screws). Despite the highly corrosive properties of wastewater and transported solid material, there have been several successful applications in wastewater systems [21,22].
The economic analysis of these projects should be based on the calculation of the annual recovered energy for a defined design flow rate, and the respective costs and benefits during the project lifetime. The capital costs (CC), operation and maintenance (O&M), costs and gross and net revenues are calculated. Several economic indicators can be used to evaluate the feasibility of these projects, such as the net present value (NPV), the payback period (PBP) and the internal rate of return (IRR) [20].
The additional input data to calculate these indicators are the discount rate, t a ; the project lifetime, n (years); the energy cost unit, C u (€/kWh); and the annual O&M costs, defined as a percentage of the CC. The CC includes the equipment control, management, civil works and turbine generator setup. The CC includes the revenues throughout the analysis, and the referred economic indicators are calculated for each design flow rate and each technological solution [20]. An acceptable and feasible solution should fit the highest NPV, with an acceptable IRR (>10%) and an adequate payback period ideally lower than 10 years [26].

Case Study
The application of the micro assessment requires that wastewater utilities have a hydraulic model of the network that is implemented and adequately calibrated. For the current study, a Portuguese wastewater utility provided a calibrated and reliable hydraulic model of a separate drainage subsystem. This subsystem, located in the Lisbon area, is part of a larger system that intercepts urban wastewater collected by the municipal drainage networks. Currently, the entire system serves a population of 800,000 equivalent inhabitants.
The network scheme of the selected subsystem is presented in Figure 2. It includes part of the general gravity flow interceptor and two emissaries. The first emissary is gravitationally connected to the general interceptor, and the second emissary has a gravitational part and an elevated part, since it does not have the possibility of a total gravitational connection to the general interceptor. The subsystem has a total network length of 15 km and is composed of 432 conduits, with diameters varying between 200 mm and 2200 mm, elevations between 2 m and 133 m, with one pumping station with a manometric head of 13 m, 92 sub-catchments and two weirs. The hydraulic model of the analysed subsystem is calibrated with the flow rate data for dry and wet weather collected in five udometers. The hydraulic model was developed using the commercial software SWMM developed by the U.S. Environmental Protection Agency. Simulations were carried out for two days in the reference period of 2015: one day of June, representing the dry season (reference situation), and one day of January, representing the wet season. The selection of these days was proceeded by an analysis of records for the season, and it was found that these two days are representative of the corresponding average situations. Therefore, the results for the January day were considered representing represent a maximum energy consumption profile, and the results for the June day were considered to represent a minimum energy consumption profile. Whenever data are available, a complete year should be simulated. Otherwise, simplifications must be assumed. In the current case, the simplification considers the results of the simulations for each day (June or January) as representative of the two seasons of the year (i.e., dry and wet seasons).

Micro-Level Assessment Application
The micro-level assessment allows the identification of the main energy inefficiencies in wastewater systems. The most important assumptions for this assessment are: (i) the percentage of the energy associated with authorized or due inflows can be estimated by the hydraulic model considering the dry weather inflow; (ii) the percentage of undue inflows can be estimated using a proportion of the runoff volume entering the system (a percentage of 75% was considered for the present case, based on results of a previous sensitive analysis procedure) [27]; and (iii) the pump efficiency was assumed to be 30% in both cases, since no auditing data were available, and old wastewater pumps usually have very low efficiencies.
The total inflow intrinsic energy is given by Equation (3). The reference elevation, z 0 , corresponds to the lowest elevation point (2.03 m). At the inflowing nodes of the system, the hydraulic head is given by the summation of the potential head and the kinetic head.
The dissipated energy in free surface systems without energy recovery equipment is equal to the difference between the total inflow intrinsic energy and the system downstream energy. The latter was calculated by Equation (3), considering that the hydraulic head is given only by the kinetic head, since the potential head at the delivery point is 0 m (no drop at the manhole). In the current case, the recovered energy (Equation (5)) and the respective dissipated energy (Equation (7)) are null. Concerning the components of the energy associated with exceedance volumes (E IEV and E IEV ), it can be estimated considering the discharged and flooded volumes obtained by the hydraulic model.
The results obtained for the energy balance application at a micro-level to the selected case study considering the reference situation (June, dry season) are presented in Appendix A (Table A1). The results for this typical summer day correspond to a minimum energy consumption profile for the current case study. This case is associated with purely dry weather conditions, so it is assumed that the percentage associated with undue inflows is 0%. The total wastewater collected volume at dry weather is 3,614,230 m 3 /year. The total elevated volume is 816,505 m 3 /year, and the total external energy consumption is 98,688 kWh/year. Concerning the exceedance volumes, at dry weather conditions, no overflows occur in the system.
The results obtained for the micro-level of the energy balance for a typical day in January (wet season) are presented in the Appendix A (Table A2). Similar to the previous results, the values for this season correspond to a maximum energy consumption profile for the present case study. For this case, given the contribution of the wet and dry weather inflows, the percentage of undue inflows is 42.6%. The total wastewater collected volume at dry weather is 6,090,268 m 3 /year, and the total volume at wet weather is 27,020,098 m 3 /year. The total elevated volume is 2,701,973 m 3 /year, and the total external energy consumption is 326,578 kWh/year. The exceedance volumes were estimated from the discharged and flooded volumes obtained from the hydraulic model, with a total of 19,931,068 m 3 /year. Figure 3 shows the comparison of the energy balance components for both seasons. Components that are zero in both cases (recovered energy and dissipated energy associated with energy recovery equipment) are not depicted. Figure 3. Comparison between the energy balance components for both seasons (June and January): (a) Energy inflows: total energy for system processes, total inflow intrinsic energy and external energy; (b) energy inflows: inflow intrinsic energy and external energy associated with authorized inflows and to undue inflows; (c) energy outflows: system downstream energy, dissipated energy due to pipe friction, and local head losses and exceedance volumes not connected to an energy consuming component and potentially inflowing to an energy-consuming component; (d) energy outflows: elevation associated energy and dissipated energy.
A substantial increase (four-times higher) in the total energy for system processes was observed in the wet season, which is mostly associated with the undue inflows, mainly direct rainfall and infiltration (Figure 3a). The external energy is also higher in the wet season, though with a lower increase (three-times higher), because of the higher occurrence of discharges and floods in this season (Figure 3a,d).
The component related to the energy associated with exceedance volumes not connected to energy-consuming components only exists in wet season and is derived from undue inflows (Figure 3c). This component represents the theoretical energy that would be additionally consumed if the total volume that left the system (because of discharges or floods) was also pumped. Calculating this component is important to show to wastewater utilities the importance of acting in the control of undue inflows to reduce energy consumption. This action, in most cases, will only achieve the expected results when the discharged or flooded volumes are eliminated, and only later will the impact be reflected in the reduction of energy consumption. It also highlights the importance of measuring discharges because of their environmental effect and their impact on energy consumption.
In both cases, the total inflow intrinsic energy has high values (>95% of the total energy), since the system is mainly composed of gravity sewers with only one pumping station (Figure 3b). The energy associated with undue inflows considering both seasons is, on average, 21.3%, which is within the estimated range (20-44%) of the macro-level analysis in previous studies [23]. These components strongly depend on the length of the gravity sewer and the number of pumping systems. The current case has only one pumping station and 15 km of sewers, with the total inflow intrinsic energy per unit length being 183,946 kWh/km for the first case and 749,282 kWh/km for the second case. This network only represents a small subsystem inside the utility, highlighting that the results could differ depending on the system layout, characteristics and condition.
The available energy at the downstream end is significantly low (<7%), as the manhole at the reference section has no drop (0 m), and this energy is only associated with the residual velocity component. Therefore, most of the energy associated with the gravity flow is dissipated. Finally, since there is no installed energy recovery equipment, no recovered energy was calculated.

Reference Elevation Analysis
Several energy balance studies in the urban water cycle have considered the minimum elevation of the system as the reference elevation, z 0 [10][11][12][28][29][30][31]. This reference elevation ensures that the energy balance components are always positive, making them easy to understand and compute. However, the reference elevation significantly affects the energy efficiency indices results based on the energy balance, which is important for the diagnosis of the system.
To assess the effect of the reference level on the results, the case study was divided into six smaller subsystems: four gravity sewers, one general interceptor and one elevation conduit. Three different situations were analysed: (i) the subsystems are connected and interdependent, and the reference elevation is the global system minimum elevation (2.03 m); (ii) the subsystems are dependent, but the reference elevation is the system downstream end section (15.00 m); and (iii) the subsystems are independent, and each one has as different reference elevation corresponding to its minimum elevation point. This sensitivity analysis was carried out for the wet season. Two energy efficiency indices, E AR 1 and, E AR 2 , were calculated. The first energy efficiency index is the energy supplied per unit volume of authorized or due inflows, defined by: in which E AR 1 is the energy supplied per unit of authorised or due inflows (kWh/m 3 ), E S is the energy supplied (either inflow intrinsic energy, E I , or external energy, E E ) to the system (kWh) and V A is the volume of authorised or due inflows (m 3 ). The second energy efficiency index E AR 2 represents the energy supplied over the minimum energy required by the system, defined as follows: in which E exc is the energy in excess in the system, typically associated with undue inflows (kWh), and E min is the minimum energy required by the system, associated with the operation at dry weather (kWh). Figure 4 shows the results of the energy indices E AR 1 and E AR 2 for the six subsystems calculated for the three different reference elevations. The selection of different reference elevation values leads to different results even though the differences do not change the ranking of the subsystems in terms of energy efficiency. System 1 is always the most energyintensive, and subsystems 3, 4 and 5 are assessed as the less intensive for both indices. When subsystems are considered as a whole and the reference elevation is the downstream end (case ii), the values of E AR 1 for subsystems 2 and 4 assume negative values, since these systems are at elevations below the endpoint, while the other subsystems are above the reference elevation. The index E AR 2 is always positive because it is the ratio of two negative energy components for subsystems 2 and 4. Based on these results, the recommendation is to use a unique regional reference for elevation in the calculation of the energy balance. This reference elevation should be further analysed with different case studies. However, it should ensure that all values of energy components and the respective energy efficiency indices, E AR 1 and E AR 2 , are positive and easy to understand, facilitating the analysis of the results.

Energy Recovery Curves Application and Economic Viability
Preferable locations for installing energy recovery devices are sites with significant elevation drops combined with high flow rates and available physical space. The locations with a higher potential for energy recovery should be identified and analysed. The average head, flow rate and available hydraulic power allow the selection of adequate types of energy recovery equipment (turbines). For instance, the inverted Archimedes screw represents a very cost-effective technological solution for energy recovery in water systems with low available heads and for a wide range of flow rates [32]. The solution is adequate for liquids transporting solid material [33]. In the current case study, the selected energy recovery solution is the inverted Archimedes screw turbine.
A preliminary assessment of the energy recovery potential was carried out for the two seasons (wet and dry). This assessment aims to illustrate different scenarios for energy recovery at the last point of the final interceptor, considering that the available head is 3 m at the manhole and that the flow rate is constant in each season (Figure 5a). Available average flow rates, available heads and the corresponding hydraulic powers calculated by Equation (12) are depicted in Figure 5b and Table 3. Calculated powers correspond to available mechanical powers in the flow, not accounting for the turbine efficiency. The points are marked as "dry season" and "wet season," referring to each season. Curves are presented on a logarithmic scale. These results show that the highest potential for energy recovery is in the wet season, with an average available hydraulic power value of 121 kW. In dry season, the average hydraulic power is significantly lower (47 kW). The values show good recovery potential associated with low heads (3 m).  Figure 6 shows the estimated hydraulic power, considering the efficiency of 70% for this equipment [34]. Considering that the inverted Archimedes screw turbine operates with this efficiency for a wide range of flow rates (between 20-110% of rated conditions), the annual recovered energy and the corresponding installed power were simulated for different design flow rates. The maximum recovered energy (515 MWh/year) was observed for design flow rate of 4.1 m 3 /s, with a corresponding installed power of 84 kW (Figure 7). Considering the corrosive characteristic of the fluid with solids, the use of these turbines or equivalent equipment in wastewater systems is difficult, and efficiencies can be lower than 70%.  Economic analysis requires the calculation of the capital cost, O&M costs, gross and net revenues, as well as several economic indicators, such as the NPV, PBP and IRR. The assumptions adopted herein are: (i) discount rate = 5%; (ii) project lifetime = 20 years; (iii) energy unit cost = EUR 0.10 /kWh; (iv) annual O&M = defined as a percentage of the capital cost (5%). The discount rate, project lifetime and unit energy cost are the typical values used by water utilities in Portugal [20]. The unit capital cost for the Archimedes screw turbine is EUR 2 k/kW.
The results for NPV, capital costs, O&M costs and revenues for the Archimedes screw solution are presented in Figure 8a as a function of the design flow rate, and the respective PBP and IRR are presented in Figure 8b.  (Figure 8a). The corresponding installed power is 75 kW, and the annual recovered energy is 507 MWh/year, which corresponds to a specific energy recovery indicator of 0.01 kWh/m 3 . For this flow rate, the Archimedes screw turbine has a capital cost of EUR 150.4 k, O&M costs are EUR 15 k/year, the gross revenue is EUR 50.7 k and the net revenue is EUR 35.7 k. The PBP is 4 years, and the IRR is 23%.
The potential for energy recovery can also be evaluated in the other sites of the system, such as after discharges with significant flows or in sewer sections with significant head drops. In each case, the potential for energy recovery and the respective economic viability analysis should be carried out.

Conclusions
This paper presents a detailed application of a novel energy balance scheme for assessing energy efficiency in wastewater systems through hydraulic modelling. In the wet season, a substantial increase (four-times higher) in the total energy was observed, mainly derived from undue inflows. In addition, a major part of the energy consumption was associated with the total inflow intrinsic energy (>95% of the total energy used for system processes), since the system was mainly composed of gravity sewers and only one pumping station. The energy associated with undue inflows considering both seasons was significant, being, on average, 21.3%. The component related to the energy associated with overflows potentially inflowing to the energy-consuming component represents additional energy that would be consumed if the total volume that left the system was also elevated. Therefore, this component should not be mistreated, since it highlights to wastewater utilities that, while they do not reduce these exceedance volumes, the impact of actions in the control of undue inflows to reduce energy consumption is compromised.
Regarding the reference elevation analysis, there is evidence that this parameter significantly affects the energy efficiency indices, and the recommendation is to use a unique regional reference in the calculation of the energy balance.
The potential for energy recovery is also of utmost importance, since it enhances the need to consider the energy recovery practice from wastewater systems, which can be sometimes neglected due to recognised limitations. The results in the present paper show a good potential for energy recovery (500 MWh/year) and workable economic viability considering the several indicators presented, namely the PBP of 4 years and IRR of 23%.
In addition, this work reinforces the need for wastewater utilities to focus on the several energy balance components to highlight the main inefficiencies, even if it is not possible to calculate all of them, and different solutions with different results can be considered. It is of the utmost importance to align the proposed energy balance with the performance indicator metrics that support the diagnosis of energy efficiency in wastewater utilities. The potential for energy recovery should also be analysed in locations with high flow rates and with available heads higher than 2-3 m.

Data Availability Statement:
The data presented in this study are contained within the article.

Acknowledgments:
The authors gratefully acknowledge the support of FCT, PhD fellowship PD/BD/135587/2018. The authors thank the Portuguese water utility Águas do Tejo Atlântico for providing the hydraulic model.

Conflicts of Interest:
The authors declare no conflict of interest. Table A1. Results of the energy balance application in June: dry season (MWh, % of the total energy used for system processes).

ENERGY INFLOWS ENERGY OUTFLOWS
Total energy used for system processes (transport and treatment), E . . . due to pipe friction and local head losses (e.g., junctions, bends, valves, screens), E EDL = 0.5 MWh (0.03%) Table A2. Results of the energy balance application in January: wet season (MWh, % of the total energy used for system processes).