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

Shortest distance between cell and boundary (in parallel)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2016, 00:26
Default Shortest distance between cell and boundary (in parallel)
  #1
Member
 
Ripudaman Manchanda
Join Date: May 2013
Posts: 55
Rep Power: 11
ripudaman is on a distinguished road
Hello FOAMers,

I have a topologically changing mesh where the boundary changes in size by splitting the internal faces and converting them to boundary faces. This is illustrated using the ACP methodology in the solidMechanics solvers.

I want to dynamically refine my mesh based on distance from this growing boundary. So basically I would like to create a volScalarField (or scalarField) that I could use in the dynamicRefinement dictionary.

So, in short, I want a method to calculate the shortest distance between a cell and a boundary patch. I could do this myself but I anticipate parallelization of that procedure to be a difficult detail to handle. Thus, before I dive into it I wanted to ask my dear FOAMers if they have ever done anything like this before. Is there anything out there that could help me?

Thanks.
Cheers,
Ripu
ripudaman is offline   Reply With Quote

Old   March 23, 2016, 04:31
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 395
Rep Power: 16
chriss85 will become famous soon enough
See this thread for a function to gather decomposed fields (such as cell or face centres) from all the processors: http://www.cfd-online.com/Forums/ope...processor.html

Once you have all the positions it's simply a matter of searching for nearest distance. I expect this to be quite slow though, of order O(n^1.666), with n being the number of cells, so I would think about doing some kind of nearest neighbour search, starting from the face which was closest last time if possible.
chriss85 is offline   Reply With Quote

Old   March 23, 2016, 08:45
Default
  #3
Member
 
Ripudaman Manchanda
Join Date: May 2013
Posts: 55
Rep Power: 11
ripudaman is on a distinguished road
That's an interesting idea. I can probably map the global field below sorting to help keep track. The slowness is what bothers me though. I wanted to do this inside a loop that will be called 100s of times in small meshes and 1000s in larger meshes. That'll make it very slow. I was thinking of using a cell-cell approach but I am not sure if it will be easy to go across processor boundaries. Any suggestions or best practices?
ripudaman is offline   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
Find distance from a cell to a Boundary patch oehmu OpenFOAM Programming & Development 1 March 22, 2016 23:47
Distance between boundary cell and boundary face STutexas OpenFOAM Running, Solving & CFD 1 March 13, 2016 07:40
Boundary layer first cell distance ACER STAR-CCM+ 1 July 19, 2012 10:23
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Meshing & Mesh Conversion 2 July 15, 2005 04:15
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


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