CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   URGENT HELP needed regarding UDF for droplet impact height and spreading values (http://www.cfd-online.com/Forums/fluent/94865-urgent-help-needed-regarding-udf-droplet-impact-height-spreading-values.html)

 skel_1 November 28, 2011 16:45

URGENT HELP needed regarding UDF for droplet impact height and spreading values

The following is a UDF that I am using to calculate the spreading radius and height of a droplet impingement on a surface. It is an axisymmetric problem and I am trying to evaluate the above values at every time-step.

#include <udf.h>
DEFINE_EXECUTE_AT_END(execute_at_end)
{
real r[ND_ND];
real time=CURRENT_TIME;
real temp, y,x;
face_t f;
cell_t c1;
FILE *fp;
c1=F_C1(f,t);
begin_c_loop(c1,t1)
{
temp=C_VOF(c1,t1);
if(temp==0.5)
{
C_CENTROID(r,c1,t1);
x=r[0];
y=r[1];
fprintf(fp,"%5.10d %5.8d %5.8d",time,x,y);
fclose(fp);
}
}
end_c_loop(c1,t1)
}

Fluent compiles the UDF properly. I hook up the UDF it up at the Execute at end and initialize the solution. Then I am patching the liquid droplet with a velocity. Once I start iterating this is the error that Fluent pops up:

Updating solution at time level N...
Global Courant Number : 0.01
done.
physical-dt 1.0000e-008
iter continuity x-velocity y-velocity time/iter
1 0.0000e+00 1.6108e-03 1.5012e-04 0:00:00 1
1 0.0000e+00 0.0000e+00 0.0000e+00

Error: