## 5 Application of CFD-Based Digital Twins
### Application of the Proposed Digital Twin for Filling Procedures
#### 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 [PERSON] 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 \(\times\) 10\({}^{-5}\) 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 \(\times\) 10\({}^{-6}\) 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 9: Air pocket pressure head pulses in filling procedures. 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\({}_{2}\)O. 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\({}_{2}\)O. 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. Figure 11: Digital Twin correlational analysis using real-time data of air pocket pressure—Filling Procedures. Figure 10: Comparison of air pocket pressure patterns of CFD model with real-time data—Filling Process of Test 38a. 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.