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

cells less than one

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2005, 06:15
Default cells less than one
  #1
Andrew Garrard
Guest
 
Posts: n/a
I am looking at some UDF code that someone gave me and I am a litte confused, it is show below. My questionis why would a cell index (c1) be assigned a negative value (i.e. < 0). Any help would be super.

DEFINE_UDS_FLUX(conv_fluxes, f, thread, eqn)

{

cell_t c0, c1;

Thread *tc0, *tc1;

c0 = F_C0(f, thread);

tc0 = THREAD_T0(thread);

c1 = F_C1(f, thread);

tc1 = THREAD_T1(thread);

if( c1 < 0 )

{

return one thing

}

else

{

return another

}

}
  Reply With Quote

Old   January 25, 2005, 08:29
Default Re: cells less than one
  #2
Luca
Guest
 
Posts: n/a
According to me the cell_t index goes from 0 to n-1 cells. So the first if will never be executed. Luca
  Reply With Quote

Old   January 26, 2005, 05:41
Default Re: cells less than one
  #3
Andrew Garrard
Guest
 
Posts: n/a
I ran this code with a Message if c1<0 and it produced results. so at some point c1 does adopt a negative value. When this happens c1 adopts the value of -1 according to the output line. I am guessing this must be something to do with the boundary, but some more insight would be very helpful.
  Reply With Quote

Old   January 26, 2005, 05:48
Default Re: cells less than one
  #4
Luca
Guest
 
Posts: n/a
Try to discover where is the cell with index -1. For example export its node position with the macro NODE_X(node). I had never come across a negative index. Maybe it means something... Is it the only negative index you found? Please let me know. Luca
  Reply With Quote

Old   January 26, 2005, 05:54
Default Re: cells less than one
  #5
Luca
Guest
 
Posts: n/a
AH! Maybe C1<0 means that no c1 cell exist. If you're applying your function on a boundary face-thread, there's no C1 cell adjacent to it, only a C0 cell. I used the macro BOUNDARY... reported on the UDF guide. Let me know what you discover.Luca
  Reply With Quote

Old   January 26, 2005, 07:29
Default Re: cells less than one
  #6
Andrew Garrard
Guest
 
Posts: n/a
-1 is the only negative index retuned and from returning F_CENTROIDS, it looks like you are right. if c == -1 then it appears to be a boundary face and hence c1 dosen't exist.

Thanks.
  Reply With Quote

Old   January 27, 2005, 05:15
Default Re: cells less than one
  #7
Luca
Guest
 
Posts: n/a
OK then, we learned something more about UDF programming... Have a good day,Luca
  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
[Netgen] Import netgen mesh to OpenFOAM hsieh OpenFOAM Meshing & Mesh Conversion 32 September 13, 2011 05:50
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
[snappyHexMesh] snappyHexMesh aborting Tobi OpenFOAM Meshing & Mesh Conversion 0 November 10, 2010 03:23
[snappyHexMesh] external flow with snappyHexMesh chelvistero OpenFOAM Meshing & Mesh Conversion 11 January 15, 2010 19:43
physical boundary error!! kris Siemens 2 August 3, 2005 00:32


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