CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Can I get x,y,z coordinates of a particle in lagrangian simulation

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2012, 14:16
Default Can I get x,y,z coordinates of a particle in lagrangian simulation
  #1
Member
 
Join Date: Jun 2011
Posts: 86
Rep Power: 15
mali28 is on a distinguished road
Hi,

Can I get x, y, z coordinates of particles moving in a fluid. The particles are tracked using lagrangian approach.

Thank you.
mali28 is offline   Reply With Quote

Old   January 30, 2012, 15:11
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Hi,

try this:
report-> discrete phase-> sample
select default-interior in boundaries panel and desired injections from injection pane then open the created file with a text editor which has "dpm" extension.

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   January 30, 2012, 15:51
Default
  #3
Member
 
Join Date: Jun 2011
Posts: 86
Rep Power: 15
mali28 is on a distinguished road
Quote:
Originally Posted by Amir View Post
Hi,

try this:
report-> discrete phase-> sample
select default-interior in boundaries panel and desired injections from injection pane then open the created file with a text editor which has "dpm" extension.

Bests,
Thanks, but I need it inside UDF because I want to apply modified drag coefficient due to close packing of the particles. For that I will need to know at any instant what the coordinates of a particles are and its nearby particles. If the distance between two adjacent particles is less than twice of diameter then modified drag coeff. will hold, other wise the one used by Fluent will be applied.

Any thoughts?
mali28 is offline   Reply With Quote

Old   January 31, 2012, 04:28
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Quote:
Originally Posted by mali28 View Post
Thanks, but I need it inside UDF because I want to apply modified drag coefficient due to close packing of the particles. For that I will need to know at any instant what the coordinates of a particles are and its nearby particles. If the distance between two adjacent particles is less than twice of diameter then modified drag coeff. will hold, other wise the one used by Fluent will be applied.

Any thoughts?
Ok, your goal needs few settings; first of all, you can use P_POS(p) in a UDF in order to access the particle coordinates, but I think that because of using less memory each particle ise solved from the start to the end of its trajectory and then switches to another particle (check it); so if you want to have particle interactions you have to use a journal file in this manner:
  • compute the all of particle trajectories for one (and equal) time step. (you may want to write additional UDf to adjust the time step)
  • correct drag coefficients and other modifications
  • compute for the next time step

Bests,
__________________
Amir
Amir is offline   Reply With Quote

Old   January 31, 2012, 04:47
Default
  #5
Member
 
laurentb's Avatar
 
Laurent B
Join Date: Jun 2009
Location: Lille, FRANCE
Posts: 70
Rep Power: 17
laurentb is on a distinguished road
Hi,

This is an udf example which save in a file particle data (id, position, velocity and velocity derivatives). It may be useful :

# include "udf.h"

FILE *fp;

DEFINE_ON_DEMAND(open_file)
{
fp=fopen("data.txt","a");
}

DEFINE_DPM_SCALAR_UPDATE(trajectory,cell,thread,in itialize,p)
{
// COMPILED MODE ONLY
fprintf(fp,"%d %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g \n",p->part_id,p->state.pos[0],p->state.pos[1],p->state.pos[2],p->state.V[0],p->state.V[1],p->state.V[2],p->state.time,C_DUDX(cell, thread), C_DUDY(cell, thread), C_DUDZ(cell, thread), C_DVDX(cell, thread), C_DVDY(cell, thread), C_DVDZ(cell, thread), C_DWDX(cell, thread), C_DWDY(cell, thread), C_DWDZ(cell, thread));
}

DEFINE_ON_DEMAND(close_file)
{
fclose(fp);
}
laurentb is offline   Reply With Quote

Old   April 5, 2012, 19:00
Default Modifying Cd by particle spacing
  #6
New Member
 
John
Join Date: Jan 2012
Posts: 3
Rep Power: 14
Mr. CFD is on a distinguished road
@mali28

Quote:
Originally Posted by mali28 View Post
Thanks, but I need it inside UDF because I want to apply modified drag coefficient due to close packing of the particles. For that I will need to know at any instant what the coordinates of a particles are and its nearby particles. If the distance between two adjacent particles is less than twice of diameter then modified drag coeff. will hold, other wise the one used by Fluent will be applied.

Any thoughts?

Hi mali28, I am currently trying to do the same thing. What exactly are/were you simulating? Since it looks like you solved your problem, would you be kind enough to tell me just how you did it?

Thanks!
Mr. CFD is offline   Reply With Quote

Reply


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lagrangian particle tracking skabilan OpenFOAM Running, Solving & CFD 7 July 15, 2014 13:40
Euler-Euler vs. Lagrangian particle tracking for biomass pyrolysis in a rotary kiln audrey Main CFD Forum 0 February 22, 2011 13:09
Pressure gradient in particle simulation Mikka Main CFD Forum 0 August 5, 2007 22:55
Pressure gradient in particle simulation Mikka Main CFD Forum 0 June 30, 2007 23:16
air particle simulation software kong Main CFD Forum 0 February 11, 2006 23:33


All times are GMT -4. The time now is 18:04.