Coder Social home page Coder Social logo

lbsim's Introduction

LBSIM

LBSIM is a CUDA high-performance Computational Fluid Dynamics simulation code based on the Lattice Boltzmann Method. It's a code for simulating low-speed incompressible flows. It is currently in its first development steps, capable of running the two-dimensional Lid-Driven Cavity benchmark with different grid sizes and flow properties. The code can both run sequentially on the CPU and in parallel on the GPU.

In the LBM part of the code, we have calculated the equilibrium in each cell using the macroscopic quantities and then performed the collision according to the BGK-operator. We directly used the Zou-He scheme for the boundary condition in moving no-slip walls and pure bounce back for fixed walls.

We are creating two programs, and both are D2Q9 Lattice Boltzmann codes. The first one runs in series and is written in C++. The second one is parallelized with a GPU. Functions in the GPU are the initialization of distribution function, setting the boundary conditions, collision, and streaming. The code will be more noticeably faster when it is run for a high-resolution problem.

Initialization:

You can change different parameters such as Reynolds number, number of the cells, time steps, and wall velocities to get different results using the cases/LidDrivenCavity/LidDrivenCavity.dat file.

Requirments:

Ensure you have all requirements before you start building the code since it is written in C++ and CUDA. This code is designed to run on Linux. We strongly recommend using Linux for compilation, computation, and post-processing. Therefore, The following prerequisites are demanded:

  1. A supported version of Linux with a GCC compiler and tool-chain
  2. C++ and its editor, preferably Visual Studio Code
  3. C++ build system generator, Cmake
  4. You need a CUDA-capable GPU, which can be checked here (Link)
  5. To use your GPU, you’ll need NVIDIA CUDA Toolkit
  6. The Visualization Toolkit, VTK 7 or higher

How to use it:

Install

git clone [email protected]:bamaratunga/lbsim.git
cd lbsim

Compile

mkdir build && cd build
cmake ..
make install

Run

To run the code sequentially on the CPU, you can use the following command:

lbsim_cpp ../cases/LidDrivenCavity/LidDrivenCavity.dat

To run the code in parallel on GPU, you can use the following command:

lbsim_cuda ../cases/LidDrivenCavity/LidDrivenCavity.dat

Contributors

Binu Amaratunga, Erfan Mashayekh, Hessel Juliust

lbsim's People

Contributors

bamaratunga avatar erfan-mashayekh avatar

Watchers

 avatar

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.