论文标题
高级自动代码生成多个放松时间晶格玻尔兹曼方法
Advanced Automatic Code Generation for Multiple Relaxation-Time Lattice Boltzmann Methods
论文作者
论文摘要
科学代码生成软件包LBMPY支持通过元编程的自动化设计和有效实现晶格Boltzmann方法(LBMS)。它基于一个新的,简洁的演算,用于描述多个松弛时间LBM,包括能够从人群中恒定背景成分的数字有利减法的技术。这些技术概括为广泛的碰撞空间和平衡分布。本文包含LBMPY的前端及其代码生成管道的概述,该管道通过符号公式操纵工具和面向对象的编程来实现新的LBM微积分。生成的代码仅具有最少数量的算术操作。它们的自动推导基于两种新型的嵌合体变换,这些变换是专门为有效计算原始和中心时刻的特殊开发的。该方法的符号表示中包含的信息将以定制的代数简化序列进一步利用,从而进一步降低了计算成本。合并后,这些代数转换会导致简洁而紧凑的数值内核。具体而言,通过这些优化,与简单的BGK方法相比,只有几乎没有额外的成本可以实现高级中央力矩和基于累积的方法。在模拟Taylor-Green涡流衰减和LBM算法的自动推导以求解浅水方程时,证明了新的LBMPY代码生成系统的有效性和灵活性。
The scientific code generation package lbmpy supports the automated design and the efficient implementation of lattice Boltzmann methods (LBMs) through metaprogramming. It is based on a new, concise calculus for describing multiple relaxation-time LBMs, including techniques that enable the numerically advantageous subtraction of the constant background component from the populations. These techniques are generalized to a wide range of collision spaces and equilibrium distributions. The article contains an overview of lbmpy's front-end and its code generation pipeline, which implements the new LBM calculus by means of symbolic formula manipulation tools and object-oriented programming. The generated codes have only a minimal number of arithmetic operations. Their automatic derivation rests on two novel Chimera transforms that have been specifically developed for efficiently computing raw and central moments. Information contained in the symbolic representation of the methods is further exploited in a customized sequence of algebraic simplifications, further reducing computational cost. When combined, these algebraic transformations lead to concise and compact numerical kernels. Specifically, with these optimizations, the advanced central moment- and cumulant-based methods can be realized with only little additional cost as when compared with the simple BGK method. The effectiveness and flexibility of the new lbmpy code generation system is demonstrated in simulating Taylor-Green vortex decay and the automatic derivation of an LBM algorithm to solve the shallow water equations.