CFD Online URL
[Sponsors]
Home > Forums > FLUENT

syntax error when interpreting UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 26, 2006, 09:14
Default syntax error when interpreting UDF
  #1
Erik
Guest
 
Posts: n/a
I have a problem when I interprete a UDF in Fluent. I think my C source code is correct, but when interpreting I get a syntax error in line 2.

My C source code is:

#include "udf.h" /* this line must be at the beginning of every UDF-file */

DEFINE_PROFILE(inlet_velocity,t,i)

{

float x[3]; /* this will hold the position vector */

float z; /* define z as a floating Data Type */

face_t f;

begin_f_loop(f, t) /* Loop over all faces in the thread passed in the DEFINE macro argument */

{

F_CENTROID(x,f,t);

z = x[3];

if (z <= 0.0143)

{

F_PROFILE(f, t, i) = 5.0 * (double power(z/0.0143, 1.0/7.0));

}

else

{

F_PROFILE(f, t, i) = 5.0

}

}

end_f_loop(f,t)

}

I hope somebody can help me with this problem.
  Reply With Quote

Old   September 26, 2006, 21:51
Default Re: syntax error when interpreting UDF
  #2
Ahmed
Guest
 
Posts: n/a
Try writting the first line as #include <udf.h>
  Reply With Quote

Old   September 27, 2006, 03:59
Default Re: syntax error when interpreting UDF
  #3
Erik
Guest
 
Posts: n/a
That doesn't seem to work. But thank you for your response
  Reply With Quote

Old   September 27, 2006, 08:52
Default Re: syntax error when interpreting UDF
  #4
cadaei
Guest
 
Posts: n/a
I have modified it a little and it compiles.

#include "udf.h" /* this line must be at the beginning of every UDF-file */

DEFINE_PROFILE(inlet_velocity,t,i)

{

real x[3]; /* this will hold the position vector */

real z; /* define z as a floating Data Type */

face_t f;

begin_f_loop(f, t) /* Loop over all faces in the thread passed in the DEFINE macro argument */

{

F_CENTROID(x,f,t);

z = x[2];

if (z <= 0.0143)

{

F_PROFILE(f, t, i) = 5.0 * (pow(z/0.0143, 1.0/7.0));

}

else

{

F_PROFILE(f, t, i) = 5.0;

}

}

end_f_loop(f,t)

}
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
parse error while interpreting udf Kristin Fluent UDF and Scheme Programming 3 March 15, 2012 08:43
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! alban Fluent UDF and Scheme Programming 2 June 8, 2010 19:54
parse error with interpreting UDF ivanbuz Fluent UDF and Scheme Programming 2 August 13, 2009 19:29
Parse Error:- Interpreting UDF on remote terminal moataz.che FLUENT 0 May 13, 2009 14:35
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 05:35.