MetaOpenFOAM 2.0: Automating CFD Workflows
- MetaOpenFOAM 2.0 is an LLM-driven system that automates CFD simulation and post-processing workflows through a modular, multi-agent pipeline.
- It employs chain-of-thought decomposition and an iterative verification loop to break down complex tasks and ensure numerical and physical accuracy.
- Benchmark results demonstrate improved executability, reduced token usage, and lower costs, making it ideal for rapid, cost-efficient CFD prototyping.
MetaOpenFOAM 2.0 is a LLM-driven system for automating computational fluid dynamics (CFD) simulation and post-processing workflows based on OpenFOAM. It integrates chain-of-thought (COT) decomposition, retrieval-augmented generation (RAG), and iterative verification mechanisms to convert natural language requirements into executable CFD tasks for both simulations and complex post-processing. MetaOpenFOAM 2.0 demonstrates improved automation, accuracy, and cost-efficiency compared to previous approaches, significantly outperforming its predecessor across a standardized benchmark suite (Chen et al., 1 Feb 2025).
1. System Architecture
MetaOpenFOAM 2.0 features a multi-agent, modular pipeline that orchestrates automation of CFD workflows in the following stages:
- Natural-Language Parser: Normalizes free-form user requirements for downstream processing.
- Retrieval-Augmented Generation (RAG): Embeds the normalized requirement in a FAISS vector store, retrieving the top- OpenFOAM tutorial/case exemplars to ground subsequent reasoning.
- QDCOT Decomposer: Applies a hierarchical, two-stage question decomposition, first partitioning the requirement into coarse tasks (simulation and post-processing), then further dividing into granular subtasks specific to OpenFOAM or post-processing routines.
- Iterative COT (ICOT) Loop: For each subtask, iterates between three agents—InputWriter (generates/edits inputs/scripts), Runner (executes shell commands, captures outputs/errors), and Reviewer (inspects, comments, triggers rewrites)—until the subtask is resolved or a maximum iteration cap is reached.
- LLM-Assisted Final Verifier: Checks global physical and numerical validity, verifying satisfaction of user intent, boundary conditions, flow characteristics, convergence, and physical consistency.
The backbone of the system is concisely presented in Algorithm 1:
1 2 3 4 5 6 7 8 9 10 11 12 |
1. {T₁, T₂} ← φ(Q) 〈QDCOT‐1〉
2. For each Tᵢ, {sᵢ,₁, …} ← ψ(Tᵢ) 〈QDCOT‐2〉
3. For each subtask s:
a. i ← 0
b. repeat
i ← i+1
xᵢ ← InputWriter(s, eᵢ₋₁)
eᵢ ← Runner(xᵢ)
until eᵢ = ∅ or i ≥ Iₘₐₓ 〈ICOT〉
4. V ← FinalVerifier(all outputs)
5. if V indicates error in sⱼ: go to step 3 for sⱼ
6. Return R |
Here, denotes task-level decomposition, subtask-level decomposition, and the final verification step (Chen et al., 1 Feb 2025).
2. Chain-of-Thought (COT) Decomposition
COT in MetaOpenFOAM 2.0 is realized as a structured, two-level hierarchy:
- Task-Level Decomposition : The requirement is divided into where is “CFD simulation,” is “CFD post-processing.”
- Subtask-Level Decomposition : Each maps to an ordered list , e.g., write controlDict, run pimpleFoam, check convergence and run post-process commands, convert to VTK, run Python script.
This explicit task-subtask breakdown, summarized as , localizes computational and logical errors and mitigates cross-domain propagation between simulators, shell, and Python subsystems.
3. Iterative Verification and Correction Mechanism
Each subtask undergoes an Iterative Chain-of-Thought (ICOT) refinement loop defined as follows:
Given an initial state , at each iteration :
The loop continues until either or saturates (default 10). Upon subtask completion, the LLM-driven FinalVerifier checks assembled outputs for requirement satisfaction, physical and numerical accuracy (e.g., range, convergence), and boundary consistency. Detected errors route the process back to the offending subtask (Chen et al., 1 Feb 2025).
4. Benchmarking and Metrics
MetaOpenFOAM 2.0’s assessment employs a 13-task benchmark suite with seven simulation cases (e.g., incompressible RANS flows, DNS-HIT, reactingFoam) and six post-processing cases (extractions like max , TKE, plus visualization outputs).
Key metrics include:
- Executability : Ranging from simulation-only completion (0–3), through mix CLI/Python post-processing (4–5), numerical/physical validation (6), to human-judged flawless execution (7).
- Cost Metrics: Total agent iterations , token usage , and USD-equivalent cost (average \$0.15/case).
- Pass@k: Fraction of generated samples with among the top-, e.g., for , represents single-shot success:
This evaluation framework quantifies both accuracy and cost-efficiency (Chen et al., 1 Feb 2025).
5. Experimental Performance and Ablation Studies
MetaOpenFOAM 2.0 demonstrates significant gains over MetaOpenFOAM 1.0 in all core metrics. Averaged across 13 tasks and 10 runs, the results are:
| Metric | MetaOpenFOAM 1.0 | MetaOpenFOAM 2.0 |
|---|---|---|
| Executability | 2.1/7 | 6.3/7 |
| Pass@1 (%) | 0% | 86.9% |
| Avg. token usage | 47,426 | 36,448 |
| Avg. cost (USD) | \$0.22 | \$0.15 | |
| Avg. iterations | 6.7 | 3.7 |
Ablation results underscore that both COT decompositions and ICOT iterative correction are essential. Removal of CLI/Python post-processing in the QDCOT ablations drops to around 2.1, while omitting the ICOT reviewer loop reduces to 1.4. Full system synergy provides a +4 increase in over monolithic (non-modular) approaches. Simulation-only tasks typically reach in near-minimal ICOT iterations, whereas more challenging DNS or complex post-processing tasks achieve lower, but still robust scores (Chen et al., 1 Feb 2025).
6. Post-Training Scaling Laws
The system exhibits two post-training scaling regularities:
- Executability versus QDCOT steps : ; token usage also increases sublinearly .
- Executability versus ICOT iterations : , with .
These trends parallel those observed in general LLM post-training scaling, enabling trade-offs between accuracy and computational (token) cost (Chen et al., 1 Feb 2025).
7. Implications, Limitations, and Future Prospects
MetaOpenFOAM 2.0 abstracts CFD task configuration and post-processing behind a natural-language interface, facilitating access for non-expert users across aerospace, energy, and biological fluid mechanics. By automating error localization through COT and ensuring reliability via ICOT, the system reduces token usage by approximately 23% compared to its predecessor, and provides rapid, low-cost (average \$0.15/case) prototyping for parameter studies.
Current limitations include an assumption of pre-meshed geometries, a lack of full pre-processing automation (mesh generation), and constraints to single-physics OpenFOAM examples. Multi-physics coupling and real-time physics selection are not addressed.
Planned future developments include:
- Integration of mesh generation and geometry parametricization within the COT framework.
- Extensions to multi-phase and fluid–structure interaction solvers.
- Use of reinforcement learning fine-tuning on CFD case libraries for improved COT efficiency.
- Development of lightweight, domain-specific LLMs to lower operational costs.
MetaOpenFOAM 2.0’s documented methodology and codebase are available at https://github.com/Terry-cyx/MetaOpenFOAM (Chen et al., 1 Feb 2025).
Sponsored by Paperpile, the PDF & BibTeX manager trusted by top AI labs.
Get 30 days free