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

UDF_Cell variables!

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 2, 2005, 03:00
Default UDF_Cell variables!
  #1
ROOZBEH
Guest
 
Posts: n/a
Hi; I want to find a face (or edge in 2D) with maximum length in a cell (largest face of a cell). I want to calculate this value for all cells. How can I do this? I want to use a formulation includs maximume length of edge in each cell. Thanks
  Reply With Quote

Old   February 2, 2005, 04:07
Default Re: UDF_Cell variables!
  #2
Dragos
Guest
 
Posts: n/a
Here is a part of code that does what you want, or almost:

Thread *t; cell_t c; Domain *d; char first; int n,i; Node *node, *prev; real l, lprev;

d = Get_Domain(1);

thread_loop_c(t, d) /*loops over all cell threads in domain*/ { begin_c_loop(c, t) /* loops over cells in a cell thread */ { first = 1; found = 0; c_node_loop(c, t, n) /*loops over nodes in a cell*/ {

node = C_NODE(c,t,n);

if(1 == first)/*first node in cell*/

{

first = 0;

prev = node;

}

else

{

l = 0;

for(i = 0; i < ND_ND; i++)

l += (node->x[i]-prev->x[i])*(node->x[i]-prev->x[i]);

l = (l < lprev ? lprev : l);

lprev = l;

} } } end_c_loop(c, t) }

  Reply With Quote

Old   February 2, 2005, 06:50
Default Re: UDF_Cell variables!
  #3
Doru Grosan
Guest
 
Posts: n/a
Is it possible to use node->x[0] for NODE_X(node)?

  Reply With Quote

Old   February 2, 2005, 07:00
Default Re: UDF_Cell variables!
  #4
Dragos
Guest
 
Posts: n/a
Yes, it is. Look through the header files and you'll find some interesting things there!
  Reply With Quote

Old   February 2, 2005, 10:28
Default Re: UDF_Cell variables!
  #5
ROOZBEH
Guest
 
Posts: n/a
Hi; Thanks. I will apply this. ROOZBEH
  Reply With Quote

Old   February 14, 2005, 15:54
Default Re: UDF_Cell variables!
  #6
arashshahin
Guest
 
Posts: n/a
hi roozbeh are you iranian? where are you? can you help me about complicated model in gambit? thank you arashshahin@yahoo.com
  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
ADDITIONAL VARIABLES LIMITERS N.P CFX 5 December 1, 2011 07:47
$FOAM_USER_APPBIN & LIBBIN variables not set rassilon OpenFOAM Installation 2 February 16, 2010 20:54
PHI file structure Eugene Phoenics 9 November 2, 2001 22:00
How Do You Name Variables in Difference Equations? Zi-Wei Chiou Main CFD Forum 3 October 17, 2001 23:47
Saving variables on a user patch with physical coordinates Zoltan Turzo CFX 2 April 20, 2000 15:05


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