CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > FLUENT

a way to find out wall-neighboring cells?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 8, 2002, 05:52
Default a way to find out wall-neighboring cells?
  #1
Christian
Guest
 
Posts: n/a
hello!

i want to find out the cell-ID of all wall-neighboring cells and declare them as a variable. I have written the following UDF, but I don't know how to find out if it works, because i have no idea how to view the cell-ID or the cells.

#include "udf.h" #include "mem.h"

cell_t c; cell_t c0; cell_t c1; face_t f; Domain *domain; Thread *t;

DEFINE_ON_DEMAND(cell_check) { begin_f_loop(f, t)

{

cell_t c0 = F_C0(f, t);

if (c0 == NULL)

{

cell_t c1 = F_C1(f, t);

}

} end_f_loop(f, t) }

1. Does anybody know how i can check if it works? 2. Maybe you know that it won't work and have other proposals, please tell me!

Thanks in advance, Christian
  Reply With Quote

Old   May 8, 2002, 21:46
Default Re: a way to find out wall-neighboring cells?
  #2
Johnix
Guest
 
Posts: n/a
Why not work? It seems perfect!!!

The way to test it is to try cases... lol
  Reply With Quote

Old   May 9, 2002, 04:55
Default Re: a way to find out wall-neighboring cells?
  #3
Christian
Guest
 
Posts: n/a
tested it ==> segmentation violation. I knew it seemed perfect, but that`s the way perfect things work. I can imagine there is an error produced at the inlet/outlet boundary conditions. by the way, the command `NULL`is defined in FLUENT anyway?

Christian
  Reply With Quote

Old   May 9, 2002, 05:59
Default Re: a way to find out wall-neighboring cells?
  #4
Johnix
Guest
 
Posts: n/a
<html> <body>
Have you defined the thread var f globally? Sounds you like global definition...lol

If not or f is not assigned correctly, there must be a problem with your function, DEFINE_ON_DEMAND(cell_check). "segmentation violation" means you are refering an mem address out of the stack or heap, and this suggest you an easy way to debug it: try to test the value of the pointer var. Since there is no debugger in Fluent, some printf statements may help.

NULL is OK, since it's an internal macro of C compiler defined in, for example, stdio.h. If you are still not sure about it, you can use if((ulong)c0==0)...

Enjoy your debugging~~~

<font size=5 face=script color=#0000FF>Johnix</font>


</body> </html>
  Reply With Quote

Old   May 10, 2002, 08:30
Default Re: a way to find out wall-neighboring cells?
  #5
Christian
Guest
 
Posts: n/a
Thanks a lot, Johnix!
  Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tmerge utility creates unwanted interface/walls comes in the final mesh dinesh2n@gmail.com OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 11 January 20, 2012 07:23
snappyHexMesh aborting Tobi OpenFOAM Native Meshers: snappyHexMesh and Others 0 November 10, 2010 04:23
How to find the cells adjacent to the wall? aam Fluent UDF and Scheme Programming 4 May 19, 2009 14:40
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
Pointers to wall adjacent cells in CFX 5 Fabian CFX 2 November 21, 2002 12:14


All times are GMT -4. The time now is 04:05.