CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

area of a patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2011, 17:01
Default area of a patch
  #1
New Member
 
mediode
Join Date: Mar 2009
Posts: 27
Rep Power: 17
mediode is on a distinguished road
Hello,

I would appreciate if anybody could give me a hint how to determine the area of an existing patch? (I would like to investigate the geometrical error produced by using snappyhexmesh.)

m*
mediode is offline   Reply With Quote

Old   March 8, 2011, 07:00
Default
  #2
Senior Member
 
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 18
gwierink is on a distinguished road
Hi mediode,

If you know the name of the patch (or the patchID straight away), then you can do the following. Here, the name of the patch is "movingWall", from the icoFoam cavity case.

Code:
// Find the patchID of the patch by name
label patchID = mesh.boundaryMesh().findPatchID("movingWall");

// Create a polyPatch for looping
const polyPatch& myPatch = mesh.boundaryMesh()[patchID];

// Initialize patchArea
scalar patchArea = 0.0;

// Loop trhough all faces on the polyPatch, adding their magnitude surface
// area vectors
forAll(myPatch, faceI)
{
    patchArea += mesh.magSf().boundaryField()[patchID][faceI];
}
__________________
Regards, Gijs
gwierink is offline   Reply With Quote

Old   April 6, 2011, 11:16
Default
  #3
New Member
 
mediode
Join Date: Mar 2009
Posts: 27
Rep Power: 17
mediode is on a distinguished road
Thanks a lot for the answer. Sorry for the delay.
Best regards
M*
mediode 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
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 01:31
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34
CFX Solver Memory Error mike CFX 1 March 19, 2008 08:22
[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 21:38.