用大模型自动完成流体模拟全流程,只需一句自然语言指令。
Foam-Agent: A Large Language Model-Based Multi-Agent Framework for Automating Computational Fluid Dynamics Workflows

- 多智能体协同,按流程阶段精准检索领域知识
- 基于依赖图拓扑遍历生成文件,保证配置一致性
- 自迭代修复失败任务,最小修改解决核心错误
计算流体动力学(CFD)是计算物理的核心工具,但学习门槛高、流程碎片化。本文提出 Foam-Agent,一个基于大语言模型的多智能体框架,仅通过自然语言指令即可在 OpenFOAM 中自动化完成端到端的 CFD 工作流。其方法包含三项创新:首先,采用多索引检索机制,沿四个互补结构维度组织领域知识,并按流程阶段选择索引,提升检索精度;其次,将文件生成建模为 OpenFOAM 用例依赖图的拓扑遍历,确保每份配置文件在已有前驱基础上生成,维持跨文件一致性;第三,引入轨迹条件化的审查循环,每次修正均基于历史错误与诊断轨迹,仅对最小配置项进行修改以解决子集求解器错误。六类专用智能体覆盖规划、网格划分、文件编写、执行、审查与可视化,且通过模型上下文协议对外提供接口。在 FoamBench 测试中,对 110 个基础任务达成 88.2% 的执行成功率,对分布外的高级任务达 62.5%,全程无需专家干预。结果表明,合理设计的多智能体系统可显著降低专业门槛,同时保持求解器模拟的严谨性。
原文摘要 · Abstract (English)
Computational fluid dynamics (CFD) has been the main workhorse of computational physics, yet its steep learning curve and fragmented, multi-stage workflow create significant barriers to entry. We present Foam-Agent, a multi-agent framework that leverages large language models (LLMs) to automate the end-to-end CFD workflow in OpenFOAM from a single natural-language prompt. Foam-Agent rests on three methodological contributions. First, a multi-index retrieval scheme organizes domain knowledge along four complementary structural dimensions and selects indices by workflow stage, sharpening retrieval precision over conventional single-index retrieval-augmented generation. Second, dependency-aware file generation is formulated as a topological traversal of the OpenFOAM case dependency graph, so that each configuration file is synthesized in the context of its already-generated predecessors, enforcing cross-file consistency. Third, a trajectory-conditioned reviewer loop iteratively repairs failed runs by conditioning each correction on the accumulated error-and-diagnosis trajectory of its own previous attempts, applying a minimal configuration edit that targets a reduced solver-error set. Around these contributions, six specialist agents span planning, meshing, file writing, execution, review, and visualization; Foam-Agent additionally exposes its capabilities through the Model Context Protocol as a deployment surface for external orchestrators. On FoamBench, Foam-Agent achieves an 88.2% execution success rate on the 110 Basic-tier tasks and 62.5% on the out-of-distribution Advanced tier, all without expert intervention. These results show how strategic harnessing of specialized multi-agent systems can reduce expertise barriers while preserving the rigor of solver-based simulation workflows.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。