The lattice Boltzmann method (LBM) is an efficient simulation technique for computational fluid mechanics and beyond. It is based on a simple stream-and-collide algorithm on Cartesian grids, which is easily compatible with modern machine learning architectures. While it is becoming increasingly clear that deep learning can provide a decisive stimulus for classical simulation techniques, recent studies have not addressed possible connections between machine learning and LBM. Here, we introduce Lettuce, a PyTorch-based LBM code with a threefold aim. Lettuce enables GPU accelerated calculations with minimal source code, facilitates rapid prototyping of LBM models, and enables integrating LBM simulations with PyTorch's deep learning and automatic differentiation facility. As a proof of concept for combining machine learning with the LBM, a neural collision model is developed, trained on a doubly periodic shear layer and then transferred to a different flow, a decaying turbulence. We also exemplify the added benefit of PyTorch's automatic differentiation framework in flow control and optimization. To this end, the spectrum of a forced isotropic turbulence is maintained without further constraining the velocity field. The source code is freely available from https://github.com/lettucecfd/lettuce.
翻译:Lattice Boltzmann 方法(LBM)是计算液力力力学及其他方面的一种高效模拟技术,其基础是在Cartesian电网上简单的流和相联算法,它很容易与现代机器学习结构兼容。虽然深层次的学习可以决定性地刺激古典模拟技术,但最近的研究没有涉及机器学习和LBM之间可能的联系。在这里,我们引入了以PyTorch为基础的LBM代码,即以三重目标为目的的Lettuce。用最小源码来推动GPU加速计算,促进快速的LBM模型的原型,并能够将LBM模拟与PyTorrch的深层学习和自动区分设施结合起来。作为将机器学习与LBMM相结合的概念的证明,正在开发一个神经碰撞模型,在双层的剪切层上进行培训,然后转移到不同的流中,一个腐蚀的气流。我们还将PyTorch的自动分解框架的附加好处加以解释。为了这个目的,对于LBMBM模型的频谱/Axproclexcexcexcex destrestrevexex dislate,没有进一步的源码。