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

UDF for looping over nodes in cells.

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Chris

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 29, 2000, 05:11
Default UDF for looping over nodes in cells.
  #1
Malcolm Wallace
Guest
 
Posts: n/a
I'm trying to develop an interpreted UDF (under Windows NT) that will ultimately check to see whether cells lie on a specified plane or not (so that I can then access cell centre values on that plane). However, in order to do this, I need a UDF that can access the coordinates of all nodes associated with a particular cell. The UDF included below is designed to run as a 'Chip-exec' command, but unfortunately I have problems getting it to compile. I suspect I have the same sort of problem as the C_NNODE item posted here recently. Can anyone shed some light as to why the UDF below should not compile? The error which comes up is:-

cpp -IE:\FLUENT.INC\fluent5.3/src -IE:\FLUENT.INC\fluent5.3/cortex/src -IE:\FLUENT.INC\fluent5.3/client/src -IE:\FLUENT.INC\fluent5.3/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" e:\fluent.inc\libudf\src\cinfo3b.c Error: e:\fluent.inc\libudf\src\cinfo3b.c: line 19: non-integer subscript expression: unsigned char.

This must refer to the 'n' contained in the line 'c_node_loop(c, t, n). What do I need to do before the compiler will recognise this line? Any help will be greatly appreciated!

Malcolm W.

mwallace@nel.uk

************************************************** ************************* #include "udf.h"

extern Domain *domain; void cinfo3();

void cinfo3() {

cell_t c;

Thread *t;

Node *v;

int n;

real yvalue;

thread_loop_c(t, domain)

{

begin_c_loop_all(c, t)

{

c_node_loop(c, t, n)

{

v = CELL_NODE(c, t, n);

yvalue = NODE_Y(v);

}

}

end_c_loop(c,t)

} }
  Reply With Quote

Old   June 30, 2000, 09:44
Default Re: UDF for looping over nodes in cells.
  #2
Chris
Guest
 
Posts: n/a
You are right, it is the same problem. Change the c_node_loop(c,t,n) line to read

for(n=0;n<cell_type_nnodes[(int)C_TYPE(c,t)];++n)

Also you need to change CELL_NODE(c,t,n) to C_NODE(c,t,n).

ali_karimi likes this.
  Reply With Quote

Old   June 30, 2000, 15:01
Default Re: UDF for looping over nodes in cells.
  #3
Chris
Guest
 
Posts: n/a
Hmm. That didn't work at all. Apparently it didn;t like the less-than symbol. Lets try again, but where it shows LT you want to use the less-than sign (the ampersand lt semicolon doesn't work either...).

You need to replace the c_node_loop(c,t,n) line with:

for (n=0; n LT cell_type_nnodes[(int)C_TYPE(c,t)]; n++)

Also you need to change CELL_NODE(c,t,n) to C_NODE(c,t,n).
  Reply With Quote

Old   July 3, 2000, 09:22
Default Re: UDF for looping over nodes in cells.
  #4
Malcolm Wallace
Guest
 
Posts: n/a
Problem solved! Thanks Chris.

Malcolm
  Reply With Quote

Reply


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
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43
export nodes, cells and heat transfer coefficients Ademar Cardoso FLUENT 0 September 13, 2005 17:22
Setting pressure value for specific cells, UDF Amir FLUENT 2 September 1, 2005 18:59
Set up the velocity of some cells in the UDF. Fluenter FLUENT 6 September 27, 2004 01:30
CFX4.3 -build analysis form Chie Min CFX 5 July 12, 2001 23:19


All times are GMT -4. The time now is 15:52.