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

Problem with getting the particle position using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2010, 02:11
Default Problem with getting the particle position using UDF
  #1
New Member
 
Ananth Pai
Join Date: Jan 2010
Posts: 1
Rep Power: 0
Ananth Pai is on a distinguished road
I am trying to get the particle positions at the end of each time step into a csv or text file. I am using DEFINE_DPM_SCALAR_UPDATE to get the positions. I am injecting 10000 particles initially and later on there is no injections. The csv file is written after each time step but there r 140000 entries into it with the no of particles bieng only 10000(i have checked it through Particle tracks). Below given is the UDF code

#include "udf.h"
#include "dpm.h"


/* update the user scalar variables */


DEFINE_DPM_SCALAR_UPDATE(follow_particle, cell, thread, initialize, p)
{
char n[18];

FILE *pf;
sprintf(n,"particle%f.csv",CURRENT_TIME);
pf = fopen ("n", "a");
fprintf(pf,"%g %g\n",P_POS(p)[0], P_POS(p)[1]);

fclose(pf);

}

Kindly help.
Ananth Pai is offline   Reply With Quote

Reply

Tags
particle, particle position, particle tracking, udf exporting variable


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
DPM UDF particle position Tom FLUENT 8 July 25, 2015 13:30
Problem with a simple UDF to calculate cell-averaged particle values kmayank FLUENT 1 January 18, 2011 02:40
I have a big problem at the UDF. Please help me motallebi FLUENT 1 July 3, 2009 12:10
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
parallel UDF problem kerem FLUENT 2 June 20, 2006 07:56


All times are GMT -4. The time now is 17:57.