csml-rpi/Foam-Agent

Foam-Agent: An end-to-end, composable multi-agent framework for automating CFD simulations in OpenFOAM. NeurIPS 2025 Machine Learning and the Physical Sciences Workshop.

What it solves

Foam-Agent automates the complex workflow of Computational Fluid Dynamics (CFD) simulations using OpenFOAM. It removes the need for deep manual expertise in meshing, case setup, and error correction by allowing users to initiate an entire simulation process from a single natural language prompt.

How it works

The system uses a multi-agent framework built on LangGraph, consisting of an Architect, Input Writer, Runner, and Reviewer. These agents collaborate in a pipeline that can automatically detect and fix simulation errors through up to 25 iterations. To ensure accuracy, it employs RAG (Retrieval-Augmented Generation) using hierarchical FAISS indices built from OpenFOAM tutorials. The core functions are exposed as MCP (Model Context Protocol) tools, allowing the framework to integrate with AI-powered IDEs like Cursor and Claude Code.

Who it’s for

It is designed for researchers and engineers who need to perform CFD simulations but may lack the specialized knowledge required to manually configure OpenFOAM's complex dictionary files and environment.

Highlights

  • End-to-End Automation: Handles everything from meshing (including external Gmsh files) to HPC job submission and visualization via PyVista.
  • $ ext{100%}$ Success Rate: Achieved on FoamBench using Claude Opus 4.6.
  • Self-Healing Workflow: Automatically reviews simulation errors and applies fixes in a loop.
  • MCP Integration: Can be used as a server for agentic tools like Cursor, Windsurf, and Claude Code.

Related

  • Project
  • Project
  • Project
  • Project
  • Project