- 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: 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: 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: 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: 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: 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: 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.