|
[Sponsors] |
Lagrangian particloe Tracking and getting values back |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 2, 2011, 00:41 |
Lagrangian particloe Tracking and getting values back
|
#1 |
New Member
Bruce Hartley
Join Date: Jun 2011
Posts: 9
Rep Power: 15 |
I am trying to trace particles with a modifed program which uses the standard particle Cloud definitions. In my program which is simply modified from the standard Lagrangian solvers I have the expression
particles.move(); I want to access the particle's 'position' following that move so that I can do some extra calculation involving it and to store a std::vector of these positions. I may later want to get other information such as velocity too. I define the variable 'particles' as passiveParticleCloud parrticles(mesh); which conforms with hte satndard definitions fo particle clouds. How can I access the position an other information from these Lagrangian solvers and particle clouds? The next statement is particles.write(), which writes all the lagrangian defaulat cloud data so the information is there, but how to access it? |
|
December 7, 2011, 00:00 |
Lagrangian Tracking of particles
|
#2 |
New Member
Bruce Hartley
Join Date: Jun 2011
Posts: 9
Rep Power: 15 |
I found out how to do this. The passive particle Cloud is a C++ list of somne kind. You need to define an iterator to the list.
passiveParticleCloud particles(mesh); passiveParticleCloud::iterator iter = particles.begin(); then Foam::vector Possy = iter().position(); Foam::vector Velocy = iter().U(); Foam::vector Diam = iter().d(); step through by incrementing iter iter++ easy once you have spent hours on it. |
|
Tags |
accessing positions, lagrangian fields, velocities etc |
|
|