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

a way to find out wall-neighboring cells?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2002, 06: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, 22: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, 05: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, 06: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, 09: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 Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find the cells adjacent to the wall? aam Fluent UDF and Scheme Programming 6 June 28, 2017 09:53
[Commercial meshers] tmerge utility creates unwanted interface/walls comes in the final mesh Shoonya OpenFOAM Meshing & Mesh Conversion 11 January 20, 2012 07:23
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 04:23
Multicomponent fluid Andrea CFX 2 October 11, 2004 06: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 03:39.