# DEFINE_DPM_BODY_FORCE

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 January 18, 2005, 00:24 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); }

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 07:41.

 Contact Us - CFD Online - Top