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

UDF- how to calculate the number of particles in DPM

Register Blogs Community New Posts Updated Threads Search

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

Reply
 
LinkBack Thread Tools Search this Thread 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: 4
Rep Power: 13
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: 186
Rep Power: 13
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
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
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: 186
Rep Power: 13
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

Old   January 17, 2020, 03:34
Default
  #5
New Member
 
Erfan Jabari
Join Date: Dec 2019
Posts: 9
Rep Power: 6
Erfan75 is on a distinguished road
Hello, Gearboy
could you please help me?
i need a udf that can calculate the number of trapped particle?
thanks alot
Erfan75 is offline   Reply With Quote

Old   November 26, 2020, 10:29
Default
  #6
New Member
 
Mraz
Join Date: Nov 2020
Posts: 2
Rep Power: 0
Mraz is on a distinguished road
Quote:
Originally Posted by Erfan75 View Post
Hello, Gearboy
could you please help me?
i need a udf that can calculate the number of trapped particle?
thanks alot



Hi

Could you find out how to calculate the number of trapped particle?

I have a similar problem. That would be great if you help me with this.

Thanks
Mraz is offline   Reply With Quote

Old   January 18, 2021, 07:04
Default
  #7
Member
 
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 6
DnyanMiri is on a distinguished road
Quote:
Originally Posted by Mraz View Post
Hi

Could you find out how to calculate the number of trapped particle?

I have a similar problem. That would be great if you help me with this.

Thanks
You can see the number of trapped particles in the DPM summary report. You can go to particle tracking -> select injection -> summary -> display
DnyanMiri is offline   Reply With Quote

Old   January 22, 2021, 16:56
Default
  #8
New Member
 
Mraz
Join Date: Nov 2020
Posts: 2
Rep Power: 0
Mraz is on a distinguished road
Quote:
Originally Posted by DnyanMiri View Post
You can see the number of trapped particles in the DPM summary report. You can go to particle tracking -> select injection -> summary -> display
Hi,

Thank you Dnyanesh for the reply. I am interested to have number of trapped particle over time. The summery just report the total number of trapped particle at the end of calculation. Do you have any suggestion for me?

Best,
Mraz is offline   Reply With Quote

Old   January 23, 2021, 13:34
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
Quote:
Originally Posted by Mraz View Post
Hi,

Thank you Dnyanesh for the reply. I am interested to have number of trapped particle over time. The summery just report the total number of trapped particle at the end of calculation. Do you have any suggestion for me?

Best,
Suggestion:
Write a UDF for a DPM boundary condition, that adds one line to a text file and then traps the particle. The line should contain at least the time of the event, perhaps more of you want more information. Then, use a different program (excel, Matlab, your choice) to do the post-processing.
pakk is offline   Reply With Quote

Reply


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: UDF - loop over all particles chris Fluent UDF and Scheme Programming 31 June 17, 2020 05:52
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 00: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 04:56.