Attention:The NSF Public Access Repository (PAR) system and access will be unavailable from 11:00 PM ET on Thursday, October 15th until 12:00 AM ET on Friday, October 16th due to maintenance. We apologize for the inconvenience.


Title: A concise python implementation of the lattice Boltzmann method on HPC for geo-fluid flow
SUMMARY The lattice Boltzmann method (LBM) is a method to simulate fluid dynamics based on modelling distributions of particles moving and colliding on a lattice. The Python scripting language provides a clean programming paradigm to develop codes based on the LBM, however in order to reach performance comparable to compiled languages, it needs to be carefully implemented, maximizing its vectorized tools, mostly integrated in the NumPy module. We present here the details of a Python implementation of a concise LBM code, with the purpose of offering a pedagogical tool for students and professionals in the geosciences who are approaching this technique for the first time. The first half of the paper focuses on how to vectorize a 2-D LBM code and show how if carefully done, this allows performance close to a compiled code. In the second part of the paper, we use the vectorization described earlier to naturally write a parallel implementation using MPI and test both weak and hard scaling up to 1280 cores. One benchmark, Poiseuille flow and two applications, one on sound wave propagation and another on fluid-flow through a simplified model of a rock matrix are finally shown.  more » « less
Award ID(s):
1918126
PAR ID:
10253868
Author(s) / Creator(s):
; ;
Date Published:
Journal Name:
Geophysical Journal International
Volume:
220
Issue:
1
ISSN:
0956-540X
Page Range / eLocation ID:
682 to 702
Format(s):
Medium: X
Sponsoring Org:
National Science Foundation
More Like this
  1. The properties of multicomponent fluids are governed by the interplay of phase behavior, fluid dynamics, and interfacial thermodynamics. A mixture formulation that leverages this interplay is an important aspect in many fabrication processes based on emulsion templating. The lattice Boltzmann method (LBM) has become a popular approach for simulating hydrodynamic effects in complex fluids and soft matter. Here we present an implementation of a ternary lattice Boltzmann model that allows to simulate a mixture of three immiscible fluids. We build on the LATBOLTZ extension of the open-source package LAMMPS and implement a ternary free energy model recently introduced by Semprebon et al. [Phys. Rev. E 93, 033305 (2016)]. We validate the static and dynamic properties by simulating liquid lenses, double emulsions, and ternary mixtures. From the simulations, we obtain the complete morphology diagram of the ternary mixture in composition space. We further discuss an application of the method to phase segregation of ternary films. The implementation of the ternary LBM in LAMMPS opens vast opportunities for mesoscale simulations of interfacial phenomena and non-equilibrium transport processes in multicomponent fluid mixtures. 
    more » « less
  2. Scour of rock in unlined rock spillway channels is a critical issue facing many of the world’s dams. From a modeling point of view this poses a challenging and interesting problem that combines rock mechanics and hydraulics of turbulent flow. We analyze this interaction between the blocky rock mass and water by directly modeling the solid and fluid phases—the individual polyhedral blocks are modeled using the Discrete Element Method (DEM) while the water is modeled using the Lattice Boltzmann Method (LBM). The LBM mesh is entirely independent of the DEM discretization, making it possible to refine the LBM mesh such that transient and varied fluid pressures acting of the rock surface are directly modeled. This provides the capability to investigate the effect of water pressure inside the fractured rock mass, along potential sliding planes, and can be extended to rock falls and slides into standing bodies of water such as lakes and reservoirs. Herein we present preliminary results to demonstrate the capabilities of the methodology. 
    more » « less
  3. We present a quantum formulation of the lattice Boltzmann method (QLBM) for simulating fluid flow and coupled thermal transport at low Reynolds and moderate Rayleigh numbers. To enable a linear operator representation, the equilibrium distribution function is linearized by neglecting higher-order nonlinear terms, allowing the collision and streaming steps of the classical lattice Boltzmann method (LBM) to be expressed as linear operators and subsequently transformed into unitary blocks. The method begins by vectorizing the particle distribution functions (PDFs) and embedding them into an amplitude-encoded quantum state augmented with an ancilla qubit. This duplication enables the use of a block-encoding strategy that accommodates the non-unitary nature of the classical LBM update. By neglecting the quadratic nonlinearity in the equilibrium distribution, the LBM update is cast as a linear matrix-vector operation, allowing the collision and streaming operators to be factorized through singular value decomposition (SVD). The resulting unitary blocks are implemented on IBM’s Qiskit state-vector simulator. The framework is demonstrated on four benchmark problems–plane Poiseuille flow, lid-driven cavity flow, steady heat diffusion in a closed domain, and buoyancy-driven natural convection–chosen to represent canonical hydrodynamic and multiphysics processes, spanning domain sizes from 10 × 10 to 21 × 21 and requiring 11 − 13 qubits depending on the case. Across all problems, the QLBM predictions agree closely with analytical and classical LBM results, demonstrating that the proposed quantum framework can accurately reproduce hydrodynamic and thermal fields within a fully unitary update structure. The study highlights both the promise of QLBM as a scalable quantum approach and the current limitations associated with circuit depth and state-preparation overhead, offering a foundation for future algorithmic optimizations that will guide implementations on quantum hardware devices. 
    more » « less
  4. Heat transfer involving phase change is computationally intensive due to moving phase boundaries, nonlinear computations, and time step restrictions. This paper presents a quantum lattice Boltzmann method (QLBM) for simulating heat transfer with phase change. The approach leverages the statistical nature of the lattice Boltzmann method (LBM) while addressing the challenges of discontinuous phase transitions in quantum computing. The method implements an interface-tracking strategy that partitions the problem into separate solid and liquid domains, enabling the algorithm to handle the discontinuity in the enthalpy–temperature relationship. We store phase change information in the quantum circuit to reduce information exchange between classical and quantum hardware, a bottleneck in many quantum applications. Results from the implementation agree with both classical LBM and analytical solutions, demonstrating QLBM as an effective approach for analyzing thermal systems with phase transitions. Simulations using 17 lattice nodes with 53 qubits demonstrate temperature root-mean-square errors of order 0.01 when compared against classical solutions. The method accurately tracks interface movement during phase transition. 
    more » « less
  5. Abstract The discrete Boltzmann equation (DBE), grounded in kinetic theory, has become increasingly attractive for solving transport phenomena. Typically, applications of the DBE employ the lattice Boltzmann method (LBM), which uses a coupled and uniform time–space discretization. However, the fixed lattice structure required by LBM limits flexibility, particularly in handling complex geometries such as porous media. Meshless methods, specifically radial basis function finite difference (RBF-FD), offer promising alternatives by eliminating the need for structured grids. Nevertheless, solving DBE using unstructured discretization introduces challenges, especially in translating macroscale boundary conditions (such as density and velocity) into the particle density function (PDF). This study addresses these challenges by employing an RBF-FD meshless method to solve the DBE for fluid flow simulations. Initially, the Taylor Green vortex flow is analyzed to validate the RBF-FD meshless approach in boundary-free scenarios, highlighting the artificial viscosity effects introduced by the method itself. Subsequently, a novel scheme for resolving unknown PDF components at Dirichlet boundaries is introduced, which separates the PDF into equilibrium and nonequilibrium parts and employs nearest-neighbor interpolation. The effectiveness of this boundary scheme is demonstrated through tests on both flat and curved surfaces, showing strong agreement with existing literature. The proposed method thus provides a viable solution for accurately applying Dirichlet boundary conditions within meshless DBE simulations, significantly enhancing the applicability of DBE to complex flow problems. 
    more » « less