Calculation Method for Hydraulic Shock in a Pipeline Considering Cavitation Phenomena in Openfoam Software Package

Hydraulic shock that occurs in pipeline systems can cause accidents and destroy pipelines, valves and equipment. If the pressure fluctuates due to a hydraulic shock, the pressure in the rarefaction phase may drop below the pressure of saturated vapours, resulting in a cavitation. This phenomenon is accompanied by an additional increase in the amplitude of pressure fluctuation, which leads to additional loads occurring in the hydraulic system. The aim of the paper is to provide the method for calculation of the hydraulic shock with the help of OpenFOAM soft-ware complex, which considers the cavitation formation.


Introduction
Hydraulic network consists of many different elements: pumps, gate valves, valves, fittings, etc. These elements are subject to wear due to impact of transient loads, occurring during transient processes, resulting in reduction of network life cycle and accidents.
A dangerous phenomenon that occurs in the hydraulic network during transient processes is hydraulic shock, described in detail in the literature [1,2,3,4]. Hydraulic shock results in liquid mass fluctuations due to its compressibility, which leads to periodic pressure fluctuations.
In case of pressure fluctuations due to hydraulic shock, the pressure in the rarefaction phase may drop below the saturated vapor pressure, resulting in cavitation cavity occurrence. This phenomenon is accompanied by additional increase in the pressure fluctuation amplitude, leading to additional loads, occurring in the hydraulic network.
This article proposes calculation procedure for hydraulic shock, considering the occurrence of cavitation cavities, in OpenFOAM open software package. The proposed calculation procedure was verified on the basis of experimental data and compared with the existing calculation procedure using method of characteristics [5].

Mathematical model description
Numerical simulation of hydraulic shock is performed using C++ libraries of OpenFOAM open CFD package. These libraries are free and are available under GPLv3 license.
The solution of hydraulic shock problem for turbulent flow with the possibility of cavitation simulation was performed using cavitatingFoam solver, a part of OpenFOAM [6]. This solver allows to simulate compressible turbulent flows of viscous liquid using homogeneous multiphase model for cavitation simulation. Medium compressibility is described by the barotropic equation of state (1). Differential equation (1) is the dependence of the medium density on the pressure, where ρm is the density of the vapor-liquid mixture, t -time, P -pressure,  -compressibility of the medium, which, equal to wave propagation velocity a squared (2): Steam mass fraction in the vapor-liquid mixture is denoted as γ and is calculated using equation (3): where ρm -vapor-liquid medium density, ρl,sat -liquid phase density at the vaporization pressure, ρv,sat -vapor phase density at the vaporization pressure. There is no cavitation in the computation mesh under the condition of γ = 0. In the case γ = 1, the mesh cell element is completely filled with steam. Vapor-liquid medium density ρm is calculated taking into account the steam mass fraction in the liquid (4): where l and v indications correspond to liquid and vapor phase, m indication corresponds to vapor-liquid mixture. Compressibility of vapor-liquid mixture m can be simulated using several approaches. In this case Wallis linear model is used, based on the steam mass fraction, and described by equation (5): Mixture viscosity value µm is calculated using equation (6): Taking into account the approach described above, the continuity equation (7) will look as follows: where U -vapor-liquid mixture velocity. Vapor-liquid mixture density value ρm calculated using continuity equation is used to obtain the preliminary value of γ (3) and  (5). After that, numerical solution of momentum-conservation equation (8) is performed: where μeff is the effective viscosity calculated using the equation (9): where µt is the turbulent viscosity, which is numerically calculated using the RANS turbulence model. In this case k-Omega turbulence model is used with wall functions, taking into account the roughness of the walls. The numerical solution of the above equations is performed by finite volume method using the PIMPLE algorithm, which is described in detail in the literature [6].

Description of the experimental setup
As experimental data the results of experimental studies conducted by the author C. S. Martin and presented in the article [7] were used. It was also compared with FlowMaster software product, using method of characteristics to solve the hydraulic shock equations in onedimensional configuration. FlowMaster calculation results data were taken from the verification report provided by the software product vendor.
Test bench diagram is shown in figure 1.

Problem setting in OpenFOAM
To simulate the verification problem, structured two-dimensional computation mesh was generated, simulating a pipeline section. The computation mesh elements number for the pipe height equals to 10.
Static pressure corresponding to the pressure in the upper tank was set as the boundary conditions at the pipeline inlet. At the outlet, the velocity is set as a function of time V(t), flow velocity change at the pipeline outlet corresponds to the Ball Valve closing. The liquid sticking condition is set for the walls. δ = 0.5 mm wall roughness was considered. Shock wave propagation velocity a = 1315 m/s. The calculation type was non-stationary, time increment was adaptive, corresponding to Courant acoustic number Co = 50. Vaporization pressure Psat = 2057 Pa.
As a result of the calculation, graphs of pressure fluctuation as a function of time at different pipeline sections x/L for all modes presented in table 1 were obtained.

Results
Pressure fluctuation graphs, showed on figures 2-7, as a function of time at the pipeline section x/L = 1/2 for all modes from table 1, are given as simulation results.

Conclusions
On the basis of verification calculations carried out, it can be concluded that hydraulic shock simulation in turbulent flow using the CFD approach gives high accuracy both for the regime without cavitation and for the regimes with developed cavitation. The two-dimensional problem configuration allows to significantly reduce the calculation time while maintaining high accuracy of the results.
Comparison of CFD simulation with one-dimensional simulation using FlowMaster method proved that for hydraulic shock without cavitation, both approaches demonstrate high accuracy of the results, but with the growth of cavitation cavities, the accuracy of the characteristics method decreases.
It is worth noting that OpenFOAM library does not have specialized boundary conditions for simulation of operation of pumps, valves, etc. This requires additional development of libraries with boundary conditions simulating the performance characteristics of hydraulic network equipment.