Skip to content

AhmedMoustafaa/paraview-su2-reader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

paraview-su2-reader

A ParaView plugin that adds native .su2 mesh file support directly in the File → Open dialog. No conversion step required.

SU2 is the open-source CFD and multiphysics solver developed at Stanford University. ParaView has no built-in SU2 reader — this plugin fills that gap.

Features

  • Reads SU2 v7 and v8 mesh files (and older formats with trailing node IDs)
  • Supports all standard element types: line, triangle, quad, tetra, hexahedron, wedge, pyramid
  • 2D and 3D meshes
  • Handles CRLF (Windows) and LF (Unix) line endings
  • Handles FFD box sections (shape optimisation meshes) and NPERIODIC sections silently
  • Exposes boundary markers as a BoundaryTag cell data array for easy selection and coloring
  • Preserves original MARKER_TAG string names in field data (TagIDs / TagNames)

Supported SU2 format variants

Format feature Supported
NELEM before NPOIN (v7/v8)
NPOIN before NELEM (old format)
Trailing element IDs on cell lines
Trailing local/global node IDs on point lines
NPOIN= N N (two-value old format)
FFD box sections (FFD_CORNER_POINTS, etc.) ✅ silently skipped
NPERIODIC sections ✅ silently skipped
CRLF line endings
2D meshes (z=0 appended for VTK)

Requirements

  • ParaView 5.10 or later (any version with Python plugin support)
  • No additional Python packages required — uses only ParaView's bundled Python

Installation

  1. Download SU2ReaderPlugin.py
  2. Open ParaView
  3. Go to Tools → Manage Plugins → Load New
  4. Select SU2ReaderPlugin.py
  5. Check Auto Load to persist across sessions

After loading, .su2 files appear automatically in File → Open.

Usage

Opening a mesh

File → Open → select your .su2 file → click OK → Apply

Visualising boundary markers

The plugin attaches a BoundaryTag integer array to every cell:

Tag value Meaning
0 Interior volume cells
1, 2, 3, ... Boundary markers in order of appearance

To isolate a specific boundary (e.g. the inlet):

  1. Select the mesh in the Pipeline Browser
  2. Filters → Threshold
  3. Set Scalars to BoundaryTag, set min = max = the tag number you want
  4. Click Apply

To see which tag ID maps to which boundary name, open the SpreadSheet View and switch the attribute to Field Data — the TagIDs and TagNames arrays list the full mapping.

Coloring by boundary

In the toolbar, set Color By to BoundaryTag. Use a discrete colormap (e.g. Glasbey) to distinguish boundaries clearly.

Element type mapping

SU2 uses VTK element type IDs directly, so no remapping is needed:

SU2 type ID Element VTK type
3 Line VTK_LINE
5 Triangle VTK_TRIANGLE
9 Quad VTK_QUAD
10 Tetrahedron VTK_TETRA
12 Hexahedron VTK_HEXAHEDRON
13 Wedge VTK_WEDGE
14 Pyramid VTK_PYRAMID

Converting .su2 to other formats

To convert .su2 meshes to VTK or other formats, use meshio. Note that upstream meshio has several bugs affecting SU2 v7/v8 meshes — CRLF line endings cause crashes, and FFD box sections generate 60,000+ spurious warnings. A patched version is available:

pip install meshio-su2-fix
meshio convert mesh.su2 mesh.vtu

The patches are also submitted upstream as a pull request.

Known limitations

  • Large meshes (millions of cells) may load slowly — the reader is pure Python. For performance-critical workflows, convert to VTK format first using meshio-su2-fix: meshio convert mesh.su2 mesh.vtu
  • Solution files (.csv, restart files) are not read — mesh geometry only
  • Periodic boundary pairing information in NPERIODIC sections is skipped, not parsed

Background

ParaView ships with an SU2 writer (via meshio/VTK) but has no SU2 reader. Gmsh also has no SU2 reader — only a writer. This plugin was developed after discovering that neither tool could open SU2 v7/v8 meshes directly, and that meshio's reader had several bugs affecting real tutorial meshes (CRLF crashes, FFD warning spam). Those bugs were fixed in a separate meshio PR.

License

MIT — see LICENSE

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages