## 5 Application of CFD-Based Digital Twins
### Application of the Proposed Digital Twin for Emptying Procedures
#### 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 [PERSON] et al. (2017) and [PERSON] et al. (2018). 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\times 10^{-4}\) 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.  
Figure 14: Correlation between minimum air pocket pressure: measurements and numerical data.  
Figure 13: Comparison of air pocket pressure patterns from CFD model and measurement—Test 12.  
Figure 15: Air–water interface: Digital Twin and Experimental Facility: Emptying Process—Test 12.