CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

Effects of droplets to each other in an electrostatic field

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

LinkBack Thread Tools Display Modes
Old   May 19, 2011, 02:39
Post Effects of droplets to each other in an electrostatic field
Join Date: May 2011
Posts: 31
Rep Power: 6
alighaffari is on a distinguished road
Hi every body
I want to calculate the electrostatic forces between a large numbers of water droplets dispersed in oil continuum under the electrostatic field. I have used lagrangian frame work in DPM model in fluent 6.3.26. and for electrostatic body forces acting on droplets I have written a UDF code according to Dipole-Dipole interaction model. My UDF searches all particles in the all cells all over the domain to calculate electrostatic forces. But this is very time consuming and for large number of droplets it is not so efficient. Some have suggested using parcel concept in this case but I donít know how I can use parcels concept in my UDF to reduce run time. If anybody has suggestion in this case or any suggestion that help me I will be very thankful.
This is my UDF code:
/* UDF for computing the electric force on particles in all cells of a domain */

#include "udf.h"
#include "mem.h"
#include "dpm.h"
#include "surf.h"
#include "stdio.h"
#define epsoil 2.2 /* epsilon for oil */
#define E0 25 /* electric background field,v/m */
#define beta 0.9934
#define M_PI 3.14159265358979323846

double bforce,Fr,Ft,d2,d1,s,tet,k1,k2,m;

/* get the cell and Thread that the particle is currently in */
cell_t c;
Thread *t;
Domain *d;
/* Particle index for looping over all particles in the cell */
Particle *pi;
/* loop over all particles in all cells of domain to find their position and diameter */
int ii;
double p1[2],p2[2];

d = Get_Domain(1); /* mixture domain if multiphase */
{p1[ii]= p->state.pos[ii];
d1 = P_DIAM(p);

thread_loop_c(t,d) /*loops over all cell threads in domain*/

begin_c_loop(c,t) /* loops over cells in a cell thread */


if (s > (d1/2+d2/2))
if(i==0) bforce+=((1)*Fr*cos(tet)+(1)*Ft*cos(M_PI/2+tet));
else if(i==1) bforce+=((-1)*Fr*sin(tet)+(-1)*Ft*sin(M_PI/2+tet));




}/*end of thread_loop_c(t,d)*/

return (bforce/m);


alighaffari is offline   Reply With Quote

Old   May 19, 2011, 02:56
New Member
Join Date: Nov 2010
Posts: 25
Rep Power: 6
mojtaba1365 is on a distinguished road
Hey guy.
Your question is very attractive..
Did you manage to get any solution to this problem? I am also stuck there.
mojtaba1365 is offline   Reply With Quote

Old   June 18, 2012, 19:32
Shawn Fotovati
Join Date: Jul 2009
Location: Cincinnati, OH
Posts: 41
Rep Power: 8
sfotovati is on a distinguished road
I wanted to consider the intraction of partciles to each other. I wrote a UDF.

Apparently it is impossible to ccombine begin_particle_loop macro and define_body_force. How would you be able to run this udf?
sfotovati is offline   Reply With Quote

Old   July 10, 2012, 23:56
Default droplets
New Member
Join Date: Nov 2010
Posts: 25
Rep Power: 6
mojtaba1365 is on a distinguished road
Hi guys, how is every things?
This is a very important issue and i wanna join you guys. Dr.ghaffari please have more explanation about the issue and let us to join. any details may be important.

Have a good time.
mojtaba1365 is offline   Reply With Quote


body force, droplet interaction, electrostatic force, parcel, udf

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
problems after decomposing for running OpenFOAM 5 April 20, 2011 08:44
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 07:51
Electrostatic field and momentum source with CFX5 Domenico CFX 0 May 5, 2005 11:45
UDF for Electrostatic Field Zhenan Li FLUENT 1 August 11, 2002 21:58

All times are GMT -4. The time now is 13:10.