OpenFOAM

Open source computational fluid dynamics (CFD) software

OpenFOAM (Open Field Operation and Manipulation) is a free, open-source CFD package with solvers and utilities for fluid flow, turbulence, heat transfer, and reacting flows, backed by remote compute. This image bundles OpenFOAM 10 (with ParaView); the container stays up so you can run mesh, solver, and post-processing commands against cases mounted at /data.

Configuration

name: openfoam
tags:
    - simulation
steps:
    - name: app
      platform: docker
      mode: parallel
      image: ghcr.io/dxflow-ai/openfoam:latest
      command:
          - tail
          - -f
          - /dev/null
      volumes:
          - name: volume
            host: ./volume
            container: /data
      resources:
          cpu: "16"
          memory: 32G
[volume]
app.volume = ./volume

[resource]
app.cpu = 16
app.memory = 32G
{
    "arch": ["amd64"],
    "image": "ghcr.io/dxflow-ai/openfoam:latest",
    "version": "10",
    "minimum": {
        "cpu": 8,
        "memory": "16G",
        "storage": "50G"
    }
}

Usage

1. Deploy

dxflow workflow create --identity openfoam openfoam.yml
dxflow workflow start openfoam

The container stays up so you can run OpenFOAM commands against data mounted at /data.

2. Run a case

The commands below run inside the workflow container.

# Copy a tutorial case into the mounted volume
cp -r $FOAM_TUTORIALS/incompressible/icoFoam/cavity/cavity /data/cavity
cd /data/cavity

# Mesh, solve, post-process
blockMesh
icoFoam
postProcess -func 'writeCellCentres'

3. Run in parallel

decomposePar
mpirun -np 16 simpleFoam -parallel
reconstructPar

4. Retrieve results

Everything under /data persists — meshes, time directories, and logs are written there. Visualize with the ParaView image.

Common solvers

SolverApplicationType
icoFoamLaminar incompressibleTransient
simpleFoamTurbulent incompressibleSteady-state
pimpleFoamTurbulent incompressibleTransient
interFoamTwo-phase flow (VOF)Transient
rhoSimpleFoamCompressible turbulentSteady-state

Case structure

myCase/
├── 0/          # Initial and boundary conditions (U, p, T, …)
├── constant/   # Mesh (polyMesh/) and physical properties
└── system/     # controlDict, fvSchemes, fvSolution

Notes

  • The OpenFOAM environment is sourced automatically, so blockMesh, icoFoam, snappyHexMesh, etc. are on PATH.
  • For parallel runs, decomposePar splits the case, mpirun -np N <solver> -parallel runs it, and reconstructPar merges the result.

References