Skip to content

An unofficial module of the geometric Volume of Fluid (VOF) method for OpenFOAM.

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE.txt
Unknown
COPYING
Notifications You must be signed in to change notification settings

daidezhi/geometricVofExt

Repository files navigation


geometricVofExt

DOI

Overview

The geometricVofExt package is an unofficial module of the geometric Volume of Fluid (VOF) method for OpenFOAM. This extension has a suite of pre- and post-processing tools alongside various solvers dedicated to two-phase flow dynamics. The pre-processing utilities are methodically assembled to initialize fraction fields of arbitrary shapes with optional dynamic mesh refinement, and to set up scalar, vector or tensor fields that vary based on the fraction values. These utilities are designed to enhance the flexibility and accuracy of multiphase flow simulations.

Moreover, the geometricVofExt package features solvers that utilize the innovative SimPLIC method, which supports unstructured meshes composed of arbitrary polyhedral cells. The SimPLIC method integrates Piecewise Linear Interface Calculation (PLIC) with Simpson's rule, offering an accurate and efficient approach to solve the VOF equation. These solvers are also designed to simulate the phase change phenomena and floating body dynamics. Additionally, the solvers ensure high adaptability to complex simulation scenarios with optional dynamic mesh refinement.

Package Structure

The geometricVofExt package is a comprehensive collection that includes libraries, applications, and tutorials. This package is meticulously organized to facilitate easy navigation, allowing users to effortlessly utilize the solvers and utilities included in the package. The package structure is shown below.

It should be noted that the utilities, solvers and tutorials under test are used to replicate the results presented in this study (Dai, Dezhi, Haomin Yuan, Albert Y. Tong, and Adrian Tentner. "A Geometric VOF Method for Interface Flow Simulations." arXiv preprint arXiv:2402.05247 (2024)), which illustrates the concepts and efficiency of the SimPLIC method.

SimPLIC Library

The SimPLIC library embodies the implementation of the SimPLIC method.

Key features:

  • Employs the PLIC-VOF method for precise interface capturing.
  • Delivers efficient interface reconstructions for improved computational performance.
  • Ensures accurate interface advections, maintaining the fidelity of the fluid interface over time.
  • Implements Adaptive Mesh Refinement (AMR) that dynamically refines the mesh based on the fraction field.
  • Accommodates overset meshes, enhancing the flexibility in handling complex geometries and moving boundaries.
  • Supports run-time PLIC interface sampling.

The VOF equation solved in the SimPLIC library is written as:

$$\frac{\partial \alpha}{\partial t} + \nabla \cdot \left(\alpha \mathbf{U}\right) = S_p \alpha + S_u,$$

where $\alpha$ represents the VOF function, $t$ denotes time, $\mathbf{U}$ is the velocity vector, and $S_p$ and $S_u$ correspond to the implicit and explicit contributions to the net source, respectively.

For incompressible two-phase flows without phase change, both $S_p$ and $S_u$ are zero ($S_p = S_u = 0$). In the case of compressible two-phase flows without phase change, $S_p$ remains zero ($S_p = 0$) and $S_u$ is given by $\left(\nabla \cdot \mathbf{U}\right) \alpha$. For incompressible two-phase flows involving cavitation, $S_p = \left(\nabla \cdot \mathbf{U}\right) + \dot{V}_v - \dot{V}_c$ and $S_u$ as $\dot{V}_c$, where $\dot{V}_v$ and $\dot{V}_c$ represent the volume change rates due to condensation and evaporation, respectively. Within OpenFOAM framework, the Kunz, Merkle or SchnerrSauer cavitation model in the phaseChangeTwoPhaseMixtures library is adopted to evaluate $\dot{V}_v$ and $\dot{V}_c$. A summary of the different scenarios along with the corresponding solver(s) is given in the table below.

Scenario Solver(s) $S_p$ $S_u$ Note
  • Incompressible
  • Without phase change
  • interPlicFoam
  • overInterPlicDyMFoam
  • wavePlicFoam
$0$ $0$ $\nabla \cdot \mathbf{U} = 0$
  • Incompressible
  • Cavitation
  • interPlicPhaseChangeFoam
  • overInterPlicPhaseChangeDyMFoam
$\left(\nabla \cdot \mathbf{U}\right) + \dot{V}_v - \dot{V}_c$ $\dot{V}_c$ Cavitation models
  • Kunz model
  • Merkle model
  • SchnerrSauer model

When employing AMR, the geometric interpolation of fraction field during refinement can be achieved by setting the control parameter mapAlphaField to true within fvSolution->solvers->"alpha.*". This innovative fraction interpolation scheme, initially introduced in VoFLibrary, has been reimplemented in the SimPLIC library. Its process is presented below, where the reconstructed interface within the parent cell is utilized to divide each of the child cells and compute their respective submerged volumes/fractions.

geometric interpolation

CGALVof Library

The CGALVof library acts as a bridge between OpenFOAM meshes and CGAL geometric algorithms.

Key features:

  • Delivers accurate geometric predicates while providing approximate geometric constructions.
  • Capable of transforming an OpenFOAM surface mesh (MeshedSurface<face>) or an OpenFOAM mesh cell into a CGAL polyhedral surface (CGAL::Surface_mesh<P>).
  • Allows for the direct creation of CGAL polyhedral surface meshes for boxes or spheres based on given dictionaries.
  • Supports the import of external surface mesh files, compatible formats include *.stl, *.vtk and *.ftl.
  • Features a Boolean operation processor for the manipulation of two CGAL surface meshes.
  • Enables the assessment of mesh cell locations in comparison to a designated surface mesh, typically denoting the interface between two distinct phases.

Applications

The current list of utilities distributed with geometricVofExt is given below:

Utility Description
setVofField Set the VOF field (alpha.*) with arbitrary shapes.
  • Built-in shapes: box, sphere, cylinder and cone.
  • External surface meshes: *.stl, *.stlb, *.vtk, etc.
  • Fraction-based dynamic mesh refinement.
setShapedFields Set field values using arbitrary shapes.
  • Dictionary is similar to the one for setFields.
  • Volume-fraction averaging for cells partially enclosed by the shapes.
writeVtkSeries Generate and write a VTK series for a surfaces function object.
  • Function name is <funcName>.
  • Output file is <funcName>.vtp.series or <funcName>.vtk.series.

The following are solvers that utilize the SimPLIC method:

Solver Description
interPlicFoam
  • Solver for two-phase flows.
  • Incompressible, isothermal and immiscible fluids.
  • Derived from interFoam and interIsoFoam.
  • Using SimPLIC method.
  • Dynamic mesh refinement.
overInterPlicDyMFoam
  • Derived from overInterDyMFoam and interPlicFoam.
  • Incompressible, isothermal and immiscible fluids.
  • Overset (Chimera) meshes.
interPlicPhaseChangeFoam
  • Derived from interPhaseChangeFoam and interPlicFoam.
  • Incompressible, isothermal and immiscible fluids.
  • Cavitating flows.
  • Dynamic mesh refinement.
overInterPlicPhaseChangeDyMFoam
  • Derived from overInterPhaseChangeDyMFoam and overInterPlicDyMFoam.
  • Incompressible, isothermal and immiscible fluids.
  • Cavitating flows.
  • Overset (Chimera) meshes.
wavePlicFoam
  • Solver for two-phase flows.
  • Incompressible, isothermal and immiscible fluids.
  • Employing waves2Foam toolbox to generate and absorb free surface water waves.
  • Derived from interPlicFoam.
  • Using SimPLIC method.
  • Dynamic mesh refinement.

Build geometricVofExt

Compatibility

The source code of geometricVofExt is developed and maintained for OpenFOAM v2312.

Before Starting

  • Make sure that OpenFOAM v2312 has been compiled successfully on the target machine.

  • Verify that CGAL has been successfully compiled/loaded. Otherwise, the CGALVof library, setVofField and setShapedFields will not be compiled.

Building

  • Create a directory named modules within $WM_PROJECT_USER_DIR, then proceed to download the geometricVofExt source code into $WM_PROJECT_USER_DIR/modules, i.e.,
source <installation path>/OpenFOAM-v2312/etc/bashrc

[ -d $WM_PROJECT_USER_DIR ] || mkdir $WM_PROJECT_USER_DIR
cd $WM_PROJECT_USER_DIR

[ -d modules ] || mkdir modules
cd modules

git clone https://github.com/daidezhi/geometricVofExt.git
  • Check CGAL library:
source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./checkCGAL

⚠️ IMPORTANT ⚠️ The GNU Multiple Precision Arithmetic (GMP) and GNU Multiple Precision Floating-Point Reliably (MPFR) Libraries are highly recommended for use with CGAL. Otherwise, the setVofField and setShapedFields utilities will operate in a low-efficiency mode. If you are using a GCC compiler, one potential solution is:

source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./compileCGALWithGMPAndMPFRUsingSystemGCC
  • (Optional) Enable the utilities and solvers to produce iso-surfaces/plic-surfaces at the initial time (e.g., $t = 0$):
source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./enableInitialTimeWriting
  • Compile libraries, utilities and solvers of geometricVofExt:
source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./Allwmake -j4
  • (Optional) Build waves2Foam library and wavePlicFoam solver (It is important to mention that the Gnu Scientific Library (GSL) 2.7.1 is locally compiled for HPC users.):
source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./compileWaves2FoamInOpenFOAM2312

./Allwmake -j4
  • (Optional) Build utilities/solvers in applications/test:
source <installation path>/OpenFOAM-v2312/etc/bashrc

cd $WM_PROJECT_USER_DIR/modules/geometricVofExt

./enableReconstructionTimeTrackingInIsoAdvector

./Allwmake.test

Gallery

3Dwaves.mp4
3Dwave
damBreakWithObstacle.mp4
oilDeaeration.mp4
Dam break Oil deaeration
dropletImpact.mp4
bubbleRising.mp4
Droplet impact Bubble rising
axisymmetricHemispherical.mp4
Cavitation

Tutorials

  • ./tutorials/utilities/setVofField/
Case Result
variousShapes variousShapesNoAMR
variousShapesAMR1 variousShapesAMR1
variousShapesAMR2 variousShapesAMR2
  • ./tutorials/utilities/setShapedFields/
Case Result
variousShapesAMR1 scalarAndVectorVolFieldsOfVariousShapesAMR1
  • ./tutorials/solvers/interPlicFoam/
Case
Configuration
bubbleRising bubbleRising
damBreakWithObstacle damBreakWithObstacle
dropletImpact dropletImpact
oilDeaeration oilDeaeration
  • ./tutorials/solvers/overInterPlicDyMFoam/
Case Result
floatingBody
floatingBody_overInterDyMFoam
floatingBody.mp4
twoSimpleRotors
twoSimpleRotors_overInterDyMFoam
twoSimpleRotors.mp4
twoSquaresOutDomain
twoSquaresOutDomain_overInterDyMFoam
twoSquaresOutDomain.mp4
  • ./tutorials/solvers/wavePlicFoam/
Case Result Note
3Dwavs
3Dwaves.mp4
Modified from waves2Foam.
  • ./tutorials/solvers/overInterPlicPhaseChangeDyMFoam/
Case Result
twoSimpleRotors
twoSimpleRotors_overInterPhaseChangeDyMFoam
twoSimpleRotorsCavitation.mp4
  • ./tutorials/verificationAndValidation/
Case Configuration/Result Note
axisymmetricHemispherical
  • Case illustration
  • Mesh independence
  • Pressure coefficient distributions
Mesh independence study is performed by using interPlicPhaseChangeFoam.

This case is configured to verify the SimPLIC method for solving cavitating flows and includes the following solver(s):
  • interPlicPhaseChangeFoam
  • interPhaseChangeFoam

References:
  • ./tutorials/test/
Case Note
createIcosphere Create three different icospheres.
calcSurfaceMeshNonUniformFlow Calculate tool meshes at various time instants using different initial surface meshes:
The tool surface meshes used in arXiv:2402.05247 are available at ./tutorials/test/toolSurfaceMesh.
plicVofOrientationFoam Test four orientation schemes in SimPLIC:
  • CAG
  • NAG
  • LS
  • RDF
using a hexahedral mesh of $\Delta s = 2^{-5} m$ (First row of Table 6 in arXiv:2402.05247).
plicVofAdvectionFoam Test SimPLIC-LS method using a hexahedral mesh of $\Delta s = 2^{-6} m$ (Table 14 in arXiv:2402.05247).
isoAdvectorAdvectionFoam Test isoAdvector-plicLS method using a hexahedral mesh of $\Delta s = 2^{-6} m$ (Table 14 in arXiv:2402.05247).

Change Log

  • 06/25/2024. Add support for waves2Foam. The associated solver wavePlicFoam is also available.
  • 05/13/2024. Initial release.

Contributors

  • Dezhi Dai, Nuclear Science & Engineering (NSE) Division, Argonne National Laboratory (ANL), [email protected] (Main developer)
  • Haomin Yuan, NSE, ANL (PI of HPC4EI project, SimPLIC development and review)
  • Albert Y. Tong, Department of Mechanical and Aerospace Engineering (MAE), University of Texas at Arlington (UTA) (SimPLIC development and review)
  • Adrian Tentner, NSE, ANL (SimPLIC development and review)
  • Vimalan Adaikalanathan, MAE, UTA (AMR testing)

License

geometricVofExt is released as an extension of OpenFOAM: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the file COPYING in this directory or http://www.gnu.org/licenses/, for a description of the GNU General Public License terms under which you may redistribute files.

Acknowledgment

This work was initially funded by the U.S. Department of Energy High-Performance Computing for Energy Innovation (HPC4EI) program, support for this program was provided by the U.S. DOE Office of Science, Office of Fossil Energy, Office of Energy Efficiency & Renewable Energy.

This work was conducted at Argonne National Laboratory and was supported by the U.S. Department of Energy, Office of Nuclear Energy, under Contract DE-AC02-06CH11357.


About

An unofficial module of the geometric Volume of Fluid (VOF) method for OpenFOAM.

Resources

License

GPL-3.0, Unknown licenses found

Licenses found

GPL-3.0
LICENSE.txt
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published