CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Looping in UDF (https://www.cfd-online.com/Forums/fluent-udf/108380-looping-udf.html)

 sg24589 October 22, 2012 05:46

Looping in UDF

I am a starter in UDF. In a particular problem, I want to give an inlet velocity in a pipe using UDF. I am confused as to whether I should use looping over cells or looping over faces. What difference would it produce in results and why.....?

 syavash October 22, 2012 12:20

Quote:
 Originally Posted by sg24589 (Post 387854) I am a starter in UDF. In a particular problem, I want to give an inlet velocity in a pipe using UDF. I am confused as to whether I should use looping over cells or looping over faces. What difference would it produce in results and why.....? Plz help.....Thanks in advance....

You should loop over faces at inlet. Velocity is a Boundary condition. You must apply it to inlet faces not cells.

 sg24589 November 30, 2012 02:58

Thanks a lot for the reply..... :)
That's what is confusing me actually. It's a boundary condition, and I need to give it to the whole face. Is it that if I loop over faces, after the first iteration the values at each cell of a face will be calculated separately and stored which will be used for every subsequent calculation.
One more question - In sixdof udf solver in fluent, we have to mention moment of inertia, product of inertia among others. Is this mass moment of inertia or area moment of inertia. Also it is to be input about which point (center of gravity or geometric center).

Thank You.... :)

 syavash December 1, 2012 01:03

Quote:
 Originally Posted by sg24589 (Post 394967) Thanks a lot for the reply..... :) That's what is confusing me actually. It's a boundary condition, and I need to give it to the whole face. Is it that if I loop over faces, after the first iteration the values at each cell of a face will be calculated separately and stored which will be used for every subsequent calculation. One more question - In sixdof udf solver in fluent, we have to mention moment of inertia, product of inertia among others. Is this mass moment of inertia or area moment of inertia. Also it is to be input about which point (center of gravity or geometric center). Thank You.... :)
1-
When you apply B.C. to certain faces of a boundary, Fluent needs to initialize the flow field by a initial condition, often the same value(s) of inlet B.C. considered. The values which you specified as B.C. is constant during the whole simulation for faces (unless you consider changing it with time in a transient case!). The first layer of cells adjacent to boundary faces are treated same as the interior cells and you don't need to specify anything to them.
2-
It refers to mass moment of inertia. The second part should be already clear! It's center of gravity.
Good luck.

 sg24589 December 3, 2012 01:45

Thanks a lot :)