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

How to define nodes for a certain cell ?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 25, 2000, 11:00
Default How to define nodes for a certain cell ?
  #1
mikhail
Guest
 
Posts: n/a
Hi !

While looping over cells in a thread I need to define coordinates of all cell nodes to provide the next calculations.All I want to do might be done by using functions NODE_X(node), NODE_Y(node), NODE_Z(node),NODE_GX(node),NODE_GY(node),NODE_GZ(n ode), but how can I get this "node" parameter for a certain cell ?

Your reply would be very convenient...

Best wishes. Mikhail
  Reply With Quote

Old   October 29, 2000, 22:52
Default Re: How to define nodes for a certain cell ?
  #2
minun
Guest
 
Posts: n/a
do you want a kind of following ones?

DEFINE_ADJUST(test_coord,domain) { cell_t c; Thread *t; Node *v; int n; real xn,yn;

thread_loop_c(t, domain){

begin_c_loop(c, t){

Message("cell %d (%d) : ",c,C_NNODES(c,t));

c_node_loop(c, t, n){

v = C_NODE(c, t, n);

xn = NODE_X(v);

yn = NODE_Y(v);

Message(" %d(%g,%g)",n,xn,yn);

}

Message("\n");

} end_c_loop(c,t) } }
  Reply With Quote

Old   November 8, 2000, 21:59
Default Re: How to define nodes for a certain cell ?
  #3
Harry
Guest
 
Posts: n/a
Hi Minun, I've try to run your program, but it doesn't work. The error seem when reach the "Message("cell %d (%d) : ",c,C_NNODES(c,t));" line with the error message (unsigned char error). Is it true??, and how to fix it?

  Reply With Quote

Old   November 12, 2000, 21:51
Default Re: How to define nodes for a certain cell ?
  #4
minun
Guest
 
Posts: n/a
If you compile the source with 'compiled udf', it should work well.

I guess you compiled it with 'interpreted udf'. Change that line to 'printf("cell %d (%d) : ",c,cell_type_nnodes[(int)C_TYPE(c,t)]);

You can find following message posted by Chris in this forum. ================================================== ===============

That is a bug. It should work OK as is for compiled UDFs.

To make it work in the interpreted UDFs, change the line:

num = C_NNODES(c,thread);

to read:

num = cell_type_nnodes[(int)C_TYPE(c,thread)];

Chris
  Reply With Quote

Old   November 17, 2000, 02:42
Default Re: How to define nodes for a certain cell ?
  #5
Harry
Guest
 
Posts: n/a
Thank you very much, and i'll try it
  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
How do you define a cell zone or region for porous? bigbang OpenFOAM Meshing & Mesh Conversion 3 March 25, 2015 12:51
How can I define the cell centers without using writeCellCenters? Taylorreihe OpenFOAM Post-Processing 3 May 5, 2011 06:54
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 12:24
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 11, 2000 03:43


All times are GMT -4. The time now is 09:33.