Run OpenFOAM CFD simulations on macOS and Linux. Use when asked to run, execute, or simulate OpenFOAM cases, convert meshes, analyze solver errors, or work with CFD boundary conditions. Includes mesh conversion, CFL setup, required-files lookup, and error diagnosis.
A minimal OpenFOAM runner with mesh conversion, boundary extraction, CFL setup, and required-file lookup. Supports both macOS (via openfoam-app) and Linux natively.
All paths below are relative to the skill root directory (where this SKILL.md lives).
scripts/run_cli.shsrc/runner.pyscripts/check_env.sh
scripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST--case: OpenFOAM case directory with system/controlDict--mesh: mesh file or polyMesh directory--grid-type: msh or polyMesh--turbulence-model: used for required-files lookupconstant/polyMesh (if msh)case_run.log under the case directoryscripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST --dump-case-content /path/to/case_content.json
case_path and case_content (system/constant/0)scripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST --analyze-error-log /path/to/case_run.logscripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST --analyze-error-text "Floating point exception"missing_file and matched pattern metadatascripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST --prepare-correction /path/to/correction_task.jsonscripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST --apply-correction /path/to/corrections.json--error-text or --error-log (optional; defaults to case_run.log if present)case_files, case_files_content, reference_files, and prompt guidancecheck_env.sh will print installation instructions.The scripts auto-detect the platform and choose the right OpenFOAM loading method.
Install via Homebrew using openfoam-app:
brew install gerlero/openfoam/openfoam@2406
# Verify
openfoam2406 bash -c 'simpleFoam -help'
The openfoam2406 wrapper mounts a disk image at /Volumes/OpenFOAM-v2406 and sources the environment automatically. The ChatCFD scripts detect macOS and use this wrapper.
# Add official OpenFOAM repository
curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash
# Install
sudo apt-get update
sudo apt-get install -y openfoam2406-default
# Load environment (add to ~/.bashrc for persistence)
source /usr/lib/openfoam/openfoam2406/etc/bashrc
# Verify
simpleFoam -help
fluentMeshToFoam -help
Set the OPENFOAM_PATH environment variable to override auto-detection:
export OPENFOAM_PATH=/path/to/openfoam2406
Note: After installation, run scripts/check_env.sh to verify everything is ready.
src/runner.py
src/mesh_utils.py
msh to constant/polyMesh or copies an existing polyMesh, and parses boundary names/types.src/control_utils.py
system/controlDict values (adjustTimeStep, maxCo, deltaT, endTime, etc.).src/case_catalog.py
database_OFv24/final_OF_solver_required_files.jsondatabase_OFv24/final_OF_turbulence_required_files.jsondatabase_OFv24/OF_bc_entry.jsondatabase_OFv24/OF_case_dimensions.jsondatabase_OFv24/processed_merged_OF_cases.jsonsrc/case_summary.pysrc/case_corrector.py
system/, constant/, and 0/ (or 0.bak) and outputs JSON.--case: path to the OpenFOAM case directory--mesh: mesh file path (.msh) or a polyMesh directory--grid-type: msh (default) or polyMesh--solver: override solver (otherwise read from system/controlDict)--max-co: CFL target, default 0.6--turbulence-model: used for required file lookup--dump-case-content: write case contents to JSON--analyze-error-log: analyze a log file with rule-based patterns--analyze-error-text: analyze a raw error string--prepare-correction: write correction task JSON for the model--apply-correction: apply corrections JSON from the model--error-text: error string for correction task--error-log: error log path for correction taskcase_run.log in the case directory--dump-case-content JSON file--prepare-correction)fluentMeshToFoam in PATH (OpenFOAM env).application is set in system/controlDict.openfoam2406 command not found, run brew install gerlero/openfoam/openfoam@2406.scripts/check_env.shscripts/run_cli.sh --case /path/to/case --mesh /path/to/mesh.msh --grid-type msh --turbulence-model kOmegaSST