Source-linked AI summary

A Case-Bundle Operating Model for Coding Agents in OpenFOAM-Based CFD

Ke Xiao, Han Li, Teng Zhang, Yangchen Xu, Runze Mao, Zhi X. Chen

arXiv:2609.11941v1cs.SEcs.CEcs.DC

TL;DR

General-purpose coding agents need persistent engineering context and evidence to produce CFD work that can be reviewed and reused. The paper introduces a two-mode case-bundle model and evaluates it in OpenFOAM-7 injector screening, where the reviewed bundle was replayed across 140 variants and four Pi runs succeeded across different model backends. The results support bounded automation while retaining engineering control over physical meaning and result suitability.

  • Problem

    General-purpose coding agents can execute CFD workflows, but reviewable and reusable work requires persistent engineering context and evidence.

  • Method

    The paper organizes OpenFOAM CFD work into reviewed case bundles with Build for engineer-guided development and Replay for reuse across approved variants.

  • Results

    The reviewed bundle completed solver and post-processing for 140 design variants, while four Pi replays with different model backends all succeeded.

  • Takeaways & Limitations

    Reviewed case bundles support bounded, reusable automation while engineers retain control over physical meaning and result suitability.

  • Takeaways & Limitations

    The operating model is expected to apply most readily to CFD software exposing inputs, commands, logs, and outputs through comparable file and command interfaces.

Abstract

from arXiv · show

General-purpose coding agents can set up computational fluid dynamics (CFD) cases, execute solvers, and manage remote jobs. Reviewable and reusable work additionally depends on persistent engineering context and evidence. We present a case-bundle operating model with two modes. Build supports agent-assisted case development under engineering review. Replay applies a reviewed case to new variants. We used this model in an OpenFOAM-7 interFoam study for screening injector designs. GPT-5.5 in Codex helped develop a case bundle containing the simulation configuration, geometry-processing and meshing procedures, remote-execution scripts, post-processing code, and review records. The bundle was replayed to execute and post-process 140 Stereolithography (STL) geometry variants on a remote high-performance computing system. A separate replay exercise used the Pi coding agent as the runtime with four different LLM backends. All four runs succeeded and produced verified results. Tool use and token consumption varied across runs. The results show how reviewed case bundles can support bounded, reusable automation with distinct roles for routine execution and engineering judgment.

1. Introduction

The paper proposes a reviewed case-bundle operating model for general-purpose coding agents in OpenFOAM-based CFD, separating engineer-guided Build from procedure-driven Replay. An OpenFOAM-7 injector-screening study demonstrates the model across 140 STL variants and four additional agent backends.

  • 1. Introduction: The model addresses a gap between purpose-built agentic CFD systems and general-purpose coding agents by organizing OpenFOAM artifacts around editable files, commands, logs, and outputs.The paper positions OpenFOAM as suitable for coding agents because its cases expose these artifacts directly, while geometry and mesh generation remain especially difficult.
  • 1. Introduction: The operating model separates Build, where engineers review agent-assisted case development, from Replay, where reviewed procedures are applied to approved variants.Build retains engineering judgment over meshes, boundary conditions, physical assumptions, and meaningful changes; Replay permits greater autonomy for routine execution and post-processing.
  • 1. Introduction: A case bundle preserves the configurations, procedures, scripts, outputs, and review records needed to inspect, correct, reconstruct, and reuse CFD work.The workspace includes solver dictionaries, mesh and run scripts, Slurm files, logs, post-processing outputs, manifests, and review notes.
  • 1. Introduction: The case study applied the model to OpenFOAM-7 interFoam injector screening with complex STL geometry, custom preprocessing, remote Slurm execution, and automated replay over 140 design variants.The study included solver and post-processing completion across the variants.
  • 1. Introduction: The paper derives design implications emphasizing structured case directories, persistent state, executable records, and reviewable decision points for future CFD-agent environments.These elements support bounded automation while preserving engineering checkpoints.

2. Methods

The methods center CFD-agent work on reusable OpenFOAM case bundles and separate case development in Build from reviewed reuse in Replay. The study combines agent runtimes, engineering checkpoints, documented artifacts, remote execution, and verification evidence.

  • 2.1. Case bundles and operating modes: The operating model uses Build to assemble and repair a case, then Replay to rerun a reviewed procedure across approved variants.Build keeps engineers close to configuration and validation; Replay delegates routine execution while retaining review gates.
  • 2.1. Case bundles and operating modes: A case bundle combines OpenFOAM directories with geometry, mesh, execution, post-processing, manifests, logs, and review materials needed for repeatable inspection and reruns.Reusable files are separated from generated processor directories, scratch data, and routine outputs unless those outputs document a correction or reported result.
  • 2.1. Case bundles and operating modes: The bundle records CFD decisions affecting results, including geometry interpretation, patch mapping, mesh controls, solver settings, time-step controls, and post-processing definitions.These decisions are stored in scripts, dictionaries, manifests, and notes so another engineer or agent can rerun the case from the recorded procedure.
  • 2.1. Case bundles and operating modes: Build includes geometry staging, dictionary editing, mesh checks, pilot solver runs, and post-processing adjustments under close engineering review because completed runs can still embody incorrect assumptions.Review checks geometry, patch mapping, and physical assumptions rather than relying on solver completion alone.
  • 2.2. Model and agent runtimes: The reported implementation used GPT-5.5 through Codex, Pi with four model backends, OpenFOAM-7 interFoam, SSH, remote directories, and Slurm job chains.The agent environment included editable case artifacts, utilities, logs, scheduler state, and procedural skills for discovering software and preserving provenance.
  • 2.5. Verification: Verification used case files, Slurm states, solver logs, post-processing outputs, and bundle integrity checks to confirm completed calculations and replayable artifacts.This evidence framework supports inspection of case progression, solver completion, post-processing completion, and the reviewed bundle.

3. Results

The reviewed bundle was built for one injector-screening path and replayed across STL variants, producing completed VOF calculations and inspection outputs. A separate Pi exercise succeeded across four model backends, while interaction and token footprints varied.

  • 3.1. Building and replaying the injector-screening bundle: The Build path covered STL staging, meshing, phase initialization, interFoam execution, and post-processing before Replay reused the bundle for remaining variants.The procedure included mesh synchronization, decomposition, dependent Slurm jobs, log monitoring, and automated post-processing.
  • 3.1. Building and replaying the injector-screening bundle: Batch execution required script repairs for alternate sampling locations, SSH interruptions, and overlapping submissions, with each correction retained for subsequent variants.The post-processing wrapper normalized center-plane visualizations and preprocessing moved from login-shell commands to Slurm jobs.
  • 3.1. Building and replaying the injector-screening bundle: 140 completed VOF calculations produced solver and post-processing outputs under the reviewed replay procedure.Completion was checked using Slurm states, solver logs reaching Time = 0.05 and End, expected files, and identifiers in merged summaries.
  • 3.2. Cross-model replay and interaction footprint: All four Pi replays succeeded and produced verified CFD results using GPT-5.4, DeepSeek V4 Pro, GLM-5.2, and Qwen3.7-plus.Each run handled one STL geometry and recovered the same sequence from geometry staging through interFoam, result handling, and reproducibility documentation.
  • 3.1. Building and replaying the injector-screening bundle: The workflow outputs included center-plane visualizations, cone-angle classifications, per-case summaries, per-time records, and inlet-flow records for engineering inspection.These artifacts supported inspection of the 140-geometry screening study.
  • 3.2. Cross-model replay and interaction footprint: Tool calls ranged from 56 to 145, processed tokens from 2.48 million to 6.87 million, and estimated API costs from USD 0.12 to USD 2.31.Cached input exceeded 85% of processed tokens in every session and reached 98% for DeepSeek V4 Pro.

4. Discussion

The case-bundle model separates agent-assisted Build from more stable Replay, preserving engineering review while enabling repeated execution across variants and agent configurations.

  • The case bundle preserved configurations, geometry processing, meshing, execution, post-processing, and review records, allowing corrections to carry into later runs.
  • Replay: The four successful Pi replays across different LLM models show that the preserved case state was usable across agent configurations.
  • Build: Build established geometry interpretation, patch assignment, meshing, solver settings, sampling, and metric definitions, so generated procedures required inspection before reuse.
  • Replay: Replay applied reviewed procedures to new variants, reducing per-run decisions while covering job submission, monitoring, output collection, and post-processing.
  • Bounded autonomy emerged through staged delegation: agents handled construction and repetitive execution, while engineers retained control over physical meaning and result suitability.

5. Conclusion

OpenFOAM case bundles preserve engineering state for inspection, correction, and reuse. In the injector-screening study, the reviewed procedure completed 140 variants and four successful Pi replays, supporting bounded automation with continued engineering responsibility.

  • The case bundle combined solver dictionaries, geometry and mesh procedures, run scripts, logs, post-processing code, manifests, and review notes into persistent working context.
  • The reviewed procedure completed 140 VOF calculations with post-processing outputs, verified through scheduler states, solver logs, expected files, and case identifiers.
  • Four Pi replays using different model backends all succeeded, while tool use, token consumption, and estimated model costs varied.
  • Build supported reviewed case construction and repair, whereas Replay applied the reviewed procedure to approved variants and automated repetitive execution tasks.
  • Structured directories, persistent state, executable scripts, recorded outputs, and reviewable decision points provide a practical basis for bounded CFD autonomy.
Loading 2609.11941v1…