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

philosophy of using Headers!

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By mprinkey

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 27, 2015, 05:34
Question philosophy of using Headers!
  #1
New Member
 
Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 12
Majid Zarif is on a distinguished road
Hi Every body

I know that every UDF file should include
#include "udf.h"

but I saw other things like:

sg.h
or
prop.h

do any body know how can we understand how to use these headers?and also WHY we use them?

Thanks
Majid Zarif is offline   Reply With Quote

Old   January 27, 2015, 11:04
Default
  #2
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
Header files in C are essentially just another container for functions, variable declarations, and macros. They are not usually compiled by themselves into a standalone executable files. "Proper use" of header files are mostly to provide function prototypes for functions that are defined in a different .c file or exist in a pre-compiled library or executable, and maybe some supporting macros.

That is the case with udf.h. That header file (and it is distributed as source code with FLUENT ANSYS) has function prototypes and (many) macro definitions. F_C0, C_UDMI, etc are all defined as macros. All of the variables, function prototypes, and macros that UDFs generally need to access are defined in the udf.h file. But, there are other header files as well and those may contain function prototype/macro definitions that are not in udf.h but still may be useful. What those variables are and what use they are can only be sorted out by careful reading of the header files and trial-and-error testing, or by getting documentation or assistance from ANSYS.
Majid Zarif likes this.
mprinkey is offline   Reply With Quote

Old   January 27, 2015, 13:43
Default
  #3
New Member
 
Majid Zarif
Join Date: May 2014
Posts: 19
Rep Power: 12
Majid Zarif is on a distinguished road
So it's essential to know other header's usage in UDF ?
I mean I can always use udf.h instead of these headers?
Majid Zarif is offline   Reply With Quote

Old   January 27, 2015, 13:46
Default
  #4
Senior Member
 
Michael Prinkey
Join Date: Mar 2009
Location: Pittsburgh PA
Posts: 363
Rep Power: 25
mprinkey will become famous soon enough
Likely not. udf.h has most everything you should need to code UDFs.
mprinkey 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
can not include Windows.h and sys/stat.h headers eromon84 Fluent UDF and Scheme Programming 3 February 7, 2017 06:38
[ICEM] Blocking Philosophy Query aerospaceman ANSYS Meshing & Geometry 4 June 15, 2011 12:46
Borked license headers mwild OpenFOAM Bugs 2 July 2, 2010 05:34
ubuntu 9.10 64bit - wmake missing headers soeren87 OpenFOAM Installation 5 November 11, 2009 11:01
Philosophy of implicit solution of different regions Louis Le Grange OpenFOAM 0 October 5, 2009 11:53


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