Energy Recovery Optimization by Means of a Turbine in a Pressure Regulation Node of a Real Water Network Through a Data-Driven Digital Twin

In recent years, various devices have been proposed for pressure regulation and energy recovery in water distribution and transport networks. To provide a real net benefit, they require a dedicated long-distance management system in order to carry on both hydraulic regulation and electricity production without direct human manual operations. This work presents a new proposal for the management of a pressure regulation system based on the PRS turbine. The proposal is applied to a real water distribution network, named Montescuro Ovest pipeline, at the San Giovannello station. The Real Time Control (RTC) logic currently applied at San Giovannello station is first presented and discussed. A new Advanced Real Time Control (ARTC) logic is then proposed, based on direct configuration of the turbine and the surrounding valves as computed by the solution of an optimization problem. In ARTC a digital twin, including the hydraulic model of the surrounding network, provides a one-to-one relationship between the configuration parameters and the state variables, i.e. flow rates and pressures. The digital twin model equations are continuously updated on the basis of the recorded measures. Besides providing almost identical performance to the current RTC logic in the current operational scenario, the improved ARTC is more robust, in that it guarantees better hydropower generation in modified operational scenarios, as shown in specific tests. The proposed methodology constitutes a new approach to regulating the valves in hydroelectric plants which are currently regulated with traditional automation algorithms.


Introduction
One of the most frequent operational problems associated with pressurized water networks is regulation of service pressure (Xu et al. 2014).The fact is that exceedingly high service pressure may result in various unpleasant implications, including pipe bursts and excessive leakage.Though service pressure reduction is typically performed by installing and regulating Pressure Reducing Valves (PRVs), the last two decades have seen their frequent replacement with turbines (Samora et al. 2016;Sammartano et al. 2017;Bonthuys et al. 2020) and pumps operating as turbines (PATs) (Ramos and Borga 1999;Carravetta et al. 2012;Fontana et al. 2018).Turbines and PATS have the advantage of recovering the pressure energy otherwise dissipated by the PRVs (Mariano et al. 2021;Rodríguez-Pérez et al. 2021;Pirard et al. 2022;e Souza et al. 2023).When connected to an electric generator, they can convert the surplus into electrical energy for local use and/or for sale on the electricity market.The implementation of turbines and PATs represents an environmentally friendly solution that helps in offsetting and mitigating the high energy consumption (International Energy Agency 2016, 2018;Giudicianni et al. 2023) occurring in the water industry.This solution is especially attractive in the case of water transmission mains.Indeed, these systems generally feature large available flow rates and head-drops, thus offering high potentials for hydropower generation to quickly pay back the initial installation cost (Creaco et al. 2020).
Both turbines and PATs have pros and cons.Despite the high hydraulic efficiency of conventional turbines, their technology is hardly scalable down to the size relevant to water transmission and distribution networks (Ramos and Borga 1999;Power et al. 2014Power et al. , 2017)).Though PATs are cheaper and more widely available in the market, the main disadvantages associated with these devices consist, instead, of lower hydraulic efficiency and the absence of any hydraulic system to regulate the downstream service pressure, thus rendering necessary the installation of a downstream control valve (Fecarotta et al. 2015).
An economically sustainable solution, which guarantees both hydropower generation and service pressure regulation, has recently been provided by the new crossflow type of turbine, named PRS.As was proven by previous numerical and laboratory experimental studies (Sammartano et al. 2017;Sinagra et al. 2019), the PRS turbine has the simplicity and high efficiency of crossflow turbines with positive outlet pressure.Furthermore, it is also equipped with a flap-based hydraulic regulation system, which allows changes in the characteristic curve according to the specific flow rate or to the head drop required by the water manager.
The economic advantage of using micro-turbines instead of Pressure Reducing Valves (PRVs) is obtained only if their management is an unmanned process and if each turbine is equipped with an autonomous regulation system to be always remotely supervised, except for extraordinary maintenance operations.Real time control (RTC) using automation is now an established technology in the water industry.In this context, automation (AU) is commonly used with a simple scheme based on a feedback principle (Olsson 2021): a sensor measures the controlled variable, e.g. the pressure; a computer algorithm checks that the measurement is valid and calculates the correction to be made, e.g. a new valve setting.
The feedback process is simple, but it can be easily influenced by the interactions that arise when other simultaneous actuations occur in the water network.In this case even a small variation of one valve regulation can provide a signal for all the sensors resulting in iterative corrections of all the valve regulations.Observe that this also occurs assuming slow valve regulation without significant pressure surge effects.Furthermore, the dependence of the actuation on the single sensor value can make the whole process unstable in the event of failure of the sensor itself or of its communication.
In recent years, Artificial Intelligence (AI) algorithms have been proposed for the water sector as alternative solutions to traditional automation systems.AI is a data-driven methodology based on a pre-defined structure of the functional relationship linking measures with the optimal system configuration.This structural relationship can be either a simple regression or a neural network; in both cases the system configuration is close to the optimum only if the current measurements match those used for training.Otherwise, very poor configurations can be selected using the AI approach.
In this paper, a new Advanced Real Time Control (ARTC) logic is designed for direct valve setting and optimization of hydropower production inside a water network.In the proposed approach the physical relationship occurring between the system configuration and the measured variables is given by a digital twin model, the coefficients of which are calibrated based on the recorded measures.The concept of digital twin transcends that of the numerical model in terms of completeness and accuracy for the intended purpose, e.g., real-time control.The main difference consists of the possibility of direct (real-time) feeding of sensor data into the model for calibration and control purposes, as well as the possibility of controlling the real system (by means of actuators) starting from the digital twin.
The following sections describe the turbine PRS, adopted for pressure regulation and energy production, the case history and the proposed methodology, followed by a comparison with field measurements obtained in the case study.The final section is dedicated to simulation of plant management in operational scenarios different from the present one.

PRS Turbine
The PRS turbine is a new device to be installed along water pipes and aimed at regulating pressure in the outlet section while producing electrical energy.The PRS turbine is equipped with an internal flap, concentric with the impeller, which makes it possible to modify the characteristic curve of the turbine by changing its rotation with respect to the turbine axis (Fig. 1).Let λ the rotation angle, where λ = 0 and λ = 100 correspond respectively to the fully closed and fully opened positions, respectively.
The major advantages of the PRS turbine for pressure regulation, compared to other possible energy recovery devices, are the following: 1) the blades and all the rotating parts have a simple cylindrical shape; 2) the flux direction is always along a vertical plane shared with the original pipe axis; 3) it is possible to simply change the characteristic curve by partially closing the impeller inlet surface through a simple semi-circular cylindrical flap.
Previous studies (Sinagra et al. 2021) showed that the efficiency of the PRS turbine is mainly a function of two parameters: 1) the velocity ratio Vr, given by the ratio of the tangent component of the inlet velocity to the reference system velocity at the impeller inlet surface; 2) the λ angle.The efficiency always decreases along with λ and attains the optimal value at Vr ≈ 1,7 (Sinagra et al. 2021).Observe that, because the generated electrical power is proportional, for a given flow rate, to both the head drop of the turbine and the efficiency, the maximum power generation, for a given flow rate and minimum pressure PD = P set allowed downstream of the turbine, can be attained even with a PD pressure greater than P set .

Case Study: Montescuro Ovest Aqueduct
The case study for the application of the proposed ARTC is the Montescuro Ovest aqueduct in Sicily, serving 24 municipalities and managed by Siciliacque SpA.The tank named 'Torretta' is the header tank of the aqueduct at an altitude of 185 m above sea level and serves five reservoirs, as well as four urban users and one industrial one.Eleven km downsteam of the Torretta tank, along the main pipeline featuring a diameter of 600 mm, hydraulic pressure regulation is provided by a PRS turbine, located in the site named San Giovannello, at an altitude of 88 m above sea level.Downstream of the San Giovannello station, two needle valves, named V2 and V3, regulate the water supply to the tanks named Trapani, Raganzili and Cava Ricevuto.In parallel with the PRS turbine, there is a bypass pipe where a needle valve is installed, named V1.In addition to guaranteeing maintenance of the turbine, the by-pass is helpful in the case of any exceptional flow rates, when the downstream pressure would otherwise drop below the minimum P set value.Let β indicate the valve opening degree, with β = 0 and β = 100 for the fully closed and fully open valve, respectively.The hydraulic parameters are measured using five flow meters, named from FM1 to FM5, two pressure meters, named PU and PD, positioned upstream and downstream of the turbine respectively, and one pressure meter downstream of valve V3, named PA.A sketch of the water transport network study case is shown in Fig. 2.
In the San Giovannello station the flow rate and the upstream pressure measured by PU periodically change, in the range 110-180 L/s and 5.4-7.5 bar respectively, according to the water demand.In order to recover the maximum hydraulic energy, the PRS turbine () developed by WECONS (Water Engineering Consulting) was designed with a hydraulic head drop ΔH = 42 m and a maximum flow rate Q t = 180 L/s, in the condition of fully opened flap.The minimum pressure required by the water manager downstream of San Giovannello station is equal to P set = 2.5 bar.
The turbine impeller is axially coupled to an 8-pole IE2 efficiency class asynchronous electric generator with an electrical power of 70 kW, directly connected to the national 400 V -50 Hz electricity grid.The electrical power produced by the generator is measured by means of a power meter named PW.Observe that in this configuration the turbine operates with a fixed rotational velocity equal to 760 RPM, and it is not possible to maintain the relative velocity constant at its optimal value Vr = 1,7.
An RTC system is currently carried out for regulating the setting of the needle valves and of the turbine flap.The implemented RTC algorithm has the following objectives at the generic time t of the operation: 1. to set the flow rates Q T1 (Casa Santa tanks) and Q T2 (Trapani tank) at the assigned values; 2. to lead the downstream service pressure to the setpoint value P set , which is the lowest acceptable pressure in PD.
Minimization of the service pressure in PD makes it possible to indirectly maximize hydropower generation.
To pursue these two objectives, a control loop-based regulation is implemented.Specifically, the control valves V2 and V3 are associated respectively with the flow meters FM3 and FM4, while the λ and β parameters are associated with the pressure gauge PD.The Programmable Logic Controller (PLC) acquires the instrumental readings from the above sensors and a proportional -integral -derivative controller (PID) simultaneously calculates the error ε occurring between the target and the read values, as well as the corresponding new setting of the needle valves and of the turbine flap.To try to maximize the generated hydropower, the automation performs the following simple steps: 1. Applies the PID controller to valves V2 and V3; 2. If λ < 100 it applies the PID controller to λ; 3.If λ = 100 it applies the PID controller to β.To avoid continuous adjustments of the actuators, a steady state error has been imposed for each sensor, below which the PID controller does not activate.

Digital Twin for Optimization and ARTC of San Giovannello Station
The automation adopted in the San Giovannello station operates with a very small control time step, i.e., one second, potentially resulting in a high number of setting corrections, and therefore in high wear of the actuators.Furthermore, it assumes that the maximum hydropower is always attained at the minimum downstream pressure.To overcome these limitations, a new RTC based on the digital twin of the San Giovannello station was constructed.This digital twin includes the hydraulic model of the plant and, given the valve and the flap configuration, is able to accurately reproduce the behaviour of the San Giovannello station equipped with the PRS turbine, in terms of both hydraulic variables and hydropower generation.
The layout of the proposed digital twin is represented in Fig. 3, Tables 1 and 2. Valves V1, V2, V3 and the turbine PRS are represented as fictitious pipes with fully turbulent flow and a specific resistance r k , that is: where H is the nodal total head, P is the pressure head, D is the elevation difference across the pipe, Q is the flow rate, and k is the index used for the fictitious pipe connecting upstream node i to downstream node j.The index k also applies to the valve or turbine present in the pipe.O 1 is the opening setting in the by-pass valve V1; O 2 and O 3 are the opening settings of valves V2 and V3, respectively; finally, O 4 corresponds to λ.For the valve-fitted pipes, the correlations observed in the data confirmed the resistance r k to be a function of the actuator opening setting, i.e. r k (O k ) for k = 1,…, 3.For the turbine-fitted pipe, the resistance r 4 was assumed to be a function of both O 4 and Q 4 , i.e., r 4 (O 4 , Q 4 ), based on the correlations observed in the data.The relationships for evaluating r k can be constructed starting from the historical data measured after a preceding time horizon (e.g.within the previous 10 days).The changing boundary conditions are the demand in node 5, corresponding to Q w1 plus Q w2 in Fig. 2, as well as the pressure head in node 2, which is assumed to be equal to the measured pressure head PU and not to be affected by the valve (1) and turbine configuration changes.The same hypothesis is applied to node 6, where the pressure head acquired by PA is assumed as a boundary condition.This choice is motivated by the fact that the Raganzili and Cava Ricevuto tanks, as well as their inlet mains, are not managed by Siciliacque SpA, and at least one regulation valve, with an unknown setting, is included inside.
The following optimization problem is embedded into the digital twin: subject to the following constraints: where Q and P are the numerical model pipe flow rates and nodal pressure heads, P 3 , P 5 , Based on the assumption that the boundary conditions assigned to the model are not significantly affected by the valve and flap opening changes, the relationships r 1 (O 1 ), r 2 (O 2 ), r 3 (O 3 ), r 4 (O 4 ,Q 4 ), as well as η(O 4 ,Q 4 ), were obtained by means of data-driven empirical relationships, to be calibrated based on recent measurements. (2) (5) P 2 = PU, P 6 = PA, P 1 = 0  The optimization problem presented in Eqs. ( 2)-( 5) is non linear and has been solved by using a specifically developed algorithm, which includes a hydraulic solver (Creaco et al. 2022) for enforcing preservation of energy balance on pipes and mass conservation at nodes.The digital twin was constructed in the Matlab2022b ® environment and is linked to EPANET 2.2 code (Rossman et al. 2020) for visualizing the results.
The maximization of hydropower PW is carried out as a function of Q 4 and O 4 , by making use of the interior point line search algorithm in the Matlab2022b ® environment.The settings O 1 , O 2 and O 3 are then obtained by enforcing physically based relationships in the digital twin related to energy balance on pipes (see Eq. 1) and mass conservation at nodes.
The operation of the digital twin for the ARTC of the San Giovannello station can be explained as follows (see Fig. 4).The ARTC is applied at the end of each control time step Δt by optimizing the actuator settings with the digital twin, given the measured boundary conditions and using the relationships r 1 (O 1 ), r 2 (O 2 ), r 3 (O 3 ), r 4 (O 4 ,Q 4 ), and η(O 4 ,Q 4 ) calibrated with the measures collected in a previous T precal time window.The time step Δt must be small enough to follow the dynamics of the system and large enough to dampen the flow transient effects in the system and the accidental errors in the measurements.If the actuator setting variations proposed by the optimizer at the generic time instant t are smaller than 1%, the settings of the previous time steps are kept for the new Δt.
The calibration of the relationships r 1 (O 1 ), r 2 (O 2 ), r 3 (O 3 ), r 4 (O 4 ,Q 4 ), and η(O 4 ,Q 4 ) is carried out at the end of each T CAL time window using the measures collected in the previous T PRECAL time window.

Applications Under Ordinary Operating Conditions
The two following sections describe the applications of the digital twin under the current ordinary operating conditions, using the data downloaded from the Supervisory Control And Data Acquisition (SCADA) system of the aqueduct during twenty days from 9 to 28 March 2022 with 25 min resolution.To facilitate presentation of the results, a value of 10 days was used for both T PRECAL and T CAL .Therefore, the first ten days, from 9 to 18 March 2022, were used for the calibration of the digital twin and the following ten days, from 19 to 28 March 2022, were used for simulation of the ARTC with a control time step Δt = 10 s.

Calibration of the Digital Twin
An added value of the digital twin, compared to a traditional hydraulic model, is represented by the automatic adaptation of the model parameters to the external environmental conditions, according to the registered sensor data.Therefore, the proposed digital twin is based on the recursive calibration of the relationships O 4 , Q 4 , r 1 O 1 , r 2 O 2 , r 3 O 3 and r 4 O 4 , Q 4 , by using the field data recorded in a moving time window as time goes by.

Fig. 4 ARTC Temporal scheme
In the present work, the calibration of the digital twin was carried out using the SCADA data concerning 10 days of real operation from 9 March 2022 to 18 March 2022.The patterns observed from the measured data for η(O 4 ,Q 4 ), r 1 O 1 , r 2 O 2 , r 3 O 3 and r 4 O 4 , Q 4 are shown in the following Figs.S1, S2 and S3 reported in the supplementary material.
The structure of the relationships holding between pipe resistances, turbine efficiency and decision variables was previously selected according to their best fit to the data measured along the benchmark period.As simple linear regression proved to perform poorly in computing and r 4 as a function of Q 4 and O 4 , the structures chosen for the turbine efficiency η and for the resistance r in the turbine are nonlinear as shown in the following Eqs.( 6) and ( 7): In fact, the experimental pattern of η as a function of O 4 was found to be slightly less than linear for increasing values of the water discharge Q 4 (see Fig. S1).The experimental pattern of η as a function of Q 4 was found, instead, to be slightly more than linear for increasing values of the water discharge Q 4 (see Fig. S3).
The structure chosen for the pipe resistance r in the valve-fitted pipes is: Observe that Campisano et al. (2016) and Creaco (2017) previously proved exponential relationships with a structure similar to Eq. ( 8) to be suitable for representing the resistance of valves as a function of the opening setting.The graphs in Figs.S1, S2 and S3 show a good fit of the calibrated relationships implemented in the digital twin to the values of η and r 1 , r 2 , r 3 , r 4 .

Simulation of ARTC
The simulation of the proposed ARTC for the control of the San Giovannello station was carried out from 19 March 2022 to 28 March 2022, i.e. for 240 h, using the model parameters calibrated using the data collected from 9 March 2022 to 18 March 2022.The reaction of the system to the actuator setting adjustments computed by the optimizer was simulated by EPANET2.2.The time control interval is Δt = 10 s.
The assigned boundary conditions, i.e., the temporal patterns of P 2 , P 6 and Q w recorded from the sensors, are shown in Fig. 5 for the reference period.It must be remembered that the fixed head of 75 m above sea level (a.s.l.) at the Trapani tank was set as an additional boundary condition.
The flow rates Q T1 and Q T2 were set as they were scheduled by the water utility manager Siciliacque SpA in the same period.According to the current water resource management rules, to prevent excessive head losses along the main pipe starting at the Torretta tank, the flow rate target Q T1 is reduced when the demand Q w1 exceeds a pre-set value.Starting from the daily average allocation of 86.27 L/s, the actual value delivered to the Casa Santa tanks is reduced up to Q T1 = 76.27L/s when Q w ≥ 48 L/s.reports the historical series of Q T1 and Q T2 as a function of time t during the ten consecutive days (240 h) of operation, highlighting an excellent fit to the field measurements.
Figure 6 shows the main results of the application of the digital twin.Namely, Fig. 6a shows the pattern of the produced hydropower PW, which is the objective function maximized by the digital twin.Figure 6b shows, instead, the pattern of the actuators O 1 , O 2 , O 3 and O 4 , which are the decision variables in the digital twin optimization.In all cases, the results of the digital twin model optimization are very close to the experimental patterns, obtained applying the traditional RTC approach.The larger fluctuations present in the numerical pattern of O 4 during some time intervals are likely due to the large interval occurring between experimental measures, much larger than Δt and equal to 25 min.
Figure 7 shows additional results of the digital twin, namely the temporal pattern of the water discharges in the turbine and bypass lines and of the pressure head at the exit of the San Giovannello station (node 3 of the digital twin).The fit of numerical to experimental results obtained using the automation currently installed is strong for these patterns too, including both the periods of inactive bypass and the periods of active bypass (Q BP > 0), occurring four times in the reference period (see Fig. 7a).Compared to the numerical values, the experimental results of the pressure head at node 3, obtained by means of pressure sensor PD, feature some short duration large fluctuations, mainly undershooting the minimum pressure P set .This could also be due to some delay in the initial opening of the bypass when too large a flow rate occurs (see Fig. 7b).
Overall, the closeness of the numerical to the experimental results proves that: 1 3 -at time step 10 s, the improved ARTC yields similar results to the logic currently implemented in the field.This is because hydropower generation under the current ordinary operating condition is maximized when the minimum acceptable pressure head P set is pursued in the regulation.-however, it must be observed that the improved ARTC is advantageous in terms of wear of the actuators (turbine flap and the three control valves present).Indeed, while the currently implemented logic is applied on a continuous time basis by operating through iterative actuator adjustments, the ARTC logic can be applied with coarser time steps (up to some minutes), because the optimization problem embedding the digital twin directly yields the optimal values of the actuator settings, with no need for fine iterative actuator adjustments.The robustness of the digital twin was then tested against modified operating scenarios.
To this aim, a set of modified scenarios was constructed assuming constant boundary conditions corresponding to the daily average operation of the station with closed bypass, and modified values for the coefficients of Eqs.
(3)-( 5), obtained with ± 5% random perturbations.As expected, the maximization of the hydropower generated in the digital twin resulted in a pressure head at the exit of the station quite similar to P set , like under the current operating conditions (Subsection 5.2).Then, a scenario that occurred in the past, prior to the installation of the turbine, was simulated.
This scenario is based on the following constant boundary conditions: When applied to the modified operating conditions, the maximized generated hydropower is 8.66 kW.The bypass valve always stays closed (O 1 = 0), due to the low water discharge (83 L/s) flowing through the San Giovannello station, which does not require the bypass activation.Furthermore, the control valve in pipe 2 is always closed, because there is no water transfer to the Trapani tank (O 2 = 0).The opening degree O 3 of the control valve supplying the Casa Santa system of tanks is 42.14%, which is smaller than in the current scenario (Fig. 6b) because of the smaller water discharge flowing in the turbine line (Q 4 = 83 L/s).Finally, in contrast to Fig. 7b, the pressure head at the exit of the San Giovannello station is equal to 53.89 m, which is larger than the minimum value P set .The physical reason is that the small flow rate leads to a very small flap opening, such that a possible additional head drop increment no longer balances the corresponding efficiency reduction.The maximization of PW in the digital twin does not entail the pursuit of the smallest acceptable pressure head P set at the exit of the San Giovannello station, as in the current operational conditions.This marks an important advantage of the digital twin-based ARTC, which seeks direct maximization of PW, instead of simple minimization of the pressure head at the exit of the station.Application of the current AU-based RTC would have yielded a pressure head value P 3 = P set and a suboptimal value of PW.

Conclusions
In this paper, a new Advanced Real Time Control system is conceived for the automatic management of the valves and the turbine inside a node of water transport mains with hydropower production.The main advantage of the new system, compared with the traditional RTC based on the feedback principle, are: 1) it avoids iterative corrections, otherwise occurring especially in the case of several control parameters, 2) it can embed complex strategies aimed to the maximization of the produced electric power, subject to the given hydraulic constraints.
The system is based on the use of a digital twin of the hydraulic plant and is applied to a pressure regulation node active in Sicily.The system includes a PRS turbine and a control valve-equipped bypass line, both installed in the San Giovannello station, plus other control valves placed for regulating the flow rates delivered to downstream tanks inside urban and industrial areas.
The digital twin is based on physically-based equations of mass conservation and energy balance, plus five relationships linking the decision variables to the turbine efficiency as well as to the head losses in the turbine, in the bypass lines and in two downstream delivery valves, continuously calibrated on the basis of field measurements.
An ARTC logic was developed in the digital twin for maximizing the hydropower generated and for regulating the service pressure at the exit of the San Giovannello station, in contrast to the automation logic currently implemented in the field, based on exploitation of the whole surplus of service pressure.
Following calibration against field measurements, the digital twin was applied to simulate twenty days of real operation of the San Giovannello station.The digital twin guaranteed identical hydropower generation with respect to the current automation logic in the real operational scenario, besides offering potential for reducing wear of the actuators, which can be governed at coarser time steps.Simulation of different scenarios, different from the ones that really occurred in terms of boundary conditions, also proved the capability of the proposed ARTC logic to strongly improve the global hydropower production with respect to the traditional automation logic.
Before being potentially implemented in the field, additional numerical analyses should be carried out to explore the most suitable size for the time slot T PRECAL to be used for calibration of the digital twin.In this connection, T PRECAL should be long enough to access a sufficiently large range of operating conditions including the current behaviour of the system, without overloading the memory capacity of the database.This trade-off is beyond the scope of the present paper and will be the subject of future investigations.Additional analyses will also explore the most suitable frequency for updating the calibration of the digital twin.
Future work will be dedicated to the set-up of other control logics, also considering additional operational choices such as the adoption of time variable flow-rates delivered to downstream tanks, for enhancement of hydropower generation.

Fig. 1
Fig. 1 Vertical section of a PRS turbine along a pipeline axis (left) and PRS turbine installed at the San Giovannello station (right)

Fig. 2
Fig. 2 Sketch of the water transport network study case

Fig
Fig. 3 San Giovannello digital twin hydraulic network functions, through the same model, of the assigned boundary conditions of the model and of the decision variables O 1 , O 2 , O 3 and O 4 .The constraint on O 4 is due to a turbine constructive requirement on the flap setting λ.The decision variables of the optimization problem are the four configuration-settings O of the three valves and of the turbine flap, which affect all the digital twin variables.The variable η is equal to the total (mechanic, hydraulic and electric) efficiency of the turbine, multiplied by the gravity acceleration.It is a function of the flap opening setting O 4 and of the velocity ratio Vr, which is a function of flow rate Q 4 and of λ.Therefore, in this work, it was assumed that η = η(O 4 ,Q 4 ).

Fig. 5
Fig.5As a function of time t during ten consecutive days (240 h) of operation, a boundary conditions for the digital twin: patterns of P 2 and P 6 , and Q w ; b patterns of Q T1 and Q T2, obtained in the field (exp) and with the digital twin of the San Giovannello station (mod)

Fig. 6
Fig. 6 Numerical (mod) and experimental (exp) results concerning a the patterns of generated PW hydropower and b setting O 1 , O 2 , O 3 and O 4 as a function of time t during ten consecutive days (240 h) of operation

Fig. 7
Fig. 7 Numerical (mod) and experimental (exp) results: patterns of a water discharge Q 4 in the turbine line and water discharge Q 1 in the bypass line, and b pressure head P 3 at the exit of the San Giovannello station, as a function of time t during ten consecutive days (240 h) of operation

Table 1
San Giovannello digital twin network nodes