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

find the adjacent face on the boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By olesen

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 23, 2012, 10:12
Default find the adjacent face on the boundary
  #1
Member
 
bojiezhang
Join Date: Jan 2010
Posts: 64
Rep Power: 16
bojiezhang is on a distinguished road
Hello everyone:

I want to find the cells surround one cell "on the boundary", (the cell is face). If I know one face ID, how can I find the faces ID around this face? For example, if the face is quadrangle, I want to find the other 8 faces around it.

Could someone know how to deal with it? Thank you!

bojiezhang
bojiezhang is offline   Reply With Quote

Old   June 25, 2012, 03:36
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,685
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by bojiezhang View Post
Hello everyone:

I want to find the cells surround one cell "on the boundary", (the cell is face). If I know one face ID, how can I find the faces ID around this face? For example, if the face is quadrangle, I want to find the other 8 faces around it.

Could someone know how to deal with it? Thank you!

bojiezhang
Finding the immediate neighbouring faces (eg, 4 neighbouring faces from a quad) shouldn't be too bad:
- from boundary face, get the owner cell
- for this owner cell, get all the associated faces
- get the neighbouring cells from the faces
- loop through to find the which of the neighbour cell faces to find a boundary face.

If you need the "corner" faces, my first approach would be brute force.
- from the boundary face you know the vertices, place them in a labelHashSet.
- loop through the boundary faces and tag each face that shares a vertex with the original face. A labelHashSet of the face Ids might be useful here.

This should work. Instead of looping across all boundary faces, you may want to restrict your search to a particular patch though - for efficency and to avoid finding a neighbour with a different BC treatment.
Tushar@cfd and codder like this.
olesen is offline   Reply With Quote

Old   September 16, 2014, 05:05
Default use of GroovyBC to acess the data
  #3
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Dear olesen,

Quote:
Finding the immediate neighbouring faces (eg, 4 neighbouring faces from a quad) shouldn't be too bad:
- from boundary face, get the owner cell
- for this owner cell, get all the associated faces
- get the neighbouring cells from the faces
- loop through to find the which of the neighbour cell faces to find a boundary face.
Thank you for the valuable information.

How to get all the associated faces for the owner cell? I wish to use groovyBC for the same.
Tushar@cfd is offline   Reply With Quote

Old   November 9, 2014, 14:52
Default
  #4
Member
 
Join Date: Jul 2014
Posts: 39
Rep Power: 11
PicklER is on a distinguished road
Hello

The function name is bit confusing, but to get the faces of a cell called FaceIOwner:

Code:
const cell& facesOfOwner = mesh.cells()[FaceIOwner];
PicklER is offline   Reply With Quote

Old   November 10, 2014, 07:50
Default
  #5
Senior Member
 
T. Chourushi
Join Date: Jul 2009
Posts: 321
Blog Entries: 1
Rep Power: 17
Tushar@cfd is on a distinguished road
Thank you for the info.

-
Best Regards!
Tushar@cfd 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
CFX-Pre problem, pls help!!! cth_yao CFX 0 February 17, 2012 00:52
designmodeler and mesh and fluent, lose face boundary uriah ANSYS Meshing & Geometry 6 October 16, 2010 04:31
gmsh2ToFoam sarajags_89 OpenFOAM 0 November 24, 2009 22:50
How to get specie mass fraction at a boundary face shuqin FLUENT 0 February 24, 2006 01:52


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