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/)
-   -   New in UDF and C (https://www.cfd-online.com/Forums/fluent-udf/127758-new-udf-c.html)

itsme_kit December 19, 2013 11:17

New in UDF and C
 
1 Attachment(s)
Hi

This is a parabolic inlet profile written in UDF

Can anybody interpret each line into words?

I couldn't understand all of them

Many thanks

Zaktatir December 19, 2013 12:34

Which lines are causing you such a headache?

itsme_kit December 20, 2013 05:15

Quote:

Originally Posted by Zaktatir (Post 467086)
Which lines are causing you such a headache?

Hi Zaktatir

Thanks for your concern

For x[1] in equation of y, I think the domain is assumed to be from 0 to a positive value, isn't it? In other case, for example, the domain could be between -2 and 2

How the equations of y and F_profile been derived?

Zaktatir December 20, 2013 05:52

X is any array or vector holding your coordinates. In C we enumerate starting from 0 that means x[1] will be you y-coordinate x[0] your x-coordinate, x[2] your z-coordinate.

Then you apply F_Profile where you put your formula or your law in that case this velocity profile. Why F_Profile because your making an input to a boundary condition that means your law or your function should apply to the faces localized on that boundary

itsme_kit December 20, 2013 06:01

Quote:

Originally Posted by Zaktatir (Post 467159)
X is any array or vector holding your coordinates. In C we enumerate starting from 0 that means x[1] will be you y-coordinate x[0] your x-coordinate, x[2] your z-coordinate.

Then you apply F_Profile where you put your formula or your law in that case this velocity profile. Why F_Profile because your making an input to a boundary condition that means your law or your function should apply to the faces localized on that boundary

Yes, I know x[1] stands for y coordinate

My point is, for example, we got a pipe with diameter in 1m, will the value of x[1] coordinate be input to equation of y from bottom to top, from top to bottom or from middle to both sides?

Zaktatir December 20, 2013 06:04

it will scan your y in positive y direction

Zaktatir December 20, 2013 06:38

and it will handle the faces of the cells as ordered in the matrix since we are using unstructured meshes

tandem October 29, 2014 23:47

To Zaktatir.
Code:

it will scan your y in positive y direction
Are you comment fully?
My mean: y be scan from 0. to...?

pakk October 30, 2014 03:53

It will not 'scan' anything, I think you are thinking in the wrong way.

You write the code for the profile, and add it as a boundary condition to a surface (let's call it surface A). During the calculation, Fluent will at some point need to put a velocity to a cell face from surface A. It then asks the UDFs that you wrote: "which velocity should I give to the cell face with coordinates x[0],x[1],x[2]?"

The UDF does not scan, or define the order in which the cells are accessed. Fluent does that. And for a properly written UDF, the order in which that happens should not matter for the result.

tandem October 30, 2014 08:19

To pakk
Thanks for your reply, i try to think your hehp


All times are GMT -4. The time now is 11:05.