openfoam-analysis

End-to-end CFD analysis workflow using OpenFOAM — from problem definition through meshing, solving, and post-processing to calculation report generation. Integrates with calculation-methodology (6-phase structure) and calculation-report (YAML → HTML rendering). Use when performing CFD analyses, not just setting up cases.

5 stars

Best use case

openfoam-analysis is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

End-to-end CFD analysis workflow using OpenFOAM — from problem definition through meshing, solving, and post-processing to calculation report generation. Integrates with calculation-methodology (6-phase structure) and calculation-report (YAML → HTML rendering). Use when performing CFD analyses, not just setting up cases.

Teams using openfoam-analysis should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/analysis/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/engineering/cfd/openfoam/analysis/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/analysis/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How openfoam-analysis Compares

Feature / Agentopenfoam-analysisStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

End-to-end CFD analysis workflow using OpenFOAM — from problem definition through meshing, solving, and post-processing to calculation report generation. Integrates with calculation-methodology (6-phase structure) and calculation-report (YAML → HTML rendering). Use when performing CFD analyses, not just setting up cases.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# OpenFOAM Analysis Workflow

> Run CFD analyses end-to-end: define → mesh → solve → validate → report.
> Reference skill (`openfoam`) has dict syntax; this skill has the workflow.

## Quick Start

```bash
# 1. Define analysis in YAML
cp references/analysis-templates/current-drag.yaml my-analysis.yaml
# Edit: geometry, flow conditions, mesh parameters

# 2. Run analysis
bash scripts/openfoam-analysis/run-analysis.sh my-analysis.yaml

# 3. Generate calculation report
uv run --no-project python scripts/openfoam-analysis/generate-calc-yaml.py my-analysis.yaml
uv run --no-project python scripts/reporting/generate-calc-report.py my-analysis-calc.yaml
```

## Workflow Stages

This skill maps to the calculation-methodology 6-phase structure:

| Stage | Calc-Methodology Phase | Micro-skill | Key Output |
|-------|----------------------|-------------|------------|
| 1 | Phase 1: Problem Definition | `stage-01-problem-definition.md` | Analysis YAML with scope, objective, acceptance criteria |
| 2 | Phase 2-3: Inputs + Method | `stage-02-case-setup.md` | OpenFOAM case directory with all dicts |
| 3 | — (CFD-specific) | `stage-03-meshing.md` | Validated mesh (checkMesh PASS) |
| 4 | Phase 4: Computation | `stage-04-execution.md` | Converged solution + logs |
| 5 | Phase 5: Validation | `stage-05-post-processing.md` | Extracted results + validation checks |
| 6 | Phase 6: Reporting | `stage-06-reporting.md` | calculation-report YAML → HTML |

## Analysis Templates

Pre-configured templates in `references/analysis-templates/`:

| Template | Solver | Physics | Marine Use Case |
|----------|--------|---------|-----------------|
| `current-drag.yaml` | simpleFoam | Steady RANS k-omega SST | Drag on subsea structures |
| `wave-loading.yaml` | interFoam | VOF + waves2Foam | Wave forces on fixed platforms |
| `cavity-benchmark.yaml` | icoFoam | Laminar transient | Validation benchmark |
| `dambreak-benchmark.yaml` | interFoam | VOF laminar | Validation benchmark |

## Environment

```bash
# Source before any OpenFOAM operation (script handles this automatically)
source /usr/lib/openfoam/openfoam2312/etc/bashrc 2>/dev/null || true
```

**Key learning:** OpenFOAM bashrc has unbound variables — never use `set -u` in scripts.
Tutorials with `0.orig/` require `cp -r 0.orig 0` before running.

## Script Reference

| Script | Purpose |
|--------|---------|
| `run-analysis.sh` | Orchestrate full analysis from YAML config |
| `check-convergence.py` | Parse solver log, detect divergence, plot residuals |
| `extract-results.py` | Extract forces, pressures, free surface from results |
| `generate-calc-yaml.py` | Convert analysis results to calculation-report YAML |
| `run-openfoam-tutorials.sh` | Run benchmark tutorials for validation |

## Convergence Criteria

| Field | Target (steady) | Target (transient) | Divergence threshold |
|-------|-----------------|-------------------|---------------------|
| p | initial < 1e-4 | final < tolerance | initial > 1e+6 |
| U | initial < 1e-4 | final < tolerance | initial > 1e+6 |
| k, omega | initial < 1e-4 | final < tolerance | initial > 1e+6 |
| Continuity (local) | < 1e-4 | < 1e-4 | > 1e-1 |

## Integration with Calculation Methodology

Every CFD analysis produces a calculation YAML with these sections:

```yaml
metadata:
  title: "Current Drag on Subsea Manifold"
  standard: "DNV-RP-C205 Environmental Conditions and Environmental Loads"

inputs:
  - {name: "Current velocity", symbol: "U_c", value: 1.2, unit: "m/s", source: "Metocean report"}
  - {name: "Water depth", symbol: "d", value: 85, unit: "m"}
  - {name: "Structure diameter", symbol: "D", value: 2.5, unit: "m"}

methodology:
  description: "CFD analysis using OpenFOAM simpleFoam with k-omega SST turbulence model"
  standard: "DNV-RP-C205 §6 Current Loads"
  equations:
    - {id: "eq1", name: "Drag force", latex: "F_D = \\frac{1}{2} \\rho C_D A U^2"}
    - {id: "eq2", name: "Reynolds number", latex: "Re = \\frac{U D}{\\nu}"}

outputs:
  - {name: "Drag coefficient", symbol: "C_D", value: null, unit: "-", pass_fail: true, limit: "<2.0"}
  - {name: "Drag force", symbol: "F_D", value: null, unit: "kN"}

assumptions:
  - "Steady-state flow (no wave-current interaction)"
  - "Smooth surface (no marine growth)"

references:
  - "DNV-RP-C205:2021 Environmental Conditions and Environmental Loads"
  - "OpenFOAM v2312 ESI Group"
```

The `generate-calc-yaml.py` script populates `value: null` fields from OpenFOAM results.

## Mesh Quality Gates

Analysis will not proceed to solver execution if mesh fails these checks:

| Metric | Pass | Fail |
|--------|------|------|
| Non-orthogonality max | < 70 | ≥ 70 |
| Skewness | < 4 | ≥ 4 |
| Aspect ratio | < 100 | ≥ 100 |
| Negative volumes | 0 | > 0 |

## Error Handling

Each stage validates before passing to the next. On failure:
1. Diagnostic YAML written to `<case>/diagnostics.yaml`
2. Exit code propagated (non-zero = failure)
3. Partial results preserved for debugging

Refer to `openfoam` skill §4 (Failure Diagnosis) for root cause analysis.

Related Skills

openfoam

5
from vamseeachanta/workspace-hub

OpenFOAM AI Interface Skill — case setup, CLI execution, output parsing, failure diagnosis, validation

comprehensive-learning

5
from vamseeachanta/workspace-hub

Single fire-and-forget command that runs the full session learning pipeline: insights → reflect → knowledge → improve → action-candidates → report. All machines run local Phases 1–9 against logs/orchestrator/ and commit derived state. dev-primary additionally runs Phase 10a (cross-machine compilation) and Phase 10 (report). Safe for cron scheduling. Use when session ends, nightly cron fires, or you want to harvest learnings from recent sessions. Replaces running 4 skills manually.

cc-best-practice-adoption

5
from vamseeachanta/workspace-hub

Use when onboarding new Codex features, reviewing external best-practice repos, or expanding the daily learning catalog. Covers: gap analysis against native CC capabilities, tips catalog expansion, daily-learning script, native .Codex/ structure (agents, commands, settings).

mnt-analysis-cleanup

5
from vamseeachanta/workspace-hub

Survey, classify, and clean up `/mnt/local-analysis/` (or any sibling-to-workspace-hub directory holding orphan worktrees, codex-burn artifacts, agent log accumulations, and outer-clone duplicates) without losing useful code/work. Surfaces a tiered approval menu rather than baking decisions; defers all destructive ops until user confirms.

repo-architecture-analysis

5
from vamseeachanta/workspace-hub

Scan a Python repo's package structure, count classes/functions, classify module maturity (PRODUCTION/DEVELOPMENT/SKELETON/GAP), and generate architecture reports with Mermaid diagrams. Use when asked to analyze codebase structure, find untested packages, or assess module maturity.

viv-analysis

5
from vamseeachanta/workspace-hub

Assess vortex-induced vibration (VIV) for risers and tubular members with natural frequency and safety factor calculations. Use for VIV susceptibility analysis, natural frequency calculation, vortex shedding assessment, and tubular member fatigue from VIV.

structural-analysis

5
from vamseeachanta/workspace-hub

Structural analysis for marine and offshore structures per DNV/API/ISO codes. Use when performing ULS/ALS limit state checks, column buckling, beam deflection, tubular joint capacity (DNV-RP-C203), or stiffened panel analysis. Covers section properties, combined loading, and ALS dented pipe assessment.

signal-analysis

5
from vamseeachanta/workspace-hub

Perform signal processing, rainflow cycle counting, and spectral analysis for fatigue and time series data. Use for analyzing stress time histories, computing FFT/PSD, extracting fatigue cycles (ASTM E1049-85), and batch processing OrcaFlex signals.

orcawave-qtf-analysis

5
from vamseeachanta/workspace-hub

Second-order wave force QTF computation in OrcaWave. Use when computing mean drift forces, difference-frequency or sum-frequency QTFs, slow-drift response, or applying Newman approximation for offshore structures.

orcaflex-modal-analysis

5
from vamseeachanta/workspace-hub

Perform modal and frequency analysis on OrcaFlex models to extract natural frequencies, mode shapes, and identify dominant DOF responses. Use for VIV assessment, resonance identification, and structural dynamics characterization.

orcaflex-jumper-analysis

5
from vamseeachanta/workspace-hub

Rigid and flexible jumper modelling in OrcaFlex covering installation analysis, in-place analysis, VIV screening, and fatigue assessment.

orcaflex-installation-analysis

5
from vamseeachanta/workspace-hub

Create and analyze OrcaFlex models for offshore installation sequences including subsea structure lowering, pipeline installation, and crane operations. Generate models at multiple water depths and orientations for installation feasibility studies.