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

Access to Boundary Edges / Points of Patch

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Kellis

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2023, 14:13
Default Access to Boundary Edges / Points of Patch
  #1
Member
 
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9
Kellis is on a distinguished road
Hello all,

I am wondering if there is a function within OpenFOAM, or an efficient algorithm I could implement, to gather the exterior / boundary edges or points of a patch, i.e. the ones that form the outline of the patch. I don't see any such functionality within any of the mesh classes, and can't think of an efficient way to search for them. Any advice would be wonderful.

Thanks,
Kellis
Kellis is offline   Reply With Quote

Old   August 25, 2023, 02:59
Default
  #2
Member
 
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14
LongGe is on a distinguished road
Hello Kellis

Just an idea of mine, but could you use the method of looking for single edges on the patch? However, it cannot be used if it picks up a face from an adjacent patch.

const labelListList& edgeFaces = patch_.edgeFaces();
forAll(edgeFaces, edgeI){
const labelList& faces = edgeFaces[edgeI];
if(faces.size() == 1){
Info << "single edge: " << edgeI << endl;
}
}
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/
Powered by Ennova : https://ennova-cfd.com/
Ennova's Channel Partners : http://www.wolfdynamics.com/
LongGe is offline   Reply With Quote

Old   August 27, 2023, 17:58
Default
  #3
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Kellis View Post
Hello all,

I am wondering if there is a function within OpenFOAM, or an efficient algorithm I could implement, to gather the exterior / boundary edges or points of a patch, i.e. the ones that form the outline of the patch. I don't see any such functionality within any of the mesh classes, and can't think of an efficient way to search for them. Any advice would be wonderful.

Thanks,
Kellis

The functionality is all there, but hiding in plain sight (ie, probably not that easy to find if you don't know what to look for).
If you follow from the polyPatch (https://develop.openfoam.com/Develop...ch/polyPatch.H) you will notice that is inherits directly from a primitivePatch which is a variant of the PrimitivePatch template: https://develop.openfoam.com/Develop...imitivePatch.H
Within that you will see there is piles of functionality, including obtaining the boundary edges.
Note however, that these patch edges will be in terms of the local patch faces/point ids and not the global face/points, so you may need to apply the patch meshPoints() to obtain mesh ids. The handling of local vs mesh ids may or may not be needed, depending on what you are trying to achieve - but at least you know where to look.
olesen is offline   Reply With Quote

Old   August 29, 2023, 11:08
Default
  #4
Member
 
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9
Kellis is on a distinguished road
Mark,

Excellent, this is exactly what I was looking for, I just didn't delve deeply enough into the parent classes. Thank you!

Cheers,
Kellis
olesen likes this.
Kellis 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
y+ and u+ values with low-Re RANS turbulence models: utility + testcase florian_krause OpenFOAM 114 August 23, 2023 06:37
flow over cylinder in openFoam saeed jamshidi OpenFOAM Pre-Processing 3 August 11, 2023 16:16
[snappyHexMesh] Invalid Normals for source face to target face while making AMI? Sorabh OpenFOAM Meshing & Mesh Conversion 1 August 3, 2021 07:35
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 06:12


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