CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   what's wrong with my UDF?? (https://www.cfd-online.com/Forums/fluent/44351-whats-wrong-my-udf.html)

zlk April 5, 2007 02:35

what's wrong with my UDF??
 
#include "udf.h" #define PI 3.1415926 #define R 0.0045 #define Q 2000 #define xs 0.61 #define Rj 0.0045 #define I 100 #define u 1.26e-6 #define L 0.01 DEFINE_SOURCE(cell_heat_source,cell,mixture_thread ,dS,eqn) double x,y,a,b,t,w;

w=(PI/180)*1000; /*15*/

double xc[ND_ND],source;

int phase_domain_index=0;

Thread *water_thread=THREAD_SUB_THREAD (mixture_thread,phase_domain_index); /*18*/

C_CENTROID(xc,cell,mixture_thread);

x=xc[0];

y=xc[1];

if(C_VOF(cell,water_thread)<1&&C_VOF(cell,water_th read)>0&&y<0)

{

t=RP_Get_Real("flow-time");

a=(PI/3)*sin(w*t);

b=-atan(y/x);

if(fabs(a-b)<(PI/6))

{

source=1000*(3*Q*xs/(PI*R*R));

dS[eqn]=0;

}

else

source=dS[eqn]=0;

}

else

source=dS[eqn]=0;

return source; }

Error: E:\4.5ngwelding\ng4.5.c: line 15: parse error.

Error: E:\4.5ngwelding\ng4.5.c: line 16: parse error.

Error: E:\4.5ngwelding\ng4.5.c: line 17: parse error.

Error: E:\4.5ngwelding\ng4.5.c: line 18: xc: undeclared variable


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