name: openfoam-agent
description: OpenFOAM CFD workflow playbook for AI coding assistants. Use to plan and implement OpenFOAM cases, choose solvers, generate/validate meshes, run/debug simulations, and standardize post-processing.
argument-hint: "[task] [case_path(optional)]"
license: Complete terms in LICENSE.txt
OpenFOAM Agent Skill
This skill is an AI-facing OpenFOAM manual.
When invoked, follow the workflow below.
0) First clarify (don’t guess)
Ask for the minimum set of facts required to avoid non-physical or unstable setups:
- Physics: incompressible/compressible, single/multiphase, heat transfer/CHT, reacting?
- Regime: laminar/RANS/LES, steady/transient
- Geometry & scale: key dimensions, 2D vs 3D assumption
- Fluid properties: ρ, ν (or μ), cp, k, etc.
- Boundary conditions: inlets/outlets/walls/symmetry, turbulence quantities if RANS
- Outputs: forces, pressure drop, temperature, y+, probes
- Resources: target runtime, cores, memory
If any item is unknown, propose 1-3 concrete options and request confirmation.
1) Use standard case structure
Enforce the canonical OpenFOAM layout:
0/: initial conditions and boundary fields
constant/: mesh and physical properties
system/: numerics and runtime controls
Allrun / Allclean: reproducible run scripts (recommended)
Detailed reference: reference/case_layout.md
Boundary condition baselines: reference/boundary_conditions.md
2) Mesh workflow (always validate)
- Pick the path:
blockMesh (structured / simple)
snappyHexMesh (STL-based)
gmshToFoam (Gmsh .msh)
- Always run
checkMesh and address quality issues before solver runs.
- Ensure boundary patch names match what
0/ expects.
Detailed reference: reference/meshing.md
3) Solver & turbulence selection (engineering defaults)
- Prefer the simplest solver that matches physics.
- For RANS, default to k-omega SST unless there’s a reason not to.
- Target version is ESI/OpenCFD OpenFOAM v2412. Ensure run commands match the installed environment.
Detailed reference: reference/solver_selection.md
Numerics templates: reference/fv_solution_patterns.md
4) Run, monitor, and iterate
- Start with conservative numerics (time step / relaxation) and then tighten.
- Track:
- residual trends
- continuity errors
- CFL / Co number (transient)
- forces / Δp stabilization
- Prefer small, explainable changes per iteration.
Debug playbook: reference/troubleshooting.md
Parallel workflow: reference/parallel_run.md
5) Post-processing as first-class output
- Use
functionObjects / postProcess for repeatable outputs.
- Output concise, decision-oriented summaries (e.g., drag coefficient, Δp, max T, y+ stats).
Cheatsheet: reference/command_cheatsheet.md
6) Repository-local helper scripts
scripts/case_audit.py: static audit of a case directory (structure + presence of key dictionaries)
scripts/skill_quality_check.py: validate skill docs (broken links + length limits)
Additional resources
- reference/windows_wsl.md
- reference/version_notes_v2412.md
- reference/dictionary_syntax.md
- reference/solver_log_reading.md
- reference/openfoam_cpp_dev.md
- reference/boundary_conditions.md
- reference/fv_solution_patterns.md
- reference/parallel_run.md
- reference/quality_and_maintenance.md
1---2name: openfoam-agent3description: ---4---56---7name: openfoam-agent8description: OpenFOAM CFD workflow playbook for AI coding assistants. Use to plan and implement OpenFOAM cases, choose solvers, generate/validate meshes, run/debug simulations, and standardize post-processing.9argument-hint: "[task] [case_path(optional)]"10license: Complete terms in LICENSE.txt11---1213# OpenFOAM Agent Skill1415This skill is an AI-facing OpenFOAM manual.1617When invoked, follow the workflow below.1819## 0) First clarify (don’t guess)2021Ask for the minimum set of facts required to avoid non-physical or unstable setups:2223- Physics: incompressible/compressible, single/multiphase, heat transfer/CHT, reacting?24- Regime: laminar/RANS/LES, steady/transient25- Geometry & scale: key dimensions, 2D vs 3D assumption26- Fluid properties: ρ, ν (or μ), cp, k, etc.27- Boundary conditions: inlets/outlets/walls/symmetry, turbulence quantities if RANS28- Outputs: forces, pressure drop, temperature, y+, probes29- Resources: target runtime, cores, memory3031If any item is unknown, propose 1-3 concrete options and request confirmation.3233## 1) Use standard case structure3435Enforce the canonical OpenFOAM layout:3637- `0/`: initial conditions and boundary fields38- `constant/`: mesh and physical properties39- `system/`: numerics and runtime controls40- `Allrun` / `Allclean`: reproducible run scripts (recommended)4142Detailed reference: [reference/case_layout.md](reference/case_layout.md)4344Boundary condition baselines: [reference/boundary_conditions.md](reference/boundary_conditions.md)4546## 2) Mesh workflow (always validate)4748- Pick the path:49 - `blockMesh` (structured / simple)50 - `snappyHexMesh` (STL-based)51 - `gmshToFoam` (Gmsh `.msh`)52- Always run `checkMesh` and address quality issues before solver runs.53- Ensure boundary patch names match what `0/` expects.5455Detailed reference: [reference/meshing.md](reference/meshing.md)5657## 3) Solver & turbulence selection (engineering defaults)5859- Prefer the simplest solver that matches physics.60- For RANS, default to k-omega SST unless there’s a reason not to.61- Target version is ESI/OpenCFD OpenFOAM v2412. Ensure run commands match the installed environment.6263Detailed reference: [reference/solver_selection.md](reference/solver_selection.md)6465Numerics templates: [reference/fv_solution_patterns.md](reference/fv_solution_patterns.md)6667## 4) Run, monitor, and iterate6869- Start with conservative numerics (time step / relaxation) and then tighten.70- Track:71 - residual trends72 - continuity errors73 - CFL / Co number (transient)74 - forces / Δp stabilization75- Prefer small, explainable changes per iteration.7677Debug playbook: [reference/troubleshooting.md](reference/troubleshooting.md)7879Parallel workflow: [reference/parallel_run.md](reference/parallel_run.md)8081## 5) Post-processing as first-class output8283- Use `functionObjects` / `postProcess` for repeatable outputs.84- Output concise, decision-oriented summaries (e.g., drag coefficient, Δp, max T, y+ stats).8586Cheatsheet: [reference/command_cheatsheet.md](reference/command_cheatsheet.md)8788## 6) Repository-local helper scripts8990- `scripts/case_audit.py`: static audit of a case directory (structure + presence of key dictionaries)91- `scripts/skill_quality_check.py`: validate skill docs (broken links + length limits)9293## Additional resources9495- [reference/windows_wsl.md](reference/windows_wsl.md)96- [reference/version_notes_v2412.md](reference/version_notes_v2412.md)97- [reference/dictionary_syntax.md](reference/dictionary_syntax.md)98- [reference/solver_log_reading.md](reference/solver_log_reading.md)99- [reference/openfoam_cpp_dev.md](reference/openfoam_cpp_dev.md)100- [reference/boundary_conditions.md](reference/boundary_conditions.md)101- [reference/fv_solution_patterns.md](reference/fv_solution_patterns.md)102- [reference/parallel_run.md](reference/parallel_run.md)103- [reference/quality_and_maintenance.md](reference/quality_and_maintenance.md)