Saturday, October 27, 2018

Lattice Boltzmann method (D2Q9) - modelling fluid flow in a pipe with an obstacle - Serial and parallel approach

based on the kinetic theory and easy to be parallelized.
The Lattice Boltzmann method (LBM) has become an attractive and promising approach in computational fluid dynamics (CFD). Easy of implementation, extensibility, and high level of parallelism are the major reasons for LBM increasing popularity. Here, we present a serial and parallel codes examples of a bi-dimensional pipe flow with an internal obstacle using LBM - D2Q9, where:

Lx = Mesh size in x direction
Ly = Mesh size in y direction
vxFlow = 0.02  Flow velocity in x direction
vyFlow = 0.00  Flow velocity in y direction
Re = 25 Reynolds number

with: no-slip wall boundary condition

The codes calculates:
- Macroscopic variables ;
- Dirichlet boundary condition;
- Calculates the Zou/He boundary condition;
- Calculates the collision step;
- Calculate microscopic boundary condition (bounce back);
- Calculates the streaming step;

Serial:

Fortran .f90  / .C



Parallel:

OpenMP: latticeBoltzmann_OpenMP.c

Pthreads: latticeBoltzmann_Pthreads.c

MPI: latticeBoltzmannMPI.c


No comments:

Post a Comment