ChatCFD: An LLM-Driven Agent for End-to-End CFD Automation with Structured Knowledge and Reasoning

ChatCFD: An LLM-Driven Agent for End-to-End CFD Automation with Structured Knowledge and Reasoning
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Computational Fluid Dynamics (CFD) is critical for scientific advancement but is hindered by operational complexity and high expertise barriers. This paper introduces ChatCFD, a Large Language Model (LLM)-driven multi-agent system designed for end-to-end CFD automation using OpenFOAM. Powered by DeepSeek-R1/V3, ChatCFD integrates structured domain knowledge bases, a precise error locator, and iterative reflection to dramatically outperform existing methods. On 315 benchmark cases, ChatCFD achieves 82.1% execution success (vs. 6.2% for MetaOpenFOAM and 42.3% for Foam-Agent) and 68.12% physical fidelity - a novel metric assessing scientific meaningfulness beyond mere runnability. A dedicated Physics Interpreter attains 97.4% summary fidelity, bridging the gap between narrative fluency and the enforcement of tight physical constraints. Resource analysis confirms efficiency, averaging 192.1k tokens and $0.208 per case, significantly lower than baseline costs. Ablation studies identify the Error Locator and Solver Template DB as critical, with the latter’s removal collapsing accuracy to 48%. The system exhibits robust flexibility, achieving 95.23% success in autonomous solver selection and 100% in turbulence modeling, while successfully reproducing complex literature cases (e.g., NACA0012, supersonic nozzle) with 60-80% success rates where baselines failed. Featuring a modular, MCP-compatible design, ChatCFD facilitates scalable, collaborative AI-driven CFD. Code is available at: https://github.com/ConMoo/ChatCFD


💡 Research Summary

ChatCFD presents a novel, end‑to‑end automation framework for Computational Fluid Dynamics (CFD) built on large language models (LLMs) and a multi‑agent architecture. Leveraging DeepSeek‑R1 and DeepSeek‑V3, the system integrates a richly structured OpenFOAM knowledge base, an error‑location module, and iterative self‑reflection to bridge the gap between natural‑language user intent and executable CFD simulations.

The pipeline consists of four stages. Stage 0 constructs a knowledge base from OpenFOAM manuals, tutorials, and public case files, converting them into a JSON‑style structured database and a vector store. Four sub‑databases store file dependencies, boundary‑condition specifications, physical‑quantity dimensions, and solver templates, enabling the LLM to retrieve precise configuration information without exceeding context limits.

Stage 1 provides a multimodal Streamlit interface where users can describe a case in natural language, upload research PDFs, or submit mesh files (currently Fluent .msh). The system extracts candidate CFD cases, presents them with metadata (solver, turbulence model, flow regime), and assists the user in selecting the target case. Mesh conversion to OpenFOAM format is handled automatically.

Stage 2 uses the DeepSeek models to synthesize the required OpenFOAM case files. The process is divided into file‑configuration synthesis, boundary‑condition mapping, and dimension validation, each guided by the corresponding sub‑database. Place‑holder tokens replace large non‑uniform field data to keep prompts within token limits.

Stage 3 runs the generated case, captures log output, and invokes the Error Locator module. This module employs Retrieval‑Augmented Generation (RAG) with ReferenceRetriever and ContextRetriever to pinpoint missing files, dimension mismatches, numerical divergence, and other failure modes. The agents then reformulate prompts, correct the identified issues, and re‑execute the simulation. This iterative reflection loop typically requires 2–3 retries before convergence.

Experimental evaluation on 315 benchmark problems—covering compressible/incompressible, steady/transient flows, and ten turbulence models—shows an 82.1 % overall execution success rate, dramatically higher than MetaOpenFOAM (6.2 %) and Foam‑Agent (42.3 %). More importantly, the authors introduce a “Physical Fidelity” metric that measures whether a runnable simulation yields scientifically meaningful results; ChatCFD attains 68.12 % fidelity, a first in the field. A dedicated Physics Interpreter achieves 97.4 % summary fidelity, demonstrating tight alignment between generated code and physical constraints.

Resource analysis reports an average of 192.1 k tokens and $0.208 per case, roughly half the token usage of Foam‑Agent and 1.5× cheaper than MetaOpenFOAM. Ablation studies reveal that removing the Solver Template database collapses accuracy to 48 %, while disabling the Error Locator reduces success below 30 %, confirming these components as critical.

Flexibility experiments indicate 95.23 % success in autonomous solver selection across flow regimes and 100 % success in turbulence‑model switching, even for unseen configurations. The system reproduces complex literature cases such as the NACA0012 airfoil and a supersonic nozzle with 60–80 % end‑to‑end success, where prior agents fail completely. Multi‑physics cases demand more resources, and the authors note a residual LLM bias toward simpler setups, leading to occasional over‑simplifications.

Limitations include restricted support for external, highly complex meshes (e.g., CAD‑derived geometries) and reliance on external tools for post‑processing and visualization. The current implementation focuses on OpenFOAM’s solver, pre‑processor, and runtime; extending to coupled physics engines or optimization frameworks will require additional integration.

Overall, ChatCFD demonstrates that coupling structured domain knowledge with LLM‑driven reasoning and self‑correcting loops can achieve reliable, high‑fidelity CFD automation without human intervention. Its modular, MCP‑compatible design paves the way for collaborative multi‑agent networks and broader AI‑driven scientific simulation pipelines. Future work will explore tighter multi‑physics coupling, reinforcement‑learning‑based self‑improvement, and seamless integration with downstream analysis tools, potentially transforming the accessibility and productivity of CFD and related engineering disciplines.


Comments & Academic Discussion

Loading comments...

Leave a Comment