|
[Sponsors] |
UDF- how to calculate the number of particles in DPM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 23, 2012, 03:32 |
UDF- how to calculate the number of particles in DPM
|
#1 |
New Member
Andreas Sun
Join Date: Jul 2012
Posts: 4
Rep Power: 14 |
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. |
|
April 8, 2013, 10:04 |
|
#2 |
Senior Member
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 14 |
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, 23:34 |
|
#3 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
#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; } } |
||
April 9, 2013, 05:09 |
|
#4 |
Senior Member
Astio Lamar
Join Date: May 2012
Location: Pipe
Posts: 186
Rep Power: 14 |
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. |
|
January 17, 2020, 04:34 |
|
#5 |
New Member
Erfan Jabari
Join Date: Dec 2019
Posts: 9
Rep Power: 6 |
Hello, Gearboy
could you please help me? i need a udf that can calculate the number of trapped particle? thanks alot |
|
November 26, 2020, 11:29 |
|
#6 | |
New Member
Mraz
Join Date: Nov 2020
Posts: 2
Rep Power: 0 |
Quote:
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 |
||
January 18, 2021, 08:04 |
|
#7 |
Member
Dnyanesh Mirikar
Join Date: Jul 2019
Posts: 35
Rep Power: 7 |
You can see the number of trapped particles in the DPM summary report. You can go to particle tracking -> select injection -> summary -> display
|
|
January 22, 2021, 17:56 |
|
#8 | |
New Member
Mraz
Join Date: Nov 2020
Posts: 2
Rep Power: 0 |
Quote:
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, |
||
January 23, 2021, 14:34 |
|
#9 | |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
Quote:
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. |
||
|
|
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 06:52 |
Low Reynolds Number Drag Law - UDF | Daggemann | FLUENT | 0 | April 30, 2009 06: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 11:37 |
DPM - Why do the particles not vanish? | Johannes | FLUENT | 12 | July 6, 2007 12:19 |