How to get the particles trajectory from an Open Foam simulation

Hello everyone!

I’m currently trying to track particle using the solver icoUncoupledKinematicParcelFoam of OpenFoam 7 .

My simulation runs well but the only positions for the particles that I get are barycentric coordinates. And I didn’t find on Internet an easy method to switch barycentric coordinates to cartesian 's ones…

So I tried to do it using Paraview by using this method:

  1. run the simulation

  2. type paraFoam on the terminal

  3. add the filter extrudeBlocks and chose lagrangian data

  4. open a new layout and select spreedsheet view

  5. export date into . csv file

I was really happy with this method when I figured out there was a problem. Indeed, if, for exemple, in the file time1.csv, at the line 3 there is the coordinate of the particle 3 then in the file time2.csv , at the line 3 it’s not the coordinate of the particle 3 anymore but of another one…

It’s really a problem for me because I need to follow the trajectory of the particles…

I was wondering if there is a way in Paraview to print the trajectory of particles?

Thanks to all in advance, hope someone know how to do that…

I’m sorry, but your problem is a bit unclear. ParaView is only showing your data. Can you explain what is wrong and what you were expecting instead ?

Well, let me re explain.

Using the method that I described, I got one csv file for each time step. In each file, each line represent the coordinate x, y, and z of one particle.

The problem is that in the file of the time 1, at the line 3, I got the coordinate of the particle number 3 but in the file of the time 2, at the line 3, I got the coordinate of the particle number 5 (so it’s not the same particle).

However, for my internship project, I need to know the exact trajectory of each particle. Which I can’t do using those csv file because when I have a lot of particle, I can’t know in which line are the coordinates of the particle 3 in the file of the time 2 (to follow my example)

Hope it’s more clear for you…

Sounds like this known problem with lagrangian data in openfoam.org version.

  • could use a different version (eg, OpenFOAM-v2006), which should be the same for your type of calculations.
  • could use the vtkCloud function object from openfoam.com, and attempt to port it to openfoam.org
  • foamToVTK to convert from OpenFOAM to VTK format
  • foamToEnsight to convert from OpenFOAM to EnSight format and then process that in ParaView.

Thank you for your quick answer, I am gonna try those options

Hi all,
I am trying to get the positions of particles in Paraview, I see the file of positions in each time step, but I dont see the position field in paraview, I tried foamToVTK and foamToEnsight, but both of them dont show the field positions in the lagrangian part.
thanks for your time