Table of Contents
Fetching ...

libMobility: A Python library for hydrodynamics at the Smoluchowski level

Ryker Fish, Adam Carter, Pablo Diez-Silva, Rafael Delgado-Buscalioni, Raul P. Pelaez, Brennan Sprinkle

TL;DR

libMobility tackles the challenge of accurate, large-scale hydrodynamic simulations at the Smoluchowski level by providing a GPU-accelerated, Python-facing library with a unified interface for multiple solver geometries. It unifies diverse solvers (SelfMobility, PSE, NBody with RPY kernels, and DPStokes) under a common API, enabling deterministic mobility, thermal fluctuations, and thermal drift to be computed efficiently on NVIDIA GPUs using CUDA. The framework is rigorously validated against analytical benchmarks and fluctuation-dissipation tests, and demonstrated through active/passive colloid studies, rheology of suspensions, and multi-physics electro-osmotic flows. The combination of modular solvers, rigorous validation, and real-world demonstrations suggests a significant practical impact for computational soft matter, biophysics, and materials science by enabling accurate, scalable fluid-particle simulations in complex geometries. All components are designed to be extensible, with a focus on reproducibility and accessibility via conda packages and open-source licensing.

Abstract

Effective hydrodynamic modeling is crucial for accurately predicting fluid-particle interactions in diverse fields such as biophysics and materials science. Developing and implementing hydrodynamic algorithms is challenging due to the complexity of fluid dynamics, necessitating efficient management of large-scale computations and sophisticated boundary conditions. Furthermore, adapting these algorithms for use on massively parallel architectures like GPUs adds an additional layer of complexity. This paper presents the libMobility software library, which offers a suite of CUDA-enabled solvers for simulating hydrodynamic interactions in particulate systems at the Rotne-Prager-Yamakawa (RPY) level. The library facilitates precise simulations of particle displacements influenced by external forces and torques, including both the deterministic and stochastic components. Notable features of libMobility include its ability to handle linear and angular displacements, thermal fluctuations, and various domain geometries effectively. With an interface in Python, libMobility provides comprehensive tools for researchers in computational fluid dynamics and related fields to simulate particle mobility efficiently. This article details the technical architecture, functionality, and wide-ranging applications of libMobility. libMobility is available at https://github.com/stochasticHydroTools/libMobility.

libMobility: A Python library for hydrodynamics at the Smoluchowski level

TL;DR

libMobility tackles the challenge of accurate, large-scale hydrodynamic simulations at the Smoluchowski level by providing a GPU-accelerated, Python-facing library with a unified interface for multiple solver geometries. It unifies diverse solvers (SelfMobility, PSE, NBody with RPY kernels, and DPStokes) under a common API, enabling deterministic mobility, thermal fluctuations, and thermal drift to be computed efficiently on NVIDIA GPUs using CUDA. The framework is rigorously validated against analytical benchmarks and fluctuation-dissipation tests, and demonstrated through active/passive colloid studies, rheology of suspensions, and multi-physics electro-osmotic flows. The combination of modular solvers, rigorous validation, and real-world demonstrations suggests a significant practical impact for computational soft matter, biophysics, and materials science by enabling accurate, scalable fluid-particle simulations in complex geometries. All components are designed to be extensible, with a focus on reproducibility and accessibility via conda packages and open-source licensing.

Abstract

Effective hydrodynamic modeling is crucial for accurately predicting fluid-particle interactions in diverse fields such as biophysics and materials science. Developing and implementing hydrodynamic algorithms is challenging due to the complexity of fluid dynamics, necessitating efficient management of large-scale computations and sophisticated boundary conditions. Furthermore, adapting these algorithms for use on massively parallel architectures like GPUs adds an additional layer of complexity. This paper presents the libMobility software library, which offers a suite of CUDA-enabled solvers for simulating hydrodynamic interactions in particulate systems at the Rotne-Prager-Yamakawa (RPY) level. The library facilitates precise simulations of particle displacements influenced by external forces and torques, including both the deterministic and stochastic components. Notable features of libMobility include its ability to handle linear and angular displacements, thermal fluctuations, and various domain geometries effectively. With an interface in Python, libMobility provides comprehensive tools for researchers in computational fluid dynamics and related fields to simulate particle mobility efficiently. This article details the technical architecture, functionality, and wide-ranging applications of libMobility. libMobility is available at https://github.com/stochasticHydroTools/libMobility.

Paper Structure

This paper contains 26 sections, 32 equations, 7 figures, 2 tables.

Figures (7)

  • Figure 1: Comparison of gravitational heights $h_g=1.5a$ (left) and $h_g=6.1a$ (right) for deterministic (blue) and stochastic (pink) simulations. Top panels: top-down snapshots of simulations at multiples of the characteristic time $t^\star$. Deterministic and stochastic simulations are independent and offset for visual clarity. Bottom panels: probability distribution of particle heights at $t=t^\star$ (left) and distribution of particle positions at $t=t^\star$ (right). The distributions at $t=0 s$ are shown in black. Reference data from Usabiaga et al. MagneticRollers is shown in darker colors and with dashed lines.
  • Figure 2: (a) structure factor $S(k)$ for the simulation of a monolayer above a wall. The theoretical curve is from Thorneywork et al.thorneywork_structure_2018. (b) example decays of $f(k, t)$, from the same simulation, along with fitted curves. (c) $D(k)$ for the monolayer suspended in free space (red), and above a wall (blue), showing clearly, the lack of divergence, compared to in free space. The black theory curve is \ref{['eq:Dk']}.
  • Figure 3: a) Relative viscosity $\eta_r$ of the sheared suspension for increasing packing fraction $\phi$ and different multiblob resolutions $m$. Reference data (dashed lines) is from Wang et al. WangFioreSwan_ShearingRheology_2019 for m=12, 42, and 162. The semi-analytical reference curve (solid black line) is from Equations (3.23) and (3.25) from Ladd Ladd_1990. The inset spheres show the discretized multiblob spheres where the color corresponds to the resolution of the sphere (see legend). b) 3D rendering of one sample of the periodic suspension of spheres. The multiblobs are colored by the log of blob-wise stress. The axis in the lower left indicates the direction of shear. c) is the inset of figure b) showing the near-contact of two multiblob spheres. Blobs that appear missing are periodically wrapped to the opposite edge of the cube.
  • Figure 4: Schematic representation of the system. Yellow rectangles at the base are the electrodes, connected to an AC signal with a phase shift indicated below. Dotted arrows indicate that the system continues, repeating the 4-electrode array another 20 times. Blue circles are the tracer blobs where we evaluate the fluid velocity. Dark-blue blobs correspond to the vertical wall where we impose $\bm{v}^B = 0$ and yellow blobs are where we impose the electro-osmotic slip velocity $\bm{v}^B = \left<\bm{v}_{\text{slip}}\right>$, defined in \ref{['eq:vslip']}. The system is periodic in the y-direction (modeling infinitely long electrodes) and confined in the z-direction with two non-slip walls. The system is a recreation of Figure 1b from Garcia et al.garcia-sanchez_experiments_2006.
  • Figure 5: Streamlines of TWEO far from the vertical wall. We observe oscillations due to the structure of the electrodes near this area, while the flow becomes laminar farther away. The velocity changes direction at a certain height, due to backflow induced by the domain being closed. The flow patterns observed here resemble those reported in the experimental results of Figure 4 from García-Sánchez et al. garcia-sanchez_experiments_2006. The right figure is the flow next to the wall where the back flow is formed.
  • ...and 2 more figures