Skip to content
Back to skills

Openfoam To Paraview Pipeline

ASecurity

Sub-skill of paraview-interface: OpenFOAM to ParaView Pipeline (+2).

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

Security analysis

A100/100

Scanned September 9, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Openfoam To Paraview Pipeline?

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

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

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: paraview-interface-openfoam-to-paraview-pipeline
description: 'Sub-skill of paraview-interface: OpenFOAM to ParaView Pipeline (+2).'
version: 1.1.0
category: engineering
type: reference
scripts_exempt: true
---

# OpenFOAM to ParaView Pipeline (+2)

## OpenFOAM to ParaView Pipeline


```python
"""Complete OpenFOAM post-processing pipeline."""
from paraview.simple import *

def openfoam_to_images(case_dir, output_dir, fields=['U', 'p']):
    """Generate standard visualization images from OpenFOAM case."""
    import os
    os.makedirs(output_dir, exist_ok=True)

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

    # Load case
    reader = OpenFOAMReader(FileName=foam_file)
    reader.MeshRegions = ['internalMesh']
    reader.CellArrays = fields
    reader.SkipZeroTime = 1

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

    view = GetActiveViewOrCreate('RenderView')
    view.ViewSize = [1920, 1080]
    view.Background = [1, 1, 1]  # White background

    for field in fields:
        display = Show(reader, view)
        ColorBy(display, ('POINTS', field))
        display.SetScalarBarVisibility(view, True)
        view.ResetCamera()
        Render()

        SaveScreenshot(
            os.path.join(output_dir, f'{field}_final.png'),
            view, ImageResolution=[1920, 1080]
        )
        Hide(reader, view)

    return output_dir
```


## VTK Export for Blender


```python
def export_surface_for_blender(source, output_stl):
    """Export surface mesh as STL for Blender import."""
    surface = ExtractSurface(Input=source)
    triangulate = Triangulate(Input=surface)
    SaveData(output_stl, proxy=triangulate)
    print(f"Exported STL for Blender: {output_stl}")
```


## OrcaFlex Results in ParaView


```python
def load_orcaflex_vtk(vtk_dir):
    """Load OrcaFlex VTK export in ParaView."""
    import glob
    vtk_files = sorted(glob.glob(f'{vtk_dir}/*.vtk'))
    if not vtk_files:
        raise FileNotFoundError(f"No VTK files in {vtk_dir}")

    reader = LegacyVTKReader(FileNames=vtk_files)
    reader.UpdatePipeline()
    return reader
```

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.