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

DEFINE_DPM_BODY_FORCE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 17, 2005, 23:24
Default DEFINE_DPM_BODY_FORCE
  #1
Sinan
Guest
 
Posts: n/a
Hi,

I am trying to write a UDF to include the particle-particle interaction forces. I know that P_POS(p)[i] gives me the particle's positions in each time step but I am not clear how to include P_POS(p)[i] in my loop within the program.As a simple example in the udf I wrote below I tried to calculate the force as a function of interparticular distance, Is the way I used P_POS(p)[i] ok or wrong?

I really appreciate any help THANKS!!!!!!!

Is there a way to reach more UDF example on the subject I deal other than Manual?

#include "udf.h"

#define n 60 /* Number of particles in the Tube*/

DEFINE_DPM_BODY_FORCE(particle_body_force, p, i) { Particle *k,*j real D,distance,bodyforce,acceleration;

for(k=1;k<=n;k++){ D[i]=0; for(j=1;j<=n;j++){ distance(k,j)[i]=P_POS(j)[i]-P_POS(k)[i]; bodyforce(k)[i]=D[i]+Function(distance(k,j))[i]; acceleration(k)[i]=bodyforce(k)[i]/P_MASS(k); } } return(acceleration); }
  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



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