cfd-pipeline-path-a-freecadcad-to-gmsh

Sub-skill of cfd-pipeline: Path A: FreeCAD/CAD to Gmsh (+3).

5 stars

Best use case

cfd-pipeline-path-a-freecadcad-to-gmsh is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of cfd-pipeline: Path A: FreeCAD/CAD to Gmsh (+3).

Teams using cfd-pipeline-path-a-freecadcad-to-gmsh 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/path-a-freecadcad-to-gmsh/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/engineering/workflows/cfd-pipeline/path-a-freecadcad-to-gmsh/SKILL.md"

Manual Installation

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

How cfd-pipeline-path-a-freecadcad-to-gmsh Compares

Feature / Agentcfd-pipeline-path-a-freecadcad-to-gmshStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of cfd-pipeline: Path A: FreeCAD/CAD to Gmsh (+3).

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

# Path A: FreeCAD/CAD to Gmsh (+3)

## Path A: FreeCAD/CAD to Gmsh


```bash
# 1. Export from FreeCAD to STEP/BREP
freecadcmd -c "
import FreeCAD, Part
doc = FreeCAD.openDocument('geometry.FCStd')
Part.export(doc.Objects, 'geometry.step')
"

# 2. Mesh with Gmsh
gmsh geometry.step -3 -format msh2 -o mesh.msh \
  -clmin 0.01 -clmax 0.5 \
  -algo del3d
```


## Gmsh to OpenFOAM Conversion


```bash
# Convert Gmsh mesh to OpenFOAM format
gmshToFoam mesh.msh

# Fix boundary patches (Gmsh exports generic names)
# Edit constant/polyMesh/boundary to set correct patch types
```

```python
# Automated Gmsh-to-OpenFOAM boundary patch fix
import re
from pathlib import Path

def fix_boundary_patches(case_dir, patch_map):
    """Fix boundary patch types after gmshToFoam conversion.

    Args:
        case_dir: OpenFOAM case directory
        patch_map: dict of {patch_name: patch_type}
            e.g. {'inlet': 'patch', 'outlet': 'patch', 'walls': 'wall'}
    """
    boundary_file = Path(case_dir) / 'constant' / 'polyMesh' / 'boundary'
    content = boundary_file.read_text()

    for name, ptype in patch_map.items():
        # Replace patch type for named patch
        pattern = rf'({name}\s*\{{[^}}]*type\s+)\w+'
        content = re.sub(pattern, rf'\g<1>{ptype}', content)

    boundary_file.write_text(content)
```


## Path B: CAD to snappyHexMesh (Complex Geometry)


```bash
# 1. Export STL from CAD (FreeCAD or external)
# Ensure STL is watertight and in meters

# 2. Create background mesh with blockMesh
blockMesh

# 3. Run snappyHexMesh
snappyHexMesh -overwrite

# Key files needed:
# - system/blockMeshDict     (background mesh)
# - system/snappyHexMeshDict (refinement + snapping)
# - constant/triSurface/geometry.stl
```


## Validation: Geometry to Mesh


```python
def validate_geometry_to_mesh(stl_path, mesh_dir):
    """Validate the geometry-to-mesh conversion."""
    import subprocess
    checks = {"passed": True, "issues": []}

    # Check STL is readable
    import os
    if not os.path.exists(stl_path):
        checks["issues"].append(f"STL not found: {stl_path}")
        checks["passed"] = False
        return checks

    stl_size = os.path.getsize(stl_path)
    if stl_size < 100:
        checks["issues"].append(f"STL suspiciously small: {stl_size} bytes")
        checks["passed"] = False

    # Check OpenFOAM mesh
    polymesh = os.path.join(mesh_dir, 'constant', 'polyMesh', 'points')
    if not os.path.exists(polymesh):
        checks["issues"].append("No polyMesh/points — mesh conversion failed")
        checks["passed"] = False
        return checks

    # Run checkMesh
    result = subprocess.run(
        ['checkMesh', '-case', mesh_dir],
        capture_output=True, text=True
    )
    if 'FAILED' in result.stdout:
        checks["issues"].append("checkMesh reports failures")
        checks["passed"] = False

    # Extract mesh stats
    import re
    cells_match = re.search(r'cells:\s+(\d+)', result.stdout)
    if cells_match:
        checks["cells"] = int(cells_match.group(1))

    return checks
```

Related Skills

teams-meeting-pipeline

5
from vamseeachanta/workspace-hub

Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.

solidworks-to-blender-pipeline

5
from vamseeachanta/workspace-hub

Use when converting SolidWorks .sldprt/.sldasm geometry to Blender for rendering, animation, or visualization, including questions about STEP export settings, FreeCAD as a bridge, or which mesh format (STL/OBJ/GLTF) to choose.

python-import-path-mismatch-debugging

5
from vamseeachanta/workspace-hub

Diagnose and fix ModuleNotFoundError when a package is installed but imports still fail due to environment/path mismatches

python-import-path-debugging

5
from vamseeachanta/workspace-hub

Diagnose ModuleNotFoundError when a package is installed but still fails to import

multi-role-agent-contract-review-pipeline

5
from vamseeachanta/workspace-hub

Execute a 4-role agent team (Planner/Architect/Reviewer/Integrator) pipeline for self-reviewing knowledge artifacts before delivery

learned-git-worktree-hook-path-and-real-hook-shape-review

5
from vamseeachanta/workspace-hub

Catch hook-installation and governance bugs that only appear in linked git worktrees or against the real generated hook shape, not simplified test fixtures.

provider-audit-bootstrap-and-path-classification

5
from vamseeachanta/workspace-hub

Fix provider-session ecosystem audit failures caused by source-checkout imports and over-aggressive symbolic-path classification.

overnight-worktree-uv-warmup-and-log-path-guardrails

5
from vamseeachanta/workspace-hub

Prevent false stalls and missing-log failures in overnight Codex worktree batches by pre-warming uv environments, using exact log-path directory creation, and interpreting buffered logs correctly.

gtm-prospect-pipeline-phased-execution

5
from vamseeachanta/workspace-hub

Phased execution pattern for

background-Codex-worktree-absolute-path-launch

5
from vamseeachanta/workspace-hub

Prevent overnight/background Codex worker launch failures in git worktrees by using absolute prompt/log paths and immediate post-launch polling.

provider-review-prompt-path-guard

5
from vamseeachanta/workspace-hub

Prevent adversarial review dispatch failures caused by sandbox/tmp path mismatches and provider CLI working-directory drift when launching Codex or Gemini with prompt files.

absolute-path-review-prompt-dispatch

5
from vamseeachanta/workspace-hub

Prevent adversarial review dispatch failures caused by relative prompt paths, superseded background sessions, and stale completion notices when launching Codex/Gemini review jobs.