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

UDF for external force related to particle position

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 5, 2013, 17:03
Default UDF for external force related to particle position
  #1
Member
 
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 5
czhao86 is on a distinguished road
Hi,

i wanna exert an external force on particles, and below is my draft. But it is not working, anyone have some idea? Thank you very much.

Code:
#include "udf.h"
 
DEFINE_DPM_BODY_FORCE(particle_body_force,p,i)
{
real bforce=0;

Domain *domain;
domain = Get_Domain(1);

Thread *t;
cell_t c;
real xc[ND_ND];

thread_loop_c(t,domain)
{
begin_c_loop_all(c, t)    
  {        
       C_CENTROID(xc,c,t);
       bforce = xc[0];
               
  }                         
end_c_loop_all(c, t)
}

return (bforce);
}
__________________
Best,

Rexxar
czhao86 is offline   Reply With Quote

Old   September 6, 2013, 10:48
Default
  #2
Member
 
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 5
czhao86 is on a distinguished road
Code:
Thread *t=P_CELL_THREAD(p);
cell_t c=P_CELL(p);
C_CENTROID(xc,c,t);
The code above seems to work.
__________________
Best,

Rexxar
czhao86 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
UDF for defining a body force in Singel ROtating Reference Frame teymourj FLUENT 2 July 28, 2011 17:45
how to know position of particle in PTK areriko CFX 0 November 19, 2007 22:19
udf about particle concentration--who can help me? zhaoh FLUENT 1 January 17, 2007 12:46
how to get the particle residence time in UDF? welch FLUENT 0 November 17, 2005 20:32
How can I get the particle current position in UDF cfdfans FLUENT 4 April 2, 2001 05:03


All times are GMT -4. The time now is 04:56.