VOFTools 3.2: Added VOF functionality to initialize the liquid volume fraction in general convex cells
Abstract
An updated version of the VOFTools library for convex geometries is presented to add a functionality for volume fraction initialization, which is important for any VOF (volume of fluid) method. The earlier version of the library includes efficient analytical and geometrical routines for area and volume computation, truncation operations that typically arise in VOF methods, area and volume conservation enforcement in PLIC (piecewise linear interface calculation) reconstruction and computation of the distance from a given point to the reconstructed interface. The updated version incorporates an accurate initialization procedure, based on local grid refinement, to determine the liquid region bounded by a convex polygonal or polyhedral cell and a given implicitly-defined liquid interface. Also, two bugs have been fixed. 2D and 3D tests are provided in the software package to assess the accuracy of the implemented initialization procedure.
New version program summary
Program Title: VOFTools
Program Files doi: http://dx.doi.org/10.17632/brrgt645bh.2
Licensing provisions: GNU General Public License, version 3
Programming language: FORTRAN and C, with C interfaces
Journal reference of previous version: J. López, J. Hernández, P. Gómez, F. Faura, “VOFTools A software package of calculation tools for volume of fluid methods using general convex grids”, Comput. Phys. Comm. 223 (2018) 45–54.
Does the new version supersede the previous version?: Yes
Reasons for the new version: Add to the library a new functionality for liquid area/volume fraction initialization in convex polygonal/polyhedrical cells and fix two bugs.
Summary of revisions: The features added and minor changes made in the new VOFTools version are the following:
• Added volume fraction initialization functionality:
(1) The new routines initf2d and initf3d have been included in the VOFTools library package for the liquid area and volume fraction initialization in 2D and 3D, respectively. Many authors use a local grid refinement of the cell to be initialized, coupled with a generally linear representation of the interface (see, for example, [1, 2]). The initialization procedure implemented in the supplied routines is an extension to general convex polygons and polyhedra of the grid refinement method of López et al. [2]. The approach is similar to that presented in [3], but limited in this work to convex cells. The routines compute the fraction, , of the area/volume of a liquid body defined by a given implicitly-defined function in Cartesian coordinates, , (the coordinate drops for 2D cases), within a polygonal/polyhedrical grid cell, . Let us define the liquid and void regions of , and , where and , respectively, and the liquid interface, , where . If or , is initialized to 1 or 0, respectively. Otherwise, the procedure explained below is applied. For the ease of explanation, Fig. 1 shows a 2D example with a sketch of the initialization procedure, which basically consists of the following steps (the 3D extension is straightforward):
(i) Construction of the minimum bounding box, , of (Fig. 1(a)).
(ii) Uniform bounding box division into sub-boxes (), where for 2D and 3 for 3D (Fig. 1(b)).
(iii) Obtain sub-cells (Fig. 1(c)).
(iv) Obtain liquid sub-regions (Fig. 1(d)).
(v) Finally, (1)where and are the areas/volumes of cell and liquid sub-regions , respectively.
All the geometrical tasks required in the above procedure are performed using the routines included in the supplied software.
(2) The test programs include an additional operation to assess the new initialization procedure.
(3) The new files uservoftools.f and cuservoftools.h define different liquid body shapes that can be used to assess the initialization procedure, which are given by the following implicit functions for circular, elliptical, spherical and toroidal shapes, respectively: (2) (3) (4) (5) Fig. 2, Fig. 3 show different cases included in the new version of the test programs.
(4) The Makefile script, used to build the new versions of the VOFTools library and the test programs in C and FORTRAN, has been updated. The accuracy of the implemented initialization procedure is quantified through the error norm defined as (6)where is the solution obtained, using Richardson extrapolation [4], as (7)where and are the very accurate numerical solutions obtained with and , respectively. Almost identical results are obtained when the exact solution for the case of Fig. 2(a) is used in Eq. (6) instead of . Fig. 4 presents the corresponding initialization errors as a function of , showing second-order convergence. As expected, the proposed initialization procedure is exact for a planar liquid interface.
• Updated user manual: The user manual supplied with the software package has been updated to include, along with other minor changes, the input and output arguments and calling convention of the new routines initf2d and initf3d.
• Bugs fix: Two bugs, which could cause a crash of the 2D test programs for some compilation options, have been fixed in the enforv2d routine: (1) two variables were not initialized to zero, and (2) an infinite loop occurred during the solution bracketing for very rare situations.
Nature of problem: The package of routines includes efficient analytical and geometrical tools for area and volume computation; truncation operations that typically arise in VOF methods; area and volume conservation enforcement (VCE) to position the interface in PLIC reconstruction; computation of the area/volume of a material body, defined by implicit functions, which is contained inside a general polygonal/polyhedral convex cell; and computation of the distance from a given point to the reconstructed interface.
Solution method: The area/volume computation of a polygon/polyhedron uses an efficient formula based on a quadrilateral decomposition and a 2D projection of each polyhedron face. The analytical VCE method is based on coupling an interpolation bracketing procedure with an improved final calculation step based on the above mentioned area/volume computation formula. The liquid area/volume fraction is initialized using a refinement algorithm valid for general polygonal and polyhedrical convex cells. Also, the distance from a given point to a reconstructed PLIC interface is calculated.
Acknowledgments The authors gratefully acknowledge the support of the Spanish Ministerio de Ciencia, Innovación y Universidades - Agencia Estatal de Investigación and FEDER through projects DPI2017-87826-C2-1-P and DPI2017-87826-C2-2-P.
References:
[1] S.J. Cummins, M.M. Francois, D.B. Kothe, Estimating curvature from volume fractions, Comput. Struct. 83 (2005) 425-434.
[2] J. López, C. Zanzi, P. Gómez, R. Zamora, F. Faura, J. Hernández, An improved height function technique for computing interface curvature from volume fractions, Comput. Methods Appl. Mech. Eng. 198 (2009) 2555-2564.
[3] J. López, J. Hernández, P. Gómez, F. Faura, Non-convex analytical and geometrical tools for volume truncation, initialization and conservation enforcement in VOF methods, J. Comput. Phys. 392 (2019) 666-693.
[4] I. Celik, W. Zhang, Calculation of numerical uncertainty using Richardson extrapolation: Application to some simple turbulent flow calculations, ASME J. Fluids Eng. 117 (1995) 439-445.
References (0)
Cited by (5)
Isosurface extraction for piecewise-linear reconstruction of complex interfaces on arbitrary grids
2024, Computer Methods in Applied Mechanics and EngineeringIn the field of volume of fluid type schemes, there is still great room for improvement in the accuracy of the methods used to reconstruct interfaces, especially when highly complex interfaces are involved. Isosurface extraction is exploited in a series of piecewise-linear interface reconstruction methods to simulate complex interface dynamic problems on arbitrary grids, and high-order surface patches are applied to achieve significantly improved accuracy. Isosurface extraction is also used to choose a convenient set of neighboring cells, hereafter called reconstruction stencil, for the reconstruction of highly curved interfaces when using well-known linearity-preserving methods. The relevance of the proper selection of the reconstruction stencil is highlighted, showing that the convergence of formal second-order methods can deteriorate when inappropriate reconstruction stencils are used. The accuracy, computational efficiency and performance of the implemented piecewise-linear interface reconstruction methods coupled with different reconstruction stencils are thoroughly analyzed for the reconstruction of interfaces in static conditions and dynamic simulations that produce highly deformed interfaces by using an accurate unsplit geometric advection method and imposing prescribed velocity fields.
Numerical simulations of bubbly flows in a vertical periodic channel
2024, International Journal of Multiphase FlowIn this study, numerical simulations of bubbly flows in an infinitely long vertical channel were performed. Generally, the upper and lower boundaries of such channels are simplified as periodic boundary conditions. Unlike horizontal channel flows, the presence of gravity in the streamwise direction complicates the establishment of periodic boundary conditions. Therefore, a specialized treatment is required to prevent fluid acceleration. Here, we developed a novel treatment for the imposition of periodic boundaries and proposed a new microbubble model to consider the surface tension effect of microbubbles. To detect each bubble in the flow field, we implemented a bubble identification algorithm, which facilitates a thorough statistical analysis of bubble number, size, and spatial distribution. Validation tests were conducted, and good agreement was achieved between our results and reference data. We also confirmed that the results obtained with periodic boundaries are consistent with those achieved without them. Finally, we simulated the evolution of rising bubble swarms in a quiescent liquid. The method presented here contributes to the numerical simulations of bubbly flows in industrial systems, including oil-gas transportation, bubble columns, and nuclear reactors.
A comparative study of two open-source state-of-the-art geometric VOF methods
2023, Computers and FluidsCitation Excerpt :The initialization error is defined as the difference between the volume enclosed by the exact interface and the initialized volume. To maintain consistency in comparisons by ensuring the same initialization error, we use in all tests the volume fraction initialization procedure described in [33] and extended to arbitrary convex and nonconvex cells in [29,34], respectively. We have found that this procedure yields an error significantly smaller than OpenFOAM’s setAlphaField tool, although the latter is usually faster when the simulation is performed on a single core.
We present a systematic study of geometric volume of fluid (VOF) methods provided in the gVOF and TwoPhaseFlow packages, which include algorithms that are among the most accurate proposed in recent years. In addition to contributing to their further validation, the main purpose is to evaluate, in terms of accuracy and efficiency, the relative advantages of the advection and reconstruction algorithms used in the two packages (mainly, FMFPA-CLCIR and isoAdvector-plicRDF, respectively), and to investigate the suitability of combining them. Since TwoPhaseFlow is available in OpenFOAM, gVOF was also coupled with this open source CFD toolbox to maintain the same conditions in common solvers when obtaining and comparing their results, including discretization schemes, tolerances and meshes. For the same reason, identical computational resources were also maintained. The use of a common software and hardware framework that guarantees strictly the same simulation conditions overcomes many of the limitations and uncertainties of comparisons made in previous studies. Several reconstruction and advection tests are presented, showing the differences between the algorithms in terms of accuracy, as measured by several error norms, and in terms of efficiency, as measured by CPU times consumed. Simulations of the rise of a bubble and the impact of a drop on a pool were also performed, in which the VOF methods were coupled to the same solver of the Navier–Stokes equations, and the results obtained with the two combinations of algorithms FMFPA-CLCIR and isoAdvector-plicRDF are compared with each other and, in the case of the second test, with our own experimental results. The relative advantages and limitations of the analyzed algorithms are discussed, and it is suggested that a combination of isoAdvector for advection and CLCIR for reconstruction can provide a good compromise between accuracy and efficiency.
gVOF: An open-source package for unsplit geometric volume of fluid methods on arbitrary grids
2022, Computer Physics CommunicationsThe gVOF package implements several accurate and efficient geometric volume of fluid (VOF) methods on arbitrary grids, either structured or unstructured with convex or non-convex cells, based on multidimensional unsplit advection and piecewise linear interface calculation (PLIC) schemes, with the purpose of facilitating and extending the use of advanced unsplit geometric VOF methods in new or existing computational fluid dynamics codes. The package includes a complete and self-contained set of routines for VOF initialization, interface reconstruction and fluid advection, and uses as external libraries a set of publicly available in-house tools to perform several analytical and geometrical operations. These operations may involve handling of high-complex non-convex flux polyhedra, even with self-intersecting faces, which are robustly and efficiently treated in this work without the need of costly techniques based on convex decomposition. Results for the accuracy, computational efficiency, and volume (local and global) conservation properties of different combinations of the implemented advection and reconstruction methods are presented for several numerical tests on structured and unstructured grids. An extensive comparison with results obtained by other authors using advanced geometric VOF methods shows the outstanding performance of the gVOF package in terms of efficiency and accuracy. To demonstrate the performance of the package in solving complex two-phase flow problems, the implemented methods are combined with an existing in-house code to simulate the impact of a water drop on a free surface.
Program Title: gVOF
CPC Library link to program files: https://doi.org/10.17632/9gmn6gsb6p.1
Licensing provisions: GPLv3
Programming language: FORTRAN and C, with C interfaces
External routines/libraries: VOFTools (https://doi.org/10.17632/brrgt645bh.3) and isoap (https://doi.org/10.17632/4rcf98s74c.1) libraries
Nature of problem: The software package includes efficient and accurate routines for volume of fluid initialization, reconstruction of interfaces and fluid advection on arbitrary grids, either structured or unstructured with convex or non-convex cells, which are used to implement advanced unsplit geometric VOF methods. In particular, the package includes a fluid volume fraction initialization method, six PLIC reconstruction methods and three multidimensional unsplit advection methods. Routines to visualize interfaces and compute reconstruction errors; tests to assess the accuracy, computational efficiency, and volume conservation of the implemented methods for the reconstruction and advection of complex interfaces on arbitrary grids; and a user manual have also been included in the supplied package.
Solution method: Basically, the implemented methods, which can be used on grids with polyhedral cells of arbitrary geometry, have the following general characteristics. The methods implemented for fluid volume fraction initialization and reconstruction error calculation are based on a recursive grid refinement procedure to compute the fluid volume bounded by cell edges and an implicitly-defined fluid interface. The six implemented interface reconstruction methods are the following: a least-squares gradient interface reconstruction method; three isosurface-based interface reconstruction methods; an extension to 3D of the iterative Swartz interface reconstruction; and a least-squares fit interface reconstruction method. Three unsplit advection methods, which are based on edge-matched, face-matched and non-matched flux polyhedra and are valid for 3D arbitrary grids, are implemented. All the implemented methods can be combined by the user to solve different tests on arbitrary grids. The implemented routines can be used in FORTRAN or C. The OpenMP application programming interface is used to improve the computational efficiency.
A new isosurface extraction method on arbitrary grids
2021, Journal of Computational PhysicsThe development of interface-capturing methods (such as level-set, phase-field or volume of fluid (VOF) methods) for arbitrary 3D grids has further highlighted the need for more accurate and efficient interface reconstruction procedures. In this work, we propose a new method for the extraction of isosurfaces on arbitrary polyhedra that can be used with advantage for this purpose. The isosurface is extracted from volume fractions by a general polygon tracing procedure, which is valid for convex or non-convex geometries, even with non-planar faces. The proposed method, which can be considered as an extension of the marching cubes technique, produces consistent results even for ambiguous situations in polyhedra of arbitrary shape. To show the reproducibility of the results presented in this work, we provide the open source library isoap, which has been developed to implement the proposed method and includes test programs to demonstrate the successful extraction of isosurfaces on several grids with polyhedral cells of different types. We present results obtained not only for isosurface extraction from discrete volume fractions resulting from a volume of fluid method, but also from data sets obtained from implicit mathematical functions and signed distances to scanned surfaces. The improvement provided by the proposed method for the extraction of isosurfaces in arbitrary grids will also be very useful in other fields, such as CFD visualization or medical imaging.