LB3D: A parallel implementation of the Lattice-Boltzmann method for simulation of interacting amphiphilic fluids
간접 관련 필름·전자재료 · (18) VENT(방수통기 부품) (5) 연료전지용 수분제어장치(가습기)(6) PEM(고분자전해질막)(11) 배리어 필름
기본 정보
- 저자
- DOI
- 10.1016/j.cpc.2017.03.013
- 저널
- Computer Physics Communications
- 발행년도
- 2017
- 발행기관
- Elsevier BV
- 피인용수
- 45
- 라이선스
- cc-by
- 논문 유형
- –
- 언어
- –
- 원문 페이지
- https://doi.org/10.1016/j.cpc.2017.03.013
- 토픽
- Heat and Mass Transfer in Porous Media
- OpenAlex ID
- W2607496649
평가 내용
- 관련도
- 간접 관련
- 사업분야
- 필름·전자재료 · (18) VENT(방수통기 부품)
- 부 분야
- (5) 연료전지용 수분제어장치(가습기), (6) PEM(고분자전해질막), (11) 배리어 필름
- R&D 측면
- 분석·모델링
- 확신도
- 0.70
- 근거 용어
- Lattice-Boltzmann method, amphiphilic fluids, fluid transport in porous media, permeability, mesoscopic scale
- 판단 근거
- 본 논문은 격자 볼츠만법(LBM)을 이용한 다상 유체 및 다공성 매질 내 유체 수송 시뮬레이션 소프트웨어에 관한 연구입니다. 이는 코오롱인더스트리의 방수통기용 멤브레인(18)이나 연료전지용 중공사막(5) 등 다공성 막 구조 내에서의 유체 흐름 및 투과성 분석 모델링에 간접적으로 활용될 수 있습니다.
- R&D 활용 포인트
- 멤브레인(방수통기, 가습기 등)의 미세 기공 구조 내에서 수증기나 공기가 이동하는 메커니즘을 수치 해석적으로 모델링하고 투과 성능을 예측하는 데 활용 가능합니다.
- 평가 입력
- 초록 3,828자
초록
본문 40,612자
본문 펼치기
섹션 본문 88문단 · 38,311자
(제목 없음)
1a b s t r a c tWe introduce the lattice-Boltzmann code LB3D, version 7.1. Building on a parallel program and supporting tools which have enabled research utilising high performance computing resources for nearly two decades, LB3D version 7 provides a subset of the research code functionality as an open source project. Here, we describe the theoretical basis of the algorithm as well as computational aspects of the implementation. The software package is validated against simulations of meso-phases resulting from self-assembly in ternary fluid mixtures comprising immiscible and amphiphilic components such as water-oil-surfactant systems. The impact of the surfactant species on the dynamics of spinodal decomposition are tested and quantitative measurement of the permeability of a body centred cubic (BCC) model porous medium for a simple binary mixture is described. Single-core performance and scaling behaviour of the code are reported for simulations on current supercomputer architectures.Program summaryProgram Title: LB3D Program Files doi: http://dx.doi.org/10.17632/9g9x2wr8z8.1 Licensing provisions: BSD 3-clause Programming language: FORTRAN90, Python, C Nature of problem: Solution of the hydrodynamics of single phase, binary immiscible and ternary amphiphilic fluids. Simulation of fluid mixtures comprising miscible and immiscible fluid components as well as amphiphilic species on the mesoscopic scale. Observable phenomena include self-organisation of mesoscopic complex fluid phases and fluid transport in porous media. Solution method: Lattice-Boltzmann (lattice-Bhatnagar-Gross-Krook, LBGK) [1, 2, 3] method describing fluid dynamics in terms of the single particle velocity distribution function in a 3-dimensional discrete phase space (D3Q19)[4,5,6]. Multiphase interactions are modelled using a phenomenological pseudopotential approach[7,8]with amphiphilic interactions utilising an additional dipole field[9,10]. Solid boundaries are modelled using simple bounce-back boundary conditions and additional pseudo-potential wetting interactions[11]. Additional comments including Restrictions and Unusual features: The purpose of the release is the provision of a refactored minimal version of LB3D suitable as a starting point for the integration of additional features building on the parallel computation and IO functionality.
2[3] C. K. Aidun, J. R. Clausen, Lattice-Boltzmann Method for Complex Flows, Annual Review of Fluid Mechanics 42 (2010)
Introduction
3Since its advent almost 30 years ago, the lattice-Boltzmann method (LBM) has gained increasing popularity as a means for the simulation of fluid dynamics. Driving factors for this development are the relative simplicity and locality of the lattice-Boltzmann algorithm. The latter allows for straightforward parallelisation of the method and its application in high performance computing. Today, a wide range of LBM implementations is available ranging from specialised academic packages such as Ludwig for the simulation of complex fluids [1] and HemeLB for the simulation of flow in blood vessels [2] to very versatile open-source projects such as OpenLB [3] and Palabos [4] as well as commercial applications such as PowerFlow [5] and XFlow [6].
4The lattice-Boltzmann (LB) code LB3D provides a number of algorithms and scripts designed for the simulation of binary and ternary amphiphilic complex fluid mixtures in bulk and complex geometries using high performance computing environments. As in the case of Ludwig, LB3D focuses on the simulation of complex fluids. While Ludwig implements a top-down model where a free energy has to be provided by the user, LB3D is a bottom-up code in which interactions are specified between particle distributions. LB3D is the only package which handles amphiphilic fluids in such a manner. Originally implemented in 1999, LB3D has since been in constant use and development. This document starts out with an overview of the history of the development and scientific applications of the code. Following this, the paper considers LB3D in version 7.1, the latest release of a re-factored open-source instance of the program which has been development since 2013 and available in this version under the BSD 3-Clause license.
5Following work on lattice-gas models [7,8], the development of LB3D started out in the group of Coveney then at Queen Mary University of London, as a summer project of then third year University of Oxford undergraduate student Chin who implemented the amphiphilic fluid model with assistance of Boghosian and Nekovee [9,10]. During the first decade of development and application, the amphiphilic fluid model was employed for extensive research on the properties of complex fluids. Publications on computational science developments in this period report aspects of distributed computing as an integral part of the design, including real time visualisation and computational steering [11][12][13][14][15]. Scientific contributions included the study of the spinodal decomposition and emulsion formation of binary fluid mixtures [16][17][18][19] as well as the self-organisation of mesoscopic phases in general and the cubic gyroid phase in particular [20][21][22]. Flow of complex fluids in porous media and under shear was investigated [23].
6The utilisation of substantial resources like the US TeraGrid and UK HPC facilities in ground breaking federation of national grid infrastructures [12][13][14] and the highest performance class of national supercomputers for capability computing [24,25], allowed scientists working with LB3D large-scale numerical investigation of rheological properties of the gyroid phase [26][27][28][29]. Later work explored the parameters of ternary amphiphilic fluids and their flow properties in detail [30][31][32][33][34].
7Subsequent research with version 6 of LB3D, which remains unreleased, has focused on fluid surface interaction and coupling of particle models. Version 7.1 of LB3D, however, which is released in conjunction with this paper, includes the amphiphilic fluid model and has been restructured and optimised to ease future development. First steps have been taken to support hybrid parallel programming models in order to ensure compatibility with projected next generation supercomputer architectures on the path to the exascale.
8A newly integrated Python interface for the configuration of initial conditions and interactive execution improves ease of use. Moreover, improved in-code documentation and extension of the user manual are intended to encourage new users and developers to harness the potential of LB3D as well to as enhance it further.
9The paper has the following structure. In Section 2 we describe the lattice-Boltzmann method (LBM) used. We do not provide the derivation of this model, but show the key points necessary for understanding the implementation; references are provided to the relevant original papers. In Section 3 we discuss implementation details such as memory organisation, communication and scripting capabilities. In Section 4 we discuss tests used to verify and validate the implementation. We also provide performance benchmarks for the code and compare performance and scaling with other LBM codes. The section closes with a conclusion and outlook on future development directions.
Method
10In this section we give an overview of the single phase lattice-Boltzmann method as well as its multiphase extension and boundary conditions as implemented in LB3D.
Single phase lattice-Boltzmann
11The lattice-Boltzmann equation is a popular method to simulate flows and hydrodynamic interactions in incompressible fluids [35][36][37]. It is a mesoscopic approach where the fluid is represented by populations that evolve according to a fully discrete analogue of the Boltzmann kinetic equation [38,39]. We write the lattice-Boltzmann equation in the following form
12where the pre-collisional populations f σ ,i and post-collisional populations f * σ ,i are related through the streaming step
13Eq. (1) describes a collision step and neglects terms of order O(h 2 /τ ) compared to the more common second-order accurate LBE [38][39][40][41]; however, this does not affect the density and flow field which are of primary interest. The populations f σ ,i (x, t) and f * σ ,i (x, t) represent number densities of a fluid species σ at discrete grid points x and discrete time t, moving with discrete velocities c i . LB3D uses the so-called D3Q19 lattice, a three-dimensional Cartesian lattice with 19 velocities [42] obtained from a projected face centred hyper-cubic (FCHC) lattice. The lattice velocities c i can be derived systematically as the abscissae of a Gauss-Hermite quadrature in velocity space [40,43,44]. The D3Q19 lattice is illustrated in Fig. 1 along with the (arbitrary) numbering of the velocities c i implemented in LB3D. Eq. (1) describes the lattice-Bhatnagar-Gross-Krook (LBGK) collision model where the populations relax towards local equilibrium on a single time scale τ σ [42,45]. The equilibrium distribution f eq i (n, u) is a Hermite expansion of the Maxwell-Boltzmann distribution [38,46]. Here we choose an expansion including cubic terms in the velocity
14where c s denotes the speed of sound, w i are lattice weights, and Q iαβ and W iαβγ are the second and third rank isotropic tensors
15Note that the Einstein convention for summation over Greek indices is implied. For the D3Q19 lattice, the speed of sound is c s = 1/ √ 3 and the lattice weights w i are [42] w i = 1/3,
16Hydrodynamic fields are obtained from the populations by calculating velocity moments, e.g., density and momentum density are given by
17where m σ is the molecular mass. In the presence of a force density F σ (x, t), the lattice momentum densityp σ (x, t) has to be corrected for a discretisation effect, such that the hydrodynamic momentum density of the fluid is [36,40,41,47]
18Here the sign stems from the fact that we calculate the moments from the post-collisional distributions. Finally, the hydrodynamic flow field is
19which is used in the lattice-Boltzmann equation (1). Generally the force density F σ (x, t) may accommodate any kind of contribution. In particular, F σ (x, t) may include both intermolecular forces (Shan-Chen forces in our model, cf. Section 2.2) and external forces such as gravity or an artificial Kolmogorov scaled force [48].
Shan-Chen multiphase model
20The Shan-Chen approach [49] provides a straightforward way to model multi-component (e.g. water and oil) and/or multi-phase fluids (e.g. water and water vapour). The single phase model is extended by the so-called pseudo-potential method to include multiphase interactions [50,51]. Each fluid component σ is governed by the lattice-Boltzmann equation (1).
21The total fluid density is simply
22It is assumed that there is a common velocityũ for all components.
23In the absence of forces, it can be shown that total momentum is conserved if the common velocity is chosen to be [49] u(
24Note that the common velocityũ(x, t) implies an effective momentum exchange between the species even when no explicit forces are prescribed.
25In addition, each fluid component may be subject to an explicit force density F σ (x, t). Similar to the single phase case, we need to redefine the hydrodynamic momentum to account for discretisation effects. The hydrodynamic flow field for the multiphase fluid is then given by [49] u(
26) .
27If the fluid as a whole is subject to a force density F(x, t), it has to be distributed to each fluid component proportionally to the mass fraction [52]:
28Eq. (14) ensures that the total force density obeys F(x, t) = ∑ σ F σ (x, t) and that the acceleration for each component is iden-
29The basic idea of the Shan-Chen approach for multiphase fluids is to introduce coupling forces
30which are non-local and depend on density gradients. Here, ψ σ (x, t) represents an effective mass of component σ which is realised as a function of component density ρ σ (x, t) [49]
31where ρ 0 is a reference density. The Green's function G σ σ ′ (x, x ′ ) must be symmetric in σ and x to ensure global momentum con-
32We choose G σ σ ′ (x, x ′ ) to be short-ranged and allow interaction only between neighbouring lattice sites [52]
33We can now rewrite Eq. (15) as
34and Eq. (18) as
35Note that g σ σ ′ is the coupling strength of components σ and σ ′ .
36The number of components is not limited by the Shan-Chen model. Also note that non-zero values of g σ σ allow for self-interaction of component σ . The pseudo-potential forces introduce a densitygradient-dependent term into the equation of states which ensures phase separation for a given critical coupling strength and overall density. Masses are determined up to a constant allowing the use of unit mass where convenient. Mass contrasts of components imply a contrast in dynamic viscosity and warrant the introduction of the effective common equilibrium velocity (12). No differences in mass have been used so far in our published work while, in the low Mach number limit, the common velocity equals the single component bulk velocity.
Amphiphilic fluid components
37LB3D supports fluid mixtures of up to three components, one of which is amphiphilic (oil or red, water or blue and surfactant or green). Amphiphilic properties of the surfactant component are modelled by introduction of a dipole field d(x, t) representing the average molecule orientation at each lattice site [10]. The orientation of the dipole vector d is allowed to vary continuously. It is advected with the fluid and thus propagates according to
38where d * denotes the post-collisional dipole vector which is relaxed through a BGK process on a single timescale
39The equilibrium orientation is derived from a mean field approach. The mean dipole field in the surrounding fluid can be written as
40where the contribution from ordinary species is
41Here q σ is a colour charge for the ordinary species. The contribution from the amphiphilic species can be written as
42where the traceless second rank tensor D i is given by
43The equilibrium dipole configuration can then be derived from a Boltzmann distribution which gives
44and d 0 is a parameter representing the intrinsic dipole strength of the amphiphiles.
45With an amphiphilic species present, additional force components are introduced between the species. In addition to the density dependence of the binary model, the resulting forces do not only depend on the fluid densities alone, but on the dipole moment (with the relative orientation to boundaries and neighbouring dipoles) as well. The force on oil and water components σ is now
46where F int σ is given in Eq. (19), and the additional force due to the amphiphiles is
47Similarly, the force on the amphiphilic components is
48where F ασ is the reaction force to F σ α and has the form
49Finally, the force acting between surfactant components on neighbouring sites is given by
50The parameters g ασ , g σ α , and g αα in Eqs. (29), (31), and (32) are the coupling strength between water and oil components σ and amphiphilic component α, respectively. Details on the derivation of the force terms can be found in [10,51]. These forces are added in the algorithm in a manner analogous to the pseudo-potential force inducing the phase transition in the binary multi-component system.
Boundary conditions
51In the present lattice-Boltzmann model, each lattice site contains either fluid components or an obstacle, e.g., a boundary wall. LB3D v7.1 supports a number of different boundary closures for the unknown pre-collisional populations on fluid nodes that are adjacent to one or more boundary nodes. In the following we describe the simple bounce-back rule and on-site rules for Dirichlet and Neumann boundary conditions that enable inlet and outlet boundary conditions. Furthermore, we describe wetting boundary conditions for surfaces that have specific affinities with respect to different fluid species.
Bounce-back boundary conditions
52The bounce-back boundary condition was originally introduced for lattice-gas models and poses a simple way to implement a noslip boundary condition located approximately halfway between a boundary node and an adjacent fluid site [53][54][55]. Simple midgrid boundary conditions achieve zero velocity on a link connecting fluid and an obstacle by inverting the velocity of the impinging populations. This reflection can be written as a modified streaming step, cf. Eq. (2),
53where x + hc i is a solid site, and the indexī indicates the inverse velocity of i, i.e., c¯i = −c i . For the simple bounce-back rule, the effective location of the no-slip boundary condition is approximately halfway between fluid and solid. A detailed analysis shows that the exact location depends on the collision model employed, and for the LBGK model the location is viscosity dependent [56][57][58].
On-site velocity boundary conditions
54It is often desirable to specify the exact position where Dirichlet or Neumann boundary conditions are to be satisfied independently of other simulation parameters. To this end, on-site boundary conditions allow us to specify the velocity or fluxes on the boundary and lead to a fully local closure relation. This approach was originally suggested by Zou and He [59] for D2Q9 and D3Q15 models, and later extended to D3Q19 lattices [60][61][62].
55For on-site Neumann (or pressure) boundary conditions, one uses Eqs. (7) and (8) to calculate the unknown velocity component on the boundary from the two known ones and a specified density ρ 0 . Similarly, for on-site Dirichlet (or flux) boundary conditions, one can calculate the density ρ from the two known velocity components and the third specified component. In order to determine the unknown populations, one applies the bounce-back condition to the non-equilibrium part of the populations, e.g., for a boundary normal to the xy-plane,
56which leads to an expression for the unknown population
57The equation system for the remaining unknown populations is over-determined, which can be remedied by introducing additional transverse momentum corrections that reflect the stresses introduced by the boundary conditions. The equation system for the remaining populations then reads
58where the transverse momentum corrections are given by
59These expressions close the boundary equations. More details and the generalisation to arbitrary flow directions can be found in [62].
Wetting boundary conditions
60Specific surface interactions can be realised by introducing a pseudo-density ψ W at obstacle sites x ′ , which is used to calculate a pseudo-potential interaction between the fluid and components and the surface
61This strategy was first introduced by Martys and Chen [52]. The wetting boundary conditions are usually augmented with bounceback or on-site boundary conditions.
Implementation
62The core of the lattice-Boltzmann code LB3D is written in FOR-TRAN 90/95. In addition, version 7.1 provides conduits written in C to facilitate a Python interface that supports scripting during the initialisation stage. The core code is parallelised using MPI-2 for distributed memory and OpenMP for shared memory. It can be compiled and run using arbitrary combinations of MPI and OpenMP threads. LB3D makes use of several external libraries including Python, MPI, OpenMP, HDF5, and XDR. The testing framework and supplementary tools are written in Python.
63The execution flow of LB3D is structured in self-contained initialisation, simulation, and finalisation stages. The corresponding subroutine call structure is illustrated in Fig. 2. In the initialisation stage, the code reads an input file describing the simulation setup (number of components, initial conditions, simulation time, output options) as well as the physical parameters such as τ σ , g σ σ ′ , etc. The input file can also specify Python scripts to be executed during initialisation in order to introduce boundary conditions and to modify the initial fluid state (cf. Section 3.7). The simulation stage evaluates the lattice-Boltzmann equation until the specified simulation time is reached. Each time step involves several substeps for the lattice-Boltzmann algorithm, data caching, parallel communication, and file I/O. After completion of the simulation stage, the finalisation stage shuts down the MPI environment, deallocates memory, and polls and prints the execution timers before the program terminates successfully.
64We now outline the essential elements of the implementation in more detail which serves to provide a development guide for future extensions.
Data structures
65The core data structure of the implementation is a fivedimensional array of fluid populations f σ ,i (x, y, z) for the current time step with index order i, x, y, z and σ . The layout is illustrated in Fig. 3. FORTRAN column major order implies indices varying fastest from left to right. We evaluated different memory layouts for the populations array and found this order to be most effective for the present algorithm implementation. A five-dimensional array is used to store forces F σ (x, y, z, t) with index order α, x, y, z, σ (α denoting the vector component). Information on solid boundary conditions is stored in a three-dimensional array of obstacle flags with indices x, y, z. In addition, a four-dimensional array for cached fluid densities f σ (x, y, z) with indices x, y, z and σ is used.
System initialisation
66System initialisation can be performed either from scratch using a set of input options or by re-initialisation from checkpoint files in HDF5 format. The initialisation subroutine first reads any command line arguments including the path to a set of input files. The parameter input file is expected in .ini file format and processed by the module fini_parser. It is structured in sections for the simulation environment, common simulation parameters, physics parameters and output properties. Settings for special boundary conditions and checkpoints are given in separate sections. A unique feature of LB3D is the ability to adjust the system initialisation by providing a Python script which can modify density values for the respective fluid components as well as boundary geometries and wetting interaction parameters. Example input files are given in Figs. 4 and 5. Detailed explanations of all available input parameters can be found in the LB3D user manual.
67During initialisation, the MPI parallel environment is set up, MPI and HDF5 data structures are instantiated, the random number generators are seeded, and general variable defaults are set. The simulation parameters are then set to the values specified in the input file, where a set of compatibility checks is executed to catch conflicting options and parametrisations. Subsequently, the lattice data structures are allocated and initialised with a velocity field and obstacle site distribution, where the LB3D Python interface is invoked to execute the specified scripts. Moreover, additional properties such as specific interaction forces as well as in-and outflow boundary conditions are initialised. If restoration from a checkpoint is requested, simulation parameters and lattice data are read from the specified HDF5 files. Once the lattice data has been initialised, any derived properties are computed and an initial MPI communication is performed. The initialisation concludes by writing data output for time step zero and performing a sanity check, i.e. validating the numerical stability of the physical properties of the system.
Algorithmic subroutines
68In order to evaluate the lattice-Boltzmann equation (1), the following sequence of subroutine calls is implemented. The execution of these steps is performed in the main time loop subroutine of LB3D as illustrated in Fig. 6. The computation steps are interspersed with communication steps as required by the parallelisation, cf. Fig. 7. In addition, optional steps can be executed for input/output, checkpointing, and sanity checks. In contrast to other lattice Boltzmann implementations, the algorithm starts by performing communication followed by an advection step. Subsequently, calculation and caching of data is required by boundary conditions and interaction forces and is performed before the collision step.
69In the current implementation the algorithm performs between 5 and 6 complete spatial loops -one for each advection and collision process, one for the calculation of pseudo-potential forces and two more to pre-calculate and cache momentum and forces. A last optional loop is required for the calculation of dipolar interactions in the ternary model. Dividing the algorithm in this fashion provides a clear structure for the integration of future features. Here the focus is not on optimal performance but rather on readability and extensibility.
Parallelisation
70Simulations are run on a three-dimensional rectangular lattice of size tnx × tny × tnz with periodic boundary conditions as default. In order to run parallel jobs, the lattice slab is divided on program start-up into blocks of equal size nx × ny × nz. The exact lattice subdivision may be either specified by the user or chosen automatically by the MPI implementation. The number of lattice sites along each axis must be divisible by the number of processes used along that axis.
71The spatial dimensions nx, ny, nz of all arrays on each CPU are extended by a halo region which contains copies of lattice blocks from neighbouring CPUs. The algorithms implemented in the current code require a halo depth of one lattice site, but it can be set to any value for more complicated algorithms. MPI-2 array data types are instantiated for the halo regions such that a single pair of MPI send and receive calls can be used for communication between MPI processes.
72Shared memory parallelisation using OpenMP is enabled by wrapping the various spatial loops responsible for the calculation of the respective algorithm steps. Advection is performed using a single lattice buffering adjacent lattice site information for one z-layer at the time. Creation of the buffer is multi-threaded separately from the subsequent advection calculation.
Data output
73LB3D writes physical properties of fluids to output files at specified time intervals. The writeable properties include the densities of components and the flow velocity, and the frequency at which data is written can be specified in the input file. Generally, no outputs are written until time step n_sci_start, after which data is written every n_sci_OUTPUT time steps, where OUTPUT stands for a specific property. A value of n_sci_OUTPUT = 0 disables the output of the respective property. The output file format is the Hierarchical Data Format (HDF) [63] which facilitates portable, platform-independent data. HDF provides the possibility to add meta data to the raw data files and LB3D makes use of this feature by adding specific information on parameters as detailed in the manual [64].
74LB3D can be instructed to produce checkpoint files at specified time intervals. These files can be used to restart the simulation from a given configuration. When the simulation is being restarted from a checkpoint, it is possible to override any of the simulation parameters and even re-apply initialisation scripts. Therefore checkpoints may be used to create non-trivial initial conditions and ad hoc steering of simulations. Both output and checkpoint files are written in HDF5 [65]. --with-lb3d-py-path =/PATH/TO/lb3d/py $ make By default LB3D builds the binary lb3d in the /lb3d/src directory. Evoking make install by default installs to /usr/local/lb3d. If configure is provided with an install prefix, the binary is copied to /PREFIX/bin/lb3d and Python bindings to /PREFIX/share/lb3d/py. More details on the installation process can be found in the user manual [64].
Workflow
75In order to illustrate the typical workflow of a LB3D simulation, we use the porous media example, the results of which are presented in Section 4. The input file is listed in Fig. 4 and the Python script generating the geometry is listed in Fig. 5. The input file specifies simulation parameters like the number of fluid species, system size, and number of time steps to simulate. Further initial parameters can be included through Python bindings. The Python script contains functions to set and unset obstacle and fluid parameters on individual lattice sites or specific geometries. It is also possible to load information from an XDR file which defines applicable boundary conditions for each lattice site (details can be found in the user manual [64]). 6. Algorithm execution in the main time loop of LB3D. As the initialisation step includes a first collision calculation to enforce well-formed initial distributions, the time-loop starts with a communication step and executes advection first. To avoid re-calculation of frequently used properties locally conserved density and momentum as well as interaction forces are cached. Symmetry in the interaction forces permits halving of the computed force components. Every time step or interval can be configured to include checks of system stability and validity, termed sanity checks, as well as scientific and checkpoint output. All file paths are specified relative to the current execution directory. The actual simulation is started by invoking mpirun -n NUMBER_OF_CORES ./lb3d -f input.in where the mpirun command is dependent on the specific system configuration and MPI library. By default LB3D writes output to the directory ./output/ relative to the execution directory. Data analysis can be performed using a range of available HDF5 tools for different languages including Python, C/C++, and FORTRAN. For example, the package h5utils provides a number of converters, i.a., to ASCII and VTK formats for visualisation. More details on the available configuration and evaluation options can be found in the user manual [64].
Case studies
76The development of LB3D version 7.1 involved substantial refactoring of an earlier version of the code. Besides integrating new features and cleaning up the input/output routines, the parallelisation structure was extended to make use of shared memory strategies within nodes that comprise more and more cores. In this section we report the results of physics validation as well as performance benchmarks. This is done to confirm the accuracy of the added and altered functionality and probe the parametrisation of the hybrid parallel approach on the current UK National Supercomputer ARCHER.
Validation
77To ensure that the re-factoring has preserved all model properties, exemplary mesophase simulations originally performed with prior versions of LB3D have been reproduced. Due to the deterministic nature of the lattice Boltzmann method and the absence of random initial and boundary conditions the obtained results reproduce values calculated by earlier versions exactly. Here we describe simulation parametrisation and results for three test cases. For the spinodal decomposition of an amphiphilic mixture we report the time behaviour of the average fluid domain size as a function of time and evaluate the power law observed. In a second test case we make use of the Python bindings and measure permeability in a model porous medium. Finally we investigate the qualitative formation of amphiphilic mesophases.
Spinodal decomposition of an amphiphilic mixture
78Spinodal decomposition is the process of rapid demixing of immiscible fluids, e.g. water and oil. The phase separation is governed by surface tension effects and characteristically exhibits an exponential increase in domain volumes of the demixing components [16,66]. The addition of an amphiphilic component reduces the surface tension between the components and slows the spinodal decomposition process down. The resulting process still behaves exponentially, but the exponent of the observed dynamics of the domain sizes is reduced [20,[67][68][69].
79In order to evaluate the dynamics of the ternary model implemented in LB3D, we validate simulation results published by some of us previously [20,69]
Permeability in a model porous medium
80Another area of application of LB3D is the modelling of the flow of fluid mixtures over solid surfaces and in porous media. A phenomenological property to classify porous media is the permeability κ which quantifies the relation of a pressure gradient applied on a medium and the resulting flow through it. For a regular lattice of spheres the permeability is accessible semi-analytically [70,71] and has been found to follow
81where R is the sphere radius, χ is the ratio between radius and separation, assumed to equal one in our case as spheres created by the initialisation algorithm do touch (see Fig. 9). Finally, ζ is a dimensionless drag coefficient which can be approximated by a series expansion in χ. With an approximate value of χ · ζ ≈ Fig. 10 shows the error of permeability measurements as a function of the simulated fluid viscosity. The deviation is a well known artefact of LBGK models when combined with bounce-back boundary conditions. The effect can be reduced by increasing the resolution as it is directly proportional to the surface to volume ratio of the simulation. Another way to correct the error is the integration of a multi-relaxation time collision scheme within LB3D, as is planned in the future.
Formation of amphiphilic mesophases
82The ternary fluid model implemented in LB3D can be applied to investigate the self-assembly of amphiphilic mesophases [20][21][22][30][31][32][33][34]. Table 1 gives an overview of the parametrisation for simulations of self-assembly of mesophases using LB3D v7.1.
83Simulations were performed on a lattice of 256 × 256 × 256 sites. Simulation domains are initialised with fluid of homogeneous densities of ρ r,b for the two components and a density ρ s for the amphiphilic component respectively. The subsequent selfassembly of the mesophases is driven by the coupling forces, cf. Eq. (15).
84In pressure jump experiments the density of the fluid components is increased, which is equivalent to an increase in overall system pressure. We observe the formation of primitive and hexagonal mesophases, respectively, for a reduction in the surfactant self-interaction strength. In our simulations the parameter was changed from g ss = −0.0005 m/(ah) 2 to g ss = −0.001 m/(ah) 2 .
85Systems at lower and higher pressure exhibit cubic diamond and gyroid mesophases, respectively. Fig. 11 shows a volume rendering of the observed morphologies. The images display the zero isosurface of the order parameter defining the boundary of immiscible components (cf. [31] for more details).
Performance
86During the refactoring of LB3D, we have focused on creating more clearly structured and well documented code. Moreover, the new implementation exhibits a significantly improved single core performance. While OpenMP shared memory parallelisation has been implemented in addition to the prior MPI parallelisation, we focus here on the single core performance and scaling of the MPI based parallelisation. Tests of a hybrid parallelisation approach, naïvely introducing OpenMP wrappers around the main loops, result in loss of performance in all cases. More sophisticated strategies introducing nested loops and explicit OpenMP parametrisation allow for performance gains of the order of 10 percent compared to simple MPI. We have, however, found the successful parametrisations to not only vary with the machine, but to depend on the chosen problem as well. While this may change for explicit shared memory machines and future heterogeneous exa-scale configurations, in the current publication the systematic investigation of hybrid parallel performance has been omitted. Table 2 compares the single core performance of LB3D v7.1 against LB3D v7.0 as measured for simulations of domains of 256 × 256 × 256 lattice sites on 22 nodes of ARCHER comprised of two 12-core CPUs each. The speedup observed between the versions measured in millions of lattice site updates per second (MSUPs) per core is approximately three-fold. Acceleration of computation has been achieved by optimising communication, memory structure and algorithms throughout the code. Most prominently, component information has been separated in memory. Pre-calculation and caching steps have reduced redundant calculations. The change in memory layout has furthermore facilitated optimised MPI array definitions and communication patterns. Fig. 12 illustrates the strong scaling behaviour for geometries of size 1024 × 1024 × 1536 lattice sites and calculations considering single phase flow, binary mixtures or amphiphilic fluid mixtures.
87Simulating a system of pure fluid (mixture) for 10,000 time steps on 256, 512, 1024 and 2048 nodes of ARCHER, we observe excellent strong scaling behaviour close to ideal speedup. This is especially true for the more computationally demanding multi-component cases. CPU counts are multiples of 24 corresponding to the ARCHER node size. The scaling remains close to linear for many tens of thousands of cores and for the selected system domain size only just starts to deteriorate on 49,152 cores. The single core performance is comparable to the values given in Table 2. . 11. Volume rendering of simulation snapshots of zero order parameter iso surfaces for the respective mesophases obtained in simulation. Simulations were run in a volume of 32 3 lattice sites for 30,000 time steps. The order parameter is given by the difference of local densities of immiscible components. The density and interaction parameters control the pressure in the model (see [31]). Table 2.
Summary
88The LB3D simulation code has enabled a substantial amount of scientific research in diverse contexts. Starting from the investigation of ternary amphiphilic fluid mixtures the code has been extended to include a variety of boundary effects and coupled models. Cleaning and refactoring of the code have led to improved readability and extensibility. To ensure scientific accuracy and model applicability of the refactored version, we have reproduced earlier findings of ternary amphiphilic mixtures on the current UK National Supercomputer. While maintaining flexibility and extensibility, the single-core performance has more than doubled. Exploiting the excellent parallelisation behaviour of the lattice-Boltzmann algorithm, the strong scaling behaviour of the code remains close to linear. With LB3D version 7.1, we release an open source version of the code that provides functionality for simulation of amphiphilic mixtures in complex geometries. The documentation and new Python scripting options enhance the ease of use of existing features, while at the same time facilitating continued development and extension. By releasing this code under a BSD 3-clause license, we hope to inspire independent developers to contribute new features to LB3D.
참고문헌 70건
- Lattice-Boltzmann and lattice-gas simulations of binary immiscible and ternary amphiphilic fluids in two and three dimensions TDX (Tesis Doctorals en Xarxa) · 2006
- High Performance Computing Communications in computer and information science · Springer Science+Business Media · 2019 10.1007/978-3-030-16205-4
- Lattice Boltzmann Modeling: An Introduction for Geoscientists and Engineers 2005
- The Lattice Boltzmann Equation: For Fluid Dynamics and Beyond 2001
- Lattice Boltzmann Simulations of Soft Matter Systems Springer eBooks · Springer Nature · 2009 10.1007/978-3-540-87706-6_2
- Discretization of the Velocity Space in the Solution of the Boltzmann Equation Physical Review Letters · American Physical Society · 1998 10.1103/physrevlett.80.65
- Structural transitions and arrest of domain growth in sheared binary immiscible fluids and microemulsions Physical Review E · American Physical Society · 2007 10.1103/physreve.75.041504
- Simulation of multicomponent fluids in complex three-dimensional geometries by the lattice Boltzmann method Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1996 10.1103/physreve.53.743
- Multicomponent lattice-Boltzmann model with interparticle interaction Journal of Statistical Physics · Springer Science+Business Media · 1995 10.1007/bf02179985
- Self-Assembly of Ternary Cubic, Hexagonal, and Lamellar Mesophases Using the Lattice-Boltzmann Kinetic Method The Journal of Physical Chemistry B · American Chemical Society · 2008 10.1021/jp0731506
- Non-Newtonian behaviour of the gyroid mesophase: A lattice-Boltzmann study Mathematics and Computers in Simulation · Elsevier BV · 2006 10.1016/j.matcom.2006.05.035
- Coarsening dynamics of ternary amphiphilic fluids and the self-assembly of the gyroid and sponge mesophases: Lattice-Boltzmann simulations Physical Review E · American Physical Society · 2004 10.1103/physreve.69.061501
- Stress response and structural transitions in sheared gyroidal and lamellar amphiphilic mesophases: Lattice-Boltzmann simulations Physical Review E · American Physical Society · 2006 10.1103/physreve.73.031503
- Lattice BGK Models for Navier-Stokes Equation EPL (Europhysics Letters) · Institute of Physics · 1992 10.1209/0295-5075/17/6/001
- On spinodal decomposition in cubic crystals Acta Metallurgica · University of Toronto Press · 1962 10.1016/0001-6160(62)90114-1
- Analytic solutions of simple flows and analysis of nonslip boundary conditions for the lattice Boltzmann BGK model Journal of Statistical Physics · Springer Science+Business Media · 1997 10.1007/bf02181482
- Lattice Boltzmann study of spinodal decomposition in two dimensions Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2002 10.1103/physreve.66.016303
- Lattice Boltzmann simulation of rarefied gas flows in microchannels Physical Review E · American Physical Society · 2005 10.1103/physreve.71.047702
- HemeLB: A high performance parallel lattice-Boltzmann code for large scale fluid flow in complex geometries Computer Physics Communications · Elsevier BV · 2008 10.1016/j.cpc.2008.02.013
- Interpolated boundary condition for lattice Boltzmann simulations of flows in narrow gaps Physical Review E · American Physical Society · 2007 10.1103/physreve.75.066705
- Slow flow through a periodic array of spheres International Journal of Multiphase Flow · Elsevier BV · 1982 10.1016/0301-9322(82)90047-7
- Kolmogorov turbulence in a random-force-driven Burgers equation Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1995 10.1103/physreve.51.r2739
- A Knudsen layer theory for lattice gases Physica D Nonlinear Phenomena · Elsevier BV · 1991 10.1016/0167-2789(91)90295-k
- Multireflection boundary conditions for lattice Boltzmann models Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2003 10.1103/physreve.68.066614
- Boundary conditions for lattice Boltzmann simulations Journal of Statistical Physics · Springer Science+Business Media · 1993 10.1007/bf01049965
- Boundaries in lattice gas flows Physica D Nonlinear Phenomena · Elsevier BV · 1991 10.1016/0167-2789(91)90294-j
- Mass-flux-based outlet boundary conditions for the lattice Boltzmann method Journal of Statistical Mechanics Theory and Experiment · Institute of Physics · 2009 10.1088/1742-5468/2009/06/p06015
- On pressure and velocity boundary conditions for the lattice Boltzmann BGK model Physics of Fluids · American Institute of Physics · 1997 10.1063/1.869307
- A priori derivation of the lattice Boltzmann equation Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1997 10.1103/physreve.55.r6333
- Lattice-Boltzmann model for interacting amphiphilic fluids Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2000 10.1103/physreve.62.8282
- A ternary lattice Boltzmann model for amphiphilic fluids Proceedings of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2000 10.1098/rspa.2000.0601
- Capturing Knudsen layer phenomena using a lattice Boltzmann model Physical Review E · American Physical Society · 2006 10.1103/physreve.74.046704
- Self-assembled uniaxial and biaxial multilayer structures in chiral smectic liquid crystals frustrated between ferro- and antiferroelectricity Physical Review E · American Physical Society · 2004 10.1103/physreve.69.060701
- Discrete Boltzmann equation model for nonideal gases Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1998 10.1103/physreve.57.r13
- Three-dimensional lattice-Boltzmann simulations of critical spinodal decomposition in binary immiscible fluids Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2003 10.1103/physreve.67.046304
- Three-dimensional hydrodynamic lattice-gas simulations of binary immiscible and ternary amphiphilic flow through porous media Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2001 10.1103/physreve.64.061302
- Lattice Boltzmann model for simulating flows with multiple phases and components Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1993 10.1103/physreve.47.1815
- Real science at the petascale Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2009 10.1098/rsta.2009.0049
- Theory of the lattice Boltzmann method: From the Boltzmann equation to the lattice Boltzmann equation Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 1997 10.1103/physreve.56.6811
- A Model for Collision Processes in Gases. I. Small Amplitude Processes in Charged and Neutral One-Component Systems Physical Review · American Institute of Physics · 1954 10.1103/physrev.94.511
- Discrete lattice effects on the forcing term in the lattice Boltzmann method Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2002 10.1103/physreve.65.046308
- Theory of the lattice Boltzmann method: Dispersion, dissipation, isotropy, Galilean invariance, and stability Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2000 10.1103/physreve.61.6546
- An evaluation of lattice Boltzmann schemes for porous medium flow simulation Computers & Fluids · Elsevier BV · 2006 10.1016/j.compfluid.2005.03.008
- On the periodic fundamental solutions of the Stokes equations and their application to viscous flow past a cubic array of spheres Journal of Fluid Mechanics · Cambridge University Press · 1959 10.1017/s0022112059000222
- Shear rheology of amphiphilic cubic liquid crystals from large-scale kinetic lattice–Boltzmann simulations Soft Matter · Royal Society of Chemistry · 2009 10.1039/b911884e
- Multiple–relaxation–time lattice Boltzmann models in three dimensions Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2002 10.1098/rsta.2001.0955
- Detection and tracking of defects in the gyroid mesophase Computer Physics Communications · Elsevier BV · 2004 10.1016/j.cpc.2004.10.001
- A three–dimensional lattice–gas model for amphiphilic fluid dynamics Proceedings of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2000 10.1098/rspa.2000.0570
- Large–scale grid–enabled lattice Boltzmann simulations of complex fluid flow in porous media and under shear Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2004 10.1098/rsta.2004.1402
- Rheological response and dynamics of the amphiphilic diamond phase from kinetic lattice–Boltzmann simulations Proceedings of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2009 10.1098/rspa.2008.0479
- Lattice-Boltzmann Method for Complex Flows Annual Review of Fluid Mechanics · Annual Reviews · 2009 10.1146/annurev-fluid-121108-145519
- Kinetic theory representation of hydrodynamics: a way beyond the Navier–Stokes equation Journal of Fluid Mechanics · Cambridge University Press · 2006 10.1017/s0022112005008153
- Dynamics of fluctuations and spinodal decomposition in polymer blends The Journal of Chemical Physics · American Institute of Physics · 1980 10.1063/1.439809
- Laboratory validation of lattice Boltzmann method for modeling pore-scale flow in granular materials Computers and Geotechnics · Elsevier BV · 2006 10.1016/j.compgeo.2006.08.002
- Large-scale lattice Boltzmann simulations of complex fluids: advances through the advent of computational Grids Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2005 10.1098/rsta.2005.1618
- LUDWIG: A parallel Lattice-Boltzmann code for complex fluids Computer Physics Communications · Elsevier BV · 2001 10.1016/s0010-4655(00)00205-8
- Steering in computational science: Mesoscale modelling and simulation Contemporary Physics · Taylor & Francis · 2003 10.1080/00107510310001605046
- (제목 없음) Journal of Statistical Physics · Springer Science+Business Media · 2001 10.1023/a:1010414013942
- Lattice Gas Cellular Automata and Lattice Boltzmann Models Lecture notes in mathematics · Springer Nature · 2000 10.1007/b72010
- 5. Lattice Boltzmann Models Lecture notes in mathematics · Springer Nature · 2000 10.1007/978-3-540-46586-7_5
- Lattice-Boltzmann methods in fluid dynamics: Turbulence and complex colloidal fluids 2011
- On spinodal decomposition Acta Metallurgica · University of Toronto Press · 1961 10.1016/0001-6160(61)90182-1
- Proceedings of the UK e-Science All Hands Meeting 2003
- LUDWIG: A parallel Lattice-Boltzmann code for complex fluids 2000
- Multicomponent lattice-Boltzmann model with interparticle interaction Journal of Statistical Physics · Springer Science+Business Media · 1995 10.1007/bf02179985
- A three–dimensional lattice–gas model for amphiphilic fluid dynamics Proceedings of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2000 10.1098/rspa.2000.0570
- On pressure and velocity boundary conditions for the lattice Boltzmann BGK model Physics of Fluids · American Institute of Physics · 1997 10.1063/1.869307
- Parallel Lattice-Boltzmann Simulations for the Investigation of Cubic Phase Rheology at the Petascale TeraGrid Conference · 2008
- Generalized Lattice-Boltzmann Equations American Institute of Aeronautics and Astronautics eBooks · American Institute of Aeronautics and Astronautics · 1994 10.2514/5.9781600866319.0450.0458
- The Lattice Boltzmann Equation for Fluid Dynamics and Beyond Oxford University Press eBooks · Oxford University Press · 2001 10.1093/oso/9780198503989.001.0001