|
[Sponsors] |
Differentiating between Boundary and Interface Faces |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 31, 2012, 06:07 |
Differentiating between Boundary and Interface Faces
|
#1 |
New Member
Rory Monaghan
Join Date: May 2010
Posts: 3
Rep Power: 16 |
Hello,
I am working with a UDF over a domain containing interfaces between different mesh structures. I need to distinguish between (a) interior cell faces, (b) boundary faces (i.e. at the edge of the domain) and (c) cell faces at INTERFACE boundaries (i.e. within the domain). I am using the BOUNDARY_FACE_THREAD_P macro to pick out boundary faces but this also picks out interface faces. Is there a unique macro to identify interface faces or can anyone suggest a way to distinguish between them? Thanks very much! Rory |
|
June 28, 2016, 11:13 |
|
#2 |
New Member
Join Date: Jun 2016
Posts: 7
Rep Power: 10 |
Hello,
are you sure with BOUNDARY_FACE_THREAD_P returning TRUE for both boundary and domain boundary faces? I didn't find anything in the UDF manual regarding this case. I'm interested in identifying only the boundary faces (and not the domain boundary faces). Is there a clever way to do so? Many thanks in advance! |
|
June 29, 2016, 04:10 |
|
#3 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
You can identify the type of a thread t with THREAD_TYPE(t).
If you want to exclude interior boundaries: Code:
if (THREAD_TYPE(t)!=THREAD_F_INTERIOR) {...} So in your case you want only walls (I guess), so you would say: Code:
if (THREAD_TYPE(t)!=THREAD_F_WALL) {...} |
|
June 29, 2016, 12:00 |
|
#4 |
New Member
Join Date: Jun 2016
Posts: 7
Rep Power: 10 |
Thank you very much!
THREAD_TYPE(t)==THREAD_F_WALL works well. Now I've got another problem. Perhaps you can give me some advice to solve it. In my geometry, there is a fluid domain and a porous domain which are matched via an interface. I want to know what happens in the neighbor cells of every cell in the fluid domain. Therefore I want to use the following code snippet in an UDF: Code:
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) { boundary_flag[indexnum] = 1.0; } else { cell0 = F_C0(f,tf); cell1 = F_C1(f,tf); cellthread0 = THREAD_T0(tf); cellthread1 = THREAD_T1(tf); if (cell0!=cell && THREAD_ID(cellthread0)!=THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (cell1!=cell && THREAD_ID(cellthread1)!=THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (cell0!=cell && THREAD_ID(cellthread0)==THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (cell1!=cell && THREAD_ID(cellthread1)==THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else { boundary_flag[indexnum] = 0.5; /* should not occur */ } } } But when I modify the code as follows: Code:
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) { boundary_flag[indexnum] = 1.0; } else { cell0 = F_C0(f,tf); cell1 = F_C1(f,tf); cellthread0 = THREAD_T0(tf); cellthread1 = THREAD_T1(tf); if (cell0!=cell && THREAD_ID(cellthread0)!=THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (!BOUNDARY_FACE_THREAD_P(tf) && cell1!=cell && THREAD_ID(cellthread1)!=THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (cell0!=cell && THREAD_ID(cellthread0)==THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else if (!BOUNDARY_FACE_THREAD_P(tf) && cell1!=cell && THREAD_ID(cellthread1)==THREAD_ID(thread)) { boundary_flag[indexnum] = 0.0; } else { boundary_flag[indexnum] = 0.5; } } } Do you see, what problem I missed in the upper code? The thing is, I also want to know what happens in the neighbor cells that lie in the porous zone. Again thanks in advance! |
|
July 5, 2016, 10:48 |
Can't remember how this worked out!
|
#5 |
New Member
Rory Monaghan
Join Date: May 2010
Posts: 3
Rep Power: 16 |
Hi there,
I am afraid I cannot be of much help to you. My original question was about 4 years and I have since moved on to other work. I hope you can get some assistance here. Regards Rory |
|
July 7, 2016, 04:20 |
|
#6 |
New Member
Join Date: Jun 2016
Posts: 7
Rep Power: 10 |
No problem, Rory.
Perhaps, for the other helpers, I should mention that I'm using the mixture model. So if anybody recognizes my mistake in the code above (e.g. in the thread architecture or something) and can tell me about it, I will really appreciate it. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Wind turbine simulation | Saturn | CFX | 60 | July 17, 2024 06:45 |
CFX13 Post Periodic interface | EtaEta | CFX | 7 | December 8, 2011 18:15 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |
Convective Heat Transfer - Heat Exchanger | Mark | CFX | 6 | November 15, 2004 16:55 |
Replace periodic by inlet-outlet pair | lego | CFX | 3 | November 5, 2002 21:09 |