CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   DEFINE_DIFFUSIVITY udf in fluent (http://www.cfd-online.com/Forums/fluent-udf/122026-define_diffusivity-udf-fluent.html)

maniek940 August 10, 2013 11:57

DEFINE_DIFFUSIVITY udf in fluent
 
Hello,
I am new user of fluent and I need udf for traser diffusivity in water. The traser is flowing from small pipe to bigger, filled with water. In manual I found only example for mean age of air, so please help me. I use k-epsilon model.

The equation of traser diffusion is:
D=(Dm+Dt)*rho

where:
Dm and rho are constant,

Dt=0.1*(k^2/epsilon)
k and epsilon are values calculated by fluent in every cell,

The udf function I need is DEFINE_DIFFUSIVITY(name,c,t,i)
in manual there was an information that c,t,i are variables, but I don't know how they are working.

Can anyone help me how to create udf, that fluent can "understand" that k and epsilon are that values calculated?

A CFD free user August 11, 2013 13:12

Quote:

Originally Posted by maniek940 (Post 444868)
Hello,
I am new user of fluent and I need udf for traser diffusivity in water. The traser is flowing from small pipe to bigger, filled with water. In manual I found only example for mean age of air, so please help me. I use k-epsilon model.

The equation of traser diffusion is:
D=(Dm+Dt)*rho

where:
Dm and rho are constant,

Dt=0.1*(k^2/epsilon)
k and epsilon are values calculated by fluent in every cell,

The udf function I need is DEFINE_DIFFUSIVITY(name,c,t,i)
in manual there was an information that c,t,i are variables, but I don't know how they are working.

Can anyone help me how to create udf, that fluent can "understand" that k and epsilon are that values calculated?

Hey Dude
You can do it either by defining a generic user scalar function (UDS) or applying species transport equation. The most important thing is the diffusivity, of course which you can use DIFFUSIVITY macro. The macro has four arguments: "name" is the name you consider for the function, "c" stands for the cells (cells in the zone), "t" designates thread (actually it represents zone ) and finally "i" is an index which imply to the interest species (the species you want to define a diffusivity). It is defined according to the order you select the species. For instance, if you have three specie, "i" is 0,1 and 2 for the specie, respectively. Let me tell you that if you use UDS then you can find the "i" for the appropriate scalar in user define/ scalars/ UDS index.
I hope it helps somehow

maniek940 August 13, 2013 17:13

Hey Azarafza,
It helped, thanks so much :)


All times are GMT -4. The time now is 18:13.