Cavitation is an undesirable phenomenon in hydraulic systems, as it causes erosion and noise. The main difficulty in cavitation prediction when using Fluent software is lack of an openly accessible tool for implementation of a freely chosen homogeneous cavitation model. In this paper the main challenge is to make such a tool, user defined function (UDF). The second challenge is to use a qualitative method in the assessment of the results of verification process. Three cavitation models are verified in Fluent 14.5: Singhal et al., Schnerr & Sauer and Zwart et al. The verification is based on the benchmark example from the Cavitation Modeling tutorial. Three methods of the algorithms verification are used: analysis of the convergence history of volume fraction, comparison of vapour volume fractions and statistical analysis of these data. The original achievements are not only the verified codes but also statistical analysis based on the computer methods of image analysis performed using two correlation coefficients: the first based on the cavitation intensity, and the second based on the changes of the cloud shape. The results of the analyses do not give any reasons to reject the UDFs. The appendix contains the analysed codes (available with the online version of this paper).
INTRODUCTION
The design of hydraulic systems and their elements require experimental measurements and numerical simulations. Scientists interested in spillways and dams first emphasized the influence of the aeration phenomenon on the considered flow (Castillo et al. 2014, 2016; Bayon-Barrachina & Lopez-Jimenez 2015). A similar tendency is visible also in closed hydraulic systems, such as pipe systems. Aeration is seen as a way to avoid the undesirable cavitation phenomenon (Najafi et al. 2012). For that reason, in numerical simulations, a multiphase flow with two phases, i.e. water and air, is considered. Cavitation in computational fluid dynamics (CFD) calculations and during the design stage is usually neglected. It should be emphasized that aeration helps to avoid cavitation, but it does not give any guarantee that cavitation will not occur. Additionally, there are some devices requiring cavitation in order to work correctly, e.g. converging-diverging nozzles (Ashrafizadeh & Ghasemmi 2015). Complex design works in hydraulic systems should also consider the cavitation phenomenon.
Cavitation is a phenomenon that consists in appearance, growth and disappearance of bubbles containing vapour of a given liquid. The bubbles grow in areas where the static local fluid pressure drops below the saturated vapour pressure. Next, the bubbles rapidly decrease and implode in areas of the increased pressure. The threshold value for pressure to start the cavitation process could be significantly lower than the saturated vapour pressure for homogeneous liquids or higher for liquids with a large amount of gases (Bagieński 1998).
Cavitation has been a topic of research since 1894 (Reynolds 1894). Thorneycroft & Barnaby (1895) subordinated this phenomenon to the wear of the surface of a screw propeller. The negative influence of cavitation, e.g. erosion and vibration, also started to be known in elements of hydro-turbines and parts of hydraulic systems. Experimental investigations are the first way to learn more about this danger for machines. To have a comprehensive picture of this phenomenon, a complex diagnostic system should be used. The measurement techniques of cavitation can be divided into two categories: contact and contactless. The contactless methods predominate in experimental investigations. To these methods we can classify high-speed imaging, particle image velocimetry (PIV), X-ray attenuation and optoelectronic systems. The oldest and most popular is the high-speed imaging method. A large number of frames per second, i.e. even millions, allows registering of even the smallest development stages of the cavitation area (Kravtsova et al. 2014). The PIV technique has been applied in the investigation of cavitating flow since 1995 (Tassin et al. 1995). The main restriction for potential users is the huge cost of this system. The X-ray is one more option for capturing images of the cavitation area. Data acquisition rates during X-ray measurements are high (more than 1 kHz) but they do not achieve the frequency values available using a high-speed camera. Stutz & Legoupil (2003) presented the first experimental results of cavitating flow investigations using X-ray. The double optical probe is an example of the contact method. The aim of these measurements is to extract the local void fraction from a liquid-vapour mixture (Stutz & Reboud 1997). The optoelectronic system registering the shape and intensity of cavitation cloud is one of the newest achievements in the field of investigations of cavitating flows. Vapour bubbles disperse the laser light and through it, and the signal measured via digital oscilloscope changes. The method is simple and does not require any large costs (Lipiński & Niedźwiedzka 2016; Niedźwiedzka & Lipiński 2016).
The paper focuses on the homogeneous approach. Among the numerical software for calculations of cavitating flows, there are many tools for simulations using homogeneous models. One of these tools is Fluent, part of Ansys. In this software, there are two possibilities to implement the homogeneous models: directly from interface and using user defined functions (UDFs). Only three models are available directly from interface: Schnerr & Sauer (2001), Singhal et al. (2002) and Zwart et al. (2004). In the literature, the number of homogeneous models is greater. To have more possibilities in numerical simulations in Fluent, application of the UDFs is necessary. There are few works concerning numerical simulations of cavitating flows with implementation of homogeneous models using the UDFs (Susan-Resiga et al. 2003; Bernad et al. 2004; Zhang et al. 2008; Cao et al. 2009). Additionally, these works do not refer to any of the existing homogeneous models, but to the Rayleigh equation. There is no information on the verification of the implementation tool, so it is impossible to assess the confidence level of the whole modelling process. The lack of a verified openly accessible tool for implementation of homogeneous cavitation models in Fluent software motivated our work.
The main goal of the presented article is to verify the UDFs defined using the Define Cavitation Rate macro for the three above-mentioned homogeneous models. The AIAA (American Institute of Aeronautics and Astronautics) Guide (Oberkampf et al. 1998) gives two possibilities to verify computational physics codes: exact analytical solution and benchmark solution. In the case of Fluent software, a list of benchmark examples is accessible in Ansys Fluent Tutorial Guide (2012). Assuming that benchmark solutions are characterized by a high accuracy, this way seems to be the best solution. In the article, the benchmark example from the Modeling Cavitation tutorial is used for the verification process in Fluent. Oberkampf et al. (2004) define two main principles, which should be followed when determining the assessment of the agreement level of the homogeneous cavitation models defined in Define Cavitation Rate macro with the same models available directly from the interface. Firstly, verification and validation are ‘processes of determining’. It means that both methods have an ongoing character. The expected finish point of solution is not specified. For that reason, it is impossible to speak about the veracity of the analysed conceptual or computerized models, or about its rejection. Secondly, the level of accuracy should be correctly understood in relation to an engineering perspective. The most popular definition of accuracy describes it as a correctness measure. It is worth emphasizing that from an engineering point of view, the exact solution is not required. It is sufficient to have a meaningful comparison. Whereas the main challenge for the authors is to make a verified tool for implementation of homogenous cavitation models in Fluent software, the second challenge is to use a qualitative method of the assessment of the results of the verification process. Consequently, the original achievement is not only the code itself, but also use of the computer methods of image analysis in the statistical analysis of the results of the verification process. The quantitative analysis is made using two correlation coefficients. A positive evaluation of the prepared tool allows using it for numerical simulations in any specified hydraulic systems and other applications. This information is necessary for future implementation of other homogeneous cavitation models.
THEORETICAL BACKGROUND
Single-fluid method based on the homogeneous approach
The crucial moment for the homogeneous approach was 1992. In this year, Kubota et al. (1992) presented the first homogeneous model called Local Homogeneous Model (LHM). The instability of this model was inspiration for other scientists to look for new ways in the formulating of the source terms. Merkle et al. (1998) showed the next widespread known model. Their mass transfer rates formulation was not the only response for the pioneering equation. Since then, new versions of source terms appear regularly. Several works (Senocack & Shyy 2001; Frikha et al. 2008; Goel et al. 2008; Žnidarčič et al. 2011; Goncalves & Charrière 2014) tried to set the ideas in order, but because of the passage of time, an update of information should be regularly made. The last work with an overview of homogeneous models comes from Niedźwiedzka et al. (2016). This work contains not only the final forms of source terms, but also detailed descriptions including advantages and disadvantages as well as examples of application areas.
Mass transfer models
TEST CASE
where vi is inlet velocity (m/s), pi is inlet static pressure (Pa), g is acceleration (m2/s) and h is elevation of the point above a reference plane (m), vo is outlet velocity (m/s), po is outlet static pressure (Pa). For that reason, cavitation is expected in these areas.
Boundary conditions are defined as follows: the inlet pressure is equal to 5 × 105 Pa and the outlet pressure to 9.5 × 104 Pa. The geometry of the analysed model is axisymmetric and two-dimensional (2-D) while the numerical calculations are performed for steady state. The chosen turbulence model is the k-ɛ turbulence model with standard wall functions. It is described using two parameters: turbulent kinetic energy with the value of 0.02 m2/s2 and turbulent dissipation rate with the value of 1 m2/s3. The Reynolds number for the orifice is equal to 153,232. The detailed description of the setup and solution stage is presented in the Cavitation Modeling tutorial (Ansys Fluent Tutorial Guide 2012). During the implementation of the UDFs, in the solution methods, for pressure–velocity coupling a simple scheme is selected.
METHODS IN NUMERICAL ALGORITHM VERIFICATION
The best way to determine the degree of compliance of the codes is comparison of the results obtained by numerical simulations. The most important results, which should be analysed, are distributions of cavitating areas with simultaneous consideration of its intensity. To have a comprehensive picture of the work of the examined computer algorithm, it is necessary to consider the process of numerical calculations. This information gives the analysis of convergence of the iterative procedure.
RESULTS AND DISCUSSION
Analysis of the convergence history of volume fraction on default interior
The aim of the analysis of the diagram is the assessment of the correctness of the prepared codes. The similar level of volume fraction at the final stage of numerical calculations is the basis for the decision that there is no reason to reject the UDFs for the considered pairs of cavitation models (i.e. implemented directly from interface and using the UDFs). In two cases, the Schnerr & Sauer (2001) and Zwart et al. (2004) models, this assumption is satisfied. For the third model, doubts appear. The maximum value of volume fraction on default interior for the calculations made using the cavitation model available from the interface is about three times smaller than for the calculations using the UDF. The shape of the convergence history of calculations using the Singhal et al. (2002) model from the interface also stands out from other convergence curves. Noticing this large difference allows expecting also a significant difference in the final vapour volume fraction in the orifice. Taking into consideration that in other calculations the convergence status at a similar level is achieved, it can indicate that in this algorithm an error can be involved. Taking an explicit stand on this issue requires further investigations.
Analysis of the vapour volume fraction in the orifice
Statistical analysis of the vapour volume fraction in the orifice
The above presented results are statistically interpreted using the correlation coefficients presented above under ‘Methods in numerical algorithm verification’. Table 1 shows obtained values of the correlation coefficient. Analysis of Table 1 shows that there are no significant differences between the obtained values for five out of six implementations. The achieved values are 0.956 for the Schnerr & Sauer (2001) model and 0.942 for the Zwart et al. (2004) model. It means the results are consistent in more than 90%, even more than 95% for the Schnerr & Sauer (2001) model. One exception is the interface implementation of the Singhal et al. (2002) model, which is also visible in Figure 10. The results are correlated only in about 50%. The results obtained with the Singhal et al. (2002) model using the UDF are very good related to the results obtained using the Schnerr & Sauer (2001) and Zwart et al. (2004) models. The compatibility level is more than 95%.
. | Schnerr & Sauer (2001) interface . | Schnerr & Sauer (2001) UDF . | Singhal et al. (2002) interface . | Singhal et al. (2002) UDF . | Zwart et al. (2004) interface . | Zwart et al. (2004) UDF . |
---|---|---|---|---|---|---|
Schnerr & Sauer (2001) interface | – | 0.956 | 0.474 | 0.960 | 0.989 | 0.949 |
Schnerr & Sauer (2001) UDF | 0.956 | – | 0.518 | 0.972 | 0.945 | 0.993 |
Singhal et al. (2002) interface | 0.474 | 0.518 | – | 0.495 | 0.465 | 0.519 |
Singhal et al. (2002) UDF | 0.960 | 0.972 | 0.495 | – | 0.955 | 0.971 |
Zwart et al. (2004) interface | 0.989 | 0.945 | 0.465 | 0.955 | – | 0.942 |
Zwart et al. (2004) UDF | 0.949 | 0.993 | 0.519 | 0.971 | 0.942 | – |
. | Schnerr & Sauer (2001) interface . | Schnerr & Sauer (2001) UDF . | Singhal et al. (2002) interface . | Singhal et al. (2002) UDF . | Zwart et al. (2004) interface . | Zwart et al. (2004) UDF . |
---|---|---|---|---|---|---|
Schnerr & Sauer (2001) interface | – | 0.956 | 0.474 | 0.960 | 0.989 | 0.949 |
Schnerr & Sauer (2001) UDF | 0.956 | – | 0.518 | 0.972 | 0.945 | 0.993 |
Singhal et al. (2002) interface | 0.474 | 0.518 | – | 0.495 | 0.465 | 0.519 |
Singhal et al. (2002) UDF | 0.960 | 0.972 | 0.495 | – | 0.955 | 0.971 |
Zwart et al. (2004) interface | 0.989 | 0.945 | 0.465 | 0.955 | – | 0.942 |
Zwart et al. (2004) UDF | 0.949 | 0.993 | 0.519 | 0.971 | 0.942 | – |
The coefficients showing correlations between the UDF and interface implementations are shown in bold.
Table 2 shows values of the correlation coefficient, obtained based on the analysis of images shown in Figure 12. The analysis of the cloud shape confirms the results of the correlation analysis with the use of the first coefficient. The best-correlated pair is the model of Schnerr & Sauer (2001) – 54%, the worst is the model of Singhal et al. (2002) – 26%. Similarly, like in the first analysis, the results obtained with the Singhal et al. (2002) model using the UDF are very good related to the results obtained using the Schnerr & Sauer (2001) model and the Zwart et al. (2004) model. Interesting is the fact that cloud shapes are better correlated when grouped by method of implementation, not when grouped by model. This leads to the interesting conclusion that the method of model implementation in Fluent plays a significant role. It is the best visible for the Schnerr & Sauer (2001) and Zwart et al. (2004) models implemented using the UDFs. In the analysis using the first correlation coefficient, the compatibility is 99% and using the second coefficient 86%.
. | Schnerr & Sauer (2001) interface . | Schnerr & Sauer (2001) UDF . | Singhal et al. (2002) interface . | Singhal et al. (2002) UDF . | Zwart et al. (2004) interface . | Zwart et al. (2004) UDF . |
---|---|---|---|---|---|---|
Schnerr & Sauer (2001) interface | – | 0.541 | 0.309 | 0.452 | 0.706 | 0.547 |
Schnerr & Sauer (2001) UDF | 0.541 | – | 0.266 | 0.535 | 0.501 | 0.857 |
Singhal et al. (2002) interface | 0.309 | 0.266 | – | 0.261 | 0.320 | 0.262 |
Singhal et al. (2002) UDF | 0.452 | 0.535 | 0.261 | – | 0.456 | 0.497 |
Zwart et al. (2004) interface | 0.706 | 0.501 | 0.320 | 0.456 | – | 0.480 |
Zwart et al. (2004) UDF | 0.547 | 0.857 | 0.262 | 0.497 | 0.480 | – |
. | Schnerr & Sauer (2001) interface . | Schnerr & Sauer (2001) UDF . | Singhal et al. (2002) interface . | Singhal et al. (2002) UDF . | Zwart et al. (2004) interface . | Zwart et al. (2004) UDF . |
---|---|---|---|---|---|---|
Schnerr & Sauer (2001) interface | – | 0.541 | 0.309 | 0.452 | 0.706 | 0.547 |
Schnerr & Sauer (2001) UDF | 0.541 | – | 0.266 | 0.535 | 0.501 | 0.857 |
Singhal et al. (2002) interface | 0.309 | 0.266 | – | 0.261 | 0.320 | 0.262 |
Singhal et al. (2002) UDF | 0.452 | 0.535 | 0.261 | – | 0.456 | 0.497 |
Zwart et al. (2004) interface | 0.706 | 0.501 | 0.320 | 0.456 | – | 0.480 |
Zwart et al. (2004) UDF | 0.547 | 0.857 | 0.262 | 0.497 | 0.480 | – |
The coefficients showing correlations between the UDF and interface implementations are shown in bold.
CONCLUSIONS
This paper presents the results of verification of the codes (UDFs) intended for implementation of homogeneous cavitation models obtained using Fluent software. Considered are three cavitation models available direct from Fluent interface: Schnerr & Sauer (2001), Singhal et al. (2002) and Zwart et al. (2004) models. The degree of compliance of the codes is assessed using three methods. The first method compares the final vapour void fraction in the considered area without any quantitative methods, the second with using of the statistical analyses and the third compares the convergence of the iterative procedure. The following concluding remarks can be made:
Three chosen verification methods give similar results.
Generally, the number of iterations is larger for calculations made using interface models than for calculations made by using the same models implemented through the UDFs, i.e. the UDF models are less computationally demanding.
The best-correlated pair is the Schnerr & Sauer (2001) model. In the analysis, the use of the first correlation coefficient gives the compatibility on the level of 96%, while use of the second coefficient gives the level of 54%.
The results of the correlation analysis for the Zwart et al. (2004) model are also correct. The compatibility using the first coefficient is 94% and using the second coefficient 48%.
All models correlate very well with the others with the exception of the Singhal et al. (2002) model implemented directly from the interface.
A better correlation is achieved through grouping by the method of implementation than by models.
There are no reasons to reject the UDFs for the Schnerr & Sauer (2001) and Zwart et al. (2004) models. In case of the UDF for the Singhal et al. (2002) model, where the analyses give low compatibility values, because of the large similarity between the results of other models, the results can be considered as correct.