CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF- how to calculate the number of particles in DPM (http://www.cfd-online.com/Forums/fluent-udf/105091-udf-how-calculate-number-particles-dpm.html)

 causuya July 23, 2012 02:32

UDF- how to calculate the number of particles in DPM

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?

 asal April 8, 2013 09:04

Hello causuya

Do you find any solution for calculate the number of DPM particles in UDF? I am stuck in a same situation.
thanks.

 gearboy April 8, 2013 22:34

Quote:
 Originally Posted by causuya (Post 372918) 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;
}
}

 asal April 9, 2013 04:09

Dear Gearboy
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: