CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF for Electrostatic Field (

Zhenan Li August 7, 2002 15:18

UDF for Electrostatic Field

Could you check this UDF for me please?

The electrostatic field defined using UDS. I want to add the electrostatic force acting on a charged particles in the field. The following is a simple code.


#include "udf.h"

#define PI 3.14159265

#define EPS 8.854e-12

DEFINE_DPM_BODY_FORCE(particle_body_force, p, i)


Thread *t;

real x[ND_ND];

real y;

real bforce;

real Q = 2.0e-6; /* Particle electric charge */

cell_t c;

C_CENTROID(x, c, t);

y = 0.3 - x[1];

bforce = C_UDSI_G(c,t,0)[i]*1000.0*Q + Q*Q/(16.0*PI*EPS*y*y)*(C_UDSI_G(c,t,0)[i]/NV_MAG(C_UDSI_G(c,t,0)));

return (bforce/P_MASS(p));


Alamgir August 11, 2002 21:58

Re: UDF for Electrostatic Field

Could you plz help me, which particles u using, where did get information about Q, which equation u r using?

look, u wrote bforce= ..............., at the end of the equation there are 3 ))), I think this could be a problem. look according to your equation whether is it correct of not?


All times are GMT -4. The time now is 09:26.