CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF execution problem (https://www.cfd-online.com/Forums/fluent-udf/87145-udf-execution-problem.html)

argeus April 12, 2011 12:01

UDF execution problem
 
Dear all,
I need your help. I cant find out how FLUENT executes UDFs in .c-file. A .c-file usually consist of a few UDFs marshalled in some logical order. Does FLUENT execute the UDFs in order they have been written?
I used UDF in testing geometry, and it works OK, but when I use it in another geometry (needed for real calculations), there is a problem with order of execution.
All parameters of boundary conditions of testing and real geometry are the same.
Ive made a write-bc file for both cases and the order of cruical UDFs (and boundary conditions as well) was swaped. Ive tried to change them and read bc file back, but finally, the order didnt change.. Am I able to affect it?

Thank you for any suggestion.

dmalcher April 13, 2011 08:08

I've had a similar problem with the order of execution of several UDFs. Apparently, FLUENT does not execute the UDFs in order the have been written.

Perhaps you can solve your problem using the UDF DEFINE_EXECUTE_AT_END. The code or the (void) function within this UDF is executed at the end of every iteration (for a steady solver) or time step (unsteady solver).
However, as far as I experienced you can not execute another UDF (DEFINE_...) within it.

Regards
D

argeus April 14, 2011 04:39

Dmalcher, firstly thank you very much for you reply. Unfortunately, I cant use EXECUTE_AT_END, because my calculation is transient and there is a need to execute all my UDFs for every iteration. Actually, I found out, that order of executing of UDFs depends on order of boundary condition in FLUENT. I can affect the order in GAMBIT by order of specifying boundary types in reversed order (the last specified boundary type takes the first place in the list and so on). Probably there are more possibilities I dont know yet.

Philipp_Sch April 14, 2011 11:03

The order of execution depends

1) on the UDF type. DEFINE_ADJUST are executed at the beginning of an iteration/time step; EXECUTE_AT_END - at the end of an iteration/time step.

2) on the order in which they are hooked.

pranab_jha April 15, 2011 14:04

UDF Manual link
 
Quote:

Originally Posted by argeus (Post 303307)
Dear all,
I need your help. I cant find out how FLUENT executes UDFs in .c-file. A .c-file usually consist of a few UDFs marshalled in some logical order. Does FLUENT execute the UDFs in order they have been written?
I used UDF in testing geometry, and it works OK, but when I use it in another geometry (needed for real calculations), there is a problem with order of execution.
All parameters of boundary conditions of testing and real geometry are the same.
Ive made a write-bc file for both cases and the order of cruical UDFs (and boundary conditions as well) was swaped. Ive tried to change them and read bc file back, but finally, the order didnt change.. Am I able to affect it?

Thank you for any suggestion.

Hi,
I dont know if you have gone through this before or not. But do take a look at this link from the UDF manual. This should give you a better picture.


All times are GMT -4. The time now is 10:34.