|
[Sponsors] |
Problem with getting the particle position using UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 17, 2010, 02:11 |
Problem with getting the particle position using UDF
|
#1 |
New Member
Ananth Pai
Join Date: Jan 2010
Posts: 1
Rep Power: 0 |
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. |
|
Tags |
particle, particle position, particle tracking, udf exporting variable |
|
|
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 |