GithubHelp home page GithubHelp logo

gweiqi / lattice-boltzmann-method-gpu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xinhuan-imperial/lattice-boltzmann-method-gpu

0.0 0.0 0.0 16.47 MB

This program is a GPU version 3D Lattice Boltzmann Method Computational Fluid Dynamics solver to simulate steady/unsteady 3D single-phase flows. Compared with CPU serial code, this GPU code is >200 times faster and has same accuracy. To run it, a NVIDIA GPU with CUDA Toolkit is a must

License: GNU General Public License v3.0

Cuda 69.36% MATLAB 19.28% C 11.35%

lattice-boltzmann-method-gpu's Introduction

Lattice-Boltzmann-Method-GPU

This program is a GPU CUDA version D3Q19 BGK Lattice Boltzmann Method Computational Fluid Dynamics solver to simulate steady/unsteady 3D single-phase Newtonian flows, where moving boundary and body force (i.e., gravity) are NOT considered. Compared with CPU serial code, this GPU code is >250 times faster with NVIDIA Geforce 2080ti and >140times with NVIDIA Geforce 1050ti, and has same accuracy. To run it, a NVIDIA GPU with CUDA Toolkit is a must. It contains: A. a LBM lecture notes;B. the author's PhD thesis (Chapter 4 contains a detailed description about implementation of LBM);C. a paper about uniform Cartesian grid generation(CartGen: Robust, efficient and easy to implementuniform/octree/embedded boundary Cartesiangrid generator);D. three Matlab tools (MyCrustOpen, fitNormal and smoothpatch) for surface reconstruction/smoothing; E. a Matlab function geo_preprocess to generate uniform Cartesian non-body-fitting grid; F. four simulation cases:

  1. Lid_driven_cavity: steady Laminar flow
  2. Poiseulle_flow: steady Laminar flow
  3. bifurcation: steady Laminar flow with arbitrary geometry. This case is a good example to start if you want to use your geometry and steady inlet/outlet boundary conditions.
  4. curved vessel: unsteady Laminar flow with arbitrary geometry. This case is a good example to start if you want to use your geometry and unsteady inlet/outlet boundary conditions.

To use your own geometry, geometry preprecessing is important and we must generate 3D uniform Cartesian non-body-fitted computational grid to fit the geometry and then denote each grid with an integer number - there are six kinds of computational grids (denoted by the 6 integers from -1 to 4): inlet 2, outlet 3, fluid 4, wall 1, not used 0, outer neighbour of wall -1. A Matlab function geo_preprocess is provided to generate such 3D uniform Cartesian grids (refer to the paper 'CartGen: Robust,...' for the algorithm used) and decide each grid's mask:

  1. For inlet and outlet grids, we use the non-equilibrium extrapolation method
  2. For wall grids, we use the half-way bounce back method
  3. For fluid grids, SRT LBM streaming and collision happens
  4. For not used grids, they are out of the flow domain while not adjacent to wall grids, and are abondoned in C function index_transform to reduce the large memory usage.
  5. For outer neighbour grids of wall, those grids are out of the flow domain and only used for easier implementation of wall half-way bounce back. As wall grids pull information from their 19 neighbour grids. A C function geo_pre is used to define if a grid is outer neighbour of wall, because this requires for-loop and inefficient using Matlab.

To use the code, you must cite:

  1. Zhou, X., Ultrasound Imaging Augmented 3D Flow Reconstruction and Computational Fluid Dynamics Simulation. (The author's PhD thesis)
  2. Zhou, X., Vincent, P., Riemer, K., Zhou, Xiaowei, Leow, C. H., Tang, M. X*. Measurement Augmented 3D Lattice Boltzmann Flow Simulation for Convergence Acceleration and Uncertainty Suppression. (Submitted to the Computers & Fluids)

lattice-boltzmann-method-gpu's People

Contributors

xinhuan-imperial 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.