CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   how to upload mutiple UDFs in FLUENT. (

shunahshep March 1, 2005 02:30

how to upload mutiple UDFs in FLUENT.
Hi All,

I am trying to simulate a situation that requires me to use 2 UDFs - one for the inlet velocity and the other for a temperature dependent viscosity. As a test case, i just tried to run the 2 UDFs available in the FLUENT UDF manual simultaneously. I created a simple rectangular mesh and exactly cutpasted the program for the udf called inlet_x_velocity into a new file in C++ (called inlet_x_velocity). Then i cutpasted the program for temperature-dependent viscosity given in the UDF manual into a different file (called cell_viscosity):

When i go to Define->User defined->Functions->Interpreted and carry out the instructions outlined in the UDF manual, i can upload each function separately without any problem. however, only the function that i upload last stays into the memory for later use. Can someone please tell me how to upload multiple UDFs in FLUENT?

Thanks very much in anticipation. Regards, Shunahshep.

mateus March 1, 2005 02:57

Re: how to upload mutiple UDFs in FLUENT.

Just write them one after another in one file and interpete it.


Frank Meißen March 1, 2005 04:08

Re: how to upload mutiple UDFs in FLUENT.

in Fluent 6.1.x you have to define all functions in one file. AFAIK in Fluent 6.2.x you can load multiple files.


shunahshep March 1, 2005 15:31

Re: how to upload mutiple UDFs in FLUENT.
Hi Mateus,

Thanks very much for your suggestion. I tried cutpasting both functions into the same file and then running the simulation, but got the following error when i tried to interpret my UDF:

Error: udfconfig.h: line 22: parse error.

Can you please tell me how to overcome the error.

Frank, thanks for your post. But unfortunately i only have Fluent Version 6.1.22.

Regards, Shunahshep.

shunahshep March 1, 2005 15:58

Problem with initializing a case file with 2 UDFs.

I could eliminate the parse error by deleting the udf.h file header in the second function. The UDF is interpreted successfully now. But during the solution initialization step, i get the following error:

Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: ()

I have no idea what it means. Can someone please help me?



mateus March 2, 2005 04:38

Re: Problem with initializing a case file with 2 U

I think that has nothing to do with interpreting 2 udfs. There is something very vrong with your problem. Maybe there's an error in one of the udfs - try to start the simulation with just one at the time. Maybe the 2 udfs can't work together (but I doubt that thats the problem)...

good luck MATEUS

major March 2, 2005 11:05

Re: Problem with initializing a case file with 2 U
hello,Shunahshep, I have been the same problem as you. You should exit your fluent case and restart fluent. It can work again. good luck! I have a question for your help. I have writen a program as following: #include "udf.h" DEFINE_PROPERTY(cell_diffusion_coefficent,c,t) { real ud; real rho=C_R(c,t); real mu=C_MU_EFF(c,t); ud=mu/rho; return ud; } When I interpreted it into fluent. I get the following error message:line 1:parse error I don't know the reason. Would you like to help me? Thank you very much! major

shunahshep March 2, 2005 18:22

Re: Problem with initializing a case file with 2 U
Mateus and Major,

Thx for your suggestions regarding my problem. I tried reloading the case many times (restarting fluent each time) but still it gave me the same error. Mateus i can send u my UDFs if you want to take a look - they can't be wrong since they are just cut-pasted from Fluent UDF manual.

Major, about your UDF, i should say that i haven't any personal experience working with diffusion yet (actually i am only beginning to use fluent UDFs). But i think i can still point out to one thing that i came across in the udf manual which i think u shd go back to.

You should probably use a DEFINE_DIFFUSIVITY macro instead of the DEFINE_PROPERTY macro that you are currently using. (Please check the UDF manual, the DEFINE_DIFFUSIVITY macro has three arguments c,t,i instead of just c,t for DEFINE_PROPERTY macro).

If you are still having problems email me your journal file (for the case) with the BCs and Operating Conditions - i'll try to see if i can make it work.

Regards, Shunahshep.

major March 2, 2005 22:56

Re: Problem with initializing a case file with 2 U
Shunahshep: Thank you very much! I have done it. good luck to you! major

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