An AI agent skill for running OpenFOAM CFD simulations, adapted for macOS and Linux cross-platform support.
This is NOT an original work. This skill is based on ConMoo/ChatCFD by @ConMoo. The contribution here is macOS native OpenFOAM adaptation (via openfoam-app) and packaging as an installable agent skill.
- Converts meshes (Fluent
.mshorpolyMesh) into OpenFOAM format - Extracts boundary names and types
- Looks up required files for a given solver + turbulence model
- Sets CFL / time controls in
controlDict - Runs OpenFOAM solvers and captures logs
- Analyzes solver errors with rule-based pattern matching
- Prepares LLM-assisted correction tasks
- macOS native OpenFOAM support via the
openfoam2406Homebrew wrapper - Auto-detection cascade:
OPENFOAM_PATHenv var > macOSopenfoam2406wrapper > Linux default path - Portable bash resolution (
shutil.which) in Python python3instead ofpythonin all scripts- Packaged as an agent skill installable via
npx skills add
npx skills add CHOSENX-GPU/chatcfd-skillThis installs the skill into your agent's skill directory (e.g. ~/.agents/skills/chatcfd/, ~/.claude/skills/chatcfd/, etc.).
Clone into your agent's skill directory:
# For Cursor
git clone https://github.com/CHOSENX-GPU/chatcfd-skill.git ~/.agents/skills/chatcfd
# For Claude Code
git clone https://github.com/CHOSENX-GPU/chatcfd-skill.git ~/.claude/skills/chatcfd
# For Codex
git clone https://github.com/CHOSENX-GPU/chatcfd-skill.git ~/.codex/skills/chatcfdmacOS (Apple Silicon):
brew install gerlero/openfoam/openfoam@2406See openfoam-app for details.
Linux (Debian/Ubuntu):
curl -s https://dl.openfoam.com/add-debian-repo.sh | sudo bash
sudo apt-get update
sudo apt-get install -y openfoam2406-default
source /usr/lib/openfoam/openfoam2406/etc/bashrcCustom install path:
export OPENFOAM_PATH=/your/openfoam/pathpip install PyFoamAfter installing the skill and OpenFOAM, verify the environment:
bash scripts/check_env.shRun a case:
bash scripts/run_cli.sh \
--case /path/to/case \
--mesh /path/to/mesh.msh \
--grid-type msh \
--turbulence-model kOmegaSSTSee SKILL.md for the full CLI reference and workflow documentation.
| Platform | OpenFOAM source | Detection method |
|---|---|---|
| macOS (Apple Silicon) | brew install gerlero/openfoam/openfoam@2406 |
openfoam2406 wrapper auto-detected |
| Linux (Debian/Ubuntu) | apt install openfoam2406-default |
Default path /usr/lib/openfoam/openfoam2406 |
| Linux (other distros) | Manual build or package | Set OPENFOAM_PATH env var |
| Custom install | Any | Set OPENFOAM_PATH env var |
chatcfd-skill/
├── SKILL.md # Agent skill definition (read by AI agents)
├── README.md # This file
├── scripts/
│ ├── check_env.sh # Environment verification
│ ├── run_cli.sh # Main CLI entry point
│ └── rerun_case.sh # Quick re-run helper
├── src/
│ ├── runner.py # Runtime orchestration
│ ├── mesh_utils.py # Mesh conversion + boundary extraction
│ ├── control_utils.py # CFL / time control setup
│ ├── case_catalog.py # Required-files lookup
│ ├── case_corrector.py # Error analysis + correction tasks
│ ├── case_summary.py # Case content dump
│ └── reflection_task.py # Reflection prompt builder
├── database_OFv24/ # OpenFOAM v2406 reference data
│ ├── OF_bc_entry.json
│ ├── OF_case_dimensions.json
│ ├── final_OF_solver_required_files.json
│ ├── final_OF_turbulence_required_files.json
│ └── processed_merged_OF_cases.json
└── error_knowledge/
└── error_patterns.json # Rule-based error patterns
- Original ChatCFD: ConMoo/ChatCFD by @ConMoo
- macOS OpenFOAM: gerlero/openfoam-app by @gerlero
- macOS adaptation & skill packaging: @CHOSENX-GPU
MIT
OPENFOAM is a registered trade mark of OpenCFD Limited, producer and distributor of the OpenFOAM software via www.openfoam.com. This project is not approved or endorsed by OpenCFD Limited.