ChatCFD: An LLM-Driven Agent for End-to-End CFD Automation with Structured Knowledge and Reasoning
E Fan, Kang Hu, Zhuowen Wu, Jiangyang Ge, Jiawei Miao, Yuzhi Zhang, He Sun, Weizong Wang, Tianhan Zhang
TL;DR
This work introduces ChatCFD, an LLM-driven multi-agent system for end-to-end CFD automation with OpenFOAM, grounded in structured domain knowledge and iterative error correction. By combining DeepSeek-R1/V3 reasoning with modular retrieval and a Physics Interpreter, ChatCFD achieves 82.1% execution success and 68.12% physical fidelity across 315 benchmark cases, while maintaining high efficiency (~192.1k tokens and $0.208 per case). Ablation and flexibility studies identify the Error Locator and Solver Template DB as critical components and demonstrate robust generalization across regimes and turbulence models. The framework, complemented by MCP compatibility, points toward scalable, collaborative AI-driven CFD workflows capable of reproducing literature cases and accelerating scientific discovery while highlighting current LLM limitations in enforcing tightly coupled physical constraints.
Abstract
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
