CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] Paraview and VTK

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2003, 07:54
Default Paraview and VTK
  #1
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
I have a written simple foamToVTK converter for Foam2.2 meshes and data. Let me know if you would like to give it a try and I'll pack it up.
  Reply With Quote

Old   October 28, 2003, 11:45
Default foamToVTK : forgot to mention
  #2
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
foamToVTK : forgot to mention but it works quite nicely with the paraview front-end to vtk.

Also I am looking for someone out there who knows how to bind in a reader into vtk.
  Reply With Quote

Old   February 9, 2004, 12:17
Default I find the converter (foamToV
  #3
Rasmus Hemph
Guest
 
Posts: n/a
I find the converter (foamToVTK) very useful for post processing in Paraview. However, the conversion algorithm does not seem to work for void fraction in two-phase flow? At least I get strange visual result looking at the 'alpha'-parameter in Paraview. In Ensight7 the same results look as expected.
Any idea as to what might be causing this?
  Reply With Quote

Old   February 9, 2004, 12:33
Default the foamToVTK converter only
  #4
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
the foamToVTK converter only handles volScalarFields and volVectorFields. If your 'alpha' field is one of those (check the header) there should be no problem with it; all volScalarFields are handled in the same way.

Do you have any pics of 'strange' visual results?
  Reply With Quote

Old   February 9, 2004, 13:24
Default Thank you for the swift reply.
  #5
Rasmus Hemph
Guest
 
Posts: n/a
Thank you for the swift reply. Alpha is indeed a volScalarField. I have posted the pictures temporarily on my webpage

http://www.tfd.chalmers.se/~md8hemra/

The files are converted to VTK with the command
>> foamToVTK . rootcase

//rasmus
  Reply With Quote

Old   February 9, 2004, 14:19
Default I just tried converting the '
  #6
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
I just tried converting the 'damBreak' tutorial case with foamToVTK.

I get proper point gamma (i.e. void fraction on the points) but zero cell wise gamma. (all my cell fields seem to be zero). Need to look into this.

Are you running 2.2 or 2.3?
  Reply With Quote

Old   February 9, 2004, 16:38
Default 2.2
  #7
Rasmus Hemph
Guest
 
Posts: n/a
2.2
  Reply With Quote

Old   February 10, 2004, 06:25
Default Paraview does not seem to be
  #8
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Paraview does not seem to be able to display cell values on a cut? I take a 2D case, e.g. dambreak. I can colour the read-in object with 'Cell gamma' but if I create a cut I cannot colour the cut with 'Cell gamma'. Point gamma works though.

Can anyone with more paraview experience tell us how to do this?
  Reply With Quote

Old   February 18, 2004, 05:59
Default There has been some activity
  #9
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
There has been some activity on the Paraview/VTK front. Seems that the new paraview1.2.1 can display cell values.
  Reply With Quote

Old   February 27, 2004, 06:13
Default I have hacked a version of fo
  #10
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
I have hacked a version of foamToVTK to write binary format. It might decrease the loading time but I haven't tested it yet on any largish case. Contact me directly if you want to try it out.
  Reply With Quote

Old   February 27, 2004, 09:49
Default I have tried with the new ver
  #11
Rasmus Hemph
Guest
 
Posts: n/a
I have tried with the new version of paraview without further success. I got hold of the foamToVTKBin-file through Niklas, but could not compile it. Is it for Foam 2.3?
This is the errormessage I get:

tfdpc236:wclean
tfdpc236:wmake
Making dependency list for source file vtkTopo.C
Making dependency list for source file foamToVTKBin.C

SOURCE_DIR=.
SOURCE=vtkTopo.C ; g++ -Dlinux -DlinuxGcc3OptLAM -DscalarMachine -DoptSolvers -DPARALLEL -DUSEMPI -Wall -O2 -DNoRepository -ftemplate-depth-30 -I/users/tfd/md8hemra/foam/foam2.2/src/foam/lnInclude -IlnInclude -I. -I/users/tfd/md8hemra/foam/foam2.2/src/lam-6.5.9/platforms/linuxGcc3OptLAM/include -I/usr/X11/include -DWM_PROJECT_VERSION='"'2.2'"' -DDEBUGList -O0 -g -I/users/tfd/md8hemra/foam/foam2.2/src/cfdTools/lnInclude -I/users/tfd/md8hemra/foam/foam2.2/src/browser/lnInclude -fPIC -c $SOURCE -o Make/linuxGcc3OptLAM/vtkTopo.o
SOURCE_DIR=.
SOURCE=foamToVTKBin.C ; g++ -Dlinux -DlinuxGcc3OptLAM -DscalarMachine -DoptSolvers -DPARALLEL -DUSEMPI -Wall -O2 -DNoRepository -ftemplate-depth-30 -I/users/tfd/md8hemra/foam/foam2.2/src/foam/lnInclude -IlnInclude -I. -I/users/tfd/md8hemra/foam/foam2.2/src/lam-6.5.9/platforms/linuxGcc3OptLAM/include -I/usr/X11/include -DWM_PROJECT_VERSION='"'2.2'"' -DDEBUGList -O0 -g -I/users/tfd/md8hemra/foam/foam2.2/src/cfdTools/lnInclude -I/users/tfd/md8hemra/foam/foam2.2/src/browser/lnInclude -fPIC -c $SOURCE -o Make/linuxGcc3OptLAM/foamToVTKBin.o
foamToVTKBin.C: In function `int main(int, char**)':
foamToVTKBin.C:120: error: 'class Foam::argList' has no member named '
noParallel'
make: *** [Make/linuxGcc3OptLAM/foamToVTKBin.o] Error 1
  Reply With Quote

Old   February 27, 2004, 10:08
Default Yes, it was written for 2.3.
  #12
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Yes, it was written for 2.3. Try commenting out the whole line with the 'noParalllel()' (foamToVTKBin.C:120).
  Reply With Quote

Old   March 1, 2004, 08:59
Default Ah, now it works! (and conver
  #13
Rasmus Hemph
Guest
 
Posts: n/a
Ah, now it works! (and converts much faster than before) Also see the velocity vectors which have been lost in translation previously.
Thanks for all help!

A small note to other 2.2 users. I had to add
-I$(FOAM_SRC)/browser/lnInclude and
-lbrowser
to get it to compile.
  Reply With Quote

Old   March 4, 2004, 07:22
Default There is a new version of foa
  #14
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
There is a new version of foamToVTK which does patchFields and lagrangian fields. These are dumped to separate directories, one for each patch and one directory 'lagrangian' containing all the lagrangian data. Contact me directly if you want it.

Mattijs
  Reply With Quote

Old   August 10, 2004, 09:52
Default ... > A Paraview reader modul
  #15
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
...
> A Paraview reader module for 2.3 sounds great,
> but how does it work? To test it,
> I ran the icoFoam tutorial case which produces Foam output files.
> I can convert this output to VTK and look at it in paraview,
> but I have not yet been able to open it without converting.
> Paraview seem to be expecting a file with a .foam-extension??
> Will the reader module work for lagrangian particles?


The new Paraview reader module needs in the case directory .foam file. This is a limitation in the way in which Paraview loads data.

It does not handle any lagrangian data. Feel free to add this yourself - all source is in $FOAM_UTILITIES/postProcessing/graphics/PVFoamReader/

Alternatively you can always convert the lagrangian data separately (using e.g. foamToVTK) and load it on top of any Foam reader data.

Mattijs
  Reply With Quote

Old   September 16, 2004, 11:29
Default Hi Mattijs The new reader mo
  #16
Rasmus Hemph (Hemph)
Guest
 
Posts: n/a
Hi Mattijs
The new reader module for Paraview looks good. I do not yet feel comfortable enough with the source code to add lagrangian support to it, but I hope I get better at it as time goes. Unfortunately, Paraview gets very slow when it has to deal with many files, taking almost 3 seconds between time steps, so it is unusable for me at the moment.

I have however had a chance to improve my VTK knowledge, and have written a small tcl/tk program to visualize my lagrangian particles. The problem is the conversion from the FOAM format to VTK. With the supplied converter, i.e. foamToVTK, I can convert my mesh and particles to VTK, but it takes too much time to be practial (approx 20 minutes) for my current case (2000 time steps). I was wondering about the best way for me to proceed:

-Can the classes used for the PVfoamReader be used to output the simulation results directly to VTK, i.e. make the need for conversion afterwards unnecessary?

-Alternatively. I saw that foamToVTK now supports more options on the commandline. I have played with those, but to my knowledge, I can not output ONLY the lagrangian data, that is, skip the mesh data and only print the position of the particles at each time step. The converter also clears the VTK subdirectory at each conversion. This is not necessary always. Can this be changed?
  Reply With Quote

Old   September 16, 2004, 12:19
Default Hello Rasmus, 1] reader su
  #17
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hello Rasmus,

1] reader support. Low on our list of priorities. As for slowness that is part due ofcourse to Foam having to read the meshes and data (though Foam reading is quite fast - especially when using binary or compressed - see your controlDict settings)

2] tcl/tk program: sounds nice. Can I try it?

- "Can the classes used for the PVfoamReader ...". Don't understand fully. You can however do a 'Save Data' to write the vtk objects to a file (and reread it later). I have no experience reading these but am quite interested if you can come up with something..

- foamToVTK. For your purpose just go to the source directories (postProcessing/dataConversion/foamToVTK) and comment out in foamToVTK.C:
- rmDir(fvPath) (line 137 for me)
- all to do with writing fields/meshes
(line 210 to 506)

(I am bit reluctant to add more logic to foamToVTK so you'll have to do it on your own version)

Let me know how you get on.

Mattijs
  Reply With Quote

Old   September 17, 2004, 09:05
Default Hi Rasmus, many thanks for
  #18
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Hi Rasmus,

many thanks for your tool - is neat. Just wondering: do you need to dump 2000 results or can you do with less? And if you have 2000 already, do you need to convert all 2000? You can use the -time or -latestTime option to convert one time only.

Mattijs
  Reply With Quote

Old   October 4, 2004, 09:53
Default Hi, I've downloaded and un
  #19
Jason J Beech-Brandt (Jasonb)
Guest
 
Posts: n/a
Hi,

I've downloaded and unpacked paraview-1.6.2 for Solaris as part of foam2.3. However when I try and run paraview I get the following link error

>paraview
ld.so.1: paraview: fatal: libucb.so.1: open failed: No such file or directory
Killed

Adding the directory /usr/ucblib to my LD_LIBRARY_PATH variable gets rid of this problem, however now I am getting a Segmentation Fault after the paraview startup screen appears.

Any ideas?

Cheers

Jason
  Reply With Quote

Old   October 4, 2004, 10:09
Default Hi Jason, I compiled paravi
  #20
Henry Weller (Henry)
Guest
 
Posts: n/a
Hi Jason,

I compiled paraview 1.6.2 on the UltraSparc machine here running Solaris 2.8 and it went without a hitch and ran fine. I am not sure why you are having problems but it may be related to your version of Solaris being more recent.

Try downloading the ParaView binaries for Solaris from http://www.paraview.org/HTML/Download.html (unfortunately only an old version is available) or the sources and see if you can build and run. If you use the binary installation you will not be able to compile the reader-module because the CMake files are not included but you will be able to run foamToVTK and look at your results that way. If you need further help let us know and I will tell you how we built and installed ParaView

Henry
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Paraview problem: loading the VTK cellSets changes the time anon_q ParaView 1 November 3, 2018 21:53
[General] How to relate tensor data in vtk file to Paraview awa5114 ParaView 0 March 7, 2017 05:56
[General] Creating VTK image compatible to Paraview Visualizer het ParaView 0 January 7, 2016 09:20
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
[General] paraview ignores SPACING in STRUCTURED_POINTS vtk data? jaffar ParaView 0 November 27, 2012 10:36


All times are GMT -4. The time now is 04:27.