## 3 Numerical Modelling in Single Pipelines
### Three-Dimensional CFD Model  
As with the two-dimensional CFD model described in Section 2 of this research, [PERSON] et al. [8; 24] ensured the numerical solution of the fluid, PVoF, transport and thermodynamic equations using OpenFOAM software v2012 of CFD Direct (ICL, UK) for application on a three-dimensional computational domain. To simulate the turbulence, SST \(k\)-\(\omega\) model was used, based on the advantages of this model mentioned in Section 2.2, taking into account that these equations have been used by other authors to analyse two-phase transient flows in three-dimensional CFD models [25; 32].  
First and second order numerical schemes were defined in the different terms of the governing equations, and the PISO algorithm was used. Cases 1 and 2 correspond to a similar experimental setup, so the difference between models is highlighted by the presence of the orifice. In Case 1, the CFD model has four boundaries: (i) outlet, (ii) walls, (iii) moving walls and (iv) Valve Sliding Interface (VSI); in Case 2, the boundary conditions of Case 1 were used, adding a boundary corresponding to Inlet (air admission orifice). Equations of boundary conditions were similar to those presented in Table 3, where the VSI boundary in contact with the pipes allowed flow circulation to aid water drainage and acted as a wall when the ball valve connections were not in contact with the pipeline.  
The CFD model was performed using a structured mesh in all geometric domains: in Case 1, using a square cross-section within the circular cross-section, and for Case 2, using a detailed orifice with small cells, with a cell had a dimension of 3 \(\times\) 10\({}^{4}\) m in width. These details are shown in Figure 9.  
A sensitivity analysis of the mesh was performed to verify the independence of the numerical results from the mesh resolution. To that end, [PERSON] et al. [8] performed an independence analysis of this CFD geometry through the analysis of the numerical evolution of the pressure patterns using different meshes, ranging from 43,500 to 1,220,000, cells with different meshing properties (aspect ratio, asymmetry, orthogonality and computational times), where the numerical results with the different meshes presented a good agreement with the reference measurement used. Finally, in this research, a mesh of 507,375 cells was used for Case 1 and a mesh of 173,500 cells in Case 2 [24].  
Figure 9: Geometric domain of 3D CFD model applied for Cases 1 and 2.  
In addition, a maximum Courant number of 0.5 was used, with an adjustable time step between \(10^{-4}\) s and 1.0 s, similar to the 2D CFD model performed in Section 2.2. To verify the convergence of the numerical solution of the CFD model, the decrease in the residuals of the pressure variable was verified, in which the residuals generated in the 3D CFD models of Case 1 tended on average to values that oscillated on the scale of \(10^{-4}\) Pa, in which the numerical solution of this variable converged after a maximum of 8 iterations. On the other hand, the residuals of the 3D CFD models of Case 2, at a general level, tended to values that oscillated on the scale of \(10^{-5}\) Pa, reaching convergence after a maximum of 2 iterations. These simulation were executed in an AMD(R) Opteron(TM) 6380 processor, with a frequency of 2.75 GHz, 16 cores, 32 threads and physical memory of 96 GB.