openfoam中计算patch到面积
label patchID = mesh.boundaryMesh().findPatchID("walls");
const polyPatch& cPatch = mesh.boundaryMesh()[patchID];
const surfaceScalarField& magSf = mesh.magSf();
scalar patchArea = 0.0;
forAll(cPatch,faceI)
{
patchArea += magSf.boundaryField()[patchID][facei];
}
Info << "Patch Area " << patchArea << endl;
参考文献
http://www.cfd-online.com/Forums/openfoam-solving/59251-how-access-faces-patch.html