CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Lagrangian particloe Tracking and getting values back

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Bruce Hartley

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 2, 2011, 00:41
Default Lagrangian particloe Tracking and getting values back
  #1
New Member
 
Bruce Hartley
Join Date: Jun 2011
Posts: 9
Rep Power: 15
Bruce Hartley is on a distinguished road
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?
Bruce Hartley is offline   Reply With Quote

Old   December 7, 2011, 00:00
Default Lagrangian Tracking of particles
  #2
New Member
 
Bruce Hartley
Join Date: Jun 2011
Posts: 9
Rep Power: 15
Bruce Hartley is on a distinguished road
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.
xgyn likes this.
Bruce Hartley is offline   Reply With Quote

Reply

Tags
accessing positions, lagrangian fields, velocities etc

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 12:55.