Papers
Topics
Authors
Recent
2000 character limit reached

MetaOpenFOAM 2.0: Automating CFD Workflows

Updated 21 November 2025
  • 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-kk 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 VV 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 QQ is divided into {T1,T2}\{T_1, T_2\} where T1T_1 is “CFD simulation,” T2T_2 is “CFD post-processing.”
  • Subtask-Level Decomposition (ψ)(ψ): Each TiT_i maps to an ordered list S=ψ(Ti)={si,1,si,2,}S = ψ(T_i) = \{s_{i,1}, s_{i,2}, \ldots\}, e.g., ψ(T1)={ψ(T_1) = \{write controlDict, run pimpleFoam, check convergence}\} and ψ(T2)={ψ(T_2) = \{run post-process commands, convert to VTK, run Python script}\}.

This explicit task-subtask breakdown, summarized as S=ψ(φ(Q))S = ψ(φ(Q)), localizes computational and logical errors and mitigates cross-domain propagation between simulators, shell, and Python subsystems.

3. Iterative Verification and Correction Mechanism

Each subtask ss undergoes an Iterative Chain-of-Thought (ICOT) refinement loop defined as follows:

Given an initial state x0x_0, at each iteration k1k \geq 1: ek=Runner(xk)(error message or  if success) xk+1={InputWriter(xk,ek)ek,k<Imax xkek= or kImax\begin{aligned} e_k &= \text{Runner}(x_k) \quad (\text{error message or } \varnothing \text{ if success})\ x_{k+1} &= \begin{cases} \text{InputWriter}(x_k, e_k) & e_k \neq \varnothing,\, k < I_{\max} \ x_k & e_k = \varnothing \text{ or } k \geq I_{\max} \end{cases} \end{aligned}

The loop continues until either ek=e_k = \varnothing or kk saturates ImaxI_{\max} (default 10). Upon subtask completion, the LLM-driven FinalVerifier checks assembled outputs for requirement satisfaction, physical and numerical accuracy (e.g., y+y^+ 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 y+y^+, TKE, plus visualization outputs).

Key metrics include:

  • Executability A{0,,7}A \in \{0,\ldots, 7\}: 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 (Isim,ICLI,IPy)(I_{\text{sim}}, I_{\text{CLI}}, I_{\text{Py}}), token usage T=Tprompt+TcompletionT = T_{\text{prompt}} + T_{\text{completion}}, and USD-equivalent cost (average \$0.15/case).
  • Pass@k: Fraction of nn generated samples with A=7A=7 among the top-kk, e.g., for n=10,k=1n=10, k=1, pass@1\text{pass@1} represents single-shot success: pass@k=Eproblems[1(nck)(nk)]\text{pass@}k = \mathbb{E}_{\text{problems}}\left[1 - \frac{\binom{n-c}{k}}{\binom{n}{k}}\right]

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 AA 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 AA to around 2.1, while omitting the ICOT reviewer loop reduces AA to 1.4. Full system synergy provides a \sim+4 increase in AA over monolithic (non-modular) approaches. Simulation-only tasks typically reach A7A \approx 7 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 (m)(m): E(m)E0+αln(m)E(m) \approx E_0 + \alpha \ln(m); token usage also increases sublinearly Tnon-iter(m)T0+βln(m)T_{\text{non-iter}}(m) \approx T_0 + \beta \ln(m).
  • Executability versus ICOT iterations (r)(r): E(r)E0+γln(r)E(r) \approx E_0' + \gamma \ln(r), with Titer(r)T0+δln(r)T_{\text{iter}}(r) \approx T_0' + \delta \ln(r).

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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)
Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to MetaOpenFOAM 2.0.