CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Paraview & paraFoam (https://www.cfd-online.com/Forums/openfoam-paraview/)
-   -   Visualization with ParaView (in general) (https://www.cfd-online.com/Forums/openfoam-paraview/71594-visualization-paraview-general.html)

sega January 8, 2010 13:28

Visualization with ParaView (in general)
 
Hello World.

My questions is not directly related to OpenFOAM, but to the usage of ParaView in CFD-Simulations in general.

What I want to know is how I can learn to visualize data with ParaView.
OpenFOAM uses the VTK-format? Is this applicabel to any kind of data?

I'm working with a selfmade CFD-code from a small company and they want to visualize their data with ParaView.

Have nice day. S.

sega January 25, 2010 08:17

Hello, me again.

I had a quick look into the VTK.
Seems like there are well defined file formats for the creation of VTK-files, which can be read from inside ParaView.

How does the conversion from the OpenFOAM data structure to the VTK format work? This should be foamToVTK?

Just for basic understandung: This tool reads the data from OpenFOAM and writes it to the specific VTK-file-format?
Just to make sure: This is the only way of dealing with this?

If yes, then I know what to do: Write a code, which converts the data from our selfmade CFD-code into the VTK-file-format!

Have a nice day.

olesen January 26, 2010 03:33

Quote:

Originally Posted by sega (Post 243672)
... This tool reads the data from OpenFOAM and writes it to the specific VTK-file-format?
Just to make sure: This is the only way of dealing with this?

If yes, then I know what to do: Write a code, which converts the data from our selfmade CFD-code into the VTK-file-format!

Note that the VTK files that OpenFOAM writes are the so-called 'legacy' format. The more modern XML-based VTK streaming formats are much more annoying to generate - I haven't bothered.
I would personally suggest writing Ensight format (ASCII and/or C binary) for your output instead. IMO this has several distinct advantages over using VTK files.
  • Paraview and VTK provide reasonable support for Ensight format.
  • Other visualization programs may also support Ensight format.
  • The Ensight format provides a native way of storing nfaced (polyhedral) cells that is currently impossible with VTK formats.
  • In the Ensight format, you can have a single time-invariant geometry with multiple time-varying field values. In the legacy VTK, you would need to store the geometry for every field, for each time. There is a paraview format that could avoid some of the redundant geometry, but then you definitely need to use the XML-based VTK formats.
As another alternative, you might also find it useful/interesting to see if a solution with XDMF/HDF5 might also work for your in-house CFD code.

sega January 26, 2010 05:13

Quote:

Originally Posted by olesen (Post 243747)
Note that the VTK files that OpenFOAM writes are the so-called 'legacy' format. The more modern XML-based VTK streaming formats are much more annoying to generate - I haven't bothered.
I would personally suggest writing Ensight format (ASCII and/or C binary) for your output instead. IMO this has several distinct advantages over using VTK files.
  • Paraview and VTK provide reasonable support for Ensight format.
  • Other visualization programs may also support Ensight format.
  • The Ensight format provides a native way of storing nfaced (polyhedral) cells that is currently impossible with VTK formats.
  • In the Ensight format, you can have a single time-invariant geometry with multiple time-varying field values. In the legacy VTK, you would need to store the geometry for every field, for each time. There is a paraview format that could avoid some of the redundant geometry, but then you definitely need to use the XML-based VTK formats.
As another alternative, you might also find it useful/interesting to see if a solution with XDMF/HDF5 might also work for your in-house CFD code.

Very interesting response, thank you for that.
I will have a look into the Ensight format.
As a matter of fact our code is using cubic cells exclusively, so basically I'm not in need of polyhedral cell support.

As I have mentioned this is the first step towards visualization.
Later our case contain of up to 2 million cells. In this case writing VTK-files and reading them into ParaView may not the right approach for obvious memory reasons. I have read something about "pipeline" visualization.
What is this? If the user wants to have a specific field visualization, ParaView communitcates via VTK with the data from our simulation?!
So there doesn't have to be a new (gigabyte) file of VTK-data?

sega January 29, 2010 10:05

So, simple question again: How does OpenFOAM and Paraview communicate?
Are there temporary VTK files or is there a 'direct' communication?

I'm still not sure ...

olesen January 29, 2010 10:39

Quote:

Originally Posted by sega (Post 244217)
So, simple question again: How does OpenFOAM and Paraview communicate?
Are there temporary VTK files or is there a 'direct' communication?

I'm still not sure ...

One means is the reader module:
Code:

applications/utilities/postProcessing/graphics/PV3FoamReader/

This would, of course, be yet another means of solving your problem. Write a reader module to handle your in-house data format.

sega January 31, 2010 06:42

Thank you olesen.

vtkPV3FoamReader.h looks like the only file worth looking at...
That can't be all?!

olesen February 1, 2010 03:24

Quote:

Originally Posted by sega (Post 244347)
Thank you olesen.

vtkPV3FoamReader.h looks like the only file worth looking at...
That can't be all?!

Nope. IMO you need to look at and study all of them. The PV3FoamReader directory has the paraview server-manager plugin (this is where you'd have found the vtkPV3FoamReader.h header). The vtkPV3Foam directory contains the ''real" work - the transformation from OpenFOAM structures and data types into VTK.


All times are GMT -4. The time now is 17:02.