|
[Sponsors] | |||||
|
|
|
#61 |
|
Senior Member
Rasmus Hemph
Join Date: Mar 2009
Location: Sweden
Posts: 108
Rep Power: 6 ![]() |
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... |
|
|
|
|
|
|
|
|
#62 |
|
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 13 ![]() |
Hi Luke,
when using the -fields option supply the fields between brackets as in -fields (gamma U p) |
|
|
|
|
|
|
|
|
#63 |
|
Member
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 6 ![]() |
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. |
|
|
|
|
|
|
|
|
#64 |
|
Member
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 6 ![]() |
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?
|
|
|
|
|
|
|
|
|
#65 |
|
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 13 ![]() |
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! |
|
|
|
|
|
|
|
|
#66 |
|
Member
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 6 ![]() |
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. |
|
|
|
|
|
|
|
|
#67 |
|
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 13 ![]() |
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. |
|
|
|
|
|
|
|
|
#68 |
|
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 8 ![]() |
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 |
|
|
|
|
|
|
|
|
#69 |
|
Super Moderator
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 13 ![]() |
- 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. |
|
|
|
|
|
|
|
|
#70 |
|
New Member
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#71 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
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.
|
|
|
|
|
|
|
|
|
#72 |
|
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 724
Rep Power: 10 ![]() |
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. |
|
|
|
|
|
|
|
|
#73 |
|
New Member
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#74 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
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. |
|
|
|
|
|
|
|
|
#75 |
|
Member
Luckyluke
Join Date: Mar 2009
Posts: 51
Rep Power: 6 ![]() |
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. |
|
|
|
|
|
|
|
|
#76 |
|
New Member
Michael Oevermann
Join Date: Mar 2009
Posts: 15
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#77 |
|
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 11 ![]() |
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.
|
|
|
|
|
|
|
|
|
#78 |
|
New Member
Amalia Apalategui
Join Date: Mar 2009
Posts: 13
Rep Power: 6 ![]() |
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 |
|
|
|
|
|
|
|
|
#79 |
|
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,697
Rep Power: 17 ![]() |
Use the "laminar" turbulence model.
in constant/turbulenceProperties: turbulenceModel laminar; Enjoy, Hrv
__________________
Hrvoje Jasak |
|
|
|
|
|
|
|
|
#80 |
|
New Member
Chris Greenshields
Join Date: Mar 2009
Posts: 28
Rep Power: 6 ![]() |
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. |
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Paraview 34 | hsieh | OpenFOAM Paraview & paraFoam | 4 | January 26, 2009 14:31 |
| Paraview 300 | vinz | OpenFOAM Paraview & paraFoam | 12 | October 6, 2007 09:46 |
| Paraview | peter | ParaView | 0 | November 29, 2006 01:47 |
| Paraview | jojo | ParaView | 4 | June 25, 2006 19:01 |
| HI all I cant find display button in paraview when i execute cavity tutorial there is only parameter button in the paraview | chan | OpenFOAM Paraview & paraFoam | 2 | February 13, 2006 07:37 |