CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   problem with compilation udf about droplet collision (DPM) (http://www.cfd-online.com/Forums/fluent-udf/94154-problem-compilation-udf-about-droplet-collision-dpm.html)

 Jaskull November 7, 2011 15:09

problem with compilation udf about droplet collision (DPM)

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??

 All times are GMT -4. The time now is 16:45.