Table of Contents
Fetching ...

LLM Agent for Fire Dynamics Simulations

Leidong Xu, Danyal Mohaddes, Yi Wang

TL;DR

This work presents FoamPilot, an LLM-based agent that unifies code insight, case configuration, and job execution to streamline FireFOAM CFD workflows. By leveraging retrieval-augmented generation over a combined header/source code corpus, compressing case directories for natural-language-driven modifications, and orchestrating serial and HPC executions, FoamPilot reduces the barrier for both new and experienced users. Experimental results show strong performance on simple tasks (Code Insight and Case Configuration) but limited reliability for complex, multi-step tasks and HPC job orchestration, highlighting the need for improved prompting, state management, and human-in-the-loop safeguards. The approach underscores the potential and current limits of LLM-enabled orchestration in large-scale scientific simulations, with clear directions for enhancing robustness, scalability, and multimodal understanding in future work.

Abstract

Significant advances have been achieved in leveraging foundation models, such as large language models (LLMs), to accelerate complex scientific workflows. In this work we introduce FoamPilot, a proof-of-concept LLM agent designed to enhance the usability of FireFOAM, a specialized solver for fire dynamics and fire suppression simulations built using OpenFOAM, a popular open-source toolbox for computational fluid dynamics (CFD). FoamPilot provides three core functionalities: code insight, case configuration and simulation evaluation. Code insight is an alternative to traditional keyword searching leveraging retrieval-augmented generation (RAG) and aims to enable efficient navigation and summarization of the FireFOAM source code for developers and experienced users. For case configuration, the agent interprets user requests in natural language and aims to modify existing simulation setups accordingly to support intermediate users. FoamPilot's job execution functionality seeks to manage the submission and execution of simulations in high-performance computing (HPC) environments and provide preliminary analysis of simulation results to support less experienced users. Promising results were achieved for each functionality, particularly for simple tasks, and opportunities were identified for significant further improvement for more complex tasks. The integration of these functionalities into a single LLM agent is a step aimed at accelerating the simulation workflow for engineers and scientists employing FireFOAM for complex simulations critical for improving fire safety.

LLM Agent for Fire Dynamics Simulations

TL;DR

This work presents FoamPilot, an LLM-based agent that unifies code insight, case configuration, and job execution to streamline FireFOAM CFD workflows. By leveraging retrieval-augmented generation over a combined header/source code corpus, compressing case directories for natural-language-driven modifications, and orchestrating serial and HPC executions, FoamPilot reduces the barrier for both new and experienced users. Experimental results show strong performance on simple tasks (Code Insight and Case Configuration) but limited reliability for complex, multi-step tasks and HPC job orchestration, highlighting the need for improved prompting, state management, and human-in-the-loop safeguards. The approach underscores the potential and current limits of LLM-enabled orchestration in large-scale scientific simulations, with clear directions for enhancing robustness, scalability, and multimodal understanding in future work.

Abstract

Significant advances have been achieved in leveraging foundation models, such as large language models (LLMs), to accelerate complex scientific workflows. In this work we introduce FoamPilot, a proof-of-concept LLM agent designed to enhance the usability of FireFOAM, a specialized solver for fire dynamics and fire suppression simulations built using OpenFOAM, a popular open-source toolbox for computational fluid dynamics (CFD). FoamPilot provides three core functionalities: code insight, case configuration and simulation evaluation. Code insight is an alternative to traditional keyword searching leveraging retrieval-augmented generation (RAG) and aims to enable efficient navigation and summarization of the FireFOAM source code for developers and experienced users. For case configuration, the agent interprets user requests in natural language and aims to modify existing simulation setups accordingly to support intermediate users. FoamPilot's job execution functionality seeks to manage the submission and execution of simulations in high-performance computing (HPC) environments and provide preliminary analysis of simulation results to support less experienced users. Promising results were achieved for each functionality, particularly for simple tasks, and opportunities were identified for significant further improvement for more complex tasks. The integration of these functionalities into a single LLM agent is a step aimed at accelerating the simulation workflow for engineers and scientists employing FireFOAM for complex simulations critical for improving fire safety.

Paper Structure

This paper contains 7 sections, 3 equations, 8 figures, 1 table.

Figures (8)

  • Figure 1: Left: render of a FireFOAM simulation of large-scale fire suppression (REN2017695). Right: typical FireFOAM case structure.
  • Figure 2: The structure of the FoamPilot agent. Solid and dashed lines indicate queries and feedback, respectively.
  • Figure 3: Illustration of the process by which the source code is embedded in a vector database and retrieved by the RAG Tool.
  • Figure 4: Case Configuration prompt.
  • Figure 5: Prompts used to run simulations serially on head node and in parallel using a job scheduler.
  • ...and 3 more figures