|
[Sponsors] |
August 24, 2023, 14:13 |
Access to Boundary Edges / Points of Patch
|
#1 |
Member
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9 |
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 |
|
August 25, 2023, 02:59 |
|
#2 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 14 |
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/ |
|
August 27, 2023, 17:58 |
|
#3 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
Quote:
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. |
||
August 29, 2023, 11:08 |
|
#4 |
Member
Kellis
Join Date: Mar 2017
Posts: 39
Rep Power: 9 |
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 |
|
|
|
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 |