CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How to let Fluent recognize diffrent faces (https://www.cfd-online.com/Forums/fluent/31008-how-let-fluent-recognize-diffrent-faces.html)

Steven March 1, 2003 16:35

How to let Fluent recognize diffrent faces
 
I am trying to implement a user defined scalar with UDF. There are three regions with different properties in my mesh, and therefore, there will be three different diffusivities for the mass transfer in these three regions. I could not figure out what macros to be used for this purpose, and how to let Fluent recognize the zones in my mesh. The structure could be something like this:

If region==1 diffusivity=value1; else if region==2 diffusivity=value2; else diffusivity=value3;

My questions are:

What macros to be used? Are threads used by UDF to represent different regions in my mesh? What will be the names of the threads? The names of faces in my mesh? Can somebody give me some ideas or hints? I will really appreciate it.

Steven

Murali March 2, 2003 21:34

Re: How to let Fluent recognize diffrent faces
 
<font face = "courier new">After you have imported the mesh into fluent and come to the juncture of specifying boundary conditions, you will find in the boundary conditions panel that you have a zone_id for every region. This number in unchangeable and is assigned internally by FLUENT. This is the number you need to use through "hardcoding" in UDFs. The way to do is to us the Macro Lookup_thread(zone_id). Refer to 6.5.7 of UDF manual.

The diffusivity can be specified by DEFINE_DIFFUSIVITY macro. Suppose I have zone-ids ranging from 3 to 11. First I obtain the domain number, and the cell and thread info are passed into the macro as arguements. I obtain the *thread pointer from the zone-id. If this *thread is equal to the cell thread that is passed, then the corresponding zone-id is the region where the cell belongs. Once I know in which region or zone-id the cell resides, I would know how to assign the value of diffusivity. See the example:



DEFINE_DIFFUSIVITY(my_diff,c,t,i)
{

int zone_id,i;
Thread *c_thread;
Domain dom;
real diff;

Get_domain(dom);

//Obtain the zone-id of the cell

for (i = 3; i < 11; i++)

{

if (c_thread == Lookup_Thread(dom,i))
{
zone_id = i;
}

}

//Assign values of diffusivity accordingly

switch (zone_id)

{

case 3:

diff = value1;
break;

case 4:

diff = value2;
break;

..
..
.

}

return diff;

}


</font>

Steven March 5, 2003 10:03

Re: How to let Fluent recognize diffrent faces
 
Thanks a lot, Murali. I'm working on it.


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