CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF- how to calculate the number of particles in DPM

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

Like Tree2Likes
  • 1 Post By causuya
  • 1 Post By gearboy

Reply
 
LinkBack Thread Tools Display Modes
Old   July 23, 2012, 02:32
Default UDF- how to calculate the number of particles in DPM
  #1
New Member
 
Andreas Sun
Join Date: Jul 2012
Posts: 2
Rep Power: 0
causuya is on a distinguished road
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.
causuya is offline   Reply With Quote

Old   April 8, 2013, 09:04
Default
  #2
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
Hello causuya

Do you find any solution for calculate the number of DPM particles in UDF? I am stuck in a same situation.
thanks.
asal is offline   Reply With Quote

Old   April 8, 2013, 22:34
Default
  #3
Senior Member
 
Ji Junjie
Join Date: Feb 2010
Location: Shanghai, China
Posts: 105
Rep Power: 7
gearboy is on a distinguished road
Quote:
Originally Posted by causuya View Post
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;
Thread*tf;
Domain*domain;
domain=Get_Domain(1);
tf=Lookup_Thread(domain,FACE_ID);
begin_f_loop(f,tf)
{
if(F_C0(f,tf)==c && THREAD_ID(t)==THREAD_ID(THREAD_T0(tf))) /* if c is neighbor to your internal face*/
{
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);
}

DEFINE_ADJUST(report,domain)
{
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 likes this.
gearboy is offline   Reply With Quote

Old   April 9, 2013, 04:09
Default
  #4
Senior Member
 
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 154
Rep Power: 5
asal is on a distinguished road
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.
asal is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DPM: UDF - loop over all particles chris Fluent UDF and Scheme Programming 24 April 11, 2015 00:47
Low Reynolds Number Drag Law - UDF Daggemann FLUENT 0 April 30, 2009 05:02
Pls help: unsteady, DPM, track, particles, number fivep Main CFD Forum 2 March 7, 2009 01:35
Unaligned accesses on IA64 andre OpenFOAM 5 June 23, 2008 10:37
DPM - Why do the particles not vanish? Johannes FLUENT 12 July 6, 2007 11:19


All times are GMT -4. The time now is 07:05.