VOFTools 3.2: Added VOF functionality to initialize the liquid volume fraction in general convex cells

https://doi.org/10.1016/j.cpc.2019.07.022Get rights and content

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, F, of the area/volume of a liquid body defined by a given implicitly-defined function in Cartesian coordinates, f(x,y,z), (the z coordinate drops for 2D cases), within a polygonal/polyhedrical grid cell, Ω. Let us define the liquid and void regions of Ω, Ω+ and Ω, where f>0 and f<0, respectively, and the liquid interface, Γ, where f=0. If Ω=Ω+ or Ω=Ω, F 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, B, of Ω (Fig. 1(a)).

(ii) Uniform bounding box division into nscD sub-boxes Bj (j=1,...,nscD), where D=2 for 2D and 3 for 3D (Fig. 1(b)).

(iii) Obtain sub-cells Ωj=ΩBj (Fig. 1(c)).

(iv) Obtain liquid sub-regions Ω+j=Ω+Ωj (Fig. 1(d)).

(v) Finally, (1)F=j=1nscDV+jVΩ,where VΩ and V+j are the areas/volumes of cell Ω and liquid sub-regions Ω+j, 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)f(x,y)=0.3252(x0.5)2+(y0.5)2, (3)f(x,y)=1x0.50.62+y0.50.22, (4)f(x,y,z)=0.62(x0.5)2+(y0.5)2+(z0.5)2, (5)f(x,y,z)=13223(x0.5)2+(y0.5)20.52(z0.5)2. 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)E=|FFext|,where Fext is the solution obtained, using Richardson extrapolation [4], as (7)Fext=43F102413F512,where F1024 and F512 are the very accurate numerical solutions obtained with nsc=1024 and nsc=512, respectively. Almost identical results are obtained when the exact solution π0.3252 for the case of Fig. 2(a) is used in Eq. (6) instead of Fext. Fig. 4 presents the corresponding initialization errors as a function of nsc, 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)

  • Numerical simulations of bubbly flows in a vertical periodic channel

    2024, International Journal of Multiphase Flow
  • A comparative study of two open-source state-of-the-art geometric VOF methods

    2023, Computers and Fluids
    Citation 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.

  • A new isosurface extraction method on arbitrary grids

    2021, Journal of Computational Physics
View full text