OpenFOAM
New1. Overview
OpenFOAM is rarely the headline of a physics-AI project, yet it usually decides whether the project is credible. It generates the training corpus, supplies the reference field against which surrogate error is measured, and provides the denominator in any claim that a learned model is cheaper than a solve. This guide is written for three readers: an algorithm engineer who must produce reproducible CFD data for a neural operator or a physics-informed network; a CAE lead who has to decide whether replacing a solver with a surrogate actually pays off; and a developer connecting OpenFOAM to a data pipeline for the first time.
After reading it you should be able to answer four questions. What quantities determine the true cost of one solve, beyond the wall-clock number printed at the end of a log? Which files in a case directory must be published together with a dataset so that another team can regenerate it? How should the same physical problem be compared across solvers without quietly changing the discretisation, the tolerance or the hardware? And under which conditions should a surrogate be abandoned in favour of the discrete solve? Those questions are the practical content of the cost boundary guide, the PINN landscape guide and the neural operator selection guide; this entry supplies the solver-side detail they deliberately leave out.
The scope is deliberately narrow. Source-level extension of OpenFOAM, derivation of turbulence closures, and industry-specific certification workflows are not covered; each has its own literature and, in many organisations, its own internal rules. Nor is OpenFOAM presented as the only viable CFD solver. Commercial codes and differentiable solvers appear only where their interfaces and data conventions clarify a comparison. Any procurement conclusion would require local benchmarks and licence review, and is explicitly outside this guide. All version and release statements were checked against the two upstream projects on 9 November 2026 and are dated in Section 9.
2. How It Works
OpenFOAM implements the finite volume method on unstructured polyhedral meshes. The governing equations are integrated over each control volume, volume integrals are converted to surface fluxes by Gauss theorem, and the resulting algebraic system is assembled from face interpolation schemes and boundary conditions. A case is therefore not a script but a declarative description of a discretisation: the mesh, the initial and boundary fields, the equation set, the interpolation and gradient schemes, the linear solver tolerances, and the time control. The system directory holds controlDict, fvSchemes, fvSolution and, for parallel runs, decomposeParDict; the constant directory holds physical properties and turbulence model coefficients; time directories such as 0 hold the fields.
The solver family encodes the algorithmic choice. simpleFoam applies SIMPLE iteration to steady incompressible RANS problems. pimpleFoam merges PISO and SIMPLE pressure correction for transient cases with larger Courant numbers. icoFoam is the laminar transient PISO solver often used as a teaching baseline. interFoam adds a volume-of-fluid interface capture for two-phase flows. In the Foundation v12 line, modular solvers allow source terms for one variable to be declared inside the equation of another, and non-conformal coupling simplifies multi-region simulations where meshes do not match at an interface. Those two changes matter more to data generation than they first appear: both reduce the amount of bespoke case preparation needed per geometry.
Function objects are the mechanism that turns a solve into a dataset. They sample probes, surfaces and volume fields at controlled intervals, compute derived quantities such as wall shear or vorticity, and write results without modifying the solver binary. In the Foundation v12 line the function-object configuration moved into system/functions, which makes the sampling definition part of the same version-controlled case description as the discretisation. For machine-learning corpora this is the critical property: the mapping from a physical configuration to an output tensor must be recoverable from the case directory alone. Utilities such as foamToVTK and postProcess then convert time directories into arrays. A dataset that ships only the resulting arrays, without the scheme and tolerance dictionaries, cannot be independently regenerated and cannot support a mesh-convergence claim.
3. Scope and Assumptions
The finite volume formulation assumes a valid mesh with acceptable non-orthogonality, skewness and aspect ratios. checkMesh reports these diagnostics, and its warnings should be part of the dataset metadata rather than discarded. Boundary conditions must be physically consistent with the equations being solved; a fixed-value inlet, a zero-gradient outlet and a wall function are not interchangeable decorations. Turbulence closure is a modelling assumption with a validity range, and RANS results averaged over a statistically steady state are a different quantity from an instantaneous DNS field. Treating them as interchangeable labels is a common source of silent errors in surrogate training.
There are also two distinct OpenFOAM distributions, which is an assumption that must be declared. The OpenFOAM Foundation line at openfoam.org uses integer major versions; its current release is v14 (released 14 July 2026, with patch releases up to 25 July 2026), while version 12 (released 9 July 2024) added modular solvers, non-conformal coupling, improved particle tracking, load balancing, units in input dictionaries and the system/functions convention. The OpenCFD line at openfoam.com, now part of Keysight, uses year-month versions and releases twice a year in June and December; its news page lists v2506 on 30 June 2025, v2512 on 22 December 2025 and v2606 on 26 June 2026, and records a move of its repositories to gitlab.com/openfoam on 4 November 2025. Dictionary syntax and solver names differ enough between the lines that a case built for one should not be assumed to run unchanged on the other. Every dataset should record the exact distribution, version and compiler.
Licensing is GPL, so redistribution of modified solver binaries carries obligations. Publishing a case directory and the fields generated by a run is a separate matter from shipping a modified executable, but organisations should have their own review before large-scale redistribution. Platform assumptions are equally concrete: native Linux is the primary environment, while Windows and macOS are supported through WSL and Canonical Multipass in the Foundation documentation. Container images are convenient for reproducible pipelines, but the image digest belongs in the metadata alongside the version string. These constraints are uninteresting until a colleague tries to reproduce a published corpus and obtains a different field.
4. Getting Started
A minimal reproducible path is short enough to serve as a data-generation smoke test. Source the environment, copy a tutorial case, generate the mesh with blockMesh, check it with checkMesh, optionally initialise the flow with potentialFoam -writephi, then run the solver with output redirected to a log. foamLog extracts residual histories from that log, and -postProcess -func evaluates function objects against saved time directories. For complex geometry the sequence extends to surfaceFeatureExtract, a background blockMesh grid, then snappyHexMesh, with checkMesh repeated afterwards because castellated and snapped meshes commonly introduce non-orthogonality.
Parallel runs are the normal case for corpus generation. decomposePar splits the mesh and fields according to decomposeParDict; mpirun -np N solver -parallel runs the solve; reconstructPar reassembles the field. numberOfSubdomains must match the process count, and the decomposition method should be chosen for the mesh: Scotch or Metis minimise inter-processor faces on complex geometries, while simple geometric splitting is adequate only for regular block-structured meshes. Repeating a case with a different decomposition is a useful numerical sanity check, because a physically identical field should not depend on how the domain was partitioned. Partition-dependent differences usually indicate an under-converged linear solve or an unstable scheme.
The most common beginner failures are mundane. A missing or misspelled boundary patch name produces an immediate error, but a wrong fvSchemes entry can produce a plausible-looking field that is not converged. A controlDict with an overly large time step can remain stable while quietly changing the transient that a surrogate is meant to learn. Function objects configured to write at every time step can produce far more data than the mesh itself. Before generating thousands of runs, fix the sampling interval, verify that residual targets are reached, confirm the field is mesh-converged for the quantity of interest, and record the command sequence in a script. The fluid simulation toolkit and numerics and solvers collections collect the surrounding tooling, while PDEBench is a useful reference for how a benchmark declares its protocol.
5. Comparison with Alternatives
Four comparison axes keep the discussion honest: governing equations and discretisation, geometry handling, differentiability, and total cost of a corpus. SU2 is oriented toward compressible aerodynamics and adjoint-based shape optimisation, with a strong gradient story for design problems; OpenFOAM has a broader multiphysics solver family and a larger stock of industrial case setups. FEniCS discretises variational forms with finite elements, which makes weak-form residuals and adjoint derivations natural; OpenFOAM's finite volume formulation is dominant where conservative fluxes across cell faces are the primary concern. The two answer different mathematical questions, and a comparison should state which one the dataset is built around.
JAX-CFD and PhiFlow are differentiable fluid solvers: their value is a gradient through the simulation, useful for solver-in-the-loop training and inverse problems, not industrial-grade generality across turbulence models and complex meshes. NeuralOperator is not a solver at all but a library for learning the map from coefficients or forcing to a solution field; it needs a corpus produced by something like OpenFOAM. PhysicsNeMo occupies the physics-informed training side and can impose residual penalties without a labelled field. Commercial CFD packages offer validated workflows and support contracts; their licence cost and scripting interfaces change the corpus economics but not the discretisation question.
A comparison table that lists only inference time is therefore misleading. If the deliverable is a single high-accuracy solve, the learned surrogate pays an up-front corpus and training cost that may never be recovered. If the deliverable is a design sweep with tens of thousands of queries inside a narrow parameter range, the amortisation can work. The cost boundary guide gives the break-even formula and the four ledgers that must be counted. What OpenFOAM uniquely contributes to that calculation is a well-defined, auditable unit cost: one case, one mesh, one tolerance, one hardware allocation, one wall-clock measurement.
6. Benchmarks and Evidence
No single published speed-up number should be transplanted into a local decision. Benchmarks in this space differ in mesh size, cell type, Reynolds number, turbulence model, linear solver tolerance, time-step count, hardware and whether the reported clock includes meshing, I/O and post-processing. A claim that a surrogate is a thousand times faster than CFD is often a comparison between a GPU forward pass and a full transient solve that also generated the corpus. Those are different clocks. The cost boundary guide separates them explicitly; this section describes how to produce a number that survives review.
A defensible protocol has five parts. First, fix the quantity of interest, for example lift coefficient, peak temperature or a volume-averaged flux, and state its units. Second, perform a mesh-convergence study with at least three resolutions and report the value on each, because a surrogate trained on an under-resolved field can appear accurate while learning discretisation error. Third, run every baseline to the same residual and time-step tolerance on identical hardware, recording core-hours as well as wall-clock time. Fourth, report the corpus size used to train the surrogate and the cost of generating it. Fifth, evaluate error in physical units and in a field norm, not only as a relative L2 number that can hide a small but safety-critical peak. PDEBench and The Well are useful references for protocol design and multiple-geometry evaluation, although their datasets are not OpenFOAM-only and their numbers should not be quoted as an OpenFOAM baseline.
Public evidence about OpenFOAM itself is mostly qualitative and version-specific. The Foundation documents v12 highlights including modular solvers, non-conformal coupling, improved load balancing and units in input dictionaries. The OpenCFD project documents a twice-yearly release cadence and a test battery covering regression, memory, performance and scalability. Those statements describe capability and process, not a measured speed-up for a given case. Accordingly, this guide reports no universal multiplier. Any figure used in a proposal must come from a local run whose case directory and log are archived with the report, with the measurement date and version string attached. That is also the convention used by the openfoam multiphysics case and the aerospace CFD case on this site.
7. Role in Physics-AI Workflows
In a physics-AI pipeline, OpenFOAM has three distinct jobs. It is a data generator: a parameter sweep over geometry, inlet conditions or material properties produces paired input and output fields. It is a verification baseline: a surrogate prediction for a held-out configuration is compared against a fresh solve on the same mesh. And it is a fallback in hybrid deployment: when an error estimator or a conservative guard flags a query as out of distribution, the query is routed back to the solver. Treating these as one role leads to weak datasets, because each asks for different sampling and tolerances.
For data generation, the design of experiments matters more than the raw count of runs. Sampling only near a nominal operating point gives a model that interpolates well and fails at the boundary of the design space. A useful corpus records the parameter vector, the mesh identifier, the solver and scheme dictionaries, the convergence history, and the field arrays in a documented layout. Function objects should write the same set of quantities for every case, including any derived quantity used in the loss. Where a neural operator will be trained, the grid convention must be fixed: a Fourier-based model expects regular sampling, while a finite-volume field on an unstructured polyhedral mesh needs interpolation to a regular lattice, and that interpolation is itself a modelling decision with an error budget.
For verification, the reference solve must be independent of the training corpus in a strict sense: a fresh parameter draw, a mesh-refinement check, and a tolerance at least as tight as the accuracy being claimed. For hybrid deployment, the routing rule needs a measurable trigger, such as an error surrogate, a conservation residual or a distance in the input-parameter space. The site's classical solver cost guide describes warm starts, Krylov iterations and deferral rates; the PINN landscape guide covers residual-based training that can be checked against a solver field. In all three roles, the case directory is the unit of provenance. Losing it turns a reproducible scientific dataset into an untraceable pile of arrays.
8. Limitations and Failure Modes
OpenFOAM is not the right tool for every data problem. Mesh generation on complex geometries remains the largest human cost, and snappyHexMesh can produce cells that fail quality checks near small features. If the geometry changes for every query, the per-case meshing time dominates and the amortisation argument for a surrogate changes shape. Multiphase, reacting and moving-boundary cases add modelling choices that are difficult to freeze across a corpus. A dataset assembled from cases with different turbulence closures or wall treatments is not one dataset, and a model trained on it will learn an average of inconsistent physics.
Numerical failure is often quiet. An under-converged linear solve, an inappropriate divergence scheme or an excessive time step can yield a smooth field that satisfies the eye and fails a conservation check. Time-step and mesh sensitivity should be measured on the quantity of interest, not judged from a residual plot alone. Version drift is another real risk: a case that ran on one distribution may produce slightly different fields on another, and a corpus assembled over months can silently mix them. The two release lines described in Section 3 make this more likely, not less. Container digests, version strings and a frozen case template are the mitigation.
There are also boundaries around the learned model that have nothing to do with the solver. A surrogate trained on steady RANS fields will not extrapolate to a transient vortex-shedding regime, and no amount of extra training on the same distribution fixes that. Conservation of mass, momentum and energy is not guaranteed by a data-driven loss, so a field that looks plausible can violate integral balances. When the deliverable must be certified, defended to a customer, or used as a safety envelope, a fresh solver run with documented verification remains the reference. The neural operator selection guide catalogues these out-of-distribution failure modes, and the physics-AI learning path places them in a broader sequence. If a project needs gradients through the simulation rather than a corpus, a differentiable solver such as JAX-CFD is a different tool with a different contract.
9. Version and Source Notes
Several public statements about OpenFOAM conflict because they refer to different release lines. Record 1: the OpenFOAM Foundation at openfoam.org publishes integer major versions; its current release is v14 (released 14 July 2026, with patch releases up to 25 July 2026), v13 was released on 8 July 2025 with patch releases up to 11 September 2025, and v12 on 9 July 2024 with patch releases up to 28 July 2024. The version 12 page lists modular solvers, non-conformal coupling, improved particle tracking, parallel load balancing, units in input dictionaries and the move of function-object configuration into system/functions; v13 rewrites mesh zones and introduces a field-based Lagrangian module that is 65% complete, and v14 adds field functions, units as a standard feature and the new XiFluid combustion solver. Record 2: OpenCFD at openfoam.com, a Keysight subsidiary, uses year-month versions and states a June/December release cadence; its news list shows v2506 on 30 June 2025, v2512 on 22 December 2025 and v2606 on 26 June 2026, and notes that repositories moved to gitlab.com/openfoam on 4 November 2025. These are not contradictory claims about one product; they are two distribution lines with a shared origin before 2014. Any version statement in a report should name the line.
Record 3 concerns licence and platform. The upstream material describes GPL distribution and native Linux as the primary environment, with Windows and macOS reached through WSL and Multipass. Some secondary tutorials describe Docker images or system packages without naming the distribution line. Record 4 concerns the year field on a resource entry: a year attached to a catalogue record is a cataloguing convenience, not a software version, and must not be quoted as a release date. Record 5 concerns performance: vendor and community pages describe capability and QA processes, while independent benchmarks report case-specific numbers. Capability claims and measured timings are different evidence classes and should be labelled as such.
All records above were checked on 16 November 2026 against the two upstream sites, the v12, v13 and v14 release notes, the OpenCFD news and user-guide pages, the library documentation for NeuralOperator, and the arXiv record for the battery thermal case. Where a source is a project's own documentation, this guide labels it as such rather than presenting it as independent validation. The site guide on cost accounting applies the same rule to every quoted number. When upstream statements change, the version string and the check date in this section should be updated together with any derived dataset metadata.
10. References
- OpenFOAM Foundation, "OpenFOAM v12, v13 and v14 release notes and patch releases", openfoam.org/version/12, /13 and /14 (accessed 16 November 2026).
- OpenFOAM Foundation, "Download OpenFOAM v14: installation on Linux, WSL and Multipass", openfoam.org/download (accessed 16 November 2026).
- OpenCFD / Keysight, "OpenFOAM release news: v2506, v2512, v2606 and repository move", openfoam.com (accessed 16 November 2026).
- OpenCFD / Keysight, "User Guide 3.2: Running applications in parallel, decomposeParDict", openfoam.com/documentation (accessed 9 November 2026).
- OpenCFD / Keysight, "v2506 usability notes: patch groups, foamConfigurePaths, function objects", openfoam.com (accessed 9 November 2026).
- Takamoto M. et al., "PDEBench: An Extensive Benchmark for Scientific Machine Learning", NeurIPS 2022 Datasets and Benchmarks Track.
- The Well project, "A Large-Scale Collection of Diverse Physics Simulations for Machine Learning", referenced on this site as the-well-paper (2024).
- Li Z. et al., "Fourier Neural Operator for Parametric Partial Differential Equations", ICLR 2021, arXiv:2010.08895.
- Kovachki N. et al., "Neural Operator: Learning Maps Between Function Spaces", JMLR 24(1):89 (2023), arXiv:2108.08481.
- DClaw Research, "The Cost Boundary of Classical Solvers: When Physics-AI Surrogates Actually Pay Off in 2026", site guide (9 November 2026).