CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   A question about UDF (

owet.L December 16, 2005 17:51

A question about UDF
hi, guys,

I met a problem about UDF, pls give me your hands.

Two parts are placed along Z axis. I loop the part A and get the perfermance of A, FA=fa(x,y,z). In part B, there is a function related to the result of FA. FB(x,y,zb)=fb(fa(x,y,za)). It means the value FB at one point (assume that the point is "C2") is deducted from FA at point C1. The values of x and y in points C1 and C2 are same, and there is only different in values of z. How to write a UDF to get the FB? In the problem, some parameters in part B are recalled in function fb, such as the concentration of B at point (x,y,zb). I should write a looping code, but how do I write it, and the parameters in Part A and Part B (in which x and y are same) can be got at the same time?

Thank you.

Owet L

Rucy December 16, 2005 20:49

Re: A question about UDF
Dear Owet,

Could you describe the case that you are simulating in detail, and also paste your UDF in this forum? So that we could find whats' wrong.

Good luck!


Sumedh December 17, 2005 10:16

Re: A question about UDF
Hi, I understood your problem. In fact i was alos doing the same thing. There is no way you can access the values of part A in loop of part B. I am accessing the parameters of the same part. that I am doing by using nested loop statement, take care to rename the thread passes to inner loop, otherwise inner loop will not get executed. The problem with this approach is, the code becomes very slow. But this seems to be the only way out.


owet.L December 17, 2005 11:51

Re: A question about UDF
Hi, Thank you for your answer.

I can not clearly understand your words. "nested loop statement" means you set a loop through thread B in Loop A? If so, how to determine "point" to "point" loop? That is, how do you get the value of a point in B from the corresponding point in A?

Could you give me an example code to describ your words?

Thank you very much!

sumedh December 20, 2005 04:19

Re: A question about UDF
Hi, In my case i am doing it for single surface. So I am starting the outer loop for surface thread. Then in that loop i am again starting inner loop for same surface, but with changed name. Now in the inner loop I am comparing the coordinates and accessing the required values. I dont know how you will access some other part in inner loop.


All times are GMT -4. The time now is 04:17.