Advertisement

SeMA Journal

, Volume 59, Issue 1, pp 53–78 | Cite as

A modular lattice boltzmann solver for GPU computing processors

  • M. Astorino
  • J. Becerra Sagredo
  • A. QuarteroniEmail author
Article

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.

Keywords

lattice Boltzmann method GPU programming CUDA parallel computing Navier-Stokes equations 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    C.K. Aidun and J.R. Clausen. Lattice-Boltzmann method for complex flows. Annu. Rev. Fluid Mech., 42:439–472, 2010.MathSciNetCrossRefGoogle Scholar
  2. [2]
    S Ansumali. Minimal kinetic modeling of hydrodynamics. PhD thesis, ETH Zürich, 2004.Google Scholar
  3. [3]
    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.CrossRefGoogle Scholar
  4. [4]
    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.CrossRefGoogle Scholar
  5. [5]
    A. Caiazzo. Analysis of lattice Boltzmann initialization routines. Journal of statistical physics, 121(1):37–48, 2005.MathSciNetzbMATHCrossRefGoogle Scholar
  6. [6]
    C. Cercignani. Mathematical methods in kinetic theory. Plenum Press New York, 1969.Google Scholar
  7. [7]
    P. Chen. The lattice Boltzmann method for fluid dynamics: theory and applications. Master’s thesis, EPFL, 2011.Google Scholar
  8. [8]
    S. Chen and G.D. Doolen. Lattice Boltzmann method for fluid flows. Ann. Rev. Fluid Mech., 30:329–364, 1998.MathSciNetCrossRefGoogle Scholar
  9. [9]
    B. Chopard and M. Droz. Cellular automata modeling of physical systems. Cambridge University Press Cambridge, UK, 1998.zbMATHCrossRefGoogle Scholar
  10. [10]
    NVIDIA CUDA. Programming Guide, Version 4.0, 2011.Google Scholar
  11. [11]
    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.zbMATHCrossRefGoogle Scholar
  12. [12]
    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.MathSciNetCrossRefGoogle Scholar
  13. [13]
    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.zbMATHCrossRefGoogle Scholar
  14. [14]
    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.zbMATHCrossRefGoogle Scholar
  15. [15]
    F.J. Higuera and J. Jimenez. Boltzmann approach to lattice gas simulations. EPL (Europhysics Letters), 9:663–668, 1989.CrossRefGoogle Scholar
  16. [16]
    J. Hoberock and N. Bell. Thrust: A parallel template library, 2010. Version 1.3.0.Google Scholar
  17. [17]
    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.MathSciNetzbMATHCrossRefGoogle Scholar
  18. [18]
    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.zbMATHCrossRefGoogle Scholar
  19. [19]
    J. Lätt. How to implement your DdQq dynamics with only q variables per node (instead of 2q). Technical report, Tufts University, June 2007.Google Scholar
  20. [20]
    J. Lätt. Hydrodynamic limit of lattice Boltzmann equations. PhD thesis, Geneva University, 2007.Google Scholar
  21. [21]
    J. Lätt and B. Chopard. Lattice Boltzmann method with regularized non-equilibrium distribution functions. Math. Comp. Sim., 72:165–168, 2006.CrossRefGoogle Scholar
  22. [22]
    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.CrossRefGoogle Scholar
  23. [23]
    O. Malaspinas. Lattice Boltzmann method for the simulation of viscoelastic fluid flows. PhD thesis, EPFL, 2009.Google Scholar
  24. [24]
    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.zbMATHCrossRefGoogle Scholar
  25. [25]
    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.MathSciNetzbMATHCrossRefGoogle Scholar
  26. [26]
    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.CrossRefGoogle Scholar
  27. [27]
    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.zbMATHCrossRefGoogle Scholar
  28. [28]
    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.zbMATHCrossRefGoogle Scholar
  29. [29]
    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.Google Scholar
  30. [30]
    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.MathSciNetCrossRefGoogle Scholar
  31. [31]
  32. [32]
    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.Google Scholar
  33. [33]
    Y.H. Qian, D. d–Humieres, and P. Lallemand. Lattice BGK models for Navier-Stokes equation. EPL (Europhysics Letters), 17:479, 1992.zbMATHCrossRefGoogle Scholar
  34. [34]
    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.CrossRefGoogle Scholar
  35. [35]
    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.Google Scholar
  36. [36]
    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.MathSciNetzbMATHCrossRefGoogle Scholar
  37. [37]
    S. Succi. The lattice Boltzmann equation for fluid dynamics and beyond. Oxford University Press, USA, 2001.zbMATHGoogle Scholar
  38. [38]
    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.CrossRefGoogle Scholar
  39. [39]
    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.zbMATHCrossRefGoogle Scholar
  40. [40]
    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.zbMATHCrossRefGoogle Scholar
  41. [41]
    D.A. Wolf-Gladrow. Lattice-gas cellular automata and lattice Boltzmann models: an introduction, volume 1725 of Lecture Notes in Mathematics. Springer, 2000.Google Scholar

Copyright information

© Sociedad Española de Matemática Aplicada 2012

Authors and Affiliations

  • M. Astorino
    • 1
  • J. Becerra Sagredo
    • 1
  • A. Quarteroni
    • 2
    Email author
  1. 1.CMCS, Chair of Modelling and Scientific Computing, MATHICSE, Mathematics Institute of Computational Science and EngineeringÉcole Polytechnique Fédérale de LausanneLausanneSwitzerland
  2. 2.Department of Mathematics, Politecnico di MilanoMOX, Modeling and Scientific ComputingMilanoItaly

Personalised recommendations