On multi-component species diffusion in Fluent


How does multi-component species diffusion work in Fluent? Can we specify binary diffusivities of various species in the mixture using UDF and use full multi-component diffusion?
Here is what I have found while investigating this issue.

There are 2 places in Fluent (6.1.19) where you can chose the option of Multi-component species diffusion: one is through species panel and the other is in materials panel while specifying diffusivity.

If the option through Species panel is enabled and multi-component diffusion is chosen in Materials panel, Fluent will let you specify binary diffusivities Dij as constants or polynomials of Temperature. If you want to use UDF, you can write a DEFINE_DIFFUSIVITY function on lines of the one given below. The example given is for 3 species mixture and for demonstration purposes d_m[0][1], d_m[0][2] and d_m[1][2] are taken as constants. The species indices 0, 1 and 2 can be found from the order in which species are included in the mixture (Materials panel).
DEFINE_DIFFUSIVITY(name, c, t, index) is called for every combination Djk (j<k). So, for three species, it will be called three times to find D01, D02 and D12.
Each time it is called, it will pass index i, which is calculated from j and k using the function i=j*(no of species-1)+k-1. So, for D01, D02 and D12, DEFINE_DIFFUSIVITY will be
called with index i equal to 0, 1 and 3. What the following UDF does is it back calcultes j and k based on the valuye of i passed by Fluent and passes the appropriate Djk value. This works only from 6.1.19 onwards.

If the option through Species panel is not activated and multi component option is chosen in Materials panel, Fluent uses dilute approximation. You are prompted to input binary diffusivities of species (Dij) which are used in equation 7.7-2 to calculate (Di,m) where m represents the mixture or carrier gas made of species that is most prevalent. So for a 3 species mixture, you would specify D01, D02 and D12 and Fluent will use equation 7.7-2 to calculate D0,m and D1,m

UDF:

#include "udf.h"
int count=0;

DEFINE_DIFFUSIVITY(multi,c,t,i)
{
Domain *d;
Material *m,*sp;
div_t divide;
int j1,j2,k,n,ns,nspe,flag;
real d_m[10][10],diff;
d_m[0][1]=0.0001;
d_m[0][2]=0.0007;
d_m[1][2]=0.005;
m=THREAD_MATERIAL(t);
n=MIXTURE_NSPECIES(m); /*n->no. of species, n-1 no of eqns*/
flag = 0;
k=n-1;

/*Get j1 and j2 from i from the formulae i=j1*(no of species-1)+j2-1 and j1<j2*/
/*then use j1 and j2 to specify binary diffusivity d(j1,j2)*/
while (flag==0)
{
divide=div((i+1-k),(n-1));
if(divide.rem==0.0)
{ j2=k;
flag=1;}
else
k=k-1;
}
j1=(i+1-j2)/(n-1);

diff=d_m[j1][j2];

return diff;

}





Show Form
No comments yet. Be the first to add a comment!