- Table of Contents
- About LBfoam
- Highlighted Features
- Directory and Code Structure
- Important Classes
- Installation
- Getting help and bug report
- Citing this work
LBfoam is an open-source CFD solver based on the lattice Boltzmann method for foaming simulations. The solver is an extended version of the Palabos library.
The paper presenting this work is published in the Journal of Computer Physics Communications.
- 2D/3D Free Surface Lattice Boltzmann (FSLBM) solver
- Coupling of the Navier-Stokes equation and advection-dffisuion equation for the simulation bubble growth
- Implementation of bubble interaction using Piecewise Linear Interface Reconstruction (PLIC) and Ray Tracing algorithms
- Nucleating bubbles based on a nucleation probability field using the Poisson-Disc Sampling algorithm
- Fully-parallelized using the Message Passing Interface (MPI) library
Figure below shows the directory structure of the LBfoam library.
The algorithms
folder contains the PLIC, ray-tracing, Poisson disk-sampling algorithm, and other related functions. The dynamics
folder contains the classes for advection-diffusion coupling and applying the Henry's law boundary condition. The bubble
folder includes the classes for calculating gas diffusion into each bubble, updating bubble pressures, tracking bubble coalescence, calculation of disjoining pressure, and updating bubbles gas content. The models
folder includes a 2D FSLBM model which is not available in Palabos. The directory examples/lbfoam
include a variety of demo cases.
lbfoam2D.h
and lbfoam3D.h
header files provide access to LBfoam classes for 2D and 3D simulations, respectively. Each LBfoam function/class must be called using the namespace called lbfoam
(e.g. lbfoam::PLIC2D
).
-
lbfoam::PLIC3D
: Piecewise Linear Interface Construction method based on Scardovelli and Zaleski for reconsturcting liquid interfaces. This method is used in the calculation of the distance between two adjacent bubbles. -
lbfoam::PLIC2D
: 2D implementation oflbfoam::PLIC3D
. -
lbfoam::RayTracer3D
: Ray tracing algorithm to search for adjacent bubbles. This method is used in the calculation of the disjoining pressure. -
lbfoam::RayTracer2D
: 2D implementation oflbfoam::RayTracer3D
. -
lbfoam::BubbleGrowth3D
: This class implements functionalities to update bubble gas content, and calculate the gas content properly after bubble coalescence, splitting, and formation of new bubbles. -
lbfoam::BubbleGrowth2D
: 2D implementation oflbfoam::BubbleGrowth3D
. -
lbfoam::BubbleTracking3D
: This class implements methods to track bubble motion, coalescence, spliting, etc. as well as calculation of the disjoining pressure between bubbles. -
lbfoam::BubbleTracking2D
: 2D implementation oflbfoam::BubbleTracking3D
. -
lbfoam::GrowthCoupling3D
: This class apply the Henry's law boundary condition on bubble interfaces, and calculates the amount of gas diffused into each bubble that is used inlbfoam::BubbleGrowth3D
to update bubble's gas content.
LBfoam installation is very similar to the Palabos library and it does not depend on any external dependencies. LBfoam uses Scons
build tool.
The mandatory packages for installation are gcc
(or clang
), make
, python3
. For MPI parallel computations, libopenmpi
library is required. To output results in .gif
format, imagemagick
library must be installed.
For Debian based distributions, the following command can install the required libraries.
$ sudo apt install gcc python3 make imagemagick libopenmpi-dev
Similar to Palabos the output of the simulations are in the form of VTK
files, which can be visualized using the
of Paraview software.
First, close the repository using the following git command:
$ git clone https://github.com/mehdiataei/LBfoam.git
Compile the bucket2D
example:
$ cd examples/lbfoam/bucket2D
$ make
(Note: To compile the software on MacOS, uncomment the -DPLB_MAC_OS_X
compilation flag in the Makefile).
Create tmp
folder to store the outputs (the output folder name must be the same as outDir
variable in the bucket2D.xml
file). Run the example using the following command. The bucket2D.xml
contains the simulation parameters.
$ ./bucket2D bucket2D.xml
To run the example in parallel using 8 cores for example:
$ mpirun -np 8 bucket2D bucket2D.xml
results will be stored in tmp
folder by default.
Please submit a Github issue, or contact [email protected] if you found a bug in the program or needed help with the software.
Please cite the accompanied paper if you intend to use this library in your work.