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

list of faces of a patch

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

Like Tree1Likes
  • 1 Post By zwlwf

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2018, 11:12
Unhappy list of faces of a patch
  #1
New Member
 
omar osama
Join Date: Feb 2017
Posts: 3
Rep Power: 9
omarabozaid is on a distinguished road
Dear Foamers!,


I have some search to in oder to get a list of the boundary faces in openfoam but i still do not know how can i do that.



In a nutshell, i managed to create isoContour of a field and I want to calculated the distance between the nearest point of the contour to each face centre on the boundaries.


so i want to loop each face on the boundaries, access its centre and then find the minimum distance to the contour. my problem is only the first step how can i get the face ID ?




any suggestion ?
omarabozaid is offline   Reply With Quote

Old   December 14, 2018, 03:20
Default
  #2
New Member
 
Weiliang Zhu
Join Date: Apr 2016
Posts: 11
Rep Power: 10
zwlwf is on a distinguished road
Quote:
Originally Posted by omarabozaid View Post
Dear Foamers!,


I have some search to in oder to get a list of the boundary faces in openfoam but i still do not know how can i do that.



In a nutshell, i managed to create isoContour of a field and I want to calculated the distance between the nearest point of the contour to each face centre on the boundaries.


so i want to loop each face on the boundaries, access its centre and then find the minimum distance to the contour. my problem is only the first step how can i get the face ID ?




any suggestion ?
the face id in boundary patch only store a start id and total number of faces. so you can try following code to list the id of boundary patch of for example "inlet",

polyPatch patch = mesh.boundaryMesh()[“inlet”];
forAll( patch, pi)
{
Info<<patch.start()+pi<<endl;
}
vatavuk likes this.
zwlwf is offline   Reply With Quote

Old   December 14, 2018, 03:28
Default
  #3
New Member
 
Weiliang Zhu
Join Date: Apr 2016
Posts: 11
Rep Power: 10
zwlwf is on a distinguished road
what is more,
polyPatch::faceCentres() function can return the face center of a patch directly.
zwlwf 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
Decomposing meshes Tobi OpenFOAM Pre-Processing 22 February 24, 2023 10:23
[snappyHexMesh] Error snappyhexmesh - Multiple outside loops avinashjagdale OpenFOAM Meshing & Mesh Conversion 53 March 8, 2019 10:42
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 01:31
[GAMBIT] periodic faces not matching Aadhavan ANSYS Meshing & Geometry 6 August 31, 2013 12:25
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


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