Code Monkey home page Code Monkey logo

lbfoam's Introduction

Image of a 2D foam structure made by LBfoam

Table of Contents

About LBfoam

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 preprint is available here, which is currently under review.

Highlighted Features

  • 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

Directory and Code Structure

Figure below shows the directory structure of the LBfoam library.

LBfoam directory structure

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 ).

Installation

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.

Run an example

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).

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

Getting help and bug report

Please submit a Github issue, or contact [email protected] if you found a bug in the program or needed help with the software.

lbfoam's People

Contributors

mehdiataei avatar

Watchers

 avatar

Forkers

gtc1030

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.