|
[Sponsors] |
How to identify the cells near the interface? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 8, 2010, 03:53 |
How to identify the cells near the interface?
|
#1 |
New Member
Yang Xiaoguang
Join Date: Apr 2009
Posts: 24
Rep Power: 17 |
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 |
|
April 8, 2010, 05:35 |
|
#2 | |
Senior Member
Join Date: Feb 2010
Posts: 164
Rep Power: 17 |
Quote:
Use Lookup_Thread(id) to get the face. Use F_C0, F_C1 to get the neighbour cells |
||
July 11, 2016, 12:32 |
|
#3 |
New Member
Join Date: Jun 2016
Posts: 7
Rep Power: 10 |
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); } } } Code:
n = C_NFACES(cell,thread); b = a[0]; for (i = 1; i < n; i++) { if (a[i] < b) { b = a[i]; } } 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. |
|
|
|
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 |