CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

find Cell Index via geometry coordinates

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

Like Tree2Likes
  • 2 Post By kmooney

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2016, 04:38
Default find Cell Index via geometry coordinates
  #1
Member
 
Charles K.
Join Date: Feb 2016
Location: Germany
Posts: 37
Rep Power: 10
McCharles is on a distinguished road
Hello everyone,

I know the xyz coordinates of a certain point in my model geometry and want to use these coordinates to get the nearest Cell Index in Open Foam. I looked through the Documentation in order to find an existing OF utility able to resolve my problem but found nothing.

I know that there is a function in OF called 'findCell' that extracts the index of a cell in a mesh. Unfortunately, I'm quite new to OpenFoam and have no Idea how to implement 'findCell' in an utility.

Does anyone have have an idea?


Charles
McCharles is offline   Reply With Quote

Old   May 9, 2016, 22:10
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
Heya,

Check out this thread and see if it helps you get started:
http://www.cfd-online.com/Forums/ope...-parallel.html

Cheers!
Kyle
kmooney is offline   Reply With Quote

Old   May 10, 2016, 05:12
Default
  #3
Member
 
Charles K.
Join Date: Feb 2016
Location: Germany
Posts: 37
Rep Power: 10
McCharles is on a distinguished road
Hello Kyle and thanks for your answer and the link!

As a first step, i would like to know how utilities are created and executed in OFl, i've never done it before. Do I simply have to write the content of my own utility in a new text file, make the file executable and run it over the specific OF case?

Thanks for your help,

Charles
McCharles is offline   Reply With Quote

Old   May 10, 2016, 14:14
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 17
kmooney is on a distinguished road
Hi Charles,

It really drastically depends on what it is you're trying to do...

A good place to start might be to go through the /applications/utilities folder and see if you find something that is already doing something roughly similar to what you're trying to accomplish. Try to understand whats its doing then try and adapt it from there.
McCharles and Pepanson like this.
kmooney is offline   Reply With Quote

Old   September 17, 2016, 16:15
Default findNearestCell() tolerance
  #5
Senior Member
 
Tarak
Join Date: Aug 2010
Location: State College, PA
Posts: 111
Rep Power: 15
Tarak is on a distinguished road
Hi Kyle,

As you suggested, I have been using the function findNearestCell() (which belongs to the meshSearch class, http://openfoamcfd.sourceforge.net/d...eshSearch.html) inside my script to get the nearest cells to a series of points inside the boundary layer for flow over an airfoil. It seems the tolerance (tol_, which is a public variable of the class) is hard-coded to a value of 1e-3, which may not be sufficient for regions of very fine mesh. That is why I'm getting wrong results out of the function findNearestCell(). Have you ever faced this issue, and Is there any way to change this tolerance without recompiling?

Thanks
Tarak is offline   Reply With Quote

Reply

Tags
cell, coordinates, find, findcell, index

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
How to find face area of each cell in a boundary patch? Hale OpenFOAM Post-Processing 3 August 6, 2019 07:06
Problem with building geometry - concentric cylinders Rhoddwen OpenFOAM Pre-Processing 9 December 17, 2014 10:02
[General] 2 datas on one plot Akuji ParaView 46 December 1, 2013 14:06
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 00:52
[ANSYS Meshing] need to convert a cell based geometry into STL or CGNS kamran_kibria ANSYS Meshing & Geometry 0 September 15, 2011 05:14


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