LBsoft: A parallel open-source software for simulation of colloidal systems,☆☆

https://doi.org/10.1016/j.cpc.2020.107455Get rights and content

Abstract

We present LBsoft, an open-source software developed mainly to simulate the hydro-dynamics of colloidal systems based on the concurrent coupling between lattice Boltzmann methods for the fluid and discrete particle dynamics for the colloids. Such coupling has been developed before, but, to the best of our knowledge, no detailed discussion of the programming issues to be faced in order to attain efficient implementation on parallel architectures, has ever been presented to date. In this paper, we describe in detail the underlying multi-scale models, their coupling procedure, along side with a description of the relevant input variables, to facilitate third-parties usage.

The code is designed to exploit parallel computing platforms, taking advantage also of the recent AVX-512 instruction set. We focus on LBsoft structure, functionality, parallel implementation, performance and availability, so as to facilitate the access to this computational tool to the research community in the field.

The capabilities of LBsoft are highlighted for a number of prototypical case studies, such as pickering emulsions, bicontinuous systems, as well as an original study of the coarsening process in confined bijels under shear.

Program summary

Program Title: LBsoft

CPC Library link to program files: http://dx.doi.org/10.17632/dvpfx9p342.1

Licensing provisions: BSD 3-Clause License

Programming language: Fortran 95

Nature of problem: Hydro-dynamics of the colloidal multi-component systems and Pickering emulsions.

Solution method: Numerical solutions to the Navier–Stokes equations by Lattice-Boltzmann (lattice-Bhatnagar–Gross–Krook, LBGK) method [1] describing the fluid dynamics within an Eulerian description. Numerical solutions to the equations of motion describing a set of discrete colloidal particles within a Lagrangian representation coupled to the LBGK solver [2]. The numerical solution of the coupling algorithm includes the back reaction effects for each force term following a multi-scale paradigm.

[1] S. Succi, The Lattice Boltzmann Equation: For Fluid Dynamics and Beyond, Oxford University Press, 2001.

[2] A. Ladd, R. Verberg, Lattice-Boltzmann simulations of particle-fluid suspensions, J. Stat. Phys. 104.5–6 (2001) 1191–1251.

Introduction

In the last two decades, the design of novel mesoscale soft materials has gained considerable interest. In particular, soft-glassy materials (SGM) like emulsions, foams and gels have received growing attention due to their applications in several areas of modern industry. For instance, chemical and food processing, manufacturing and biomedical involve several soft-glassy materials nowadays [1], [2], [3]. Besides their technological importance, the intriguing non-equilibrium effects, such as long-time relaxation, yield-stress behavior and highly non-Newtonian dynamics make these materials of significant theoretical interest. A reliable model of these features alongside with its software implementation is of compelling interest for the rational designing and shaping up of novel soft porous materials. In this context, computational fluid dynamics (CFD) can play a considerable role in numerical investigations of the underpinning physics in order to enhance mainly mechanical properties, thereby opening new scenarios in the realization of new states of matter.

Nowadays, the lattice-Boltzmann method (LBM) is one of the most popular techniques for the simulation of fluid dynamics due to its relative simplicity and locality of the underlying algorithm. A straightforward parallelization of the method is one of the main advantages of the lattice-Boltzmann algorithm which makes it an excellent tool for high-performance CFD.

Starting with the LBM development, a considerable effort has been carried out to include the hydrodynamic interactions among solid particles and fluids [4], [5], [6], [7]. This extension has opened the possibility to simulate complex colloidal systems also referred to as Pickering emulsions [8]. In this framework, the description of the colloidal particles exploits a Lagrangian dynamics solver coupled to the lattice-Boltzmann solver of fluid dynamics equations. This intrinsically multiscale approach can catch the dynamical transition from a bi-continuous interfacially jammed emulsion gel to a Pickering emulsion, highlighting the mechanical and spatial properties which are of primary interest for the rational design of SGM [9], [10], [11], [12].

By now, several LBM implementations are available, both academic packages such as OpenLB [13], DL_MESO [14], also implementing particle–fluid interaction such as WaLBerla [15], [16], Palabos [17], Ludwig [18], HemeLB [19], and commercially licensed software such as XFlow [20] and PowerFLOW [21], to name a few. The modeling of SGM requires specific implementations of LBM and Lagrangian solvers aimed at the optimization of the multi-scale coupling algorithms in order to scale up to large systems. This point is mandatory for an accurate statistical description of such complex systems which is necessary for a fully rational design of a new class of porous materials.

In this paper, we present, along with the overall model, LBsoft, a parallel FORTRAN code, specifically designed to simulate bi-continuous systems with colloidal particles under a variety of different conditions. This comprehensive platform is devised in such a way to handle both LBGK solver and particle dynamics via a scalable multiscale algorithm. The framework is developed to exploit several computational architectures and parallel decompositions. With most of the parameters taken from relevant literature in the field, several test cases have been carried out as a software benchmark.

The paper is structured as follows. In Section 2 we report a brief description of the underlying method. A full derivation of the model is not reported, but we limit the presentation to the main ingredients necessary to describe the implementation of the algorithms. Nonetheless, original references of models are reported step by step along with the implementation description. In Section 3 we describe the details on memory organization and parallel communication patterns. In Section 4 we report a set of tests used to validate the implementation and assess the parallel performance. Finally, conclusions and an outlook on future development directions are presented.

Section snippets

Method

In this section, we briefly review the methodology implemented in LBsoft. Further details are available in the literature.

The code combines two different levels of description: the first exploits a continuum description for the hydrodynamics of a single or two immiscible fluids; the second utilizes individual rigid bodies for the representation of colloidal particles or other suspended species. The exchange of information between the two levels is computed on-the-fly, allowing a simultaneous

Implementation

LBsoft is implemented in Fortran 95 using modules to minimize code cluttering. In particular, the variables having in common the description of certain features (e.g., fluids and particles) or methods (e.g., time integrators) are rounded in different modules. The code adopts the convention of the explicit type declaration with PRIVATE and PUBLIC accessibility attributes in order to decrease error-proneness in programming. Further, the arguments passed in calling sequences of subroutines have

Description of input and output files

LBsoft needs an input file to setup the simulation. The input file is free-form and case-insensitive. The input file is named input.dat, and it is structured in rooms. Each room starts with the directive [room "name"] bracket by square brackets, and it finishes with the directive [end room]. The [room system], [room fluid], and [room particle] compose the list of possible choices. The main room is the [room system], which specifies the number of time steps to be integrated, the size of the

Test cases and performance

LBsoft provides a set of test cases in a dedicated directory. Several physical scenarios verify the code functionalities testing all the implemented algorithms. Among them, there are the Shear flow and the Pouseille flow in all the possible Cartesian directions in order to test boundary conditions, forcing scheme, and, in general, the LB implementation (2D_Shear and 2D_Poiseuille sub-folders). The spinoidal decomposition of two fluids in 3D inquires the functionality of Shan–Chen force

Conclusion

We have presented LBsoft, an open-source software specifically aimed at numerical simulations of colloidal systems. LBsoft is implemented in FORTRAN programming language and permits to simulate large system sizes exploiting efficient parallel implementation. In particular, the strong scaling behavior of the code shows that LBsoft delivers an excellent parallelization of the lattice-Boltzmann algorithm. Further, whenever the particle integrator is combined with the fluid solver, LBsoft continues

Declaration of Competing Interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Acknowledgments

We would like to thank Prof. Anthony Ladd for illuminating discussions on rigid body models and precious suggestions on their implementations. The software development process has received funding from the European Research Council under the European Union’s Horizon 2020 programme /ERC Grant Agreement No. 739964 “COPMAT”. ML acknowledges the project “3D-Phys” (PRIN 2017PHRM8X) from MIUR, Italy .

References (62)

  • DesplatJ.-C. et al.

    Comput. Phys. Comm.

    (2001)
  • MazzeoM.D. et al.

    Comput. Phys. Comm.

    (2008)
  • OnishiJ. et al.

    Comput. Math. Appl.

    (2008)
  • MattilaK. et al.

    Comput. Math. Appl.

    (2008)
  • WittmannM. et al.

    Comput. Math. Appl.

    (2013)
  • SmithW.

    Comput. Phys. Comm.

    (1991)
  • RapaportD.

    Comput. Phys. Comm.

    (1991)
  • HumphreyW. et al.

    J. Mol. Graph.

    (1996)
  • SchmieschekS. et al.

    Comput. Phys. Comm.

    (2017)
  • PlimptonS.

    J. Comput. Phys.

    (1995)
  • Fernandez-NievesA. et al.

    Fluids, Colloids and Soft Materials: An Introduction to Soft Matter Physics, Volume 7

    (2016)
  • PiazzaR.

    Soft Matter: The Stuff that Dreams are Made of

    (2011)
  • MezzengaR. et al.

    Nature Mater.

    (2005)
  • LaddA.J.

    Mol. Phys.

    (2015)
  • LaddA. et al.

    J. Stat. Phys.

    (2001)
  • AidunC.K. et al.

    J. Fluid Mech.

    (1998)
  • LaddA.J.

    J. Fluid Mech.

    (1994)
  • PickeringS.U.

    J. Chem. Soc. Trans.

    (1907)
  • XieQ. et al.

    ACS Nano

    (2017)
  • LiuH. et al.

    Comput. Geosci.

    (2016)
  • FrijtersS. et al.

    Soft Matter

    (2012)
  • JansenF. et al.

    Phys. Rev. E

    (2011)
  • HeuvelineV. et al.

    Internat. J. Modern Phys. C

    (2007)
  • SeatonM.A. et al.

    Mol. Simul.

    (2013)
  • BauerM. et al.

    Comput. Math. Appl.

    (2020)
  • SchornbaumF. et al.

    SIAM J. Sci. Comput.

    (2016)
  • LattJ.

    Palabos, Parallel Lattice Boltzmann Solver

    (2009)
  • D.M. Holman, R.M. Brionnaud, Z. Abiza, Proceeding in the European Congress on Computational Methods in Applied Sciences...
  • LockardD.P. et al.

    J. Stat. Phys.

    (2002)
  • KrügerT. et al.

    The Lattice Boltzmann Method: Principles and Practice

    (2017)
  • SucciS. et al.

    The Lattice Boltzmann Equation: For Complex States of Flowing Matter

    (2018)
  • Cited by (18)

    • LBcuda: A high-performance CUDA port of LBsoft for simulation of colloidal systems

      2022, Computer Physics Communications
      Citation Excerpt :

      In this paper, we present and make available the CUDA Fortran code LBcuda, specifically designed to simulate on GPUs bi-continuous systems with colloidal particles under a variety of different conditions. LBcuda is a direct port of the LBsoft code [8], an open-source software for simulations of soft glassy emulsions originally developed for CPU-architectures, which successfully combines the lattice-Boltzmann method (LBM) [9–12] with a Lagrangian solver to tackle the multi-scale coupling of fluids and particles [13]. Nowadays, the straightforward parallelization of LBM makes the lattice-Boltzmann algorithm an excellent candidate for high-performance CFD, especially on GPU-based architectures, given the relative simplicity and locality of its underlying algorithm.

    • TLBfind: a Thermal Lattice Boltzmann code for concentrated emulsions with FINite-size Droplets

      2022, Computer Physics Communications
      Citation Excerpt :

      The focus of this paper is on LB models, which have become very popular and attractive in the last two decades, due to their simplicity, efficiency and applicability in different contexts [31,32]. Several open-access LB implementations are available, e.g., Ludwig [33], LB3D [34], LBsoft [35], Palabos [36], and LBfoam [37]. However, an LB software that simulates the dynamics of finite-size droplets stabilised against coalescence and subjected to thermal convection is not available to the best of our knowledge in an open-access version.

    • Toward exascale design of soft mesoscale materials

      2020, Journal of Computational Science
      Citation Excerpt :

      Further results are shown in Fig. 8, in which the bijel is confined within solid walls with opposite speeds ±U = 0.01, hence subject to a shear S = 2U/H, H being the channel width. The complex and rich rheology of such confined bijels is a completely open research item, which we are currently pursuing through extensive simulations using LBsoft, a open-source software for soft glassy emulsion simulations [67]. Fig. 8 reports the bijel before and after applying the shear over half-million timesteps.

    • Lightweight lattice Boltzmann

      2023, Journal of Chemical Physics
    View all citing articles on Scopus

    The review of this paper was arranged by Prof. D.P. Landau.

    ☆☆

    This paper and its associated computer program are available via the Computer Physics Communication homepage on ScienceDirect (http://www.sciencedirect.com/science/journal/00104655)

    View full text