CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

FoamToVTK and MayaVi

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2008, 22:50
Default Hi Foam World... What can
  #1
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Foam World...

What can I do to have CFD quantities in MayaVi?

I can successfully create a VTK export... and i can open it in MayaVi... but inside Mayavi there is nothing that i can do to let me access CFD quantitites... and the same thing happens with a VTK export in VisIt...

Is there something that i should do with the VTK files prior to trying to pen them In MayaVi or VisIt...?

Best Regards

Alex
alexandrepereira is offline   Reply With Quote

Old   April 30, 2008, 04:57
Default foamToVTK outputs 'UNSTRUCTURE
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
foamToVTK outputs 'UNSTRUCTURED_GRID' data with 'FIELD attributes' (run foamToVTK with -ascii). How does Mayavi/Visit want the vtk format?
mattijs is offline   Reply With Quote

Old   April 30, 2008, 23:50
Default Hi Mattijs... I have done s
  #3
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Mattijs...

I have done so...

root@iskandhar:~# foamToVTK . simpleV33M_HS5c -ascii

It creates a folder

~/OpenFOAM/root-1.4.1/run/simpleV33M_HS5c/VTK

I try to open in Mayavi one of the time files of the VTK database, say simpleV33M_HS5c_320.vtk, but i do not know how to access CFD qantities, (scalars, vectors...)

I configure the VTK reader to access colorScalars, Fields, Normals, Scalars, TCoords, Tensors and Vectors - should be enough to grasp the data in VTK database -
but when i try to configure an isosurface module, it says that there is no scalar data to contour... there shuld be at least three scalar quantities in a simpleFoam simulation... pressure epsilon and k... according to Paraview these quantities are there... how to make them appear in mayavi...?

Thanks in Advance

Alex
alexandrepereira is offline   Reply With Quote

Old   May 1, 2008, 16:41
Default Sorry, I don't run MayaVi/Visi
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Sorry, I don't run MayaVi/Visit. If you think it is the format of vtk we output tell me what to change. See www.vtk.org/pdf/file-formats.pdf. Generate e.g. a 1x1x1 cell cavity and run foamToVTK with the -ascii option to see how we currently are outputting fields.
mattijs is offline   Reply With Quote

Old   May 25, 2008, 00:12
Default Hi Mattijs Sorry for not re
  #5
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Mattijs

Sorry for not replying sooner, had some hard stuff to do in the lab...

well here it is:

I have run the cavity tutorial with just 4 cells in blockMeshDict in icoFoam folder, and made a vtk output with the following command :

foamToVTK ./tutorials/icoFoam cavity -surfaceFields -ascii -allPatches -fields "(U p)" -time 5


The Output is here...
# vtk DataFile Version 2.0
cavity
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 18 float
0 0 0 0.05 0 0 0.1 0 0 0 0.05
0 0.05 0.05 0 0.1 0.05 0 0 0.1 0
0.05 0.1 0 0.1 0.1 0 0 0 0.01 0.05
0 0.01 0.1 0 0.01 0 0.05 0.01 0.05 0.05
0.01 0.1 0.05 0.01 0 0.1 0.01 0.05 0.1 0.01
0.1 0.1 0.01
CELLS 4 36
8 1 10 13 4 0 9 12 3 8 4
5 14 13 1 2 11 10 8 4 13
16 7 3 12 15 6 8 7 8 17
16 4 5 14 13
CELL_TYPES 4
12 12 12 12
CELL_DATA 4
FIELD attributes 3
cellID 1 4 int
0 1 2 3
p 1 4 float
2.32671e-09 0.184773 -0.162071 0.346843
U 3 4 float
-0.0726998 0.0621648 0 -0.0580389 -0.0721513 0 0.124485 0.0721513 0 0.139146 -0.0621648
0
POINT_DATA 18
FIELD attributes 2
p 1 18 float
2.32671e-09 0.0923865 0.184773 -0.0810355 0.0923863 0.265808 -0.162071 0.092386 0.346843 2.32671e-09 0.0923865
0.184773 -0.0810355 0.0923863 0.265808 -0.162071 0.092386 0.346843
U 3 18 float
0 0 0 0 0 0 0 0 0 0 0
0 0.0332231 1.7808e-17 0 0 0 0 0.5 0 0
1 0 0 0.5 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0.0332231 1.7808e-17
0 0 0 0 0.5 0 0 1 0 0
0.5 0 0

I guess that i do need to learn how to use mayavi...

The output is allright, isnt it?

Alex
alexandrepereira is offline   Reply With Quote

Old   May 25, 2008, 00:30
Default Hi Again... Could it be tha
  #6
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Again...

Could it be that mayavi doesn't support unstructured data...?
I have this example /usr/share/docs/mayavi/example/heart.vtk that displays well in mayavi, allowing me to select the filters and postprocess, but i

%cat /usr/share/docs/mayavi/example/heart.vtk

and the header is


# vtk DataFile Version 2.0
CT scan data of human heart, courtesy by Henk Mastenbroek RuG
ASCII

DATASET STRUCTURED_POINTS
DIMENSIONS 32 32 12
ORIGIN 0.000 0.000 0.000
SPACING 1.000 1.000 4.000

POINT_DATA 12288
SCALARS scalars float
LOOKUP_TABLE default

... A bit different from Foam Output format...

... can this be the problem...?

Alex
alexandrepereira is offline   Reply With Quote

Old   May 25, 2008, 00:36
Default BTW, foamToVTK outputs vtk for
  #7
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
BTW, foamToVTK outputs vtk format correctly to paraview...

...paraview VTK reader can access the data in VTK output...

... So i guess that the issue is with mayavi VTK reader format...

Alex
alexandrepereira is offline   Reply With Quote

Old   July 20, 2008, 12:16
Default hi alex I can not use the p
  #8
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
hi alex

I can not use the paraFoam command correctly on my macintosh. so i want to use this command of foamToVTK...i understand the command you have given above but can you tell me what do the arguments after the casename specify.....

please help.

thanx
mgz1985 is offline   Reply With Quote

Old   July 20, 2008, 15:23
Default Hi Gupta, I think... ( not
  #9
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Gupta,

I think... ( not with my linux box now...) the correct syntax is:

%foamToVTK <mycasedir> <mycase> -ascii -time <time> -allPatches (not sure about this)

but i am sure about
%foamToVTK <mycasedir> <mycase> -ascii -time <time>

That should create a VTK folder inside <mycase>
with a selection of scalarFields and vectorFields sampled in <time> in ascii format.

Anyway, i wouldnt advise you to use Mayavi... it has difficulties reading unstructured meshes...

I never got to use Mayavi... but VTK exports of foamToVTK read well in paraview...

If you should have any difficulties, just type foamToVTK in shell... it should give you all the syntax flags.

Alex
alexandrepereira is offline   Reply With Quote

Old   July 20, 2008, 15:56
Default thanx alex i tried it....and i
  #10
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
thanx alex i tried it....and it works....

as i could not view anything in paraview after executing the command although they did not show any errors or warning. so i got into another confusion,

i first executed the blockMesh and then the checkMesh but after that when i run foamToVTK, i get a folder created as you say alex but if i open this folder with paraview, i can see nothing.

am i following the wrong path? i m still trying to succeed in visualizing cavity case.

i know this would be silly for u efficient foamers but i have just installed it for the first time, so please bear with me.
thanx in advance.
mgz1985 is offline   Reply With Quote

Old   July 21, 2008, 05:49
Default hi again alex, I have a que
  #11
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
hi again alex,

I have a query. as i m trying to solve drag and lift on a 2D airfoil. i need these directories but they are not available in my version of openfoam. hence, what to do? especially when the postprocessing directory is missing in the src directory and also the liftdrag directory in the utilities.

can anybody help? I am using openfoam-1.4.1. and i do not have any previous versions of openfoam. also i checked the following forums already

http://www.cfd-online.com/OpenFOAM_D...tml?1216629859
mgz1985 is offline   Reply With Quote

Old   July 21, 2008, 15:38
Default Hi again, As to yr first qu
  #12
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi again,

As to yr first question, the VTK folder SHOULD ( unless your OpenFOAM is not properly intslled ) have this :

1.A VTK file database of the CFD domain 2D or 3D mesh with all the associated CFD quantities, scalarFields, vectorFields and tensorFields, consisting ot all the time slices of your case ( or the specific time slice if you used the -time flag )

2.Several folders, one for each patch ( boundary in FOAMese ), bearing the name of the patch it reports to, containing a VTK file database of the associated CFD quantities pertaining to each patch, in an ordered set of timeslices.

Your problem, maybe, is that when you open the VTK database, you should select which kind of rendering mode do you want in paraview... wireframe, volume, ... there are at least 4 options there... but ( my guess again ) if you did not run your case yet

quote: "...and then the checkMesh but after that when i run foamToVTK, i get a folder created as you say alex but if i open this folder with paraview, i can see nothing..."...

You do not yet have scalars, or vectors in your database to be queried...

I take that you proceeded to foamToVTK AFTER checkMesh WITHOUT first performing a CFD calculation with say,

%icoFoam . cavity

for instance...

Am i wrong here...?

If i am right, there is NOTHING you will do in paraview that will present CFD quantities, simply because they do not yet exist in the VTK database that you create with foamToVTK . cavity <whatever> after checkMesh . cavity...!

Get the point here... ?

As to you second question, check

http://www.cfd-online.com/OpenFOAM_D...es/1/1604.html, and download and compile

( i take it you know how to do it...

% cd .../src/.../myUtil
% ./wmake
% ./wclean

)

Best regards

Alex
alexandrepereira is offline   Reply With Quote

Old   July 21, 2008, 16:18
Default yeah u r right. i proceeded w
  #13
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
yeah u r right.
i proceeded without icoFoam

neways regarding my first question. the lift and drag cases r not in my version. I have written a code for solving them but when i try and add it to the utilities in application, i get the error, the openfoam-1.4.1 can not be modified.

also i think if u r using 1.4.1 u shuld check u wuld not be having these commands liftDrag

let me know if u succeed with them
mgz1985 is offline   Reply With Quote

Old   July 21, 2008, 18:08
Default Hi again... I had my laptop
  #14
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi again...

I had my laptop to repair last week, but i have an old PC at home, running FC4 x64, i will install and build the liftDrag utility over OpenFOAM-1.4.1 tomorrow...

I will give you the details of how to do it... since, i do no fix these things, just do it on the spot... :-)

BTW which distro do you use...? Should be no prob anyway...

is your foamInstallationTest ok...?

Should be... proper environment settings are crucial to compile new apps...

Alex
alexandrepereira is offline   Reply With Quote

Old   July 21, 2008, 18:31
Default thanx alex. I use a macinto
  #15
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
thanx alex.

I use a macintosh and a disk image of the software.

It would be a gr8 help
mgz1985 is offline   Reply With Quote

Old   July 23, 2008, 10:38
Default Hi Mayank... Didn't have ti
  #16
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Mayank...

Didn't have time to install ( compile ) liftDrag for OF-1.4.1... but check this...

http://www.cfd-online.com/OpenFOAM_D...tml?1208496888

Download liftDragTool.. extract, and follow the instructions in the README...


That should be enough...

never used OpenFOAM as an image... and i am not very familiar with image disks in Macintosh... so i do not know if there are any quirks about compiling or installing stuff in an emulated OS...

But i guess this should be enough.. at least in VMware there are no probs... with Paralels ( if that's what u use ), i just dunno...

Alex
alexandrepereira is offline   Reply With Quote

Old   July 23, 2008, 13:03
Default thanx alex a lot for ur time a
  #17
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
thanx alex a lot for ur time and info..

I have it installed at macintosh for my personal purpose. But i am doing n internship in Czech and have to install it on linux over there. i tried to install it but i keep coming across problems

earlier when i installed, it actually sourced the files properly but not when i m trying to install it again it says no such file or directory while sourcing it.

also, previously i had followed the instructions on a forum here and i followed everything here and cross-checked my results with the persons, everything was same but blockMesh command failed to execute. the only difference in my installation and the one by the person was inability to connect to ssh or rsh.

is it because of that? and can u tell me how to solve this problem? or could it be because i m the only linux user in the entire network? it has been 3 weeks since i m trying to install OpenFOAM1.4 on linux Ubuntu 8.04 64 bit and desperately need some help.

sorry, the message is really long but please help. i m trying to compile on linux and not install
mgz1985 is offline   Reply With Quote

Old   July 23, 2008, 13:06
Default and yes the link really helped
  #18
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
and yes the link really helped....
mgz1985 is offline   Reply With Quote

Old   July 23, 2008, 15:54
Default Hi Mayank In LINUX, i would
  #19
Senior Member
 
Alexandre Pereira
Join Date: Mar 2009
Posts: 155
Rep Power: 17
alexandrepereira is on a distinguished road
Hi Mayank

In LINUX, i would know how to help...

% yum install rsh-server,
for Red Hats, Fedoras, CentOS's, SL's etc ( rpm based distros )
or

% apt-get install ssh
for Ubuntus, or Debians

You only need ONE of them, rsh OR ssh... not both...

But as for Mac's I do not know what the heck is ssh in "Mac'ese"... :-)

Alex
alexandrepereira is offline   Reply With Quote

Old   July 23, 2008, 16:33
Default Hi Alex! ssh is ssh on Mac.
  #20
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Alex!

ssh is ssh on Mac. And it comes with the system

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Problem with channeloodles and foamToVTK farbfilm OpenFOAM Running, Solving & CFD 0 October 31, 2008 06:28
[OpenFOAM] FoamToVTK problem oevermann ParaView 6 July 11, 2006 16:10
[OpenFOAM] FoamToVTK error with OF 13 melanie ParaView 1 May 22, 2006 05:40
what is Mayavi and what is vtk ztdep Main CFD Forum 1 July 14, 2005 12:08
Mayavi A.S. Main CFD Forum 1 July 12, 2005 15:07


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