Elsevier

Computer Physics Communications

Volume 232, November 2018, Pages 35-45
Computer Physics Communications

Colloidal suspension by SRD–MD simulation on GPU

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

Abstract

In this paper, we focus on a coarse-grained model for fluid simulation named Stochastic Rotation Dynamics (SRD) combined with colloids simulated with Molecular Dynamics (MD). In this method, the fluid is represented by point particles with continuous velocities distributed in small cells. The coupling between the dynamics of the fluid particles and the dynamics of colloids is performed by applying repulsive forces between these two kinds of particles at each MD step. As this method is computationally expensive for large systems, we propose an approach adapted to graphical processing units (GPU) that outperforms existing methods by associating each colloid to a block of parallel threads. This strategy offers a better workload balance on the GPU even for systems with a large number of neighbors.

Introduction

During the last few decades, numerous computer simulations have been developed to study soft matter (including complex fluids, polymers in suspension, colloidal suspensions, etc.). In this field, “large” particles are studied taking into account thermal fluctuations, which need specific simulations. Brownian dynamics simulations (BD) [1], dissipative particles dynamics simulations (DPD) [2] or Lattice-Boltzmann simulations (LB) [[3], [4]] are among the common methods used for these studies. In BD, the fluid is modeled as a continuum medium although in the two other methods, it is described by a coarse-grained model. In this paper, we focus on another kind of simulation using a coarse-grained model for the fluid particles, namely stochastic rotation dynamics (SRD) also known as multi-particle collision dynamics (MPCD), which was first introduced by Malevanets and Kapral in 1999 [[5], [6]]. Many applications and variants of this method have been extensively reviewed in Refs. [7] and [8]. In this method, the fluid is represented by point particles with continuous positions and velocities distributed in small cells. The dynamics of the fluid proceeds in two steps: a streaming step and a collision step. During the streaming step, the fluid particles move ballistically according to their velocity and during the collision step, a stochastic rotation of the relative velocity of each particle in each cell is applied. The dynamics of fluid particles is thus described without calculating any explicit interactions between them. When embedded colloids are introduced in the system, their dynamics is described by a traditional molecular dynamics scheme (MD) and simulations are called hybrid SRD–MD simulations. In order for the fluid and the colloids to interact, the SRD simulation of the fluid has to be coupled with the MD simulation of the colloids. Different coupling methods exist in the literature. The most common and the simplest one is to introduce the colloids in the collision step of the fluid. In this manner, only the colloid–colloid interactions are explicitly calculated. The exchange of momentum between fluid particles and colloids takes place in the collision steps of SRD. This coupling was largely applied and give good results when the colloids concentration is moderate [9]. It is also very suitable for parallelization and a GPU version has recently been developed by Westphal et al. [10]. However because of its simplicity, it fails to model precisely the hydrodynamics. The fluid can penetrate inside the colloids, therefore this method cannot describe the lubrication effects. In this paper, another coupling is considered. It consists in introducing explicit repulsive interactions between the colloids and the fluid particles, which are chosen to avoid depletion and to mimic the lubrication [11]. In this method called in the following ‘SRD–MD with force coupling’, the fluid particles are not allowed to penetrate deeply into the colloids and thus, they are not homogeneously distributed in the simulation box. The main disadvantage is that, as more interactions must be computed for each MD step, this method becomes computationally expensive for large systems. To improve the performance of such kind of simulations, we propose here a code suitable for graphical processing units (GPU) calculations.

This paper is organized as follows. First, in Section 2, the hybrid SRD–MD simulations are described. Then, the GPU implementation details are presented in Section 3. Finally, Section 4 summarizes our results.

Section snippets

Simulations of the fluid: stochastic rotation dynamics

In the SRD method, the fluid is represented by Nf point particles of mass mf. Their dynamics is described by two steps: a streaming step and a collision step. During the streaming step, the fluid particles move according to their velocity vi, and their position xi is updated as follows: xi(t+ΔtSRD)=xi(t)+ΔtSRDvi(t)where ΔtSRD is the time duration of the streaming step. For the collision step, the space is divided into regular cubic cells of linear size a0, called SRD cells. Collision consists

GPU implementation

In the remainder of this paper we rely on the terminology related to GPUs (see also Reference [21]). GPUs contain multiple streaming multiprocessors running small routines called kernels on a large number of parallel threads. Threads are divided into groups known as warps, typically containing 32 threads on current architectures. A block is a logical group of threads of larger dimension (64, 128, etc.), defined by the programmer independently from the exact size of a warp: the task of mapping

Results

Our algorithms were tested with several NVIDIA GPUs:

  • GTX 690 with 3  072 CUDA cores and 4  GB of memory (2012)

  • Tesla K20m with 2  496 cores and 5  GB (2012)

  • Tesla K40m with 2  888 cores and 12  GB (2013)

  • GTX TITAN-X with 3  072 cores and 12  GB (2015)

Conclusion

In this paper, we have presented a complete algorithm for SRD–MD simulations with force-coupling on GPU. This algorithm combines the previous studies on the SRD on GPU and the MD on GPU. The main problem with this force-coupling is the MD part of the SRD–MD algorithm, where the standard strategy is inefficient to compute the interactions between colloids and fluid particles. To solve this problem, we proposed to use a new block decomposition scheme. This approach associates a colloid to a block

Acknowledgments

This work is supported by institutional grants from the LabEX SigmaLim (ANR-10-LABX-0074-01). The authors thank CALI and its team for computing facility (CALI has been financed by the region Limousin, the institutes XLIM, IPAM, GEIST and the University of Limoges). The authors also wish to thank Giulia Rossi from the Department of Physics of the University of Genoa for her help to test our code on recent GPU cards. Fig. 6 has been obtained by VMD, a molecular graphics program originally

References (39)

  • WestphalE. et al.

    Comput. Phys. Comm.

    (2014)
  • Al-RefaieA.F. et al.

    Comput. Phys. Comm.

    (2017)
  • WangD.-B. et al.

    Comput. Phys. Comm.

    (2007)
  • LiuW. et al.

    Comput. Phys. Comm.

    (2008)
  • AndersonJ.A. et al.

    J. Comput. Phys.

    (2008)
  • AbrahamM.J. et al.

    SoftwareX

    (2015)
  • HumphreyW. et al.

    J. Mol. Graph.

    (1996)
  • ErmakD.L. et al.

    J. Chem. Phys.

    (1978)
  • GrootR.D. et al.

    J. Chem. Phys.

    (1997)
  • LaddA.J.C.

    J. Fluid Mech.

    (1994)
  • LaddA.J.C.

    J. Fluid Mech.

    (1994)
  • MalevanetsA. et al.

    J. Chem. Phys.

    (1999)
  • MalevanetsA. et al.

    J. Chem. Phys.

    (2000)
  • KapralR.

    Advances in Chemical Physics

    (2008)
  • GompperG. et al.
  • CerbelaudM. et al.

    Soft Matter

    (2017)
  • PaddingJ.T. et al.

    Phys. Rev. E

    (2006)
  • IhleT. et al.

    Phys. Rev. E

    (2001)
  • NoguchiH. et al.

    Europhys. Lett.

    (2007)
  • Cited by (1)

    • Evaluation of the influence of aggregation morphology on thermal conductivity of nanofluid by a new MPCD-MD hybrid method

      2021, International Communications in Heat and Mass Transfer
      Citation Excerpt :

      The interactions (i.e. momentum and energy transfer) between nanoparticles and coarse-grained fluids can be realized by a stochastic rotation transformation in a cell. This allow us to couple MPCD with MD [35,36]. The hybrid method of MPCD-MD can be employed in structure and dynamics of macromolecule [37], aggregation process of nanoparticles [38,39], shear thickening and thinning of nanofluids [40,41].

    View full text