Papers
Topics
Authors
Recent
Search
2000 character limit reached

Foam-Agent 2.0: An End-to-End Composable Multi-Agent Framework for Automating CFD Simulation in OpenFOAM

Published 17 Sep 2025 in cs.AI, cs.CE, and cs.LG | (2509.18178v2)

Abstract: Computational Fluid Dynamics (CFD) is an essential simulation tool in engineering, yet its steep learning curve and complex manual setup create significant barriers. To address these challenges, we introduce Foam-Agent, a multi-agent framework that automates the entire end-to-end OpenFOAM workflow from a single natural language prompt. Our key innovations address critical gaps in existing systems: 1. An Comprehensive End-to-End Simulation Automation: Foam-Agent is the first system to manage the full simulation pipeline, including advanced pre-processing with a versatile Meshing Agent capable of handling external mesh files and generating new geometries via Gmsh, automatic generation of HPC submission scripts, and post-simulation visualization via ParaView. 2. Composable Service Architecture: Going beyond a monolithic agent, the framework uses Model Context Protocol (MCP) to expose its core functions as discrete, callable tools. This allows for flexible integration and use by other agentic systems, such as Claude-code, for more exploratory workflows. 3. High-Fidelity Configuration Generation: We achieve superior accuracy through a Hierarchical Multi-Index RAG for precise context retrieval and a dependency-aware generation process that ensures configuration consistency. Evaluated on a benchmark of 110 simulation tasks, Foam-Agent achieves an 88.2% success rate with Claude 3.5 Sonnet, significantly outperforming existing frameworks (55.5% for MetaOpenFOAM). Foam-Agent dramatically lowers the expertise barrier for CFD, demonstrating how specialized multi-agent systems can democratize complex scientific computing. The code is public at https://github.com/csml-rpi/Foam-Agent.

Summary

  • The paper introduces Foam-Agent 2.0, a multi-agent framework that automates the entire CFD simulation process in OpenFOAM using six specialized agents.
  • It achieves high-fidelity configuration and error recovery as evidenced by an 88.2% success rate across 110 benchmark tasks, outperforming previous frameworks.
  • Foam-Agent 2.0 enables advanced mesh generation and HPC scalability, validated through complex simulations including CounterFlowFlame and 3D lid-driven cavity cases.

Foam-Agent 2.0: Automating CFD with a Multi-Agent Framework

Introduction to Foam-Agent 2.0

Foam-Agent 2.0 is a sophisticated framework designed to streamline Computational Fluid Dynamics (CFD) simulations using OpenFOAM through a multi-agent setup. The framework automates the entire CFD workflow from natural language input to final visualization, significantly reducing the expertise required to execute complex simulations. The system features six key agents—Architect, Meshing, Input Writer, Runner, Reviewer, and Visualization agents—that collaboratively manage different aspects of the simulation pipeline (Figure 1). Figure 1

Figure 1: Foam-Agent system architecture illustrating the complete end-to-end workflow from natural language input to post-processing visualization.

Central to its design, Foam-Agent achieves automation in three innovative ways: comprehensive end-to-end simulation management, high-fidelity configuration generation, and a modular service architecture enabled by the Model Context Protocol (Figure 2). Figure 2

Figure 2: Modularized Foam-Agent architecture using model context protocol (MCP).

Results and Comparative Analysis

The framework was tested on a designed benchmark comprising 110 distinct simulation tasks across various physics scenarios. Foam-Agent demonstrated an impressive success rate of 88.2%, outperforming existing frameworks such as MetaOpenFOAM and OpenFOAMGPT-Alt, which only achieved success rates of 55.5% and 37.3% respectively using similar models (Table 1).

This superior performance was attributed to the framework's integrated reviewer node, which markedly improves error diagnosis and correction, and its hierarchical retrieval system, enhancing the precision of file generation. Additionally, Foam-Agent has demonstrated proficiency in scenarios involving advanced mesh generation and HPC deployment, further solidifying its capabilities.

Case Studies and Application Scenarios

Foam-Agent's capabilities were tested on several complex simulation scenarios, including handling external mesh files and employing HPC resources for large-scale simulations.

For instance, in the CounterFlowFlame case, Foam-Agent's simulation closely matched human-generated ground truth, as opposed to the less accurate MetaOpenFOAM results (Figure 3). This showcases Foam-Agent's high fidelity in reproducing expert-level simulations across diverse case studies. Figure 3

Figure 3: Comparison of simulation results produced by MetaOpenFOAM and Foam-Agent for CounterFlowFlame, wedge, and forwardStep cases against human expert-generated ground truth.

Moreover, Foam-Agent's ability to process externally provided mesh files was validated through simulations of complex airfoil and tandem wing configurations (Figure 4). This flexibility allows users to incorporate pre-defined geometric structures into simulations seamlessly. Figure 4

Figure 4: External mesh file processing ability through 2D multi-element airfoil and tandem wing case simulations.

Similarly, Foam-Agent efficiently used the Gmsh library for mesh generation in challenging flow scenarios, outperforming native OpenFOAM utilities and ensuring accurate domain representation (Figure 5). Figure 5

Figure 5: Flow over a cylinder and two square obstacles simulated using the Gmsh library.

Lastly, the HPC Runner agent demonstrated the framework's scalability by executing simulations on HPC platforms, exemplified by a 3D lid-driven cavity simulation requiring substantial computational resources (Figure 6). Figure 6

Figure 6: Highly refined simulation of a 3D lid driven cavity flow utilizing HPC resources.

Future Directions

Foam-Agent establishes a robust template for extending multi-agent frameworks into complex scientific domains, enhancing adaptability, error recovery, and integration. Future developments may focus on broadening the framework's applicability by incorporating additional solvers and extending its modular architecture to other scientific computing challenges.

Conclusion

Foam-Agent 2.0 represents a significant advancement in automating complex CFD simulations within OpenFOAM. By integrating specialized tool-usage capabilities and flexible service architecture, it democratizes access to high-fidelity simulations, transforming them into manageable tasks for users across various expertise levels. This framework not only facilitates efficient simulation workflows but also paves the way for future innovations in AI-driven scientific automation.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We found no open problems mentioned in this paper.

Collections

Sign up for free to add this paper to one or more collections.

GitHub