CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   separate .vtk files + OpenFOAM fields: synchronous time (https://www.cfd-online.com/Forums/openfoam-post-processing/94538-separate-vtk-files-openfoam-fields-synchronous-time.html)

tomislav_maric November 18, 2011 09:45

separate .vtk files + OpenFOAM fields: synchronous time
 
Hi everyone,

I have a bunch of POLYDATA .vtk files that correspond to the time-steps (results) of a simulation. Is there a way to visualise the .vtk file set and the OpenFOAM solution at the same time? Right now, the time steps of the CFD solution are iterated and displayed, after which, the iterations start to loop over the .vtk files... and I need to see them all at the same time.

Thanks!

deepsterblue November 18, 2011 12:48

Unfortunately, legacy VTK files do not inherently support time evolution. One possible (although slightly tedious) approach is to modify the reader (either PVFoamReader or the in-built one in paraview) to additionally read in VTK files by index, so that they are read in-sync at each time-step - i.e., read file_001.vtk for time-step 1, etc. If you can get that to work, it would be quite handy indeed.

tomislav_maric November 21, 2011 03:33

Thanks a lot for the advice! :)

I'll have to check this out soon, right now I'm viewing the data separately, because I'm concentrated on debugging the alg., but at some point I guess I will be needing this. I'll ask on the pview mailing list for advice on how to code this painlessly before I jump into it.

7islands November 21, 2011 06:16

Or other ways would be
* Read the .vtk files as time series and apply the temporal shift scale filter (if your timestep is constant)
* To write a VTK-Python script that converts .vtk files to .vtp (XML polydata format) files and writes a .pvd file (metadata file that refers to the collection of .vtp files with time information).

T

tomislav_maric November 21, 2011 09:34

Quote:

Originally Posted by 7islands (Post 332912)
Or other ways would be
* Read the .vtk files as time series and apply the temporal shift scale filter (if your timestep is constant)
* To write a VTK-Python script that converts .vtk files to .vtp (XML polydata format) files and writes a .pvd file (metadata file that refers to the collection of .vtp files with time information).

T

I just got it: it doesn't care about the .vtk naming, as long as it is consistent: the files are named so that they may be read as time-changing data. The number of files corresponds to the number of iterations, so all that is needed is to scale the interval. In my case, I had 500 steps, and I needed them to correspond to the interval [0, 0.5], so I scaled the interval by 0.001.

Thanks for the advice!:)


All times are GMT -4. The time now is 21:33.