1. Introduction
Water pipelines are hydraulic infrastructures that supply and distribute water from the point of origin to the points of water demand. The water supply systems are divided into the following infrastructures: (i) raw water pipelines, (ii) drinking water pipelines, and (iii) water distribution networks [
1].
Pipeline filling and emptying processes in pressurised systems are critical operations in hydraulic engineering [
2], as they involve transient two-phase air–water interactions that can lead to severe pressure surges, vacuum conditions, and potential structural damage [
3,
4,
5,
6]. Accurately predicting and controlling these transient phenomena are essential to ensuring operational safety and efficiency. In that sense, Digital Twin (DT) technologies have emerged as powerful tools for modelling and optimising water flow efficiency [
7,
8,
9].
DTs for water distribution systems can harness static and dynamic big data collection and management, including SCADA and IoT data, to represent system performance more accurately, generate valuable insights, and support actionable outcomes for managers, operators, and users [
10,
11]. DTs facilitate the integration of artificial intelligence (AI), enhancing decision-making processes. System managers increasingly utilise DTs to optimise all system management [
12,
13,
14]. In control and emergency centres, hydraulic simulators powered by DTs allow operators to simulate responses to emergencies such as pipeline failures, rupture occurrences, leakage increases, fraud water connections, and water supply outages [
15]. Implementing these advanced interactive tools enhances system-wide awareness and supports the sustainability and efficiency of water pipe systems by integrating real-time measurement data [
16,
17,
18].
DTs for water distribution systems have been applied using one-dimensional mathematical model approaches for single-phase (water) flows, and they have been integrated with real-time monitoring to represent typical scenarios that can be useful for making decisions. For example, Ramos et al. [
19] developed a DT based on a one-dimensional mathematical model that was applied to water distribution networks, integrating sensors and real-time data analysis to supply datasets concerning hydraulic parameters for making decisions, where its key contribution was the significant reduction in water losses. Conejos Fuertes et al. [
20] implemented a DT to manage a drinking water distribution network in Valencia, Spain. Their main contribution was developing the GO2HydNet system based on mathematical models, an application that integrated hydraulic models with real-time data from GIS, SCADA, and IoT sensors. This allowed for the accurate simulation of network behaviour in past, present, and future scenarios, facilitating decision-making for planning, operation, and emergency response. Romero et al. [
16] implemented a DT for the sustainable management of pressurised water systems based on hydraulic modelling (EPANET) with sustainability indicators (social, economic, and environmental). The model optimised water and energy efficiency, achieving reductions in energy consumption, as well as generating 103,710 kWh/year of renewable energy.
Although DTs based on one-dimensional models can effectively predict specific hydraulic parameters in both steady and unsteady flow conditions, they treat the flow as a single-phase (water) flow, which limits their ability to capture the effects of air–water interaction. In need of more information on two-phase transient flows in pressurised pipelines, Computational Fluid Dynamics (CFD) models have been developed in some research to understand the hydraulic and thermodynamic phenomena in water infrastructure [
21]. Unlike one-dimensional models, CFD models allow for detailed spatial resolution and provide valuable information in both the temporal and spatial domains using contours [
22,
23], allowing the study of local-scale phenomena such as the shape and movement of air bubbles [
6,
24].
Two-dimensional (2D) and three-dimensional (3D) CFD models provide higher accuracy in simulating transient flows during filling and emptying procedures. However, selecting the appropriate CFD modelling approach depends on the specific characteristics of the hydraulic process under study [
21,
25].
Two-dimensional (2D) CFD models are characterised by the fact that they are more straightforward than 3D CFD models and allow for the fitting of a flow that predominates over a specific plane. These models assume that the flow spans mainly two directions and that the flow in the third dimension does not significantly affect the dominant flow plane. From the literature, it is essential to highlight the different relevant 2D CFD models developed in the previous research. For example, Authors such as Liu and Zhou [
26] and Zhou et al. [
27] developed 2D CFD models with structured cells to study the air–water interaction processes through a horizontal pipe defined in profile, where the authors represented, in the two-dimensional plane, the pipe diameter (vertical axis) and its length (horizontal axis). On the other hand, Besharat et al. [
24,
28] developed a two-dimensional CFD model using a mixed mesh (structured–non-structured) to study the air–water interactions during filling processes in a branched pipeline, with a total length of 7.3 m and an internal diameter of 51.4 mm, in which the flow presented a predominant trajectory on a vertical–horizontal plane, with the diameter being projected on the vertical dimension and the pipe axis on the horizontal axis thus forming vertical–horizontal projections. On the other hand, Hurtado-Misal et al. [
29] developed a two-dimensional CFD model using a structured mesh for studying emptying processes using a similar experimental setup.
On the contrary, 3D CFD modelling contributes to a detailed representation of two-phase flows in austere and complex geometries, capturing spatial interactions and the three-dimensional effects of a fluid, especially in two-phase transient phenomena. Today, some researchers have adopted 3D CFD models, and it has been the most reliable alternative for modelling two-phase flows in water pipes with entrapped air. Authors such as Martins et al. [
30] studied the behaviour of the air–water interface in a horizontal–vertical water pipeline during rapid filling processes using a three-dimensional CFD model discretised through a structured mesh, comparing their numerical results obtained in a previous investigation using a 2D CFD model [
31]. Furthermore, Zhou et al. [
4] studied the dynamic behaviour of trapped air from a thermodynamics and pipe roughness approach. For this purpose, the authors used a 3D CFD model with hexahedral cells to represent the pipe layout and observe the transient and heat transfer phenomena presented in different tests. Li et al. [
32] and Chan et al. [
33] developed 3D CFD models to study pressurised air in water pipes, in which similar air entrapment phenomena occur as in actual water pipes. In the case of Li et al. [
32], a discretised CFD model in unstructured cells was used, while Chan et al. [
33] discretised the 3D CFD model into mixed finite elements (hexahedral and tetrahedra). Eldayih et al. [
34] studied the air–water interaction during the pressurisation of a water pipe with return air flow using three-dimensional geometry for the modelling and then discretised it in hexahedra. Huang et al. [
35] analysed detailed physical parameters such as velocity profile, pressure distribution, temperature, and air–water interaction during the pressurisation of a water pipeline with trapped air using a three-dimensional geometry with structured elements. Furthermore, Paternina-Verona et al. [
6,
36] studied transient phenomena focused on emptying processes in water pipelines with/without air valves, respectively, where different phenomena were identified, such as backflow air and the aerodynamic effect of air admission.
The above review highlights significant advancements in the application of one-dimensional models as Digital Twins (DTs) for water distribution systems and CFD-based two-phase flow simulations in pressurised pipelines. However, a research gap remains in integrating high-resolution CFD models within a Digital Twin framework to enhance real-time monitoring and predictive capabilities for pipeline filling and emptying procedures. While DTs based on one-dimensional models have proven effective in deciding on water networks, they do not capture air–water interactions, limiting their applicability in transient two-phase flow scenarios. Similarly, although 2D and 3D CFD models provide adequate representations of air entrapment and pressurisation dynamics, their potential has not been fully explored as a DT to optimise operational strategies in hydraulic infrastructures.
This paper presents a CFD-based Digital Twin in order to fill the knowledge gaps about air–water interactions during filling and emptying processes in water distribution systems. This paper explores how CFD models can represent the real-time data generated by physical twins and provide predictions with more numerical and visual information thus allowing the identification of complex hydraulic and thermodynamic phenomena. This study comprises three sections as follows: (i) a real-time dataset for investigating filling and emptying procedures obtained from an experimental setup conducted at Instituto Superior Técnico in Lisbon, Portugal; (ii) a CFD modelling framework, focusing on studies that developed CFD models applied for studying two-phase transient flows for filling and emptying procedures in pipelines, highlighting the advantages and limitations of each approach; and (iii) the application of machine learning algorithms to predict hazard scenarios in both processes.
5. Application of CFD-Based Digital Twins
For developing Digital Twins to analyse the two-phase flow in pipes during filling and emptying procedures, real-time measured data are unified and, consequently, CFD simulations are performed. In this scenario, tests are performed in an experimental setup, recording data with the various equipment described in
Section 2.2. For the CFD simulations, HVoF equations and turbulence models are defined. Experimental and simulation data are integrated into a dataset to calibrate the CFD model using mesh sensitivity analysis. By applying AI/machine learning tools, predictive analyses are performed that lead the user to identify the magnitude of the effects of air–water interaction in the study network through real-time records and, finally, represent these findings through a virtual model (DT) to test the most efficient conditions for decision-making on pressure conditions, trapped air volume, as well as the need for air valves in the study network.
Figure 8 illustrates a DT framework which integrates CFD modelling to analyse hydraulic procedures.
In this section, an application of the DT based on CFD modelling is shown, taking two example cases as the filling and emptying procedures, as well as a summary of the correlational analysis of the pressure values between the real-time measurements and the DT with the dataset.
Scenarios of
Table A1 were used for simulating filling procedures. On the other hand, information of
Table A2 were used to simulate emptying procedures. Some modelling conditions are defined and shown in
Table 6.
The CFD-based DTs were simulated using a two-way coupling approach with HVoF equations. This ensures a reciprocal interaction between water and air, allowing each phase to influence the other’s dynamics. Furthermore, the DTs were represented through the OpenFOAM v2412 software using a solver entitled
compressibleInterFoam, which considers the compressibility of both air and water, with their respective compressibility differences (air is 20,000 times more compressible than water [
70,
71]). The effects of surface tension due to the application of the filling and emptying process in a small inner diameter pipe were considered (equal to 51.4 mm).
On the other hand, the modelling conditions for the filling and emptying procedures were based on the modelling conditions of Paternina-Verona et al. [
59] for the filling procedures, as well as Hurtado-Misal et al. [
29] and Paternina-Verona et al. [
54] for the emptying procedures, highlighting some aspects such as mesh conditions with mesh independence analysis and physical boundary conditions. In this case, a turbulence model such as SST
was applied for the filling procedures due to the good performance concerning adaptation in scenarios with high-pressure gradients. It was also used in emptying procedures since this turbulence model can represent the effects of the viscous layer as a function of the dynamic viscosity thus adequately simulating the fluid–pipe wall interaction independently in air and water.
5.1. Application of the Proposed Digital Twin for Filling Procedures
The Digital Twin application in this section discusses an analysis of the real-time measurements of the pressure patterns during filling procedures and describes the role of machine learning in determining possible efficient filling procedures. On the other hand, it also shows the development of the Digital Twin, describing the calibration methods and the validation of the numerical information with the measured data.
5.1.1. Data Analysis—Filling Procedures
The Digital Twin representing the filling procedures was refined from the hydraulic scenarios defined in
Table A1. From these scenarios, pressure patterns were identified according to the presence or absence of air valves, air valve discharge diameter, and initial air pocket size.
Figure 9 presents a sample of the real-time measurements carried out using the big data platform, which aids in analysing the pressure patterns according to the input data for filling procedures.
Figure 9 compares the pressure evolution in the different test scenarios. The results indicate that the most critical peak pressure occurs in the hydraulic filling conditions associated with the Type II scenario, specifically in Test No. 11, where a pressure peak exceeding 120 m-H
2O occurs within the first second. This behaviour suggests a rapid transition of flow conditions, likely influenced by the use of the D040 air valve, which does not effectively regulate the air expulsion rate, leading to sudden pressure surges. In contrast, the Type I scenario (Test No. 6), where no air valve is used, exhibits a more gradual pressure response, although with prolonged oscillations due to the trapped air and its compressibility effects.
In addition, differences in the pressure oscillation patterns are observed between the different scenarios. In the Type I and V scenarios, pressure oscillations are more pronounced and persist for extended periods, as the trapped air pocket is compressed without controlled expulsion. This situation is also evident in the Type III and VI scenario, where the S050 air valve is used but still allows considerable pressure oscillations, albeit slightly less extreme than in Types I and V.
The influence of initial air pocket size is also significant. A different pressure evolution is observed in Type V–VII, where the air pocket is increased by 1.5 m while maintaining the same conditions as Types I–IV. The increased air volume acts as a form of damping, altering the transient response. However, pressure fluctuations persist for extended periods without an air regulation mechanism. In contrast, when air valves are incorporated (Types VI and VII), pressure peaks are reduced, and the system stabilizes rapidly.
5.1.2. CFD-Based Digital Twin for Filling Procedures
To develop a DT, a three-dimensional CFD model discretised by 330,793 tetrahedral elements was used. The number of elements was based on the mesh sensitivity of Paternina-Verona et al. [
59]. The Digital Twin had three (3) boundaries and an inlet boundary, which was set using the absolute inlet pressure value (i.e., if the hydro-pneumatic tank pressure was 0.5 bar, the absolute pressure inlet value would be 151.325 Pa). The atmospheric pressure conditions determined the outlet boundary, and it was applied in scenarios where air valves were present. Additionally, the walls were another boundary governed by the no-slip function due to the friction generated by flow–pipeline interactions.
The CFD model was executed using the PISO algorithm with a variable Courant number, capped at a maximum of 0.9. This value, close to 1.0, was chosen to enhance the numerical analysis of air outflow through the air valve zone. The simulation time for filling procedures varied depending on the scenario. In the Type I and V scenarios (without air valves), the simulation required approximately two days to reproduce just two seconds of real-world behaviour, with an average time step of 4 × s. In contrast, scenarios involving air valves (Type II, III, IV, VI, and VII) demanded significantly more computational effort, taking between 7 and 10 days with an average time step of 1 × s. The reduced time step in these cases was necessary to capture airflow behaviour over the air valves accurately. All simulations were performed on an AMD Opteron processor (AMD, Santa Clara, CA, USA) with 16 cores, 32 threads, and 96 GB of RAM.
Figure 10 compares the real-time measurement of the trapped air pocket pressure and the three-dimensional CFD model, both associated with Test 38a (
Table A1), and is shown as a representative example of a specific case study, illustrating in detail the evolution of trapped air pressure in a particular scenario. Test 38a highlights a good similarity between the measured information and the information calculated by the CFD model. At
t = 0.00 s, the water phase, including the trapped air, rests. Subsequently, at
t = 0.25 s, the water column rises to the pipe’s left branch. Consequently, the pressure in the air pocket gradually increases, reaching a pressure of 1.2 m-H
2O. At
t = 0.50 s, the water column has reached the upper end of the hydraulic network, generating a backward movement of the water column through the upper zone of the pipe. At this instant, the trapped air pocket reaches the maximum overpressure value of 10.2 m-H
2O. At
t = 1.5 s, the water column has displaced the volume of air trapped in the pipes outwards using a S050 air valve, and the water column has partially reached the upper zone of the pipe. At that instant, the trapped air pocket has started its second pressure pulse at
t = 2.00 s.
To calibrate the DT to simulate the dataset, a compilation of the data measured concerning the air pocket pressure obtained in the DT is carried out, comparing the information of several tests associated with the different dataset typologies.
Figure 11 compiles and synthesises the results of all the modelled scenarios, allowing for a global view of the DT performance under different conditions. This figure shows an adequate correlation between the measured values and those obtained in the DTs of the various scenarios associated with filling procedures.
To assess the correlation between the measured real-time data and the respective DT, the relative error equation is used for each dataset, and the results are then averaged. To calculate the relative error, Equation (
12) is used.
where
corresponds to the real-time measured value of the air pocket pressure, while
corresponds to the maximum pressure value of the DT. Based on the data in
Figure 11, the correlational error between the datasets is 6.54%, indicating a satisfactory fit of the DT to the measured values in the filling scenarios analysed in this study. In particular, some correlated data are scattered concerning the fit line, especially in the range of values between 10 and 20 m-H
2O. These data in the mentioned range mostly correspond to the pressure measurements associated with secondary oscillations after the filling procedures, where the pipe acts as a buffer for the pipe material. This deviation is because the DT does not consider fluid–pipeline interactions.
5.2. Application of the Proposed Digital Twin for Emptying Procedures
The Digital Twin application in this section focuses on analysing the real-time pressure measurements during emptying procedures and exploring the role of machine learning in identifying efficient drainage strategies. Additionally, it examines the system’s behaviour by comparing numerical predictions with measured data.
5.2.1. Data Analysis—Emptying Procedures
In the case of the Digital Twin for the representation of emptying procedures, some sensitivity parameters such as the initial size of the trapped air pocket, the opening percentage of the drain valves, as well as the air intake orifice diameter of the air valves are taken into account.
Figure 12 offers a sample of the identified behaviours, showing that the most critical vacuum pressures are associated with the Type II scenarios (with a value of 9.32 m-H
2O in Test 3, where there are no air valves, and the valve opening is complete). A different behaviour occurs in the Type I scenario, where the opening of the drain valves is partial, generating a controlled drainage process and a damping of the vacuum pressures and thus resulting in a value of 9.73 m-H
2O in Test 1. In the case of the Type III scenario, the lengths of the air pockets are longer compared to those presented in the Type II scenario, and the conditions of whole drain valve opening are maintained, thereby offering a minimum pressure of 9.51 m-H
2O in Test 5.
Also, the differences in pressure patterns between the emptying procedures with and without air valves are shown.
Figure 12 shows that in the emptying scenarios without air valves (Type I, II and III), pressure oscillations occur, which are dissipated because of energy damping by the trapped air and the pipe material, whereas in the scenarios with air valves (Type IV and V), the minimum vacuum pressures are less than the scenarios without air valves.
In the Type IV scenario, an air valve with a diameter of 3.175 mm is used, and in a study test (Test 7), a minimum vacuum pressure of 9.56 m-H2O is shown. In contrast, in the V scenario, an air valve with an orifice inlet diameter of 9.375 mm is applied thus generating a minimum pressure of 10.14 m-H2O. Consequently, a rapid filling procedure takes place, since, in the other scenarios (Type I–IV), the pressure takes more than 8 s to recover the atmospheric conditions, which suggests that the emptying process for that point in time has not finished; whereas, in the Type V scenario (Test 12), the atmospheric pressure recovers its atmospheric conditions at 6.5 s, which is related to the total emptying of the water from the pipe at that point in time.
5.2.2. CFD-Based Digital Twin for Emptying Procedures
In this case, a DT is used based on a two-dimensional CFD simulation discretised by 26,130 hexahedral cells. The number of elements is based on the mesh sensitivity of Paternina-Verona et al. [
54] and Hurtado-Misal et al. [
29]. The Digital Twin for emptying procedures has four (4) boundary conditions. The inlet boundary allows for air admission and is governed by an atmospheric pressure condition, which is only applied in the Type IV and V scenarios where air valves are present. The outlet boundary is also determined by atmospheric pressure and corresponds to the water discharge during emptying. The walls are subject to no-slip conditions, ensuring realistic fluid behaviour along solid surfaces. A Valve Sliding Interface (VSI) function is implemented, acting as a dynamic mesh that simulates a shut-off valve, allowing for controlled drainage.
Using a PISO algorithm, the DTs were run using a maximum Courant number of 0.7 to guarantee numerical stability during the simulation. The average time step was 1 × s, and the model took approximately 4 days to represent the equivalent of 8 s of the real-world behaviour.
Figure 13 shows a comparison between the real-time measurements by a pressure transducer and the numerical patterns of air pocket pressure during the emptying process of Test 12 (
Table A2—Type V), in which a similarity is identified between the patterns measured in real time and those obtained in the two-dimensional CFD model. In this case, the pressure drops gradually from the initial instant to
t = 2.0 s due to the gradual opening of the drain valves for a duration of 1.6 s. During this first time point, the air volume expands. Subsequently, the pressure increases in a controlled manner due to the admission of air through the air valve D040 thus generating a controlled emptying in a time of 7 s.
As in the representation of Test 12 (see
Figure 13), the DTs proposed for the emptying procedures were applied to corroborate the reliability of its development in the different types of emptying scenarios set out in
Table A2. In this case, a comparison was made between the minimum peak values of the measured air pocket pressure and those obtained in the CFD model that integrated the DT, as shown in
Figure 14, where an adequate fit, with a relative error of 0.16%, was observed between both values along the perfect fit line. This validates its applicability for simulating hydraulic scenarios involving trapped air, enabling the prediction of critical events associated with air management in pipe networks.
When pipelines are transparent, video data allow for the identification of air–water interaction phenomena that help to validate the proper development of the CFD model and verify the physical behaviour of both fluids.
Figure 15 compares the motion of the air–water interface detected by camera frames, as well as the contours of the air–water phases of the CFD model that were captured using the proposed DT.
5.3. Application of Machine Learning Model
Filling and emptying processes are essential operations that water utilities must perform using the CFD modelling. In the existing pipelines, these simulations can take approximately 2.5 months [
72]. Given the urgency of interventions, water utilities cannot afford such lengthy simulation times.
To address this challenge, the datasets presented in
Table A1 and
Table A2 were used to train a predictive model capable of forecasting the behaviour of filling and emptying procedures. The MATLAB vR2020a software validated a reliable machine learning model, testing 31 algorithms. The numerical accuracy rates of various classification learner algorithms—including decision trees, support vector machines, nearest neighbour classifiers, and ensemble classifiers—are illustrated in
Figure 16. Among these, for filling processes, the tree, efficient linear, and ensemble models proved the most suitable for accurately replicating the complex air–water interactions with an accuracy of 100%; while for the emptying procedures, the KNN models provided the best responses with a fit of 96.9%.
The following variables were used to classify the scenarios for implementing these algorithms (see
Appendix A): initial hydro-pneumatic pressure in the tank (
); initial air pocket size (
); internal pipe diameter (51.4 mm); maximum/minimum pressure during the transient event; and air valve diameter.
Figure 17 illustrates the parallel coordinates for the predictions. Only one incorrect prediction was reached for the emptying processes.
Figure 18 presents the confusion matrix for the best solution for the filling and emptying operations, allowing for an assessment of validation accuracy.
The trained models effectively captured the hazardous pressure peaks generated in the Type II scenario for the filling processes (see
Figure 9). In this scenario, a pressure head peak of 123 m was observed, approaching the nominal pipe pressure of 163.2 m (PN 16). This occurs when an air valve with a high expelled air capacity induces dangerous pressure surges. It is not a common situation but depending on initial conditions, it can occur. This finding is particularly significant, as it highlights the ability of machine learning techniques to identify undesirable conditions, thereby helping to prevent pipe failure in existing water pipelines. Similarly, for emptying processes, the adopted machine learning model can follow the tendency of air–water interactions with and without air valves, providing a practical tool for detecting collapse conditions depending on soil conditions and stiffness pipe class.
6. Discussion
The CFD-Based Digital Twins have proven to be a robust approach to analysing transient two-phase flows in pipeline filling and emptying operations. This study has demonstrated the capacity of DTs to replicate complex hydraulic phenomena, offering a predictive tool for optimising operational procedures.
One of the key findings of this research is the role of air pockets in influencing transient pressure conditions. The results show that entrapped air pockets significantly affect both the filling and emptying processes, with their size and distribution altering the pressure response. In filling procedures, large air pockets cause rapid pressure surges due to compression effects, particularly when air expulsion is not adequately controlled (e.g., Type II with an AV D040 and III with an AV S050). Conversely, air pockets contribute to vacuum pressure formation in emptying processes, which can lead to structural risks in the pipeline system if not properly managed. The results highlight the impact of different air valve configurations on the pressure regulation for emptying procedures. Scenarios incorporating air valves, such as Type IV and V for the emptying procedures, exhibit smoother pressure transitions and reduced pressure peaks compared to the cases without air regulation. This is consistent with the previous research indicating that controlled air admission and expulsion mechanisms are fundamental to mitigate hydraulic transients Carlos et al. [
73]. In the case of the study of air valves in filling procedures, it is observed that the use of a 7 mm orifice (Type IV) demonstrates a more gradual pressure variation, suggesting that optimising valve size and placement can enhance system stability.
The comparison between real-time pressure measurements and numerical data confirmed the reliability of the DT models. Calibration efforts, including mesh sensitivity analysis and turbulence model selection, accurately represented transient hydraulic behaviours. The DTs demonstrated an adequate predictive capability, obtaining the time series associated with the evolution of hydraulic–thermodynamic parameters at any point in the geometric domain, such as pressure and velocity, as well as the opportunity to visualise the spatial distribution of these same variables at different points in time. The differences between the numerical and measured values are slight, with relative errors remaining within the acceptable limits, typically below 6.54% for the filling procedures and 0.16% for the emptying procedures. However, some discrepancies were noted in the secondary oscillations post-filling (in the case of the filling procedures), likely due to pipe–wall interactions that were not explicitly accounted for in the model.
A 2D approach is chosen to simulate emptying procedures and efficiently capture the evolution of air pockets and vacuum pressures along the pipeline. Since the flow is predominantly stratified (as shown in
Figure 15 in Test 12 as an example), with air entering the system from the highest point and water draining from the lowest, a two-dimensional model provides sufficient resolution while optimising computational resources.
For filling procedures, a 3D CFD model is necessary to capture the complex dynamics of air compression and expulsion. Unlike the emptying processes, filling involves a more intricate interaction between air and water, with significant pressure surges and turbulent mixing occurring in multiple directions. The three-dimensional approach allows for a more detailed representation of the air pockets’ spatial evolution, the effects of valve positioning, and the potential for asymmetric flow patterns that cannot be captured in a 2D framework.
On the other hand, the potential of integrating machine learning techniques within the Digital Twin framework is highlighted. By training predictive models using datasets from real-time monitoring and CFD simulations, the DT can identify unfavourable conditions, such as excessive vacuum or high surge pressures. This capability can assist in decision-making by recommending optimal valve operation strategies and predicting potential failure risks before they occur. However, some limitations must be considered. ML models may struggle with highly complex or unforeseen hydraulic scenarios that are not well represented in the training phase. Furthermore, the computational cost of real-time learning and inference can be significant, especially for large-scale pipeline systems with continuously changing conditions. Despite these limitations, the integration of machine learning into the Digital Twin framework represents a valuable advance in optimising pipeline operations and safety thus leveraging predictive capabilities through real-time data and CFD modelling.
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 reduces overpressures 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 Aguirre-Mendoza 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 Técnico (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). In addition, the numerical modelling should focus on refining fluid–structure interaction models to account for the secondary oscillations due to pipe–wall interactions and expand the DT framework to real-world water distribution networks.