The visualization module is a collection of visualization interfaces for OpenFOAM, primarily VTK/ParaView based. It is provided as a module to isolate library dependencies and support multi-build paradigms (eg, different VTK or ParaView versions, different rendering types etc).
Before starting
Incorporating visualization increases the complexity (potential difficulty and issues) of the software build. It is considered an intermediate to advanced topic and should be avoided by first-time OpenFOAM users.
Things to consider:
- hardware vs. software rendering
- llvm pipelines
- mpi flavours
- what do I really need?
Building VTK libraries for use with OpenFOAM is relative straightforward, as is using pre-compiled VTK libraries.
Building ParaView becomes more complex, since it involves many more software components (the QT dependencies are often the ones that cause the most difficulty). Even using a pre-compiled set of ParaView binaries may prove difficult, since they often lack the necessary development headers for creating additional plugins.
In light of these potential difficulties, it is worthwhile carefully examining the following section.
Do I really need the ParaView plugins?
Before blindly launching into compiling ParaView with the idea that this is simply necessary for a complete software stack, you should examine your actual requirements. Note that the term paraFoam is often used loosely to mean the reader plugins, but it is merely a small wrapper script.
For general functionality, the paraview version distributed with the operating system or a binary package is likely fully adequate for your needs.
Native reader | OpenFOAM Plugin | Functionality |
---|---|---|
[+] | [-] | Does not require OpenFOAM installation |
[+] | [-] | No duplicate of the OpenFOAM mesh in memory |
[+] | [-] | Supports decomposed cases (without reconstructPar) |
[+] | [-] | Supports parallel rendering |
[-] | [+] | Handles collated file formats |
[-] | [+] | Selection of faceSet, faceZones, etc. |
[paraview-5.10] | [+] | Patch group selection - merged |
[paraview-5.10] | [+] | Dimensioned (Internal) fields - merged |
[in progress] | [+] | finiteArea mesh and results - merged, but inactive |
[-] | [+] | Additional patch names (low priority) |
Workarounds:
- Use
foamToVTK
for faceSets, faceZones as required and load the generated VTK files in ParaView as usual.
Native reader | blockMeshDict Plugin | Functionality |
---|---|---|
n/a | [+] | Explore block structures |
Alternatives:
- Use
blockMesh -write-vtk
to generate the block topology as a VTK file that can be explored in ParaView as required. The ParaView Hover Points On function is particularly useful!
Which plugins are loaded?
From the paraview menu: Tools / Manage Plugins...
Summary
Recommend using the native (builtin) ParaView/VTK reader for most normal cases. For example,
paraFoam -vtk
If you do this frequently enough, the following alias can be quite convenient:
alias parafoam='touch log.foam; paraview log.foam'
Copyright (C) 2020-2022 OpenCFD Ltd.