CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF parse error on line 1 ..... (Unusual) (http://www.cfd-online.com/Forums/fluent/41551-udf-parse-error-line-1-unusual.html)

Amit Maha June 28, 2006 14:49

UDF parse error on line 1 ..... (Unusual)
 
Hi,

I get the following error message when i interpret the example udf from the fluent tutorial.

cpp -IC:\Fluent.Inc\fluent6.1.22/src -IC:\Fluent.Inc\fluent6.1.22/cortex/src -IC:\Fluent.Inc\fluent6.1.22/client/src -IC:\Fluent.Inc\fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" S:\My Documents\Test_parabolic_inlet_udf.c Error: S:\My Documents\Test_parabolic_inlet_udf.c: line 1: parse error.

THE UDF used is as follows:

/************************************************** ******************** udfexample.c UDF for specifying a steady-state velocity profile boundary condition ************************************************** ********************/

#include "udf.h" /* must be at the beginning of every UDF you write */

DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f;

begin_f_loop(f,thread) /* loops over all faces in the thread passed

in the DEFINE macro argument */

{

F_CENTROID(x,f,thread);

y = x[1];

F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.;

} end_f_loop(f,thread) }

This is really annoying giving parse error on line 1. Could somebody PLEASE HELP!!!!!!!!!!

Thank you for your time and patience.

Sincerely,

Amit Maha

tim June 28, 2006 17:39

Re: UDF parse error on line 1 ..... (Unusual)
 
Seems your udf works well on my computer. Problem is you should save it in another directory. Maybe the space in "My Document" caused the error. By the way, you'd better format the code when post it. :)

Tim

Yuhao June 28, 2006 17:45

Re: UDF parse error on line 1 ..... (Unusual)
 
I met a similar problem. After checking, I found the problem comes from the folder name in which you saved udf. The "space" in the name leads to the mistake of compilation.

Amit Maha June 29, 2006 09:26

Re: UDF parse error on line 1 ..... (Unusual)
 
Thank You Tim and Yuhao for your time and comments. I'll check it out in a different folder. I appreciate your help!

Sincerely,

Amit Maha

Vidya Raja June 30, 2006 12:15

Re: UDF parse error on line 1 ..... (Unusual)
 
Hi,

Make sure that there are no spaces in your working directory. Also, the case and data files and the UDF files SHOULD be in the same directory.

Vidya


All times are GMT -4. The time now is 01:51.