🤖 AI Summary
This work addresses the challenge non-expert users face in maintaining multi-file consistency when configuring CFD cases in OpenFOAM. To tackle this, the authors propose a multi-stage retrieval-augmented intelligent configuration system that integrates several novel components: an LLM-driven query expansion mechanism, a dual-path retrieval router based on keyword rules, MMR reranking with HNSW indexing, and Reciprocal Rank Fusion for result aggregation. The system further incorporates a three-agent collaborative architecture and a static knowledge layer to enable highly comprehensive and repairable automated configuration. Evaluated on 28 public cases, the approach achieves an average retrieval coverage of 77.9%—exceeding 90% for parameter-modification tasks—and generates fully executable cases with built-in capabilities for automatic error diagnosis and repair.
📝 Abstract
Configuring a computational fluid dynamics (CFD) case in OpenFOAM requires assembling a multi-directory input deck of mutually consistent solver, discretisation and boundary-condition dictionaries -- a task that remains a substantial barrier to non-specialist use of open-source CFD software. Large language models (LLMs) coupled with retrieval-augmented generation (RAG) can lower this barrier, but existing systems retrieve with a single flat query, apply one retrieval strategy to operationally distinct requests, and let a single agent both draft and review its own output. We present IteraSim RAG, a retrieval-augmented software back-end for automated OpenFOAM case generation built around these three limitations. An LLM first expands the query into physics, solver-keyword and troubleshooting variants, Reciprocal Rank Fusion then merges the resulting ranked lists, and Maximal Marginal Relevance re-ranks the fused candidates against an HNSW-indexed dense vector store. A deterministic keyword router dispatches tool-conditioned workflow queries and corpus-wide physics queries down separate retrieval paths, and generation is split across an Architect, an InputWriter and a Reviewer agent, backed by a static canonical-knowledge layer covering solver selection, turbulence closures, boundary conditions and finite-volume defaults. On an openly released 28-case benchmark spanning zero-shot setup, few-shot generalisation, single-parameter modifications and turbulence-model swaps, the pipeline attains a mean retrieval coverage of 77.9% (median 79.1%), with the parameter-modification category exceeding 90%. All six reference configurations run to completion on OpenFOAM v2506, and two synthetically corrupted cases are diagnosed and repaired within the bounded Reviewer loop using only the solver log and the canonical layer. The benchmark, scoring rubric and figure scripts are released for reproducibility.