|
[Sponsors] |
How to identify the cells near the interface? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 8, 2010, 02: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, 04: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, 11:32 |
|
#3 |
New Member
Join Date: Jun 2016
Posts: 7
Rep Power: 9 |
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 | 58 | July 3, 2020 01:13 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 05:50 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 19:43 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |
physical boundary error!! | kris | Siemens | 2 | August 3, 2005 00:32 |