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 |
Which lines are causing you such a headache?
|
Quote:
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? |
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 |
Quote:
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? |
it will scan your y in positive y direction
|
and it will handle the faces of the cells as ordered in the matrix since we are using unstructured meshes
|
To Zaktatir.
Code:
it will scan your y in positive y direction My mean: y be scan from 0. to...? |
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. |
To pakk
Thanks for your reply, i try to think your hehp |
All times are GMT -4. The time now is 11:05. |