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

area of a patch

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 7, 2011, 17:01
Default area of a patch
  #1
New Member
 
mediode
Join Date: Mar 2009
Posts: 26
Rep Power: 8
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: 9
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, 10:16
Default
  #3
New Member
 
mediode
Join Date: Mar 2009
Posts: 26
Rep Power: 8
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

Thread Tools
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 On
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 37 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
Import gmsh msh to Foam adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


All times are GMT -4. The time now is 23:41.