Abstract
During the past two decades, the lattice Boltzmann method (LBM) has been increasingly acknowledged as a valuable alternative to classical numerical techniques (e.g. finite elements, finite volumes, etc.) in fluid dynamics. A distinguishing feature of LBM is undoubtedly its highly parallelizable data structure. In this work we present a general parallel LBM framework for graphic processing units (GPUs) characterized by a high degree of modularity and memory efficiency, still preserving very good computational performance. After recalling the essential programming principles of the CUDA C language for GPUs, the details of the implementation will be provided. The data structure here presented takes into account the intrinsic properties of the Gauss-Hermite quadrature rules (on which the LBM is based) to guarantee a unique and flexible framework for two- and three-dimensional problems. In addition, a careful implementation of a memory efficient formulation of the LBM algorithm has allowed to limit the high memory consumption that typically affects this computational method. Numerical examples in two and three dimensions illustrate the reliability and the performance of the code.
Similar content being viewed by others
References
C.K. Aidun and J.R. Clausen. Lattice-Boltzmann method for complex flows. Annu. Rev. Fluid Mech., 42:439–472, 2010.
S Ansumali. Minimal kinetic modeling of hydrodynamics. PhD thesis, ETH Zürich, 2004.
P. Bailey, J. Myre, S.D.C. Walsh, D.J. Lilja, and M.O. Saar. Accelerating lattice Boltzmann fluid flow simulations using graphics processors. In 2009 International Conference on Parallel Processing, pages 550–557. IEEE, 2009.
M. Bernaschi, M. Fatica, S. Melchionna, S. Succi, and E. Kaxiras. A flexible high-performance lattice Boltzmann GPU code for the simulations of fluid flows in complex geometries. Concurrency Computat.: Pract. Exper., 22(1):1–14, 2010.
A. Caiazzo. Analysis of lattice Boltzmann initialization routines. Journal of statistical physics, 121(1):37–48, 2005.
C. Cercignani. Mathematical methods in kinetic theory. Plenum Press New York, 1969.
P. Chen. The lattice Boltzmann method for fluid dynamics: theory and applications. Master’s thesis, EPFL, 2011.
S. Chen and G.D. Doolen. Lattice Boltzmann method for fluid flows. Ann. Rev. Fluid Mech., 30:329–364, 1998.
B. Chopard and M. Droz. Cellular automata modeling of physical systems. Cambridge University Press Cambridge, UK, 1998.
NVIDIA CUDA. Programming Guide, Version 4.0, 2011.
D. d’Humières, I. Ginzburg, M. Krafczyk, P. Lallemand, and L.S. Luo. Multiple-relaxation-time lattice Boltzmann models in three-dimensions. Trans. R. Soc. Lond. A, 360(1792):437–451, 2002.
C. Feichtinger, J. Habich, H. K´’ostler, G. Hager, U. Rüde, and G. Wellein. A flexible patch-based lattice boltzmann parallelization approach for heterogeneous gpu-cpu clusters. Parallel Computing, 37(9):536–549, 2011.
U. Ghia, K.N. Ghia, and C.T. Shin. High-Re solutions for incompressible flow using the Navier-Stokes equations and a multigrid method. J. Comput. Phys., 48(3):387–411, 1982.
J. Habich, T. Zeiser, G. Hager, and G. Wellein. Performance analysis and optimization strategies for a d3q19 lattice boltzmann kernel on nvidia gpus using cuda. Advances in Engineering Software, 42(5):266–272, 2011.
F.J. Higuera and J. Jimenez. Boltzmann approach to lattice gas simulations. EPL (Europhysics Letters), 9:663–668, 1989.
J. Hoberock and N. Bell. Thrust: A parallel template library, 2010. Version 1.3.0.
P.H. Kao and R.J. Yang. An investigation into curved and moving boundary treatments in the lattice Boltzmann method. J. Comput. Phys., 227(11):5671–5690, 2008.
F. Kuznik, C. Obrecht, G. Rusaouen, and J.J. Roux. LBM based flow simulation using GPU computing processor. Comput. Math. Appl., 59(7):2380–2392, 2010.
J. Lätt. How to implement your DdQq dynamics with only q variables per node (instead of 2q). Technical report, Tufts University, June 2007.
J. Lätt. Hydrodynamic limit of lattice Boltzmann equations. PhD thesis, Geneva University, 2007.
J. Lätt and B. Chopard. Lattice Boltzmann method with regularized non-equilibrium distribution functions. Math. Comp. Sim., 72:165–168, 2006.
J. Lätt, B. Chopard, O. Malaspinas, M. Deville, and A. Michler. Straight velocity boundaries in the lattice Boltzmann method. Phys. Rev. E, 77:056703, 2008.
O. Malaspinas. Lattice Boltzmann method for the simulation of viscoelastic fluid flows. PhD thesis, EPFL, 2009.
K. Mattila, J. Hyväluoma, T. Rossi, M. Aspnäs, and J. Westerholm. An efficient swap algorithm for the lattice Boltzmann method. Comput. Phys. Commun., 176(3):200–210, 2007.
K. Mattila, J. Hyväluoma, J. Timonen, and T. Rossi. Comparison of implementations of the lattice-Boltzmann method. Comput. Math. Appl., 55(7):1514–1524, 2008.
G.R. McNamara and G. Zanetti. Use of the Boltzmann equation to simulate lattice-gas automata. Phys. Rev. Lett., 61(20):2332–2335, Nov 1988.
R. Mei, L.-S. Luo, P. Lallemand, and D. d’Humières. Consistent initial conditions for lattice Boltzmann simulations. Comp. Fluids, 35:855–862, 2006.
R.R. Nourgaliev, T.N. Dinh, T.G. Theofanous, and D. Joseph. The lattice Boltzmann equation method: theoretical interpretation, numerics and implications. Int. J. Multiphase Flow, 29(1):117–169, 2003.
C. Obrecht, F. Kuznik, B. Tourancheau, and J.J. Roux. A new approach to the lattice Boltzmann method for graphics processing units. Comput. Math. Appl., 2010.
C. Obrecht, F. Kuznik, B. Tourancheau, and J.J. Roux. The thelma project: A thermal lattice boltzmann solver for the gpu. Computers and Fluids, 54(0):118–126, 2012.
openCL. http://www.khronos.org/opencl/.
B. Palmer and J. Nieplocha. Efficient algorithms for ghost cell updates on two classes of mpp architectures. In S.G. Akl and T. Gonzalez, editors, PDCS International Conference on Parallel and Distributed Computing Systems, pages 197–202. ACTA Press, Anaheim, CA, United States(US), 2002.
Y.H. Qian, D. d–Humieres, and P. Lallemand. Lattice BGK models for Navier-Stokes equation. EPL (Europhysics Letters), 17:479, 1992.
S. Ryoo, C.I. Rodrigues, S.S. Baghsorkhi, S.S. Stone, David B. Kirk, and W.W. Hwu. Optimization principles and application performance evaluation of a multithreaded GPU using CUDA. In Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming, PPoPP’ 08, pages 73–82, New York, NY, USA, 2008. ACM.
M. Schulz, M. Krafczyk, J. Tölke, and E. Rank. Parallelization strategies and efficiency of CFD computations in complex geometries using lattice Boltzmann methods on high-performance computers. In High performance scientific and engineering computing: proceedings of the 3rd International FORTWIHR Conference on HPSEC, Erlangen, March 12–14, 2001, page 115. Springer Verlag, 2002.
X. Shan, X.-F. Yuan, and H. Chen. Kinetic theory representation of hydrodynamics: a way beyond the Navier-Stokes equation. J. Fluid Mech., 550:413–441, 2006.
S. Succi. The lattice Boltzmann equation for fluid dynamics and beyond. Oxford University Press, USA, 2001.
J. Tölke. Implementation of a Lattice Boltzmann kernel using the Compute Unified Device Architecture developed by nVIDIA. Comput. Visual. Sci., 13(1):29–39, 2010.
J. Tölke and M. Krafczyk. TeraFLOP computing on a desktop PC with GPUs for 3D CFD. Int. J. Comput. Fluid. Dynam., 22(7):443–456, 2008.
G. Wellein, T. Zeiser, G. Hager, and S. Donath. On the single processor performance of simple lattice Boltzmann kernels. Computers & Fluids, 35(8–9):910–919, 2006.
D.A. Wolf-Gladrow. Lattice-gas cellular automata and lattice Boltzmann models: an introduction, volume 1725 of Lecture Notes in Mathematics. Springer, 2000.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Astorino, M., Sagredo, J.B. & Quarteroni, A. A modular lattice boltzmann solver for GPU computing processors. SeMA 59, 53–78 (2012). https://doi.org/10.1007/BF03322610
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/BF03322610