CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Cell properties in UDF (

Arturo Ortiz September 22, 2000 16:55

Cell properties in UDF
Hi all

I am working in a porous media, and I would like to work with a property for each cell different of all those given by fluent by default. I foresight two possibilities and would like to know your opinion; work with an internal array inside a UDF (harder to implement) and adding an all new property in the mem.h file (is it possible, and how?). Do you suggest another one?


Greg Perkins September 25, 2000 19:56

Re: Cell properties in UDF
I think the easiest way to implement a new property for your problem is to use a user defined scalar. You can use this either (i) as a storage variable or (ii) to solve a scalar pde for the property at each iteration. Fluent already provides macros for accessing the data (C_UDSI ??) and you can post-process the results in the GUI. Also the storage is fully handled by Fluent code - I think it will be painful to add your own routines to properly handle data for each cell, since Fluent 5 uses a complicated storage structure - which probably only they fully understand!

Greg Perkins September 25, 2000 20:17

Re: Cell properties in UDF
This is further to my posting above. . .

What property do you wish to change ?? If you want say permeability/porosity to be a local property then I suggest using a user defined scalar above and linking this value to the code I posted some weeks ago to determine the local drag on the gas/fluid phase.

This gets tricky to do though in Fluent 5, because the convective flux (and some other terms) then needs to be scaled appropriately by the porosity, which is now a local property - which Fluent is unaware of. I tried (4 weeks) but couldn't work out how to add these terms within Fluent 5 - essentially you want to modify the internally computed terms but can't - so need to add a corrective source term - which gets majorly painful - and it's likely to become a good source of error even if you get something working!

In this case, and because I also wanted a reacting porous medium, I moved to Fluent 4.5 which implements the full two-phase Eulerian model. Fluent 4.5 is quite OK, in fact I prefer the user code facility - mainly because its simpler and you can work out the undocumented features for yourself - not like in Fluent 5. In my case I've developed code in C, which implements a generalsised heterogeneous set of chemical reactions between a mutli-species porous solid and multi-species gas/fluid - for coal combustion applications, linked it in with the Fluent Fortran user code and parallelised it for SGI machines.

But I am waiting for Fluent 6 - which hopefully will be good and allow unstructured meshes with the Eulerian model...?!

Arturo Ortiz September 26, 2000 00:37

Re: Cell properties in UDF
Thanks for your help, I am in the same problem as you. I am trying to change the permeability with time and will try to follow your advice. The problem is that the available tutorial documentation in Fluent 4.5 is quite scarce and I will fight a lot with that.

Greg Perkins September 26, 2000 00:40

Re: Cell properties in UDF
Well there perhaps aren't as many tutorials, but the user defined coding is actually better documented, and you just use the template fortran routines to calculate your source terms - in order words you don't need to write a whole routine - only the interesting bit!!!

Other than that its similar to v5 and other codes. It will take some time - but at least its possible, which may not be the case in Fluent v5 depending on your problem!!

Arturo Ortiz September 26, 2000 00:58

Re: Cell properties in UDF
I was refering to the UDS documentation. In the manual there exists only a single chapter on UDF's in Fluent 4.5.( in fluent's site). I wonder if I can keep in touch so I can ask a few questions. People from fluent had already told me about the problems in f 5.3 and I think that I will use your approach. Thanks again.

Arturo Ortiz September 26, 2000 11:53

Re: Cell properties in UDF
According to the fluent the UDS must be compiled with absoft fortran (which I do not have) I wonder if you work in NT and if it is possible to compile the code with other compiler as compaq fortran ( the one I have ). Have you tried?

Is it possible for you to post a simple code so I can figure out how to write the porous media problem?


Harry October 13, 2000 23:34

Re: Cell properties in UDF
I've the problem in UDF too. i want to model buble break up and coalescence in FLUENT 5.1, but there's only limited information on me about UDF. Just browsing the header file, i know that it's painfull to solve the problem in UDF.

then i plan to solve the problem using my own code (maybe in MATHLAB). but i've the problem in gaining local information about U,V,W velocity, turb, disp, location of coordinate, cell volume, projected areas etc. in my own arrangement.

Can anyone tell me how to write an UDF to solve this problem


All times are GMT -4. The time now is 16:20.