CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

New in UDF and C

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Zaktatir

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 19, 2013, 12:17
Default New in UDF and C
  #1
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
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
File Type: png Capture.PNG (33.6 KB, 67 views)
itsme_kit is offline   Reply With Quote

Old   December 19, 2013, 13:34
Default
  #2
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
Which lines are causing you such a headache?
Zaktatir is offline   Reply With Quote

Old   December 20, 2013, 06:15
Default
  #3
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by Zaktatir View Post
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?
itsme_kit is offline   Reply With Quote

Old   December 20, 2013, 06:52
Default
  #4
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
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.
Zaktatir is offline   Reply With Quote

Old   December 20, 2013, 07:01
Default
  #5
Senior Member
 
Join Date: Jan 2012
Posts: 197
Rep Power: 14
itsme_kit is on a distinguished road
Quote:
Originally Posted by Zaktatir View Post
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?
itsme_kit is offline   Reply With Quote

Old   December 20, 2013, 07:04
Default
  #6
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
it will scan your y in positive y direction
Zaktatir is offline   Reply With Quote

Old   December 20, 2013, 07:38
Default
  #7
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
and it will handle the faces of the cells as ordered in the matrix since we are using unstructured meshes
Zaktatir is offline   Reply With Quote

Old   October 30, 2014, 00:47
Default
  #8
New Member
 
Nguyen Duc Thuyen
Join Date: Jul 2014
Posts: 7
Rep Power: 12
tandem is on a distinguished road
To Zaktatir.
Code:
 it will scan your y in positive y direction
Are you comment fully?
My mean: y be scan from 0. to...?
tandem is offline   Reply With Quote

Old   October 30, 2014, 04:53
Default
  #9
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
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.
pakk is offline   Reply With Quote

Old   October 30, 2014, 09:19
Default
  #10
New Member
 
Nguyen Duc Thuyen
Join Date: Jul 2014
Posts: 7
Rep Power: 12
tandem is on a distinguished road
To pakk
Thanks for your reply, i try to think your hehp
tandem is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 07:12
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


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