CFD Online Logo CFD Online URL
Home > Forums > FLUENT


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

LinkBack Thread Tools Display Modes
Old   January 18, 2005, 00:24
Posts: n/a

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


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

All times are GMT -4. The time now is 23:19.