CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   error of Interpreted udf (

Zhang Junmei December 4, 2001 04:29

error of Interpreted udf
Dear Sir or madam,

Thanks for your help in recent days very much! As a new learner,your help is important to me. If you have some free time, would you please to give me a favor again?

Now, I will deal with an unsteady flow problem. The velocity of inlet is connected with time and position. If I use a transient profile to describe the velocity condition, it seems that the velocity must be spatially uniform and vary only in time. So I think maybe I shall use UDF to handle this condition.

Because the velocity can be expressed as small straightforward function, I choose the interpreted UDF to deal with the boundary condition. I following the manual to compile the UDF step by step, such as: 1) Copy the c source code and the case file in my working directory. 2) Start fluent from my working directory. 3) Read my case file. 4) Compile my UDF using the Interpreted UDFs panel.

After I press " compile" in the panel, the Error information expressed on the screen, such as : Error:profile_v.c.txt:line 2:syntax error.

I don't know why and how to deal with this problem.

Would you please to give me a favor? BTW, profile_v.c.txt is the C source code I copy from the manual to test the correct of using UDF.

Thanks for your help very much! And hope to hear from you as soon as possible!

Regards and cheer Zhang Junmei

Zhang Junmei December 7, 2001 09:55

Who can help me?Please give me some help!
Dear all, would you please to give me some advice on interpreted UDF? Thanks a lot!

Zhang Junmei December 9, 2001 23:27

Is there anyone accustom to UDF?Please to help me!
Hello everyone,

As a new learned of Fluent, I want your help very much!

If you are accustomed to UDF,please healp me! Thanks very much!

Regards and cheer

Zhang Junmei

Mark Willetts December 11, 2001 11:54

Re: error of Interpreted udf
The error message that you are getting indicates an error in your source code on line 2 of the file profile_v.c.txt. Are you sure you have copied the example in the manual exactly? Also, check whether you are using the correct format for the source code containing the UDF, since this changed slightly for fluent version 5. It is very difficult to help you further without seeing you actual source code. Hope this helps. Regards, Mark

Zhang Junmei December 11, 2001 21:53

Can you give me a further help,Mark?
Dear Mark,

Thanks for your help very much! To check the accurate of UDF, I use the parabolic inlet velocity first. Just as the following code file, it is copied from the manual of Fluent.

#include "udf.h"

DEFINE_PROFILE(inlet_x_velocity, thread, position)

{ real x[ND_ND];

real y;

face_t f;

begin_f_loop(f, thread)

{ F_CENTROID(x,f,thread);

y = x[1];

F_PROFILE(f, thread, position) = 2*0.172417855-



end_f_loop(f, thread) }

So would you please to help me find the error of this code?

And now I am wondering that maybe the error is not due to the code itself. For example if I don't write the correct name of c source code in the panel of Source File name, fluent will inform me that line 1:syntax error.Therefore maybe the informed syntax error is not really an error of syntax.

And from the manual I know that in the parallel version of FLUENT on a network of Windows NT machines, I shall organize my files in a special way, such as creating a subdirectory in the Fluent.Inc directory called udf with write permission.Therefor whether the error of this interpreted UDF is due to the version problem?

Thanks for your help very much! And hope to hear from you as soon as possible!

Best wishes, Zhang Junmei

Mark Willetts December 12, 2001 05:27

Re: Can you give me a further help,Mark?
The code compiles with no problems on my machine, indicating that your problem lies elsewhere.

However, I did have problems at first with my c compiler which created a line 1:syntax error. I'm not sure what platform your running on, but if you've installed the /contrib component from the "Prepost" CD (standard for Windows NT installation) try selecting the "Use Contributed CPP" button at the bottom of the "Interpreted UDFs" panel.

Hopefully this will solve your problem.



Zhang Junmei December 12, 2001 09:03

Thanks for your help !
Dear sir,

Thanks for your help very much!

Your advice give me a big help. Fllowing your advice, I can realize the UDF of Fluent.

I am very appreciate for your help!

Happy Christmas! Regards and cheer Zhang Junmei

All times are GMT -4. The time now is 08:55.