# HELP! how inject the same number of particles that exits the domain?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 August 1, 2013, 11:04 HELP! how inject the same number of particles that exits the domain? #1 New Member     Matias Hess Join Date: May 2012 Location: Resistencia (Argentina) Posts: 4 Rep Power: 8 Hi all, I'm making use of DPM to model a recirculating batch reactor with liquid-solid heterogeneous flow. I need help with a UDF that works on boundary conditions by injecting the same number of particles that left the domain to maintain constant mass. My boundary conditions were on output "pressure outlet" and "velocity inlet" at the inlet. Really I would greatly appreciate if you help me with the UDF. Greetings my dear!

 August 5, 2013, 13:45 #2 New Member     Matias Hess Join Date: May 2012 Location: Resistencia (Argentina) Posts: 4 Rep Power: 8 pleasee someone who can help me? any contribution will help me to advance my project

 August 7, 2013, 14:32 #3 Senior Member   François Grégoire Join Date: Jan 2010 Location: Laval University, Canada Posts: 389 Rep Power: 11 Hi, The following example is not about particles, but it shows how you can do some calculations on a boundary at each time step and apply the results somewhere else. - Area averaged temperature is calculated at the outlet. - The calculated average temperature is augmented by 1 K and will be applied as the inlet temperature at next time step. Code: ```#include "udf.h" real T_mean = 300.0; /* defined outside because will be used in multiple DEFINE macros */ DEFINE_EXECUTE_AT_END(execute_at_end) { Domain *domain; Thread *thread; face_t face; real area[ND_ND]; real total_area = 0.0; real total_area_ave_temp = 0.0; int ID = 18; /* outlet ID displayed in Fluent boundary conditions panel */ domain = Get_Domain(1); thread = Lookup_Thread(domain, ID); /*change "12" to the actual id of your b.c. */ begin_f_loop(face, thread) F_AREA(area, face, thread); total_area += NV_MAG(area); total_area_ave_temp += NV_MAG(area)*F_T(face, thread); end_f_loop(face, thread) T_mean = total_area_ave_temp/total_area; printf("Area averaged T on boundary %d = %f K\n", ID, T_mean); } DEFINE_PROFILE(T_profile, thread, position) { face_t face; real T_prof = T_mean + 1; begin_f_loop(face, thread) F_PROFILE(face, thread, position) = T_prof; end_f_loop(face, thread) }``` I guess it's not a big deal to modify the code for your case, but I don't have time for that. Hope it helps.

 October 10, 2013, 12:09 #4 New Member     Matias Hess Join Date: May 2012 Location: Resistencia (Argentina) Posts: 4 Rep Power: 8 Thanks for your reply François, i'm working on that udf.

 Tags dpm, particles, re-injection, udf

 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 sunilpatil CFX 8 April 26, 2013 08:00 causuya Fluent UDF and Scheme Programming 3 April 9, 2013 05:09 marcoymarc CFX 33 March 13, 2013 07:39 juliom FLUENT 2 July 19, 2012 16:44 KK CFX 0 March 4, 2008 16:45

All times are GMT -4. The time now is 10:02.

 Contact Us - CFD Online - Privacy Statement - Top