CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Problem with my udf (

july June 18, 2010 12:42

Problem with my udf
Hi all!
I have a question relative to UDF. I have already used UDF before but I have never encountered this problem.
In fact I got the error message "inlet3d.c": line 1: syntax error.
I don't understand because the first line of my udf is just as in any udf I have used # include "udf.h".

I have just changed my Fluent version from 6.3 to 12.1.4. Moreover the problem only appears when I launch my simulations in parallel on a cluster. I have no problem when I open Fluent and interpret my udf directly.
Do I need to add something to my c-code when I launch it in parallel on the cluster? Is it a problem of Fluent version?

Here is my udf:
#include "udf.h"

/* pressure profile */

real b=0.01;

DEFINE_PROFILE(pressure_profile, thread, index)
real x[ND_ND],y;
face_t f;
real u;

begin_f_loop(f, thread)
F_PROFILE(f,thread,index) = 100376.35*pow((1+0.2*(u)*(u)/(1.4*287*293.15)),(1.4/0.4))-101325;

Thanking you in advance for your help.


fox000002 June 19, 2010 13:26

Check line end format of ur UDF file.

Try 'dos2unix filename' before using the file on the cluster.

DoHander June 19, 2010 22:31

Or ... maybe your UDF is not a parallel UDF ...

Since it runs flawlessly on serial Fluent I suppose there is not a syntax problem or an EOL mismatch.

You need to parallelize an UDF in order to properly run in parallel - see Fluent UDF manual there is an entire chapter about parallelizing a serial UDF.


july June 20, 2010 06:56

Thanks for your answers!

fox000002: I have worked on a Linux computer so I don't think the problem comes from the format.
DoHander: I will try what you have told me. However it's strange because yesterday I managed to launch it on the cluster with a simpler mesh so I really don't understand but I'll have a go at parallelizing my udf!


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