# New in UDF and C

 Register Blogs Members List Search Today's Posts Mark Forums Read

December 19, 2013, 12:17
New in UDF and C
#1
Senior Member

Ke Wu
Join Date: Jan 2012
Posts: 179
Rep Power: 7
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
Attached Images
 Capture.PNG (33.6 KB, 65 views)

 December 19, 2013, 13:34 #2 Senior Member   Join Date: Jan 2010 Location: Germany Posts: 268 Rep Power: 10 Which lines are causing you such a headache?

December 20, 2013, 06:15
#3
Senior Member

Ke Wu
Join Date: Jan 2012
Posts: 179
Rep Power: 7
Quote:
 Originally Posted by Zaktatir Which lines are causing you such a headache?
Hi Zaktatir

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?

 December 20, 2013, 06:52 #4 Senior Member   Join Date: Jan 2010 Location: Germany Posts: 268 Rep Power: 10 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 tandem likes this.

December 20, 2013, 07:01
#5
Senior Member

Ke Wu
Join Date: Jan 2012
Posts: 179
Rep Power: 7
Quote:
 Originally Posted by Zaktatir 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?

 December 20, 2013, 07:04 #6 Senior Member   Join Date: Jan 2010 Location: Germany Posts: 268 Rep Power: 10 it will scan your y in positive y direction

 December 20, 2013, 07:38 #7 Senior Member   Join Date: Jan 2010 Location: Germany Posts: 268 Rep Power: 10 and it will handle the faces of the cells as ordered in the matrix since we are using unstructured meshes

 October 30, 2014, 00:47 #8 New Member   Nguyen Duc Thuyen Join Date: Jul 2014 Posts: 7 Rep Power: 5 To Zaktatir. Code: ` it will scan your y in positive y direction` Are you comment fully? My mean: y be scan from 0. to...?

 October 30, 2014, 04:53 #9 Senior Member   Join Date: Nov 2013 Posts: 1,134 Rep Power: 15 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.

 October 30, 2014, 09:19 #10 New Member   Nguyen Duc Thuyen Join Date: Jul 2014 Posts: 7 Rep Power: 5 To pakk Thanks for your reply, i try to think your hehp

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 kim FLUENT 3 October 26, 2011 21:38 Luc SEMINEL FLUENT 0 November 25, 2002 05:03 Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

All times are GMT -4. The time now is 13:25.