# UDF- how to calculate the number of particles in DPM

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

 July 23, 2012, 02:32 UDF- how to calculate the number of particles in DPM #1 New Member   Andreas Sun Join Date: Jul 2012 Posts: 3 Rep Power: 6 Hi everyone, I am using UDF to do a transient Dust Load Simulation for Air Cleaner(as SAE paper 2006-01-1316 describled), both DPM and UDF are new to me, so I hope I can get some help here. I have particles with 4 different size injected in, and they will all pass through a internal surface boundary condition. I need compute their distribution on this surface. So, first, I want to calculate the number of particles of each size, and then their mass. Can anyone tell me how to calculate the number of DPM particles in UDF? Thanks a million in advance. kishore.pillala likes this.

 April 8, 2013, 09:04 #2 Senior Member   Astio Lamar Join Date: May 2012 Location: Pipe Posts: 177 Rep Power: 7 Hello causuya Do you find any solution for calculate the number of DPM particles in UDF? I am stuck in a same situation. thanks.

April 8, 2013, 22:34
#3
Senior Member

Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 109
Rep Power: 9
Quote:
 Originally Posted by causuya Hi everyone, I am using UDF to do a transient Dust Load Simulation for Air Cleaner(as SAE paper 2006-01-1316 describled), both DPM and UDF are new to me, so I hope I can get some help here. I have particles with 4 different size injected in, and they will all pass through a internal surface boundary condition. I need compute their distribution on this surface. So, first, I want to calculate the number of particles of each size, and then their mass. Can anyone tell me how to calculate the number of DPM particles in UDF? Thanks a million in advance.
Here is an example. Remember to hook these two functions and check "interaction with continuous phase".

#include "udf.h"
#define FACE_ID 4 /*id of your internal face*/
#define TOTAL_INJECTIONS 4
char* Injection_names[TOTAL_INJECTIONS]={"injection-0","injection-1","injection-2","injection-3"}; //injection names in your setup
int total_particles[TOTAL_INJECTIONS]={0}; // particles from each injection
real total_mass[TOTAL_INJECTIONS]={0.0}; // mass from each injection
DEFINE_DPM_SCALAR_UPDATE(calc_size,c,t,initialize, p)
{
int i;
face_t f;
Domain*domain;
domain=Get_Domain(1);
begin_f_loop(f,tf)
{
{
Message0("current particle's inject name is %s, mass is %g\n",p->injection->name,P_MASS(p));
for(i=0;i<TOTAL_INJECTIONS;i++)
{
if(STREQ(Injection_names[i],p->injection->name))
{
total_particles[i]++;
(total_mass[i])+=P_MASS(p);
}
}
}
}
end_f_loop(f,tf);
}

{
int i;
for(i=0;i<TOTAL_INJECTIONS;i++)
{
Message0("-----------------------------------------------------\n");
Message0("total particles from %s is %d, total mass is %g\n",
Injection_names[i],total_particles[i],total_mass[i]);
Message0("-----------------------------------------------------\n");
total_particles[i]=0;
total_mass[i]=0.0;
}
}

 April 9, 2013, 04:09 #4 Senior Member   Astio Lamar Join Date: May 2012 Location: Pipe Posts: 177 Rep Power: 7 Dear Gearboy Thanks a lot for your reply. I try to compile the UDF which you offer and I got this error: "The UDF library you are trying to load (libudf) is not compiled for 3ddp on the curent platform (win64). The system cannot find the file specified. " I try to follow the instruction here: http://www.cfd-online.com/Wiki/Fluen...Fload_a_UDF.3F but it doesn't work. any idea to fix it? thanks.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post chris Fluent UDF and Scheme Programming 24 April 11, 2015 00:47 Daggemann FLUENT 0 April 30, 2009 05:02 fivep Main CFD Forum 2 March 7, 2009 01:35 andre OpenFOAM 5 June 23, 2008 10:37 Johannes FLUENT 12 July 6, 2007 11:19

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