CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Particle position each timestep (during simulation) (https://www.cfd-online.com/Forums/openfoam-programming-development/79575-particle-position-each-timestep-during-simulation.html)

 lindner August 27, 2010 06:32

Particle position each timestep (during simulation)

Hi, i have the following problem:
I need to know how many particles are there in the zone 1 and zone 2 of a room.

An example:
10 meter long room (x direction), while the first 5 meters are the zone 1 and the other 5 meters are zone 2.
The particle position file outputs the coordinate (x y z) of each particle, so it will be like:
if x < 5, sum to zone 1,
else, sum to zone 2

The actual output while solving the uncoupledKinematicParcelFoam is

Cloud: kinematicCloud
Total number of parcels added = 1210
Total mass introduced = 1.01368723e-17
Current number of parcels = 1210
Current mass in system = 1.01368723e-17
ExecutionTime = 0.61 s ClockTime = 1 s

and my objective is to add the following
Current number of parcels in Zone 1 = xxx
Current number of parcels in Zone 2 = yyy

Is it possible to make it in the solver?
Or it's better to make a separate code to extract this information?
By the way, i don't know c++ programming =(

Thank you, and if anyone needs I can send the room from Annex 20 with the uncoupledKinematicParcelFoam working.

PS: Using OpenFOAM 1.7.x

 Edison_Ge September 10, 2010 00:58

rather than modify the code, you can acturally find the particle position under time/lagrangian/postion. sort them in the dirction of interest in Excel or matlab. Then your answer would be obvious.

 lindner September 10, 2010 03:22

Thank you for the answer Edison, this really works for simple cases if there is not many zones.
But the problem is to have more 3D zones where the coordinates are complicated.
I did a simple fortran code and its working by the moment.

Thank you for the tips

 All times are GMT -4. The time now is 14:00.