# How to get the particles trajectory from an Open Foam simulation

**URL:** https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046
**Category:** In Situ Support
**Created:** [August 6, 2020, 8:01am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046 "2020-08-06T08:01:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![lucierecurt](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lucierecurt](https://discourse.paraview.org/u/lucierecurt)
#### Post date: [August 6, 2020, 8:01am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/1 "2020-08-06T08:01:33Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [August 6, 2020, 8:07am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/2 "2020-08-06T08:07:51Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![lucierecurt](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lucierecurt](https://discourse.paraview.org/u/lucierecurt)
#### Post date: [August 6, 2020, 9:16am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/3 "2020-08-06T09:16:50Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![olesenm](https://discourse.paraview.org/user_avatar/discourse.paraview.org/olesenm/32/17416_2.png) [@olesenm](https://discourse.paraview.org/u/olesenm)
#### Post date: [August 6, 2020, 9:27am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/4 "2020-08-06T09:27:11Z")

</div>

Sounds like this known problem with [lagrangian data in openfoam.org version](https://discourse.paraview.org/t/paraview-unable-to-read-lagrangian-data-openfoam/3456).

- 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](http://openfoam.com), and attempt to port it to [openfoam.org](http://openfoam.org)
- foamToVTK to convert from OpenFOAM to VTK format
- foamToEnsight to convert from OpenFOAM to EnSight format and then process that in ParaView.

---

<div class="post-metadata">

### Author: ![lucierecurt](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/bc79bd/32.png) [@lucierecurt](https://discourse.paraview.org/u/lucierecurt)
#### Post date: [August 6, 2020, 9:38am UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/5 "2020-08-06T09:38:07Z")

</div>

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

---

<div class="post-metadata">

### Author: ![mabrouka](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/m/dbc845/32.png) [@mabrouka](https://discourse.paraview.org/u/mabrouka)
#### Post date: [May 23, 2022, 6:45pm UTC](https://discourse.paraview.org/t/how-to-get-the-particles-trajectory-from-an-open-foam-simulation/5046/6 "2022-05-23T18:45:13Z")

</div>

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 don`t see the position field in paraview, I tried foamToVTK and foamToEnsight, but both of them don`t show the field positions in the lagrangian part.  
thanks for your time
