CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

How to identify the cells near the interface?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2010, 03:53
Default How to identify the cells near the interface?
  #1
New Member
 
Yang Xiaoguang
Join Date: Apr 2009
Posts: 24
Rep Power: 17
legendyxg is on a distinguished road
Dear All

Here is my question. There are two regions A and B with an interior interface I in my model. Now I want to identify the neighboring cells near the interface, so that I can add an source term into these cells. How can I identify these cells?

Thank u very much!

Xiaoguang
legendyxg is offline   Reply With Quote

Old   April 8, 2010, 05:35
Default
  #2
Senior Member
 
Join Date: Feb 2010
Posts: 164
Rep Power: 17
gearboy is on a distinguished road
Quote:
Originally Posted by legendyxg View Post
Dear All

Here is my question. There are two regions A and B with an interior interface I in my model. Now I want to identify the neighboring cells near the interface, so that I can add an source term into these cells. How can I identify these cells?

Thank u very much!


Xiaoguang
You can define the face as interior in Gambit. Then it will have an id in fluent.
Use Lookup_Thread(id) to get the face.
Use F_C0, F_C1 to get the neighbour cells
gearboy is offline   Reply With Quote

Old   July 11, 2016, 12:32
Default
  #3
New Member
 
Join Date: Jun 2016
Posts: 7
Rep Power: 10
iteration is on a distinguished road
I'm facing a pursuing problem:

I want to access the value of a UDM C_UDMI(c,t,1) in an adjacent cell across an interface.

I use the following code snippet in my UDF:

Code:
tm = THREAD_SUPER_THREAD(thread);

c_face_loop(cell,thread,indexnum)
{
    f = C_FACE(cell,thread,indexnum);
    tf = C_FACE_THREAD(cell,thread,indexnum);
    if (THREAD_TYPE(tf)==THREAD_F_WALL)
    {
        a[indexnum] = 1.0;
    }
    else
    {
        cell0 = F_C0(f,tf);
        cell1 = F_C1(f,tf);
        if (!BOUNDARY_FACE_THREAD_P(tf) && (cell0!=cell))
        {
            a[indexnum] = C_UDMI(cell0,tm,0);
        }
        else if (!BOUNDARY_FACE_THREAD_P(tf) && (cell1!=cell))
        {
            a[indexnum] = C_UDMI(cell1,tm,0);
        }
        else if (BOUNDARY_FACE_THREAD_P(tf) && (cell0!=cell))
        {
            a[indexnum] = C_UDMI(cell0,tm,1);
        }
        else if (BOUNDARY_FACE_THREAD_P(tf) && (cell1!=cell))
        {
            a[indexnum] = C_UDMI(cell1,tm,1);
        }
    }
}
Then I'm looking for the min. value b in a with

Code:
n = C_NFACES(cell,thread);
b = a[0];
for (i = 1; i < n; i++)
{
    if (a[i] < b)
    {
        b = a[i];
    }
}
...but I'm always getting the value 0, while C_UDMI(c,t,0) and C_UDMI(c,t,1) are still greater than 0.

I also should mention that I'm using the mixture model (the UDF refers to the secondary phase, see THREAD_SUPER_THREAD) and that C_UDMI(c,t,0), C_UDMI(c,t,1) and a[9] are initialized with the value 1.0 in the first time step.

Where does this contradiction come from and how can I manage to access the right value across the interface?
I'm thanking you in anticipation.
iteration is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind turbine simulation Saturn CFX 60 July 17, 2024 06:45
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 06:50
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 20:43
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 05:05
physical boundary error!! kris Siemens 2 August 3, 2005 01:32


All times are GMT -4. The time now is 21:51.