|
[Sponsors] |
November 14, 2010, 09:05 |
do particle tracking in paraview?
|
#1 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Dear OpenFOAMers,
I completed a transient interFoam case. I am wondering if it is possible to do lagrangian particle tracking in paraview/paraFoam? I do not really care about the forces/sizes of the particles. I just want to show, if massless/sizeless particles released from certain locations, their paths as function of time. Thanks! Pei |
|
November 15, 2010, 04:33 |
|
#2 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Pei-Ying,
To visualize Lagrangian particles i convert the case to VTK Code:
foamToVTK
__________________
Regards, Gijs |
|
November 15, 2010, 06:52 |
|
#3 |
Super Moderator
Takuya OSHIMA
Join Date: Mar 2009
Location: Niigata City, Japan
Posts: 518
Blog Entries: 1
Rep Power: 20 |
Hi guys,
Or in case if you want to create particle tracking with pathlines that animates over time completely within ParaView from case without lagrangian data, yes you can, but with a bit complex visualization pipeline (see the Pipeline Browser in the screenshot attached below). The key is to apply Temporal Interpolator that allows you not only to interpolate saved time steps (that are typically too sparse to create a smooth particle tracking animation by themselves) but also to access temporal filters of ParticleTracer and Particle Pathlines. And note that you can create particle seeds from whatever source you like (Plane, Point Source Line, etc) in the Sources menu. There are lots of options across the filters and sources that affect the formation of the pathlines so you need to do some experiments. Also, in my experience ParticleTracer of ParaView 3.8.0 often crashes ParaView so you might need a git version of ParaView 3.9. Takuya |
|
November 15, 2010, 07:43 |
|
#4 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Hi, 7islands,
Thanks! This is exactly what I am looking for. I did not include lagrangian particles when running the interFoam case. I am hoping to plot the particles in paraFoam/paraview. I did experiment particleTracer very briefly (before I saw your post) and could not quite figure out how to do it. Now, I will try to follow your steps to see if I can get it right this time. Pei |
|
November 16, 2010, 03:22 |
|
#5 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Pei,
Perhaps the Code:
particleTracks
__________________
Regards, Gijs |
|
November 16, 2010, 14:16 |
|
#6 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Dear Gijs,
Thanks! But, where can I find this particleTracks code? Pei-Ying |
|
November 17, 2010, 03:43 |
|
#7 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Dear Pei-Ying,
particleTracks is a utility that is part of the OpenFOAM package (see here under "New utilities"). It lives in $FOAM_UTILITIES/postProcessing/lagrangian/particleTracks. In the case directory you need to copy a file called particleTrackProperties into the constant/ directory: Code:
cp $FOAM_UTILITIES/postProcessing/lagrangian/particleTracks/particleTrackProperties constant/ Code:
particleTracks
__________________
Regards, Gijs |
|
November 17, 2010, 07:59 |
|
#8 |
Senior Member
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18 |
Thanks a lot Gijs!
Pei-Ying |
|
March 28, 2011, 14:28 |
|
#9 |
New Member
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15 |
Dear People
I tried to run FoamToVTK utility inside my case directory But it didnt run through properly, instead it gave me a message like : /*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : 1.7.1-03e7e056c215 Exec : foamToVTK Date : Mar 28 2011 Time : 17:43:35 Host : vlxhead2 PID : 16896 Case : /home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample nProcs : 1 SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 At time: 0.001 detected cloud directory : "defaultCloud" Time: 0 volScalarFields : alpha p k epsilon volVectorFields : Ua Ub Internal : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/mono1.5mmPeak-1.7.x-sample_0.vtk" Original cells:540 points:1184 Additional cells:0 additional points:0 Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/inlet/inlet_0.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/outlet/outlet_0.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/walls/walls_0.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/defaultFaces/defaultFaces_0.vtk" Lagrangian: "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/lagrangian/defaultCloud/defaultCloud_0.vtk" Time: 0.001 volScalarFields : alpha p k nutb epsilon volVectorFields : Ur Ub U Ua Uc Internal : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/mono1.5mmPeak-1.7.x-sample_5.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/inlet/inlet_5.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/outlet/outlet_5.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/walls/walls_5.vtk" Patch : "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/defaultFaces/defaultFaces_5.vtk" Lagrangian: "/home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/VTK/lagrangian/defaultCloud/defaultCloud_5.vtk" labels : origId origProcId tag scalars : d vectors : U positions spherical tensors : symm tensors : tensors : --> FOAM FATAL IO ERROR: wrong token type - expected int found on line 22 the punctuation token '(' file: /home_g07/s1065046/OpenFOAM/s1065046-1.7.1/run/mono1.5mmPeak-1.7.x-sample/mono1.5mmPeak-1.7.x-sample/0.001/lagrangian/defaultCloud/positions at line 22. From function operator>>(Istream&, int&) in file primitives/ints/int/intIO.C at line 68. FOAM exiting Eventually a Folder named VTK was made in the case directory, but it didn work. Please help. I am not able to understand why it didnt work. Best Wishes Prashant |
|
March 28, 2011, 14:51 |
|
#10 | |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Prashant,
Quote:
__________________
Regards, Gijs |
||
March 28, 2011, 15:41 |
|
#11 |
New Member
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15 |
Hey,
I checked in file, but there was not an instance of (( occuring . Anyways its a OpenFoam result file that it has indicated to a have a error in, I am not sure how to proceed, is there any other way to post process lagragian particles than using FoamToVTK. Best Wishes Prashant |
|
March 29, 2011, 02:37 |
|
#12 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Prashant,
Perhaps it's possible to use foamToTecplot, but i don't know. I don't have Tecplot and always use ParaView with VTK files. Still, there must be something wrong with line 22 in some file in 0.001, whoever wrote that file . What does Code:
awk 'FNR==22 {print FILENAME": "$0}' 0.001/*
__________________
Regards, Gijs |
|
March 29, 2011, 08:28 |
|
#13 | |
New Member
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15 |
Hey ,
I found the file it mentions, it reads like /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class vectorField; location "0.001"; object positions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 2160 ( (0.00101927 0.000749988 0.00222566) (0.00948121 0.000749997 0.000872757) (0.0132042 0.000749993 0.0036906) (0.0151473 0.00180264 0.00075) (0.0207055 0.000749997 0.000750031) (0.0215812 0.000749995 0.00196801) (0.0271111 0.000749991 0.00075002) (0.0310265 0.000749997 0.00252693) ........ ) Though it reads a punctuation mark at line 22 which is the fourth line after 2160 (0.00948121 0.000749997 0.000872757) This file is a result file generated by OpenFoam , even if I want I cant change its format. Can you copy paste a result file you get after you execute FoamToVTK. Please suggest how to go about this. Also I tried to run another code and tried using FoamToVTK , it still didnt work, but gave some other error. I am not sure what its upto Can you help ? Best Wishes Prashant Quote:
|
||
March 29, 2011, 09:25 |
|
#14 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi Prashant,
Hmm, at first glance the file looks alright. Can you e-mail me the case with time steps 0 and 0.001? Then I can have a go ... My e-mail is gijsbert dot wierink at gmail dot com. PS Please send a tar file. In case you don't know how, do "tar -pczf case.tar.gz case" in the directory where you case directory lives (here, "case" is the name of your case).
__________________
Regards, Gijs |
|
March 29, 2011, 10:07 |
|
#15 | |
New Member
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15 |
Hey Thanks very much,
I have sent you email with the whole folder I run FoamToVTK command. In it there are cases 0 and 0.001 please help Best Wishes Prashant Quote:
|
||
March 29, 2011, 10:54 |
|
#16 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi!
I received your e-mail and fixed the case (or at least it converts to VTK without error). The trick was to change "vectorField" to "volVectorField" in <timeStep>/lagrangian/defaultCloud/positions. Also, you need to add a space and a zero at the end of every vector line in the same file. Since you have more than 2000 particles, you'll probably go nuts if you do this by hand. This should do the job in the case dir: Code:
sed -i '12s/vector/volVector/' 0.001/lagrangian/defaultCloud/positions sed -i '21,2180s/$/ 0/g' 0.001/lagrangian/defaultCloud/positions
__________________
Regards, Gijs |
|
March 29, 2011, 11:30 |
|
#17 | |
New Member
Prashant Gupta
Join Date: Mar 2011
Location: Edinburgh
Posts: 29
Rep Power: 15 |
Hey ,
It worked, thanks very much for your help Also if you could suggest how can I do these changes for more time steps like 0.001, 0.002.... 0.1 ( 100 directories ) all at once. Best Wishes Prashant Quote:
|
||
March 29, 2011, 12:18 |
|
#18 |
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18 |
Hi,
Haha, our mails crossed again . Just make a bash script something like this: Code:
#!/bin/bash for i in `ls -d */ | sed -e 's/\///'`;do sed -i '12s/vector/volVector/' $i/lagrangian/defaultCloud/positions sed -i '21,2180s/$/ 0/g' $i/lagrangian/defaultCloud/positions done Code:
chmod +x ~/bin/foo . ~/.bashrc
__________________
Regards, Gijs |
|
May 20, 2011, 04:44 |
|
#19 |
New Member
M. A.
Join Date: Jul 2010
Posts: 27
Rep Power: 16 |
Hi friends,
I'm simulating a tube with water flow. The tube encounters boiling near the wall. I intend to calculate 'void fraction versus enthalpy' along the channel. Can you help me how to calculate void fraction? I'm in an emergency condition. Waiting for your comments!!! Thanks Everybody |
|
May 22, 2011, 21:43 |
|
#20 | |
Senior Member
|
Quote:
If i understand truly this works when the simulation has been done with lagrangian solvers. I have simulated a hydrocyclone with pisoFoam solver for one phase. Now i want inject particles as second phase and do particle trajectory for them. I didn't find any suitable solver in lagrangian solvers. What is your suggestion for me? Regards. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] ParaView ErrOr | soheil nazmdeh | ParaView | 1 | August 17, 2013 08:40 |
injection problem | Mark New | FLUENT | 0 | August 4, 2013 02:30 |
Particle Tracking for ion | Jun | CFX | 2 | August 31, 2010 09:19 |
particle tracking in unsteady flow | peterchen | FLUENT | 1 | July 22, 2010 23:18 |
restarting lagrange (particle tracking) simulation | dbdias | CFX | 0 | September 22, 2007 20:26 |