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   April 21, 2005, 05:19
Default I do this (in tcl) to get the
  #61
Senior Member
 
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 17
hemph is on a distinguished road
I do this (in tcl) to get the U-velocity field.
I got a lot of info from the VTK-books, 'VTK User's Guide'
and 'The Visualization Toolkit'.

//Rasmus Hemph

#------------------------------
#READ THE GRID
#------------------------------
vtkUnstructuredGridReader gridreader
append fileName $GRIDPATH $FILEPREFIX "1000.vtk"
gridreader SetFileName $fileName
#------------------------------

#-----------------------------------
#EXTRACT THE U-VECTOR VOLUME FIELD
#-----------------------------------
vtkFieldDataToAttributeDataFilter gfilter
gfilter SetInput [gridreader GetOutput]
gfilter SetInputFieldToPointDataField
gfilter DefaultNormalizeOff
gfilter SetVectorComponent 0 U 0
gfilter SetVectorComponent 1 U 1
gfilter SetVectorComponent 2 U 2
#-----------------------------------

#------------------------------
#OUTLINE OF THE DOMAIN
#----------------------------
#extract the outline of the domain
vtkOutlineFilter outline
outline SetInput [gridreader GetOutput]
#..and create a mapper and actor
vtkPolyDataMapper outlineMapper
outlineMapper SetInput [outline GetOutput]
set center [outlineMapper GetCenter]

...MORE CODE TO GET GRAPHICS...
hemph is offline   Reply With Quote

Old   April 21, 2005, 05:30
Default Hi Luke, when using the -fi
  #62
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Luke,

when using the -fields option supply the fields
between brackets as in

-fields (gamma U p)
mattijs is offline   Reply With Quote

Old   April 21, 2005, 07:05
Default Now,foamToVTK has been modifie
  #63
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 17
luckyluke is on a distinguished road
Now,foamToVTK has been modified to meet my need and a likely right VTK file was got.

I don't know exactly the difference between vtkMesh and fvMesh. The vMesh is defined as follows:
vtkMesh vMesh
(
IOobject
(
meshName,
runTime.timeName(),
runTime,
IOobject::MUST_READ
),
cellSetName
);
I want to know if the point and cell data have been read into vMesh with the above code? If the mesh of my solver keep the same along the time, then whether the code
"polyMesh::readUpdateState meshState = vMesh.readUpdate();......"
in the time loop of my solver
"while (runTime.run()){......}"
should be removed?

Help me.
luckyluke is offline   Reply With Quote

Old   April 21, 2005, 07:56
Default Another question, I want to kn
  #64
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 17
luckyluke is on a distinguished road
Another question, I want to know if vtkMesh vMesh can be constructed dircetly from fvMesh mesh? Or if we can convert foam data to VTK format without vtkMesh class?
luckyluke is offline   Reply With Quote

Old   April 21, 2005, 13:56
Default Yes, when you construct a vtkM
  #65
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Yes, when you construct a vtkMesh with an IOobject with MUST_READ flag it will read the whole mesh. (leave cellSetName an empty string)

It behaves exactly like a normal fvMesh with the difference that it holds the vtk representation (accessible through topo()).

You do not need the readUpdate if your mesh is static.

The vtk representation (vtkTopo) holds the vtk cell types and vertices and does automatic decomposition of polyhedral cells.

Sounds as if you're trying to do something hard. Good luck!
mattijs is offline   Reply With Quote

Old   April 22, 2005, 10:19
Default Hi, Mattijs, thanks for your h
  #66
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 17
luckyluke is on a distinguished road
Hi, Mattijs, thanks for your help.
The VTK file achieved has the following lines.
CELL_DATA 12800
FIELD attributes 2
cellID 1 12800 int
gamma 1 12800 float //1 for scalar?

In my Visualization Toolkit, I can only find POINT_DATA instead of CELL_DATA. Which vtk class should be used? vtkUnstructuredGridReader,vtkUnstructuredGrid, or vtkFieldData? Can you tell me how to get the gamma field out in VTK?

Help me.
Thanks.
luckyluke is offline   Reply With Quote

Old   April 22, 2005, 10:26
Default No idea. This is what I would
  #67
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
No idea. This is what I would do:
1. get a valid case with a gamma field and convert it with foamToVTK with the -ascii option and compare the output.
2. the name of the reader is displayed somewhere on the tab it creates when you read your file.
mattijs is offline   Reply With Quote

Old   April 25, 2005, 02:22
Default Hi, can anybody tell me wha
  #68
Senior Member
 
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19
braennstroem is on a distinguished road
Hi,

can anybody tell me what advantages paraview has compared to Opendx; and disadvantages. I mean there must be some good reasons, not to support OpenDX anymore!?
Until now, I use OpenDX which is in my eyes pretty powerfull, but I am thinking about leaving OpenDX and just go deeper into paraview.

Greetings!
Fabian
braennstroem is offline   Reply With Quote

Old   April 25, 2005, 04:19
Default - paraview runs without any us
  #69
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
- paraview runs without any user programming in combination with the foamToVTK converter
- paraFoam requires much less programming than the Open-DX reader (have a look at the complexity of the postFoam network)
- paraview uses much less memory.
- paraview can do distributed data.

There was never too much of a problem with Open-DX itself, it was all the programming nessecary to read and display OpenFOAM data. Paraview is setup to be a CFD postprocessor, OpenDX is an environment to quickly generate one's own postprocessor.
mattijs is offline   Reply With Quote

Old   April 27, 2005, 06:21
Default Hi, I'm having problems using
  #70
New Member
 
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 17
oevermann is on a distinguished road
Hi, I'm having problems using paraview 2.0. Since I have an installed version of paraview 2.0 aleady running on my machine, I don't want to compile it again in openfoam. However, when I call
paraFoam icoFoam cavity
on the tutorial example, I get the following error message with paraview crashing

/home/oevermann/OpenFOAM/OpenFOAM-1.1/bin/paraFoam: line 57: 5357 Segmentation fault paraview paraFoam.pvs

Question: how do I get openfoam work neatly with a pre-installed paraview? Which environmental variables and configuration files do I need to set?

Thanks for any help

michael
oevermann is offline   Reply With Quote

Old   April 27, 2005, 06:27
Default You will have to rebuild the O
  #71
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
You will have to rebuild the OpenFOAM ParaView reader module for your pre-installed version of ParaView but the binaries released from KitWare do not include all the necessary build scripts to do this which is why we release ParaView binaries with OpenFOAM which include everything necessary to build the reader module. So the easiest way forward is for you to use the ParaView we release with OpenFOAM or if for some reason you are unable to you will probably have to build from sources.
henry is offline   Reply With Quote

Old   April 27, 2005, 06:33
Default I have similar problems. I ins
  #72
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21
eugene is on a distinguished road
I have similar problems. I installed paraview 2.0 to take advantage of the new animation and parallel post-processing capabilities and it is no longer compatible with the reader module.

If you do not want to downgrade to the supported paraview version, I suggest you use the foamToVTK utility to convert your cases to vtk format before post processing. At least that is what I am doing at the moment.
eugene is offline   Reply With Quote

Old   April 27, 2005, 06:36
Default Henry, thanks for the note! I
  #73
New Member
 
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 17
oevermann is on a distinguished road
Henry, thanks for the note! I did built Paraview from source because there is no binary for G5 Mac's running Debian Gnu Linux. So, everything should be OK. How do I rebuild the reader module?

Thanks, michael
oevermann is offline   Reply With Quote

Old   April 27, 2005, 06:46
Default First change the environment v
  #74
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
First change the environment variable for the location and version of ParaView in
.OpenFOAM-1.1/apps/paraview/bashrc or cshrc depending on what shell you are using and source your ~/.bashrc or ~/.cshrc. Then goto OpenFOAM-1.1/applications/utilities/postProcessing/graphics/PVFoamReader
and remove the directories for your platform from PVFoamReader/Make and vtkFoam/Make and type Allwmake and that should build the reader module for you.
henry is offline   Reply With Quote

Old   April 27, 2005, 08:09
Default Hi,all. I want to use the VTK
  #75
Member
 
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 17
luckyluke is on a distinguished road
Hi,all. I want to use the VTK lib in this directory "OpenFOAM/linux/paraview-1.8.5/". Whether the VTK contained in paraview has any difference to the original version from the web site of VTK? What is the version of my VTK located in "OpenFOAM/linux/paraview-1.8.5/"?

Under this folder
"\OpenFOAM-1.1\applications\utilities\postProcessing\graphics \PVFoamReader\vtkFo am\Make", I found the option file

EXE_INC = \
-I$(ParaView_INST_DIR)/include/vtk \
-I../PVFoamReader

LIB_LIBS = $(GLIBS).

What is the value of $(GLIBS)? I type "echo $GLIBS", it shows nothing. What should "GLIBS" be replaced by?

Thanks.
luckyluke is offline   Reply With Quote

Old   April 27, 2005, 13:23
Default I have rebuild the ParaView re
  #76
New Member
 
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 17
oevermann is on a distinguished road
I have rebuild the ParaView reader and paraview 2.0 starts up normally. However, on the console I get the following error message and Paraview crashes when I hit e.g the accept button:

ErrorMessage
# Error or warning: There was a VTK Error in file: /home/oevermann/ftp/paraview-2.0.1/VTK/Filtering/vtkDemandDrivenPipeline.cxx (544)
Algorithm vtkFoamReader(0x117da848) did not create output for port 0 when asked by REQUEST_DATA_OBJECT and does not specify a concrete DATA_TYPE_NAME.
ErrorMessage end
ErrorMessage
# Error or warning: There was a VTK Error in file: /home/oevermann/ftp/paraview-2.0.1/VTK/Filtering/vtkDemandDrivenPipeline.cxx (544)
Algorithm vtkFoamReader(0x117da848) did not create output for port 0 when asked by REQUEST_DATA_OBJECT and does not specify a concrete DATA_TYPE_NAME.
ErrorMessage end
ErrorMessage
# Error or warning: There was a VTK Error in file: /home/oevermann/ftp/paraview-2.0.1/VTK/Filtering/vtkDemandDrivenPipeline.cxx (544)
Algorithm vtkFoamReader(0x117da848) did not create output for port 0 when asked by REQUEST_DATA_OBJECT and does not specify a concrete DATA_TYPE_NAME.
ErrorMessage end
ErrorMessage
# Error or warning: There was a VTK Error in file: /home/oevermann/ftp/paraview-2.0.1/VTK/Filtering/vtkDemandDrivenPipeline.cxx (544)
Algorithm vtkFoamReader(0x117da848) did not create output for port 0 when asked by REQUEST_DATA_OBJECT and does not specify a concrete DATA_TYPE_NAME.
ErrorMessage end

Paraview works fine with other (non openfoam) applications. Any suggestions what's going wrong here?

Thanks again for any help

Michael
oevermann is offline   Reply With Quote

Old   April 27, 2005, 13:35
Default Sorry I haven't tried the read
  #77
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Sorry I haven't tried the reader module with anything beyond paraview-1.8.5 but we will try paraview-2.0.1 for the next release.
henry is offline   Reply With Quote

Old   May 4, 2005, 05:37
Default Hi! I have run the tutorial c
  #78
aap
New Member
 
Amalia Apalategui
Join Date: Mar 2009
Posts: 13
Rep Power: 17
aap is on a distinguished road
Hi!
I have run the tutorial case simpleFoam/pitzDaily. I have seen the results with paraview. Do you know how to picture the streamlines? And other question, if I want to use simpleFoam for laminar regime, how could I "eliminate" the turbulence?
Thanks
Amalia
aap is offline   Reply With Quote

Old   May 4, 2005, 05:58
Default Use the "laminar" turbulence m
  #79
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Use the "laminar" turbulence model.

in constant/turbulenceProperties:

turbulenceModel laminar;

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 4, 2005, 06:27
Default Streamlines are documented in
  #80
New Member
 
Chris Greenshields
Join Date: Mar 2009
Posts: 28
Rep Power: 17
chris is on a distinguished road
Streamlines are documented in the user guide:
http://www.opencfd.co.uk/openfoam/do...36-2000007.1.7

Alternatively, just experiment with the Filters. They are very easy and intuitive to use.
chris is offline   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 20:53
[General] How to relate tensor data in vtk file to Paraview awa5114 ParaView 0 March 7, 2017 04:56
[General] Creating VTK image compatible to Paraview Visualizer het ParaView 0 January 7, 2016 08:20
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
[General] paraview ignores SPACING in STRUCTURED_POINTS vtk data? jaffar ParaView 0 November 27, 2012 09:36


All times are GMT -4. The time now is 05:26.