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

problem with compilation udf about droplet collision (DPM)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 7, 2011, 15:09
Default problem with compilation udf about droplet collision (DPM)
  #1
New Member
 
Maciej
Join Date: Jul 2011
Location: Poland
Posts: 16
Rep Power: 14
Jaskull is on a distinguished road
Hi
I have following problem. I'll try to compile following UDF (I found it in help).


#include "udf.h"
#include "dpm.h"
#include "surf.h"
DEFINE_DPM_SPRAY_COLLIDE(mean_spray_collide,tp,p)
{
/* non-physical collision UDF that relaxes he particle */
/* velocity and diameter in a cell to the mean over the */
/* specified time scale t_relax */
const real t_relax = 0.001; /* seconds */

/* get the cell and Thread that the particle is currently in */
cell_t c = P_CELL(tp);
Thread *t = P_CELL_THREAD(tp);
/* Particle index for looping over all particles in the cell */
Particle *pi;

/* loop over all particles in the cell to find their mass */
/* weighted mean velocity and diameter */
int i;
real u_mean[3]={0.}, mass_mean=0.;
real d_orig = P_DIAM(tp);
real decay = 1. - exp(-t_relax);
begin_particle_cell_loop(pi,c,t)
{
mass_mean += P_MASS(pi);
for(i=0;i<3;i++)
u_mean[i] += P_VEL(pi)[i]*P_MASS(pi);
}
end_particle_cell_loop(pi,c,t) /* relax particle velocity to the mean and diameter to the */
/* initial diameter over the relaxation time scale t_relax */
if( mass_mean > 0. )
{
for(i=0;i<3;i++)
u_mean[i] /= mass_mean;
for(i=0;i<3;i++)
P_VEL(tp)[i] += decay*( u_mean[i] - P_VEL(tp)[i] );
P_DIAM(tp) += decay*( P_INIT_DIAM(tp) - P_DIAM(tp) );
/* adjust the number in the droplet parcel to conserve mass */
P_N(tp) *= CUB( d_orig/P_DIAM(tp) );
}
}

But during compilation I receive following warning:

(...)
# Generating udf_names.c because of makefile aglom.obj
udf_names.c
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0

Have anybody idea what is wrong??
Jaskull is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
discrete model problem (water droplet evaporation) rabaeto1984 FLUENT 4 October 1, 2018 05:16
Problem with UDF compilation in LINUX tez Fluent UDF and Scheme Programming 2 April 11, 2010 20:18
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29
UDF compilation problem -- "undeclared variable" Henrik Ström FLUENT 1 September 21, 2005 06:25
Help with DPM UDF for OUTPUT needed Zhengcai Ye FLUENT 0 January 5, 2004 17:58


All times are GMT -4. The time now is 00:34.