|
[Sponsors] |
June 26, 2014, 17:38 |
UDF error
|
#1 |
New Member
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 13 |
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) } |
|
June 26, 2014, 17:40 |
Addition:
|
#2 |
New Member
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 13 |
The code file only contain 81 lines, while the error shows that 82 line also. This is strange to me.
ChinaDuck |
|
June 27, 2014, 05:55 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
You say you are compiling, but it looks like you are interpreting...
|
|
June 27, 2014, 08:26 |
|
#4 |
New Member
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 13 |
||
June 27, 2014, 08:29 |
|
#5 |
New Member
Peter
Join Date: May 2012
Location: New York
Posts: 18
Rep Power: 13 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM] an error in Calculator's equation | immortality | ParaView | 12 | June 29, 2021 00:10 |
Undeclared Identifier Errof UDF | SteveGoat | Fluent UDF and Scheme Programming | 7 | October 15, 2014 07:11 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 06:42 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 02:32 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 20:50 |