CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Need Help!!! parse error UDF (http://www.cfd-online.com/Forums/fluent-udf/101716-need-help-parse-error-udf.html)

fevi84 May 11, 2012 16:40

Need Help!!! parse error UDF
 
I'm using the VOF model in 3D, with water (ID=2) as primary phase and air (ID=3) as secondary phase. I made a UDF for initializing volume fraction of phase air with the Taylor bubble form (a cylinder with a half sphere at the top).

#include "udf.h"

#define Xc 0.0
#define Yc 0.0
#define Zc 0.045
#define r 0.0085

DEFINE_INIT(gas_fraction_axis,mixture_domain)
{
int phase_domain_index;
cell_t c;
Thread *ct;
Domain *sd;
real X[ND_ND];

sub_domain_loop(sd,mixture_domain,phase_domain_ind ex)
{
if (DOMAIN_ID(sd) == 3)

thread_loop_c(ct,sd)
{
begin_c_loop_all (c,ct)
{
C_CENTROID(X,c,ct);
line 25 if (X[2]<=Zc && sqrt(ND_SUM(pow(X[0]-Xc,2),pow(X[1]-Yc,2)))<r)
C_VOF(c,ct)=1.;
line 27 else if (X[2]<=Zc && sqrt(ND_SUM(pow(X[0]-Xc,2),pow(X[1]-Yc,2),pow(X[2]-Zc,2)))>r)
C_VOF(c,ct)=1.;
line 29 else
C_VOF(c,ct)=0.0;
}
end_c_loop_all (c,ct)
}
}
}

When i interpret my UDF file, it says parse error in line 25, line 27 and line 29.

This UDF is similar to that appear in UDF manual FLUENT 12 page 333, but I don't know why it fails.

Someone knows the problem?

Thank you


All times are GMT -4. The time now is 23:07.