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/)
-   -   FoamToVTK and MayaVi (https://www.cfd-online.com/Forums/openfoam-post-processing/61372-foamtovtk-mayavi.html)

alexandrepereira April 29, 2008 21:50

Hi Foam World... What can
 
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

mattijs April 30, 2008 03:57

foamToVTK outputs 'UNSTRUCTURE
 
foamToVTK outputs 'UNSTRUCTURED_GRID' data with 'FIELD attributes' (run foamToVTK with -ascii). How does Mayavi/Visit want the vtk format?

alexandrepereira April 30, 2008 22:50

Hi Mattijs... I have done s
 
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

mattijs May 1, 2008 15:41

Sorry, I don't run MayaVi/Visi
 
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.

alexandrepereira May 24, 2008 23:12

Hi Mattijs Sorry for not re
 
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 May 24, 2008 23:30

Hi Again... Could it be tha
 
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 May 24, 2008 23:36

BTW, foamToVTK outputs vtk for
 
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

mgz1985 July 20, 2008 11:16

hi alex I can not use the p
 
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

alexandrepereira July 20, 2008 14:23

Hi Gupta, I think... ( not
 
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

mgz1985 July 20, 2008 14:56

thanx alex i tried it....and i
 
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 July 21, 2008 04:49

hi again alex, I have a que
 
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

alexandrepereira July 21, 2008 14:38

Hi again, As to yr first qu
 
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

mgz1985 July 21, 2008 15:18

yeah u r right. i proceeded w
 
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

alexandrepereira July 21, 2008 17:08

Hi again... I had my laptop
 
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

mgz1985 July 21, 2008 17:31

thanx alex. I use a macinto
 
thanx alex.

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

It would be a gr8 help

alexandrepereira July 23, 2008 09:38

Hi Mayank... Didn't have ti
 
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

mgz1985 July 23, 2008 12:03

thanx alex a lot for ur time a
 
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 July 23, 2008 12:06

and yes the link really helped
 
and yes the link really helped....

alexandrepereira July 23, 2008 14:54

Hi Mayank In LINUX, i would
 
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

gschaider July 23, 2008 15:33

Hi Alex! ssh is ssh on Mac.
 
Hi Alex!

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

Bernhard


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