面向多松弛时间格子玻尔兹曼方法的高级自动代码生成
Advanced Automatic Code Generation for Multiple Relaxation-Time Lattice Boltzmann Methods
AI总结:
本文介绍 lbmpy 的自动代码生成框架,利用新 LBM 演算、Chimera 变换和代数简化高效实现多松弛时间、中心矩及累积量方法,并通过涡衰减和浅水方程验证。
摘要:
科学代码生成软件包 lbmpy 通过元编程支持格子玻尔兹曼方法(LBM)的自动化设计与高效实现。它基于一种全新、简洁的演算来描述多松弛时间 LBM,其中包含能够从分布函数中减去恒定背景分量、从而在数值上更具优势的技术。这些技术被推广到多种碰撞空间和平衡分布。本文概述了 lbmpy 的前端及其代码生成流水线,该流水线借助符号公式处理工具和面向对象编程实现了这种新的 LBM 演算。所生成代码仅包含最少数量的算术运算。其自动推导依赖于两种新颖的 Chimera 变换,它们是专门为高效计算原始矩和中心矩而开发的。方法符号表示中包含的信息还被用于一系列定制的代数简化,从而进一步降低计算成本。这些代数变换结合起来可产生简洁、紧凑的数值核。具体而言,通过这些优化,先进的基于中心矩和累积量的方法能够以仅比简单 BGK 方法略高的额外成本实现。新的 lbmpy 代码生成系统的有效性和灵活性通过模拟 Taylor-Green 涡衰减以及自动推导用于求解浅水方程的 LBM 算法得到了证明。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。