MetaOpenFOAM: an LLM-based multi-agent framework for CFD

📄 arXiv: 2407.21320v2 📥 PDF

作者: Yuxuan Chen, Xu Zhu, Hua Zhou, Zhuyin Ren

分类: cs.AI, physics.flu-dyn

发布日期: 2024-07-31 (更新: 2024-08-07)

备注: 31 pages,11 figures, 11 tables


💡 一句话要点

MetaOpenFOAM:基于LLM的多智能体CFD框架,实现自然语言驱动的自动化仿真。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 计算流体动力学 多智能体系统 大型语言模型 自动化仿真 检索增强生成

📋 核心要点

  1. 现有CFD仿真自动化方法在处理复杂问题时面临挑战,需要专业知识和手动干预,效率较低。
  2. MetaOpenFOAM利用多智能体协作,将复杂CFD任务分解为子任务,并结合RAG技术增强LLM对CFD知识的理解。
  3. 实验表明,MetaOpenFOAM在自然语言驱动的CFD仿真任务中取得了85%的通过率,且成本较低,证明了其有效性。

📝 摘要(中文)

MetaOpenFOAM是一个新颖的多智能体协作框架,旨在仅使用自然语言输入完成计算流体动力学(CFD)仿真任务。该框架利用MetaGPT的装配线范式,将不同的角色分配给不同的智能体,从而有效地将复杂的CFD任务分解为可管理的子任务。Langchain通过集成检索增强生成(RAG)技术进一步补充了MetaOpenFOAM,通过整合OpenFOAM教程的可搜索数据库来增强LLM的能力。在一个基于自然语言的CFD求解器的基准测试中,包含八个CFD仿真任务,MetaOpenFOAM实现了每个测试案例85%的高通过率,平均每个测试案例的成本仅为0.22美元。这八个CFD仿真任务涵盖了一系列多维流动问题,包括具有不同物理过程的可压缩和不可压缩流动。这证明了仅使用自然语言输入即可自动执行CFD仿真的能力,并通过迭代纠正错误来实现所需的仿真。消融研究验证了多智能体系统和RAG技术中每个组件的必要性。对LLM随机性的敏感性研究表明,低随机性的LLM可以获得更稳定和准确的结果。此外,MetaOpenFOAM还具有识别和修改用户需求中的关键参数的能力,并且擅长在发生故障匹配时纠正错误,这证明了MetaOpenFOAM的泛化能力。

🔬 方法详解

问题定义:论文旨在解决CFD仿真自动化程度低的问题。现有方法通常需要人工干预进行网格划分、参数设置和求解器选择等步骤,耗时且需要专业知识。此外,现有系统难以理解自然语言描述的CFD问题,限制了其易用性。

核心思路:论文的核心思路是利用大型语言模型(LLM)驱动的多智能体系统,将复杂的CFD仿真任务分解为多个子任务,并分配给不同的智能体协同完成。通过检索增强生成(RAG)技术,LLM可以访问OpenFOAM教程数据库,从而更好地理解CFD问题并生成相应的仿真代码。

技术框架:MetaOpenFOAM框架包含以下主要模块:1) 任务分解模块:将自然语言描述的CFD问题分解为多个子任务。2) 智能体协作模块:不同的智能体负责不同的子任务,例如网格划分、参数设置、求解器选择和结果分析。3) RAG模块:LLM通过RAG技术访问OpenFOAM教程数据库,获取CFD知识。4) 代码生成模块:智能体根据CFD知识生成相应的仿真代码。5) 仿真执行模块:执行生成的仿真代码并分析结果。6) 错误纠正模块:当仿真失败时,智能体可以识别并纠正错误。

关键创新:MetaOpenFOAM的关键创新在于:1) 提出了基于LLM的多智能体协作框架,实现了CFD仿真的自动化。2) 结合RAG技术,增强了LLM对CFD知识的理解。3) 实现了自然语言驱动的CFD仿真,降低了使用门槛。

关键设计:MetaOpenFOAM使用MetaGPT的装配线范式,将不同的角色分配给不同的智能体。RAG技术使用Langchain进行集成,并构建了OpenFOAM教程的可搜索数据库。LLM的选择和配置(例如随机性参数)对仿真结果的稳定性和准确性有重要影响。具体参数设置和损失函数等技术细节在论文中未详细描述,属于未知信息。

📊 实验亮点

MetaOpenFOAM在包含八个CFD仿真任务的基准测试中取得了85%的通过率,平均每个测试案例的成本仅为0.22美元。消融研究表明,多智能体系统和RAG技术对框架的性能至关重要。敏感性研究表明,低随机性的LLM可以获得更稳定和准确的结果。这些结果表明MetaOpenFOAM在自然语言驱动的CFD仿真方面具有显著优势。

🎯 应用场景

MetaOpenFOAM可应用于航空航天、汽车工程、能源等领域,加速产品设计和优化过程。通过降低CFD仿真的使用门槛,该框架可以帮助工程师快速验证设计方案,缩短研发周期,并降低研发成本。未来,该框架有望扩展到其他工程仿真领域,实现更广泛的自动化。

📄 摘要(原文)

Remarkable progress has been made in automated problem solving through societies of agents based on large language models (LLMs). Computational fluid dynamics (CFD), as a complex problem, presents unique challenges in automated simulations that require sophisticated solutions. MetaOpenFOAM, as a novel multi-agent collaborations framework, aims to complete CFD simulation tasks with only natural language as input. These simulation tasks include mesh pre-processing, simulation and so on. MetaOpenFOAM harnesses the power of MetaGPT's assembly line paradigm, which assigns diverse roles to various agents, efficiently breaking down complex CFD tasks into manageable subtasks. Langchain further complements MetaOpenFOAM by integrating Retrieval-Augmented Generation (RAG) technology, which enhances the framework's ability by integrating a searchable database of OpenFOAM tutorials for LLMs. Tests on a benchmark for natural language-based CFD solver, consisting of eight CFD simulation tasks, have shown that MetaOpenFOAM achieved a high pass rate per test (85%), with each test case costing only $0.22 on average. The eight CFD simulation tasks encompass a range of multidimensional flow problems, covering compressible and incompressible flows with different physical processes. This demonstrates the capability to automate CFD simulations using only natural language input, iteratively correcting errors to achieve the desired simulations. An ablation study was conducted to verify the necessity of each component in the multi-agent system and the RAG technology. A sensitivity study on the randomness of LLM showed that LLM with low randomness can obtain more stable and accurate results. Additionally, MetaOpenFOAM owns the ability to identify and modify key parameters in user requirements, and excels in correcting bugs when failure match occur,which demonstrates the generalization of MetaOpenFOAM.