Skip to content
Back to skills

Openfoam To Paraview

ASecurity

Sub-skill of cfd-pipeline: OpenFOAM to ParaView (+1).

  • 17 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
businesspythongobash

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill openfoam-to-paraview --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Openfoam To Paraview?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Openfoam To Paraview
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-openfoam-to-paraview/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-openfoam-to-paraview)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cfd-pipeline-openfoam-to-paraview
description: 'Sub-skill of cfd-pipeline: OpenFOAM to ParaView (+1).'
version: 1.0.1
category: engineering
type: reference
scripts_exempt: true
---

# OpenFOAM to ParaView (+1)

## OpenFOAM to ParaView


```bash
# Create .foam trigger file for ParaView
touch /path/to/case/case.foam

# Launch ParaView visualization
pvbatch visualize.py
```

```python
# visualize.py — Automated ParaView post-processing
from paraview.simple import *

def openfoam_post_process(case_dir, output_dir):
    """Generate standard CFD visualization outputs."""
    import os
    os.makedirs(output_dir, exist_ok=True)

    # Load OpenFOAM case
    foam_file = os.path.join(case_dir, 'case.foam')
    if not os.path.exists(foam_file):
        open(foam_file, 'w').close()

    reader = OpenFOAMReader(FileName=foam_file)
    reader.MeshRegions = ['internalMesh']
    reader.CellArrays = ['U', 'p']

    # Last time step
    anim = GetAnimationScene()
    anim.UpdateAnimationUsingDataTimeSteps()
    anim.AnimationTime = reader.TimestepValues[-1]

    view = GetActiveViewOrCreate('RenderView')
    view.ViewSize = [1920, 1080]

    # Velocity magnitude slice
    calc = Calculator(Input=reader)
    calc.Function = 'mag(U)'
    calc.ResultArrayName = 'Umag'

    slice_z = Slice(Input=calc)
    slice_z.SliceType.Normal = [0, 0, 1]

    display = Show(slice_z, view)
    ColorBy(display, ('POINTS', 'Umag'))
    display.SetScalarBarVisibility(view, True)
    view.ResetCamera()
    Render()
    SaveScreenshot(os.path.join(output_dir, 'velocity_slice.png'), view)

    # Pressure iso-surface
    Hide(slice_z, view)
    contour = Contour(Input=reader)
    contour.ContourBy = ['POINTS', 'p']
    contour.Isosurfaces = [0]
    display2 = Show(contour, view)
    Render()
    SaveScreenshot(os.path.join(output_dir, 'pressure_iso.png'), view)

    # Export line probe data (e.g., centerline)
    probe = PlotOverLine(Input=reader)
    probe.Point1 = [0, 0, 0]
    probe.Point2 = [1, 0, 0]
    probe.Resolution = 200
    SaveData(os.path.join(output_dir, 'centerline_data.csv'), proxy=probe)
```


## OpenFOAM to Blender (Presentation Rendering)


```bash
# 1. Export from OpenFOAM to VTK
foamToVTK -case /path/to/case -latestTime

# 2. Convert VTK to STL via ParaView script (pvbatch does not support -c flag)
cat > vtk_to_stl.py << 'PYEOF'
from paraview.simple import *
r = LegacyVTKReader(FileNames=['VTK/case_1000.vtk'])
s = ExtractSurface(Input=r)
t = Triangulate(Input=s)
SaveData('surface.stl', proxy=t)
PYEOF
pvbatch vtk_to_stl.py

# 3. Import into Blender
blender --background --python render_cfd.py -- --input surface.stl --output render.png
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.