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

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

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 1, 2013, 10:04
Exclamation HELP! how inject the same number of particles that exits the domain?
  #1
New Member
 
matiashess's Avatar
 
Matias Hess
Join Date: May 2012
Location: Resistencia (Argentina)
Posts: 4
Rep Power: 13
matiashess is on a distinguished road
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!
matiashess is offline   Reply With Quote

Old   August 5, 2013, 12:45
Default
  #2
New Member
 
matiashess's Avatar
 
Matias Hess
Join Date: May 2012
Location: Resistencia (Argentina)
Posts: 4
Rep Power: 13
matiashess is on a distinguished road
pleasee someone who can help me? any contribution will help me to advance my project
matiashess is offline   Reply With Quote

Old   August 7, 2013, 13:32
Default
  #3
Senior Member
 
François Grégoire
Join Date: Jan 2010
Location: Canada
Posts: 392
Rep Power: 17
macfly is on a distinguished road
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.
macfly is offline   Reply With Quote

Old   October 10, 2013, 11:09
Default
  #4
New Member
 
matiashess's Avatar
 
Matias Hess
Join Date: May 2012
Location: Resistencia (Argentina)
Posts: 4
Rep Power: 13
matiashess is on a distinguished road
Thanks for your reply François, i'm working on that udf.
matiashess is offline   Reply With Quote

Reply

Tags
dpm, particles, re-injection, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF- how to calculate the number of particles in DPM causuya Fluent UDF and Scheme Programming 8 January 23, 2021 13:34
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 07:00
Stable boundaries marcoymarc CFX 33 March 13, 2013 06:39
Reynodls Number in the domain juliom FLUENT 2 July 19, 2012 15:44
Function to inject particles only once? KK CFX 0 March 4, 2008 15:45


All times are GMT -4. The time now is 11:29.