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

Neighboring Cells on FLUENT

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 13, 2012, 11:07
Default Neighboring Cells on FLUENT
  #1
New Member
 
Redouane
Join Date: Jul 2012
Posts: 1
Rep Power: 0
Red1 is on a distinguished road
Hello everyone, can anyone help me with a specific problem. I try to compare a quantity (such as tempreture) of a cell of a quadratic mesh with neighboring cells (8 cells for 2D case ans 26 for 3D the one). There's someone there to help me? Thank you in advance!
Red1 is offline   Reply With Quote

Old   July 14, 2012, 03:07
Default
  #2
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Until now, I haven't found a straightforward solution to this problem.
I came to believe that there is no way of reading a neighboring cell directly.

In your case, there could be a workaround since you have very few cells and you know the cell extent.

It goes like this:

loop over all the cells and read the value you want to compare (e.g. temperature).
Store the position of this cell.
Now WITHIN this cell loop, loop over all the cells again and compare the position of the cell to the position you just stored.
If for example the position in X is one cell extent away and the position in Y is the same, that is a neighboring cell. Now you can read the Temperature again and compare it to the stored value.

I already did something similar, it works.
Keep in mind that the computational effort is proportional to the number of cells^2. So compiling the UDF instead of interpreting it is recommended to speed it up.
flotus1 is offline   Reply With Quote

Old   July 14, 2012, 04:47
Default
  #3
Super Moderator
 
flotus1's Avatar
 
Alex
Join Date: Jun 2012
Location: Germany
Posts: 3,399
Rep Power: 46
flotus1 has a spectacular aura aboutflotus1 has a spectacular aura about
Another possibility with a structured uniform mesh would be to store the value in an array T[x][y][z] in a first loop over all cells.

In a second loop, you can compare the values.

This would reduce the computational effort to 2*(Number of cells). What a speedup

By the way: if you should ever stumble upon a simple solution for this problem, please let me know.

Last edited by flotus1; July 14, 2012 at 15:09.
flotus1 is offline   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
[Commercial meshers] Converting a mesh with splitted cells using fluentMeshToFoam jlpelerin OpenFOAM Meshing & Mesh Conversion 4 April 25, 2011 16:56
Highly Skewed Cells chrisoturner FLUENT 7 July 22, 2010 06:43
Fluent: Mesh Adaption based on Gradient enigma FLUENT 4 July 15, 2010 17:36
physical boundary error!! kris Siemens 2 August 3, 2005 00:32
Ignore cells on partition boundary Karl FLUENT 7 May 11, 2002 22:12


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