Fine-tuning a large language model for automating computational fluid dynamics simulations

• We fine-tuned a domain-specific LLM, empowering a multi-agent system to automate CFD simulation from natural language input. • We developed NL2FOAM, a dataset containing 28716 cases designed for automated OpenFOAM simulation driven by natural language. • The system achieves an 82.6% first-attempt success rate on the benchmark with an average accuracy of 88.7%, demonstrating superior generalization and robustness. Configuring computational fluid dynamics (CFD) simulations typically demands extensive domain expertise, limiting broader access. Although large language models (LLMs) have advanced scientific computing, their use in automating CFD workflows is underdeveloped. We introduce a novel approach centered on domain-specific LLM adaptation. By fine-tuning Qwen2.5-7B-Instruct on NL2FOAM, our custom dataset of 28,716 natural language-to-OpenFOAM configuration pairs with chain-of-thought (CoT) annotations enables direct translation from natural language descriptions to executable CFD setups. A multi-agent system orchestrates the process, autonomously verifying inputs, generating configurations, running simulations, and correcting errors. Evaluation on a benchmark of 21 diverse flow cases demonstrates state-of-the-art performance, achieving 88.7% solution accuracy and 82.6% first-attempt success rate. This significantly outperforms larger general-purpose models such as Qwen2.5-72B-Instruct, DeepSeek-R1, and Llama3.3-70B-Instruct, while also requiring fewer correction iterations and maintaining high computational efficiency. The results highlight the critical role of domain-specific adaptation in deploying LLM assistants for complex engineering workflows. Our code and fine-tuned model have been deposited at https://github.com/YYgroup/AutoCFD .

Authors

Institutions

Publication Details

Journal
Theoretical and Applied Mechanics Letters
Published
2025-04-23
DOI
https://doi.org/10.1016/j.taml.2025.100594
Citations
16
Primary Topic
Meteorological Phenomena and Simulations
Type
article
Field-Weighted Citation Impact
20.81

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Fine-tuning a large language model for automating computational fluid dynamics simulations

Zhen Lu, Yang Yue, Zhen Dong
16 citations
Theoretical and Applied Mechanics Letters
Meteorological Phenomena and Simulations
20.81
article

Fine-tuning a large language model for automating computational fluid dynamics simulations

Zhen Lu, Yang Yue, Zhen Dong
article en
16 citations

Abstract

• We fine-tuned a domain-specific LLM, empowering a multi-agent system to automate CFD simulation from natural language input. • We developed NL2FOAM, a dataset containing 28716 cases designed for automated OpenFOAM simulation driven by natural language. • The system achieves an 82.6% first-attempt success rate on the benchmark with an average accuracy of 88.7%, demonstrating superior generalization and robustness. Configuring computational fluid dynamics (CFD) simulations typically demands extensive domain expertise, limiting broader access. Although large language models (LLMs) have advanced scientific computing, their use in automating CFD workflows is underdeveloped. We introduce a novel approach centered on domain-specific LLM adaptation. By fine-tuning Qwen2.5-7B-Instruct on NL2FOAM, our custom dataset of 28,716 natural language-to-OpenFOAM configuration pairs with chain-of-thought (CoT) annotations enables direct translation from natural language descriptions to executable CFD setups. A multi-agent system orchestrates the process, autonomously verifying inputs, generating configurations, running simulations, and correcting errors. Evaluation on a benchmark of 21 diverse flow cases demonstrates state-of-the-art performance, achieving 88.7% solution accuracy and 82.6% first-attempt success rate. This significantly outperforms larger general-purpose models such as Qwen2.5-72B-Instruct, DeepSeek-R1, and Llama3.3-70B-Instruct, while also requiring fewer correction iterations and maintaining high computational efficiency. The results highlight the critical role of domain-specific adaptation in deploying LLM assistants for complex engineering workflows. Our code and fine-tuned model have been deposited at https://github.com/YYgroup/AutoCFD .

Theoretical and Applied Mechanics LettersVol. 15(3)
Peking University (CN)
Tencent, National Natural Science Foundation of China
Openalex Percentile: Top 0%
Meteorological Phenomena and Simulations
20.81
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.