CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF's (

Alberto Schroth February 28, 2000 18:19

I am currently learning how to write and use UDF files within my fluent code. However, many functions (macros) described in fluent's literature do not have descriptions.

I have downloaded the fluent UDF user guide, as well as chapter 24 of Fluent's user guide. Many are described there, but the lists are incomplete.

Where can I find a comprehensive list of ALL the functions/macros available for use while writing UDF's. Hopefully this list will also contain descriptions for their use.

Alberto Schroth Raytheon Systems

Greg Perkins February 29, 2000 05:49

Re: UDF's
To my knowledge there is no other information availble other than that you have cited.

The c header files (*.h), located in the src directory of the Fluent application directory provide definitions of many macros and some functions which you can access. Its relatively easy to work out what some of these do, but others are a mystery. In essence through these we can potentially access many of Fluent's internal functions, but I think only Fluent Inc staff really know what these do.

Fluent provide good support when asked direct questions, so my suggestion is to ask them "how to do xyz?" or "what does the function xyz do?".

Greg Perkins

Alberto Schroth March 1, 2000 20:31

Re: UDF's
Having a list of common functions and their description would really make life easy when writing UDF's. Maybe UDF library where people can submit useful routines would be nice.

But frankly, I find it a waste of time to have to call Fluent each time I need a function or macro explained.


Greg Perkins March 1, 2000 21:59

Re: UDF's
I think a UDF library would be very useful, as I have similar issues when trying to write complex UDFs.

Perhaps you or I or somebody else could start a repository on the web specially for this. I'd contribute what (little) I know.

In a way this forum provides this, although the information is dispersed amongst all the discussion.

The only concern is maintaining it - presumably some internal Fluent functions will change their names/definitions or (potentially even more importantly) their implementation without our knowledge from version to version.

Regards Greg Perkins

Jonas Larsson March 2, 2000 03:45

Re: UDF's
I'd be happy to set up a UDF archive here at CFD Online if you want me to. I agree with you that the UDF documentation is not very good. Having access to more examples would be very valuable.

Greg Perkins March 2, 2000 04:21

Re: UDF's

I've been thinking about what type of features we might want in such an archive/database:-

A. Submissions would have a category, picked by the person submitting. Possible categories are:-

1. Function definition

(to document macros, internal functions defined in .h files)

2. Complete UDF

(so users can upload a complete working UDF)

3. Scheme/Journal/Script files

(so users can upload scripts etc. This could be split for example into Fluent, Gambit etc...)

B. In each case, I think the following fields should be available:

1. Submitted by

2. Date Submitted

3. Email of submitter

4. Version of Fluent used to develop it

5. Comments (problems, limitations, assumptions etc?)

C. In case 1. above we might also want to record:

1. the actual definition taken from the .h file

2. the name of the .h file

3. inputs, outputs of the function/macro etc.

4. one line summary

D. In case 2. above we might also want to record:

1. inputs, outputs of the udf

2. one line summary

3. assumptions, limitations etc

E. in case 3. above we could treat like D.

The above are suggestions, and there is probably enough overlap of field names to have a flat file database with a category field.

The database would need to be searchable.

Would the current archive system handle something like what I've suggested??

In terms of implementation I found DBMan on the web ( ) which might do the job if we need a new database etc.

Anyway what does everybody think about that? Please provide details of any fields we should include, change delete etc from those above.


Greg Perkins

Jonas Larsson March 2, 2000 05:49

Re: UDF's
That can be done. It is a bit of work to get all the details working though. One additional field that I think should be included is a password field so that the author can update the record later himself. Also a "title" and "brief description" field should be included so that it is possible to create a nice and informative browse-interface. The category structure needs to be dynamic - it will certainly be necessary to update it later. Actually all of this is very similar to the new Books Guide that CFD Online will soon launch (see post in main forum). In addition the books guide has a review-system that could be used for a file-archive also, but that might be a bit too advanced.

The CFD Jobs Database and the new CFD Books Guide are both buildt using a MySQL database server interfacing with PHP scripts. This combination works very well and it is also suitable for this kind of repository. See and for further info.

To get this system up and running will take some time though. As a quick start I could open up a temporary, very simple, interface to use while we work on the other system.

My main concern is if people are willing to share their UDFs and scheme/journal scripts. I'd be happy to submit those that I have. Any comments from others? Have you got any Fluent related scripts that you would be willing to upload to this kind of public archive?

Dan Wachs March 2, 2000 17:33

Re: UDF's
It might also be nice to add a comments page where people who have tried to implement some of these functions could share thier experience with each individual UDF for future reference.

Dan Wachs

Greg Perkins March 2, 2000 22:15

Re: UDF's

Its probably hard to gauge what the response of people writing UDFs would be. Personally I'd be happy to share my UDFs etc. There does however seem to be a lot of confusion on UDFs out there.

I think hosting the library at cfd-online is the most logical option.

Its probably best to start with a simple archive as you've suggested while we work on something more comprehensive. If there's not much interest to begin with, we can then decide whether its worth putting in the effort of setting up the full system.


Greg Perkins

Jonas Larsson March 3, 2000 09:48

Re: UDF's
Yes, this is the same functionality as the review-system for the new books guide.

I can help to set this up, but I'd really need assistance from someone, especially to moderate and maintain the service once it is up and running. Any volunteers? Prior knowledge of Unix and HTML is needed. Knowledge of PHP and MySQL would also be nice. To start something like this is a long-term engagement.

I will put together a first outline of how the registration/submission form could look.

Jonas Larsson March 3, 2000 09:54

Re: UDF's
The simplest thing to do would be to just open up an ftp site and invite people to upload their UDFs etc there. That is something I can do tomorrow if you think that it is a good idea.

The second possibility is to put some more effort into designing a web-based registration form and a database interface and a very simple list function. This would take a few weeks, but if we avoid to include all fancy search/category/review things it isn't that much work - most of the things already exist here at CFD Online.

Jason Norman March 3, 2000 10:22

Re: UDF's
Ftp is probably the best start.

Can't you just 'grep' the udf for keywords?

It seems that a lot of the fields that are being suggested as searchable items could be included within a comment section at the beginning of each UDF file.

The most future proof way would be for everyone to agree on a standard comment header for the udf's submitted. This should then be easy to search with more complex html/ cgi stuff later on if this idea takes off.

Alberto Schroth March 3, 2000 12:38

Re: UDF's
I'm very happy to see the response to my original posting regarding UDF's. I look forward to seeing this on-line archive containing UDF's and their descriptions.

I wouldn't mind helping maintain the library, but my unix skills are very weak.

Alberto Schroth

Greg Perkins March 4, 2000 23:51

Re: UDF's
I think this is a great idea! - that way all the info, description and code is in one place which would be best.


Sung-Eun Kim March 5, 2000 16:28

Re: UDF's
I agree that there's much room for improvement in the documentation of UDFs and UDS in FLUENT. And we're working on that.

Sung-Eun Kim March 5, 2000 16:48

Re: UDF's
Hi all UDFers !

We've been maintaining a repository of UDFs contributed by Fluent Inc.'s staff and users like you on our web site.

It was created recently and there may not as many UDFs as you want to see. But if you're a registered user, you have access to the repository in the User Service Center and there you can browse what it offers.

Jonas Larsson March 5, 2000 16:54

Re: UDF's
Eh, I can't find it, where is it?

Jonas Larsson March 6, 2000 09:46

Re: UDF's
Good idea, I've opened a temporary ftp area at CFD Online for this - see my post above. So far only a couple of fluent guys have checked it out without submitting anything.

I wonder if people are going to make the effort to submit things...

If anyone has any suggestions on a standard "header" please let me know.

Alfonso Ferrandez March 6, 2000 11:00

Re: UDF's
I agree with Jonas on this one. Where is this repository? I can't seem to locate any relevant links on the USC page!!

I went for training last week and I saw something similar to what you describe, but in was on Fluent's staff machines, so it could have been a local thing...

Sung-Eun Kim March 6, 2000 12:28

Re: UDF's
Oops, I realized that it's not available to the users yet. My sincere apology. However, we're working hard to make it accessible to the registered client. Until then, please contact your support engineer.

All times are GMT -4. The time now is 06:31.