arXiv:2504.09602physics.flu-dyncs.AI2025-04被引 43

用自然语言直接生成流体模拟配置,让非专家也能高效运行复杂仿真。

Fine-tuning a Large Language Model for Automating Computational Fluid Dynamics Simulations

  • 用2.8万条自然语言转OpenFOAM指令数据微调大模型,实现语义到代码的精准翻译。
  • 在21个测试案例中达到88.7%解算准确率和82.6%首次成功率,优于多个更大通用模型。
  • 构建多智能体系统自动验证、生成、纠错,适合工程仿真自动化与教学应用。

配置计算流体动力学(CFD)仿真通常需要深厚的专业知识,限制了其广泛应用。尽管大语言模型(LLMs)在科学计算中取得进展,但其在自动化CFD工作流中的应用仍不成熟。本文提出一种面向领域特定任务的LLM适配方法,通过对Qwen2.5-7B-Instruct在自建的NL2FOAM数据集(包含28,716对自然语言至OpenFOAM配置的样本及思维链标注)上进行微调,实现了从自然语言描述到可执行CFD设置的直接转换。采用多智能体框架协同完成输入验证、配置生成、仿真运行与错误修正。在21个多样化流动案例的基准测试中,该方法达到88.7%的解算准确率和82.6%的首次尝试成功率,显著优于更大的通用模型如Qwen2.5-72B-Instruct、DeepSeek-R1和Llama3.3-70B-Instruct,且所需修正迭代更少,计算效率更高。结果表明,领域特化适配对部署用于复杂工程流程的LLM助手至关重要。代码与微调模型已开源:https://github.com/YYgroup/AutoCFD。

原文摘要 · Abstract (English)

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 28716 natural language-to-OpenFOAM configuration pairs with chain-of-thought (CoT) annotations, we enable direct translation from natural language descriptions to executable CFD setups. A multi-agent framework 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 like 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.

流体模拟大模型自动化OpenFOAM

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。