|
[Sponsors] |
October 9, 2003, 13:44 |
Finding out boundary cells in a domain
|
#1 |
Guest
Posts: n/a
|
I have a simple 2-D channel, and I want to manipulate the cells at channel boundary. I wrote a code for it, but it gives Segmentation Violation when I run it.
Please see if you can see what the problem is with this UDF: --------------------------------------------- # include "udf.h" DEFINE_ADJUST (macro_s,d) { Thread *t, *tf, *tc1; face_t f; cell_t c; cell_t c1; int n,k; thread_loop_c (t, d) /*loops over all cell threads in domain*/ { begin_c_loop(c, t) /* loops over cells in a cell thread */ { c_face_loop(c,t,n) /* loops over all faces on a cell */ { f=C_FACE(c,t,n); /* returns the face f for the cell c and Thread t */ tf=C_FACE_THREAD(c,t,n); /* get cell ids c0 and c1 which are adjacent to this face f */ tc1=F_C1_THREAD(tf, t); c1=F_C1(f,tf); if (c1=NULL) ; /*Error occurs when cells are out of the boundary. Have to apply condition to the cell ADJACENT to it */ printf("%f, it's out\n", k); k++; } } end_c_loop(c, t) } } --------------------------------------------- Thanks. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Finding boundary cells | stephan | OpenFOAM Running, Solving & CFD | 5 | October 4, 2016 11:56 |
[Gmsh] Import problem | ARC | OpenFOAM Meshing & Mesh Conversion | 0 | February 27, 2010 10:56 |
increasing mesh quality is leading to poor convergence | tippo | CFX | 2 | May 5, 2009 10:55 |
help:uds source added to boundary cells | FredPacheo | FLUENT | 5 | September 5, 2008 05:45 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 04:15 |