UDF error
Hello Everyone,
I am trying to use UDF of the Fluent to generate the wave, I have compliled the UDF file, but the following error happened: Error: E:\wave.c: line 41: parse error. Error: E:\wave.c: line 77: parse error. Error: E:\wave.c: line 82: parse error. Could anyone give me some suggestions: /************************************************** *********************/ /* Solitary Wave.c */ /* UDF for specifying a transient velocity profile boundary condition */ /* for a transitional water depth linear wave theory wave */ /************************************************** *********************/ #include "udf.h" #define GRAV 9.81 #define H 0.2 #define D 1.0 DEFINE_PROFILE(x_velocity, thread, position) { real x[ND_ND]; /* this will hold the position vector */ real y; real ELE; real C; real ratio; real XX; real xc; real AA,BB,CC,DD,LL; /* y=position vector, AA,BB,etc are temporary stores */ face_t f; begin_f_loop(f, thread) { real t = RP_Get_Real("flow-time"); F_CENTROID(x,f,thread); y = x[1]; ratio = H/D; xc = 200.; C = pow( GRAV * D,0.5) * pow( ( 1. + ratio -1./20.* pow(ratio,2) -3./70.* pow(ratio,3.) ), 0.5 ); XX = xc - C * t; ELE = H * pow ((1./cosh(pow(3./4.*ratio,0.5) * XX/D)),2.); LL = ELE + D; if (y <= LL) AA = ratio + 3. * pow (ratio,3) *( 1./6. - 0.5*pow (y/D,2.)); BB = AA * ELE/H; CC = pow(ratio,2.) * (7./4. - 9./4.* pow(y/D,2.)) * pow(ELE/H,2.); DD = (BB - CC) * pow(GRAV * D, 0.5); F_PROFILE(f,thread,position) = DD; else F_PROFILE(f, thread, position) = 0; } end_f_loop(f, thread) } DEFINE_PROFILE(y_velocity, thread, position) { { real x[ND_ND]; /* this will hold the position vector */ real y; real ELE; real C; real ratio; real XX; real xc; real AA,BB,DD,LL; /* y=position vector, AA,BB,etc are temporary stores */ face_t f; begin_f_loop(f, thread) { real t = RP_Get_Real("flow-time"); F_CENTROID(x,f,thread); y = x[1]; ratio = H/D; xc = 200.; C = pow( GRAV * D,0.5) * pow( ( 1. + ratio -1./20.* pow(ratio,2.) -3./70.* pow(ratio,3.) ), 0.5 ); XX = xc - C * t; ELE = H * pow ((1./cosh(pow(3./4.*ratio,0.5) * XX/D)),2.); LL = ELE + D; if (y <= LL) AA = pow(3.*ratio,0.5) * y/D * ELE/D * tanh(pow(3.*ratio/4.,0.5) * XX/D); BB = 1. + 0.5 * ratio* (1. - 7.*ELE/H - pow(y/D,2.)*(1.-3.*ELE/H)); DD = AA * BB * pow( GRAV * D, 0.5); F_PROFILE(f,thread,position) = DD; else F_PROFILE(f, thread, position) = 0; } end_f_loop(f, thread) } |
Addition:
The code file only contain 81 lines, while the error shows that 82 line also. This is strange to me.
ChinaDuck |
You say you are compiling, but it looks like you are interpreting...
|
Quote:
ChinaDuck. |
Quote:
ChinaDuck |
All times are GMT -4. The time now is 05:11. |