MetaOpenFOAM: an LLM-based multi-agent framework for CFD

Yuxuan Chen,Xu Zhu,Hua Zhou,Zhuyin Ren
2024-08-07
Abstract:Remarkable progress has been made in automated problem solving through societies of agents based on large language models (LLMs). Computational fluid dynamics (CFD), as a complex problem, presents unique challenges in automated simulations that require sophisticated solutions. MetaOpenFOAM, as a novel multi-agent collaborations framework, aims to complete CFD simulation tasks with only natural language as input. These simulation tasks include mesh pre-processing, simulation and so on. MetaOpenFOAM harnesses the power of MetaGPT's assembly line paradigm, which assigns diverse roles to various agents, efficiently breaking down complex CFD tasks into manageable subtasks. Langchain further complements MetaOpenFOAM by integrating Retrieval-Augmented Generation (RAG) technology, which enhances the framework's ability by integrating a searchable database of OpenFOAM tutorials for LLMs. Tests on a benchmark for natural language-based CFD solver, consisting of eight CFD simulation tasks, have shown that MetaOpenFOAM achieved a high pass rate per test (85%), with each test case costing only $0.22 on average. The eight CFD simulation tasks encompass a range of multidimensional flow problems, covering compressible and incompressible flows with different physical processes. This demonstrates the capability to automate CFD simulations using only natural language input, iteratively correcting errors to achieve the desired simulations. An ablation study was conducted to verify the necessity of each component in the multi-agent system and the RAG technology. A sensitivity study on the randomness of LLM showed that LLM with low randomness can obtain more stable and accurate results. Additionally, MetaOpenFOAM owns the ability to identify and modify key parameters in user requirements, and excels in correcting bugs when failure match occur,which demonstrates the generalization of MetaOpenFOAM.
Artificial Intelligence,Fluid Dynamics
What problem does this paper attempt to address?
The paper aims to address the issue of automated simulation in the field of Computational Fluid Dynamics (CFD). Specifically, by leveraging Large Language Models (LLMs) and Multi-Agent Systems (MAS), the paper proposes a new framework called MetaOpenFOAM. The goal of this framework is to complete CFD simulation tasks, including mesh preprocessing, simulation, and post-processing, solely through natural language input. Additionally, the framework introduces Retrieval-Augmented Generation (RAG) technology to enhance the system's accuracy and efficiency, thereby lowering the technical barrier for CFD simulations and reducing the workload of researchers. Experimental results demonstrate that MetaOpenFOAM performs excellently in multiple CFD simulation tasks, achieving high-precision simulation results at a lower cost.