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

UDF for external force related to particle position

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 5, 2013, 18:03
Default UDF for external force related to particle position
  #1
Member
 
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 14
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, 11:48
Default
  #2
Member
 
Rexxar
Join Date: May 2012
Location: Bethlehem, PA
Posts: 36
Rep Power: 14
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


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 for defining a body force in Singel ROtating Reference Frame teymourj Fluent UDF and Scheme Programming 9 August 18, 2016 16:33
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 06:03


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