---
title: 'FoamBench: CFD & OpenFOAM Benchmark'
url: https://www.emergentmind.com/topics/foambench
type: topic
---

# FoamBench: CFD & OpenFOAM Benchmark

FoamBench denotes a benchmark framework for computational fluid dynamics, but the term is used in two distinct senses in the arXiv literature. In its earlier and more physically grounded usage, FoamBench is a reusable benchmark suite for **surface-tension-driven incompressible two-phase flows** formulated with the **Volume-of-Fluid (VoF)** method, introduced to enable direct quantitative comparison of VoF implementations under common canonical tests, metrics, meshes, and post-processing [2212.02904]. In later work on language-model evaluation for CFD, FoamBench is reused as the **OpenFOAM-centric component of CFDLLMBench**, where it measures whether a model can synthesize, execute, and validate complete OpenFOAM cases from natural-language prompts [2509.20374]. The shared name reflects a benchmarking function, but the underlying objects, tasks, and success criteria are different.

## 1. Origin, purpose, and scope

In the sense established by "A benchmark for surface-tension-driven incompressible two-phase flows" [2212.02904], FoamBench was proposed because many VoF methods are available in commercial and open-source software, yet stable and accurate handling of small-scale capillary flows remains challenging and fair comparison is difficult without common test conditions. Its purpose is to provide **a common, quantitative basis** for comparing different VoF implementations, especially with respect to **interface advection** and **capillary or surface-tension-dominated dynamics** [2212.02904].

The benchmark is explicitly aimed at methods discretizing the **two-phase Navier–Stokes equations in a one-fluid formulation**. The paper states that the publicly available input data, secondary benchmark data, and post-processing notebooks can be reused by any two-phase flow simulation method that discretizes the same continuum model in a one-fluid formulation [2212.02904]. This makes FoamBench not a solver, but a reproducible experimental and analytical framework for solver comparison.

A later and distinct usage appears in "CFDLLMBench: A Benchmark Suite for Evaluating Large Language Models in Computational Fluid Dynamics" [2509.20374]. There, FoamBench is the part of a larger suite intended to test whether a large language model can move beyond CFD theory and isolated code synthesis into **OpenFOAM workflow automation**. In that setting, FoamBench evaluates generation of complete case setups that execute successfully and produce physically accurate results [2509.20374]. The 2026 assessment of coding agents adopts the same meaning and focuses specifically on **FoamBench-Advanced** [2602.11689].

This suggests that "FoamBench" should be treated as a polysemous benchmark label rather than a single invariant artifact.

## 2. One-fluid VoF formulation and governing quantities

In the two-phase-flow benchmark, FoamBench is built on the standard **one-fluid formulation** of incompressible two-phase Navier–Stokes flow [2212.02904]. The phase indicator is defined as
\[
\chi\left(\mathbf{x}, t\right)=
\begin{cases}
1 & \text{if } x \in \Omega^-(t), \\
0 & \text{if } x \in \Omega^+(t).
\end{cases}
\]
From this indicator, the benchmark defines the mixture density and viscosity by
\[
\rho(x, t)  = \chi(x, t) \rho^- + (1 - \chi(x, t)) \rho^+,
\qquad
\mu(x, t)  = \chi(x, t) \mu^- + (1 - \chi(x, t)) \mu^+.
\]

Incompressibility is enforced through
\[
\nabla\cdot v = 0,
\]
and the momentum balance is written as
\[
\partial_t(\rho v) + \nabla\cdot(\rho v v) - \nabla\cdot(\mu \nabla v)
= -\nabla p + \rho\mathbf{g} + \mathbf{f}_\Sigma + \nabla\cdot(\mu (\nabla v)^T),
\]
with the surface-tension force represented as
\[
\mathbf{f}_\Sigma:=\sigma \kappa_\sigma n_\Sigma \delta_\Sigma.
\]

Within the VoF discretization, the cell-wise phase fraction is
\[
\alpha_c(t) :=\frac{1}{|\Omega_c|}\int_{\Omega_c} \chi(\mathbf{x}, t)\, dV,
\]
and its exact transport form is
\[
\partial_t \alpha_c(t) = -\frac{1}{|\Omega_c|}\int_{\partial \Omega_c} \chi(x, t) v \cdot n \, dS.
\]

These definitions matter because FoamBench is not merely a collection of test geometries. It is tied to a specific continuum formulation, so that differences in benchmark outcomes can be interpreted as differences in interface transport, curvature reconstruction, and coupling between pressure and surface-tension forcing, rather than as differences in physical modeling assumptions [2212.02904].

## 3. Benchmark families, canonical problems, and diagnostic metrics

The two-phase-flow FoamBench contains two main families of tests: **convection tests** and **hydrodynamic/capillary tests** [2212.02904]. The convection family isolates VoF transport accuracy independently of surface tension. It includes a **2D sphere/disc in diagonal flow**, a **2D sphere in vortex flow**, and a **3D sphere in vortex flow**. In each case the flow is reversed halfway through the simulation, so the interface should ideally return to its initial state [2212.02904].

For these advection tests, the benchmark uses the **\(L_1\) shape error**
\[
e_\text{shape} = \sum_i^{N_\text{cells}} V_i\left|\alpha_i^\text{end} - \alpha_i^\text{start}\right|,
\]
which measures how well the initial interface is restored after reversal [2212.02904].

The hydrodynamic and capillary family is broader and addresses parasitic currents, droplet translation, capillary-wave dynamics, and oscillatory surface-tension phenomena. The cases are **2D stationary droplet**, **3D stationary droplet**, **2D translating droplet**, **3D translating droplet**, **2D oscillating capillary wave**, and **3D oscillating droplet** [2212.02904]. Three fluid pairings are used: **water/air**, **Ravenol gear oil/air**, and **Novec 7500/water**, spanning density ratios from about 1.6 to 838.8 and kinematic viscosity ratios from about 0.06 to 15.3 [2212.02904].

Several quantitative diagnostics are defined. For stationary and translating droplets, FoamBench uses **velocity \(L_1\) and \(L_\infty\) errors**,
\[
L_1(v) = \frac{1}{N_\text{cells}}\sum_i^{N_\text{cells}} |v_i - v_\text{ref}|,
\qquad
L_\infty(v) = \max(|v_i - v_\text{ref}|),
\]
with \(v_\text{ref}=0\) for stationary droplets and \(v_\text{ref}=\mathbf{U}\) for translating droplets [2212.02904]. For capillary dynamics, the benchmark introduces the capillary time-step constraint
\[
\Delta t_\sigma = \sqrt{\frac{(\rho^- + \rho^+)\Delta x^3}{2\pi\sigma}},
\]
and, for the oscillating wave, the time-averaged relative amplitude error
\[
\Bar{\epsilon}_{a,rel} = \frac{\Delta t}{\tau}
\sum_i \frac{|a_{i,\text{num}} - a_{i,\text{ref}}|}{a_0}.
\]

The **3D oscillating droplet** benchmark uses the analytical eigenmode solution
\[
a(t) = R + \left(a_0-R\right) \exp\!{\left(-\frac{(n-1)(2n+1)\nu}{R^2}t\right)}
\cos(\omega_n t) \quad \text{for } n=2,
\]
with
\[
\omega_n^2 =\frac{n(n+1)(n-1)(n+2)\sigma}{\left((n+1)\rho^- + n \rho^+\right)R_0^3}.
\]

The benchmark structure therefore separates transport error from capillary-force error while preserving a common physical formulation. A plausible implication is that it can diagnose whether a method fails primarily in interface advection, in curvature estimation, or in pressure–surface-tension balance.

## 4. Compared solvers and main technical findings

FoamBench in the two-phase-flow sense compares **six VoF implementations**: **OpenFOAM interFoam**, **OpenFOAM interIsoFoam**, **TwoPhaseFlow interFlow**, **Ansys Fluent**, and **Basilisk**, with TwoPhaseFlow reported with both **parabolic-fit curvature** and an **RDF-based curvature** variant [2212.02904]. The comparison intentionally uses **recommended default settings** and avoids case-specific tuning, so the results reflect typical out-of-the-box behavior rather than solver-specific hand optimization [2212.02904].

Across the convection tests, the paper reports that the **geometric methods** generally outperform the **algebraic method interFoam**, and that **Basilisk** and **interIsoFoam** typically produce the smallest shape error [2212.02904]. In the diagonal-flow and vortex cases, interFoam shows substantially larger deformation errors, which can become severe enough to compromise the physical fidelity of subsequent surface-tension calculations [2212.02904].

For the hydrodynamic cases, the benchmark identifies **surface tension modeling as the main bottleneck**, especially for unstructured VoF methods in OpenFOAM and Fluent [2212.02904]. Basilisk, using **height-function curvature** on Cartesian grids, generally performs best in 2D, although the advantage is less consistent in 3D and depends on the fluid pairing [2212.02904]. The **RDF/parabolic-fit** approaches in TwoPhaseFlow can perform very well in some settings, and the paper notes that **interFlow with RDF** often yields among the smallest parasitic currents in stationary-droplet tests [2212.02904].

An important conclusion is that **no method is uniformly best across all cases, resolutions, and fluid combinations** [2212.02904]. Another is that **higher resolution does not always reduce measured error** in hydrodynamic cases, because finer meshes can localize curvature errors and increase local velocity extrema [2212.02904]. This observation is significant because it complicates naive convergence narratives: in capillary-dominated flow, error behavior is strongly entangled with curvature reconstruction and discrete force balance.

The oscillating-wave and oscillating-droplet tests also reveal that **initialization quality matters a great deal** [2212.02904]. Fluent is specifically noted to use a comparatively rough "inside-out" initialization followed by smoothing, which can perturb early-time damping and frequency measurements [2212.02904]. The paper additionally notes that boundary conditions for \(\alpha\) can materially affect results; for the oscillating wave, a TwoPhaseFlow-specific `constantAlphaContactAngle` boundary condition at \(90^\circ\) improved results relative to a standard zero-gradient treatment [2212.02904].

## 5. Reproducibility, public artifacts, and methodological role

A defining feature of FoamBench is its packaging as a **public, reusable benchmark package** [2212.02904]. The benchmark inputs, secondary data, and post-processing notebooks are openly available via a **TUDatalib data repository snapshot** and a **Bosch Research GitHub repository** [2212.02904]. The use of **Jupyter notebooks** is central: the notebooks automate post-processing, produce benchmark plots and metrics, and make it straightforward to rerun the analysis on new solver outputs [2212.02904].

This infrastructure gives FoamBench a methodological role beyond its original paper. Because other VoF implementations can submit results in the same format and compare against existing outputs with minimal additional work, FoamBench functions as a standardization layer for capillary-flow benchmarking [2212.02904]. It is intended for researchers and developers working on **VoF-based one-fluid discretizations for incompressible two-phase flows**, especially those involving **surface tension, capillary waves, droplet dynamics, and parasitic currents** [2212.02904].

This suggests that FoamBench is best understood not only as a set of canonical cases but as a reproducibility protocol: common initial conditions, common meshes, common post-processing, and common error definitions are all part of the benchmark object.

## 6. Reuse of the name in LLM-for-CFD benchmarking

A distinct benchmark called FoamBench appears in the 2025 CFDLLMBench paper [2509.20374]. There, FoamBench is defined as the **OpenFOAM-centric component** of a broader benchmark suite comprising **CFDQuery**, **CFDCodeBench**, and **FoamBench** [2509.20374]. Its purpose is to evaluate whether a model can generate complete OpenFOAM case setups that execute successfully and yield physically accurate results, rather than merely producing syntactically plausible files [2509.20374].

This FoamBench is split into **FoamBench Basic** and **FoamBench Advanced**. FoamBench Basic contains **110 cases derived from 11 OpenFOAM tutorial problems**, while FoamBench Advanced contains **16 hand-crafted cases created by CFD experts** that are not tutorial variants and require more extrapolation [2509.20374]. The benchmark is described as covering **more than 15 geometric and physics scenarios across 126 total OpenFOAM cases** [2509.20374].

Its evaluation protocol defines four component metrics: executability \(M_{\mathrm{exec}}\), folder-and-file structure \(M_{\mathrm{struct}}\), file similarity \(M_{\mathrm{file}}\), and relative error \(M_{\mathrm{NMSE}}\), where
\[
\mathrm{NMSE}\% = \frac{\sum_{i=1}^N (y_i - \hat{y}_i)^2}{\sum_{i=1}^N y_i^2} \times 100.
\]
The NMSE score is then mapped by
\[
M_{\mathrm{NMSE}} =
\begin{cases}
1,   & \mathrm{NMSE}\le10\%\,,\\
0.5, & 10\%<\mathrm{NMSE}\le30\%\,,\\
0,   & \mathrm{NMSE}>30\%\,.
\end{cases}
\]
The benchmark’s strict **Success Rate** counts only cases where both execution and physical accuracy succeed, that is, where \(M_{\mathrm{exec}}=1\) and \(M_{\mathrm{NMSE}}=1\) [2509.20374].

The reported results show a large separation between superficial text similarity and operational success. In zero-shot prompting, the best model on FoamBench Basic achieves a **Success Rate of 0.045**, and on FoamBench Advanced the best zero-shot success is **0.007** [2509.20374]. The best-performing configuration uses **Foam-Agent with RAG and Reviewer** and **Sonnet 3.5**, reaching **0.336** on Basic and **0.250** on Advanced [2509.20374]. The benchmark also catalogues recurring failure modes: inconsistent patch definitions, missing files such as `blockMeshDict` or `controlDict`, undefined solver-specific keywords, numerical instability, and geometry or mesh errors [2509.20374].

The 2026 paper "A Preliminary Assessment of Coding Agents for CFD Workflows" narrows the focus to **FoamBench-Advanced** and uses it to evaluate tool-using coding agents on OpenFOAM workflows [2602.11689]. It states that FoamBench-Advanced contains **16 expert-authored, non-tutorial cases**, grouped in that paper into **nine tutorial-derivative tasks** and **seven planar 2D obstacle-flow tasks** [2602.11689]. In tutorial-derivative tasks, an OpenFOAM-focused prompt raises completion from **4/9** to **9/9**, with average \(M_{\text{struct}} = 0.986\) and \(M_{\text{file}} = 0.919\), and **7/9** cases achieving \(NMSE < 0.1\) [2602.11689]. For the harder obstacle-flow tasks, the paper reports that stronger models such as **GPT-5.2** markedly improve geometry and mesh generation relative to weaker models [2602.11689].

The later CFDLLMBench usage thus redefines FoamBench as a benchmark of **workflow synthesis and execution in OpenFOAM**, rather than a benchmark of **VoF two-phase physics**. The shared name should not obscure that distinction.

## 7. Conceptual significance and common misconceptions

A common misconception is that FoamBench denotes a single universally recognized benchmark. The published record instead supports two benchmark lineages. The earlier FoamBench is a **VoF benchmark for incompressible two-phase flow with surface tension** [2212.02904]. The later FoamBench is an **OpenFOAM case-generation benchmark inside CFDLLMBench** [2509.20374; 2602.11689]. These lineages differ in governing equations, task formulation, metrics, and intended users.

Another misconception is that the two-phase-flow FoamBench is primarily about runtime or parallel efficiency. The paper does not frame it that way. Its central concerns are **interface transport accuracy**, **curvature and surface-tension fidelity**, **parasitic currents**, and agreement with analytical or reference solutions [2212.02904]. Conversely, the CFDLLMBench FoamBench is not a physical solver benchmark in the traditional numerical-analysis sense; it is a benchmark of whether a model can assemble the file structure, dictionaries, geometry, and numerical settings needed for a valid OpenFOAM run [2509.20374].

The coexistence of these meanings is also relevant to interpretation of adjacent literature. The 2025 robotics paper "Foam: A Tool for Spherical Approximation of Robot Geometry" explicitly notes that it **does not define anything called “FoamBench”** and that any benchmark-like interpretation would have to be inferred from its experimental evaluation rather than from a formal benchmark artifact [2503.13704]. This clarifies that the term is not a generic label for any evaluation involving "foam" software.

Taken together, the literature suggests two durable uses of the name. In numerical multiphase flow, FoamBench designates a reproducible framework for comparing **VoF methods under capillary-dominated conditions** [2212.02904]. In LLM-for-CFD research, it designates a practical benchmark for **end-to-end OpenFOAM workflow automation** [2509.20374; 2602.11689].

Source: https://www.emergentmind.com/topics/foambench