CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   random posrosity (

shekhar October 6, 2003 14:52

random posrosity
how to initialize varying longitudinal porosity in case of a 2D packed bed as a gaussian distribution.

cp October 7, 2003 18:45

Re: random posrosity

You may have to do it via UDS. Define the scalar as Porosity and write an initialization UDF which does the job for you (Include all Gaussian type distribution here). And, do not solve for the scalar, if your porosity is not varying.

Hope this helps,


Shekhar Jain October 11, 2003 12:28

Re: random posrosity
Hi, thanks for ur reply.But i am not familiar with UDS so i was planning to do it with using UDF only. But i am not getting how to give the gaussian distribution for porosity using UDF.can you help me out with this!!

cp October 11, 2003 12:38

Re: random posrosity

Could you please post the UDF, if you have, so that we can see how it can be modified?

Pls. go thru the Fluent manual, you will find the connection between UDF / UDS. Basically, you define a scalar (UDS) and control its transport thru a set of UDFs. I think, Your problem can be solved thru a set of UDS/UDFs.

Alternatively, you can search this Fluent Forum. A number of good discussions have taken place in the past.


Shekhar Jain October 11, 2003 12:54

Re: random posrosity
Hi, Again thanks for your reply. In my case I have a 2D geometry so basically i have a rectangle. Now i want to initialize some solid volume fraction in it. I can give the radial variations by marking cells so that i have parallel regions spaning the entire length of the rectangular bed. And then i patch different regions with different solid volume fraction. But now i want to give a longitudinal variation in each region as well so that i can have a porosity distribution in radial as well as longitudinaly. I thought of giving the variation by using gauusian distribution, but i am not getting how to include a gaussian number generator in an UDF.


Greg Perkins October 13, 2003 23:45

Re: random posrosity
I think you should write a DEFINE PROFILE function as explained in the udf manual and then attach it to the porosity of the porous medium in the boundary conditions panel for your fluid domain. This routine would return the porosity for each cell in the domain. How you define the spatial variation is up to you.

I have had some problems saving and loading cases/data files when using this udf for porosity and I think there might be a bug in FLUENT. It does however work fine during solution iterations.

You should not need to use UDS although you could do it this way but this will be more tricky.

This assumes you are using FLUENT 6.1 - these features are not available in earlier versions and you have to use UDS for them.


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