The library Palabos offers a framework in C++ for fluid flow simulations with the lattice Boltzmann (LB) method. Originally conceived as a research tool for lattice Boltzmann models, the code has evolved into a general-purpose software for computational fluid dynamics. The programming interface is straightforward and offers an access to the rich world of lattice Boltzmann, even to and audience with restricted theoretical knowledge of this method. However, be aware that computational fluid dynamics is a difficult topic in itself. In spite of the apparent ease of the user interface, a tool like Palabos requires a certain level of know-how from the user in order to produce meaningful results.
A substantial amount of development time for Palabos went into formulating a general programming concept for LB simulation which offers an appropriate balance between generality, ease of use, and numerical efficiency. The difficulty of this task can be understood if one considers that the core ingredients of the LB method are guided by physical considerations rather than criteria from numerical analysis. As a consequence, it is straightforward to implement a LB code for a specific physical model, a rectangular-shaped numerical grid, and simple boundary conditions. However, any of the extensions of the code required for the implementation of practical problems in fluid engineering require careful considerations and a solid amount of programming efforts. It is frequent to find LB codes which implement one specific advanced feature (for example parallelism), but then find themselves in a too rigid shape to allow other extensions (for example coupling of two grids for multi-phase flows). To cope with this problem, the various ingredients of Palabos’ software architecture (physical model, underlying lattice, boundary condition, geometric domain, coupling between grids, parallelism) where largely developed as orthogonal concepts. It is for example possible to formulate a variant of the classical BGK collision model, say a MRT or entropic model, without awareness of the advanced software components of Palabos, and automatically obtain a parallel version of the code, or a multi-phase code based on the new model.
A central concept in Palabos are so-called “dynamics objects” which are associated to each fluid cell and determine the nature of the local collision step. Full locality of inter-particle collisions is a key ingredient of LB models, a fact which is acknowledged in Palabos by promoting the raw numerical efficiency of such model. Specific data structures are also available for non-local ingredients, for implementing for example specific boundary conditions or inter-particle forces in multi-phase models. It is however assumed that these components are more marginal. While their implementation is reasonably efficient, they have been excluded from the low-level number-crunching strategy of Palabos in favor of higher-level programming constructs. In practice, it has been observed that this approach is barely penalizing for the overall program performance, but substantially improves the readability of end-user programs.
The grid structure of the simulations is based on a multi-block approach. Each block behaves like a rudimentary LB implementation, while advanced software ingredients such as parallelism and sparse domain implementations are covered through specific interface couplings between blocks.
The C++ code of Palabos makes a massive use of genericicity in its many facets. Basically, generic programming is intended to offer a single code that can serve many purposes. On one hand, the code implements dynamic genericity through the use of object-oriented interfaces. One use of this is that the behavior of lattice sites can be modified during program execution, to distinguish for example between bulk and boundary cells, or to modify the fluid viscosity or the value of a body force dynamically. On the other hand, C++ templates are used to achieve static genericity. As a result, it is sufficient to write a single generic code for various 3D lattice structures, such as D3Q15, D3Q19, and D3Q27.
The intended audience for Palabos covers scientists and engineers with a background in LB modeling, or at least a solid background in computational fluid dynamics and a basic knowledge of lattice Boltzmann. The software is freely available under the terms of an open-source AGPLv3 license, a copy of which is printed in the appendix of this user guide. It is distributed under the hope that it will promote research in the field of LB modeling, and help researchers concentrate on actual physical problems instead of staying stuck in tedious software development. Furthermore, implementing new LB models in Palabos offers a simple means of promoting new models and exchanging the information between research groups.
In short, the current release of Palabos covers the following ingredients:
The following features have been repeatedly requested by the community and are currently developed:
Project supervision and core development are taken care of by Jonas Latt (FlowKit Ltd.+Universite de Geneve, Switzerland). Orestis Malaspinas (FlowKit Ltd.+Universite de Geneve, Switzerland) writes alternative LB collision terms (MRT, entropic), some of the boundary conditions, and coupled physical models (thermal, multi-phase). Free-Surface and multi-phase models are actively developed by Andrea Parmigiani (Universite de Geneve, Switzerland) and by Dimitrios Kontaxakis (FlowKit Ltd, Switzerland). Grid refinement is taken care of by Daniel Lagrava (Universite de Geneve, Switzerland). Many other people have contributed by writing code, thinking about programming concepts, or understanding some of the LB models for which the literature is sparse. We particularly mention, in alphabetical order, the contributions of Fokko Beekhof (Universite de Geneve, Switzerland), Bastien Chopard (Universite de Geneve, Switzerland), Mathias Krause (Rechenzentrum Karlsruhe, Germany), Switzerland), Bernd Stahl(Universite de Geneve, Switzerland).
Installation instructions and a short overview of the code are provided in the section Getting started with Palabos. Additionally to the user guide, the following resources are available as a support for Palabos users: