CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF syntax error (http://www.cfd-online.com/Forums/fluent/29887-udf-syntax-error.html)

Duc June 11, 2002 08:32

UDF syntax error
 
Hello, I am new at using UDF in Fluent, as a result, I tried create a UDF for unsteady flow, as described in the user manual. For some reason, when I try to interpret the function, it keep coming up with

Line 2: Syntax error

Can anyone suggest what I'm doing wrong? thanks in advance.

Duc ------

#include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position)

{ face_t f;

begin_f_loop(f, thread)

{ real t = RP_Get_Real("flow-time"); F_PROFILE(f, thread, position) = 42.41*cos(9424.778*t);

}

end_f_loop(f, thread) }


Ale June 11, 2002 09:03

Re: UDF syntax error
 
You probably simply need to insert a return before DEFINE_PROFILE:

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position)

{ face_t f;

begin_f_loop(f, thread)

{ real t = RP_Get_Real("flow-time"); F_PROFILE(f, thread, position) = 42.41*cos(9424.778*t);

}

end_f_loop(f, thread) }

I did it and I interpreted your code without any error message by FLUENT. I hope this can help you; anyway, I think it could depend on the C compiler you use.

Good luck, Ale

Duc June 11, 2002 09:27

Re: UDF syntax error
 
It may be something to do with my settings, as I've used the code you wrote without sucess. Just so strange. thanks for you help.


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