Table of Contents
Fetching ...

Foam-Agent: Towards Automated Intelligent CFD Workflows

Ling Yue, Nithin Somasekharan, Yadi Cao, Shaowu Pan

TL;DR

Foam-Agent tackles the automation bottleneck in CFD by deploying a four-agent framework that translates natural language into OpenFOAM workflows, enforces cross-file consistency, and autonomously diagnoses and fixes simulation errors. It introduces a hierarchical multi-index retrieval system, dependency-aware file generation, and an iterative error correction loop to manage interdependencies and failures. Evaluated on a 110-task CFD benchmark across 11 physics domains, Foam-Agent achieves an 83.6% executable success rate with Claude 3.5 Sonnet—substantially higher than MetaOpenFOAM and OpenFOAMGPT-Alt—and ablation studies show error correction as the most impactful component. The work demonstrates a path toward democratizing CFD by lowering the expertise barrier while maintaining accuracy, with public code available for broader adoption and extension.

Abstract

Computational Fluid Dynamics (CFD) is an essential simulation tool in various engineering disciplines, but it often requires substantial domain expertise and manual configuration, creating barriers to entry. We present Foam-Agent, a multi-agent framework that automates complex OpenFOAM-based CFD simulation workflows from natural language inputs. Our innovation includes (1) a hierarchical multi-index retrieval system with specialized indices for different simulation aspects, (2) a dependency-aware file generation system that provides consistency management across configuration files, and (3) an iterative error correction mechanism that diagnoses and resolves simulation failures without human intervention. Through comprehensive evaluation on the dataset of 110 simulation tasks, Foam-Agent achieves an 83.6% success rate with Claude 3.5 Sonnet, significantly outperforming existing frameworks (55.5% for MetaOpenFOAM and 37.3% for OpenFOAM-GPT). Ablation studies demonstrate the critical contribution of each system component, with the specialized error correction mechanism providing a 36.4% performance improvement. Foam-Agent substantially lowers the CFD expertise threshold while maintaining modeling accuracy, demonstrating the potential of specialized multi-agent systems to democratize access to complex scientific simulation tools. The code is public at https://github.com/csml-rpi/Foam-Agent

Foam-Agent: Towards Automated Intelligent CFD Workflows

TL;DR

Foam-Agent tackles the automation bottleneck in CFD by deploying a four-agent framework that translates natural language into OpenFOAM workflows, enforces cross-file consistency, and autonomously diagnoses and fixes simulation errors. It introduces a hierarchical multi-index retrieval system, dependency-aware file generation, and an iterative error correction loop to manage interdependencies and failures. Evaluated on a 110-task CFD benchmark across 11 physics domains, Foam-Agent achieves an 83.6% executable success rate with Claude 3.5 Sonnet—substantially higher than MetaOpenFOAM and OpenFOAMGPT-Alt—and ablation studies show error correction as the most impactful component. The work demonstrates a path toward democratizing CFD by lowering the expertise barrier while maintaining accuracy, with public code available for broader adoption and extension.

Abstract

Computational Fluid Dynamics (CFD) is an essential simulation tool in various engineering disciplines, but it often requires substantial domain expertise and manual configuration, creating barriers to entry. We present Foam-Agent, a multi-agent framework that automates complex OpenFOAM-based CFD simulation workflows from natural language inputs. Our innovation includes (1) a hierarchical multi-index retrieval system with specialized indices for different simulation aspects, (2) a dependency-aware file generation system that provides consistency management across configuration files, and (3) an iterative error correction mechanism that diagnoses and resolves simulation failures without human intervention. Through comprehensive evaluation on the dataset of 110 simulation tasks, Foam-Agent achieves an 83.6% success rate with Claude 3.5 Sonnet, significantly outperforming existing frameworks (55.5% for MetaOpenFOAM and 37.3% for OpenFOAM-GPT). Ablation studies demonstrate the critical contribution of each system component, with the specialized error correction mechanism providing a 36.4% performance improvement. Foam-Agent substantially lowers the CFD expertise threshold while maintaining modeling accuracy, demonstrating the potential of specialized multi-agent systems to democratize access to complex scientific simulation tools. The code is public at https://github.com/csml-rpi/Foam-Agent
Paper Structure (40 sections, 3 figures, 3 tables, 2 algorithms)

This paper contains 40 sections, 3 figures, 3 tables, 2 algorithms.

Figures (3)

  • Figure 1: Foam-Agent system architecture showing the four primary component Agents and their interactions within the iterative workflow loop. The Architect Agent interprets requirements and plans file structures, the Input Writer Agent generates configuration files, the Runner Agent executes simulations, and the Reviewer Agent diagnoses errors and proposes corrections.
  • Figure 2: CH$_4$ mass fraction distribution comparison in counterflow flame simulations at t=0.5s: Ground Truth (left), MetaOpenFOAM (center), and Foam-Agent (right), demonstrating Foam-Agent's superior reproduction of concentration gradients.
  • Figure 3: Comparison of free surface height distribution in shallow water equation simulations: Ground Truth (left), MetaOpenFOAM (center), and Foam-Agent (right), highlighting Foam-Agent's ability to accurately reproduce complex wave dynamics.