TorchLBM: A Fully-Differentiable Lattice-Boltzmann Solver
General classification
Programming
language
Code
architectures
Lattice-Boltzmann
simulations (LBM)
Researchers are successfully exploring the concept of differentiable simulators that solve the partial differential equations governing fluid mechanics within various scientific domains. These simulators are gaining prominence due to their applicability across various fields, including the design of data-driven numerical models, reinforcement learning, or optimization tasks. They can use the fact that numerical methods often require calculating the output of discretized operators that can be segmented into sequentially connected elementary units, similar to the layer- based architecture of many machine-learning models. The distinctive features of differentiable simulators are the ability to calculate gradients using automatic differentiation, hybridize machine learning and simulation workflows, and computational efficiency when implemented using machine-learning frameworks that offer powerful acceleration capabilities.
TorchLBM is a versatile simulation environment for the simulation of complex flow phenomena using the Lattice Boltzmann method. The Lattice-Boltzmann method is a versatile method for solving CFD problems that offers high parallel efficiency and enables interactive design analysis even today. Our implementation provides elementary building blocks for the single steps of the Lattice Boltzmann algorithm. It is based on the open-source machine- learning library PyTorch and also provides a seamless integration into NVIDIA Modulus, a library for the development of Physics-ML models. To make further use of NVIDIA’s ecosystem, we integrate TorchLBM into the Omniverse platform to foster an intuitive investigation of systems involving complex flow physics. The building blocks provided by TorchLBM are designed as modules that allow composing complex layer-based architectures, enabling flawless compatibility with Modulus’ and PyTorch’s programming paradigms and efficient usage of GPU accelerators. The solver allows simulating single-phase flows around complex geometries but also multi-phase flows such as the interaction of a droplet with a circular obstacle.
Modularity concept
Often, various numerical methods and implementations for the single algorithmic steps are available. Depending on the flow problem at hand, they have to be chosen accordingly to ensure stability, accuracy and performance of the simulation. Exchanging them flexibly is ensured by defining clean interfaces of the single modules. The table above gives an overview of some of the implemented methods and visualizes the flexibility of composing the algorithm.
Machine learning integration
Our ongoing research emphasizes hybrid machine-learning simulation workflows focusing on generating digital twins for intricate flow scenarios through the application of Fourier Neural Operators (FNOs). These advanced techniques enable us to effectively capture and comprehend the dynamic behaviors of parametric Partial Differential Equations (PDEs) for predictive modeling in fluid dynamics. A distinguishing feature of FNOs lies in their independence from simulation resolution, allowing for zero-shot super-resolution outcomes, a capability with profound implications for predictive accuracy and efficiency. By incorporating FNOs into our framework, we're able to understand the intricate dynamics of Lattice Boltzmann Method (LBM) simulations and make predictions across known and unknown time instances. As a result, these models become invaluable assets, replacing segments of simulations and drastically reducing the computationally time, e.g., for steady-state simulations, and improving the efficiency of computational fluid dynamics.
Applications
Complex geometry flows
Flow over a cylinder
Flow through porous media
Bubble sphere interaction
Flow over a sports car
Publications
- Winter, J. M., Wawrzyniak, D., Schmidt, S. J., Indinger T., Janßen C. F., Schramm U. & Adams, N. A. (2024): A Fully-Differentiable Lattice-Boltzmann Solver forIntegrated Machine-Learning Simulation Workflows, conference contribution at GTC 24, San José.