## 7 Conclusions  
This research presents a Digital Twin framework based on CFD modelling for analysing and optimising the filling and emptying procedures in pressurized pipelines. The main conclusions drawn from this study are as follows:  
* Entrapped air pockets play a critical role in transient pressure fluctuations during filling and emptying operations. Their size and distribution significantly impact the hydraulic response, with large air pockets contributing to extreme pressure variations. * The implementation of air valves and orifices effectively mitigates pressure surges and vacuum formation. The results indicate that controlled air expulsion reducesoverpressures during filling, while air admission mechanisms minimize vacuum conditions during emptying. * The Digital Twin models accurately replicate pressure dynamics, demonstrating a good agreement between the real-time measurements and the numerical simulations. * Machine learning techniques enhance decision-making by identifying critical hydraulic scenarios and optimising pressure management in pipeline filling and emptying processes. They enable the prediction of optimal pressure heads for filling and the most effective valve operation settings for emptying, while also assessing the influence of air valves in both cases. This demonstrates the reliability of ML models in forecasting pipeline behaviour, not only under standard conditions (Scenarios I, III-VII) but also in situations where large air valves may induce higher overpressures than smaller ones (Scenario II), as observed by [PERSON] et al. [56]. Additionally, for the emptying procedures, ML models can help detect critical sub-atmospheric pressure levels that must be monitored to prevent pipeline collapse. Using ML techniques, it is possible to enhance computational efficiency and reduce the time required by CFD models when predicting these processes in real pipelines. Integrating a CFD-based Digital Twin with a machine learning model allows users to identify key hydraulic phenomena, such as maximum and minimum pressures, by leveraging both dataset information and CFD-simulated models. This approach enables a more comprehensive analysis of pipeline behaviour. In addition, the CFD-based Digital Twin can be used to test scenarios beyond those included in the dataset, identify some hydraulic phenomena conditions without requiring further CFD simulations, providing a valuable tool for operational decision-making to ensure safe and optimal filling and emptying conditions in a short time. It is important to highlight that improper manoeuvres can compromise the integrity of these systems under extreme pressure. Inadequate operations may lead to an increased incidence of pipeline ruptures, resulting in high costs for maintenance and repair programmes and elevated leakage volumes in water installations, which present a challenge for both developing and developed countries. Generating scenarios using the proposed Digital Twin can be a powerful tool for preventing pipeline ruptures and stopping new leakages. Unlike the proposed Digital Twin, the current recommendations and manuals, such as AWWA M51, do not provide sufficient tools for adequate modelling. This research exemplifies the implementation of a Digital Twin applied to an experimental facility located in the Hydraulics Laboratory of the Instituto Superior Tecnico (IST) at the University of Lisbon. Additionally, a comprehensive dataset of filling and emptying scenarios is presented in the Supplementary Materials, which water utilities can utilise to reproduce these results. For future work, the application of a Digital Twin scheme for large-scale hydraulic pipelines is relevant, basing machine learning on the safety conditions of the hydraulic system (resistance of pipe materials) and on the national/international regulations for the control of filling/emptying procedures (min/max velocities and pressures).