CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

DPM Output Problem (Again...)

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

LinkBack Thread Tools Search this Thread Display Modes
Old   August 30, 2011, 09:59
Exclamation DPM Output Problem (Again...)
New Member
Join Date: Aug 2011
Posts: 2
Rep Power: 0
DLINSA is on a distinguished road
Hello everybody,

I'm on a UV water treatment reactor case, using a DPM feature to measure the UV Dose received by particles.

My problem is quiet simple and common according to other related topics(SANDIA lab uv dose files) but I still can't find the problem in my UDF :

I use a SCALAR_UPDATE macro to increase the uv dose at each time step(using a DPM scalar) which is working well at the only exception that (and I do not know why) the "initialize" variable (int) given by Fluent is always on the 1 value and this implies the program to enter always in the initialization condition and then my scalar are always reset to zero.

I solved this problem by bypassing the initialization part (I know it's bad but I didn't find any solution... Anyway scalar initialization at zero seems to be automatic when adding it in the DPM menu). If you have explanation about this they are welcome but it is not the real problem.

Here it is : the DPM_OUTPUT macro. I run this simulation on a parallel mode and when I put the "%s" for name(char variable) at the end of the par_printf() the solver crashes when a particle is sampled. When I do not put the "%s" the solver doesn't crash but I have totaly non sense values written like these :

(X):5.17004e+08 (Y) :-2.85269e+28 (Z) : 2 (my scalar 1):-4.89611e-145 (my scalar2):-1.48809e+89 etc...

Wether I'm in serial or in parallel mode, the fprintf in the dpm scal update macro works fine but that was just for testing. In the file it writes well all variables but for each interpolated positions and this is not easily exploitable. I don't know if there is a way to write in the file only if a particle is removed of the domain, with a particular condition. If it is possible that will help me because the fprintf works.

Here is the UDF:
"(%10s %10s %10s %10s %10s %10s %s ) \n","DT","X","Y","Z","Age","Dose","ID");
DEFINE_DPM_SCALAR_UPDATE(part_dose,cell,thread,ini tialize,p)
int id;
if (initialize)
/*P_USER_REAL(p,0) = 0.;
P_USER_REAL(p,1) = 0.;
uv_intensity_0 = C_UDMI(cell,thread,0);
P_USER_REAL(p,0) += P_DT(p) * .5 * (uv_intensity_0 + C_UDMI(cell,thread,0));
P_USER_REAL(p,1) += P_DT(p);
uv_intensity_0 = C_UDMI(cell,thread,0);

fprintf(fs,"((%d %e %f %e %e %f %f\n",id, C_UDMI(cell,thread,0), P_DT(p), P_USER_REAL(p,0), P_USER_REAL(p,1), P_TIME(p) - p->time_of_birth, P_POS(p)[2]);

DEFINE_DPM_OUTPUT(output_part_dose,header,fp,p,thr ead,plane)
char name[100];
if (header)
if (NNULLP(thread))

"(%s %d)\n",THREAD_HEAD(thread)->dpm_summary.sort_file_name,11);


"(%s %d)\n",plane->sort_file_name,11);

"(%10s %10s %10s %10s %10s %10s %10s %s)\n","X","Y","Z","Dose","Age","Time","ID","Blabla");



int id_out;
"\n\n\n%d %s\n\n\n",id_out,name); /*well displayed in the solver window)*/


"%d %d %10.6g %10.6g %10.6g %10.6g %10.6g %10.6g %d %s\n", P_INJ_ID(P_INJECTION(p)), p->part_id, P_POS(p)[0], P_POS(p)[1], P_POS(p)[2], P_USER_REAL(p,0), P_USER_REAL(p,1), P_TIME(p) - p->time_of_birth, id_out, name);


"((%e %e %e %e) %s)\n", P_USER_REAL(p,0), P_USER_REAL(p,1), P_TIME(p) - p->time_of_birth, name);

Configuration : Ansys Workbench 13, Win XP/ I7 860 (8 threads) 3GB

Thanks a lot in advance!

PS : The intensity field is stored in an UDM (it doesn't change with the simulation)
DLINSA is offline   Reply With Quote

Old   March 16, 2012, 00:45
Join Date: Mar 2011
Posts: 50
Rep Power: 15
cdf_user is on a distinguished road
So whats your question in one line?
cdf_user is offline   Reply With Quote


dpm, output

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
DPM converging Problem Markus Alzon FLUENT 6 April 7, 2016 11:41
Problem with DPM interaction in a coal burner Nando FLUENT 1 April 17, 2007 04:46
CFX-5.7 MPICH Parallel Problem (Output of Results) James Date CFX 7 February 15, 2005 16:03
ICEM5 Hexa output problem Pete CFX 9 September 16, 2004 18:33
Problem with DPM model cwflying FLUENT 5 January 31, 2003 11:25

All times are GMT -4. The time now is 19:41.