CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   How to find face area of each cell in a boundary patch? (https://www.cfd-online.com/Forums/openfoam-post-processing/125782-how-find-face-area-each-cell-boundary-patch.html)

Hale October 31, 2013 01:58

How to find face area of each cell in a boundary patch?
 
Hi,

Is there any way to find the face area of each cell belonging to a boundary patch? Is it possible to find them after the simulation is finished?

thanks
Hale

t.oliveira September 4, 2018 17:03

Quote:

Originally Posted by Hale (Post 459959)
Is there any way to find the face area of each cell belonging to a boundary patch?

During the simulation, any of the three lines below provides the area of faces in a patch.

Code:

// mesh is a fvMesh, patchI is a label
mesh.magSf().boundaryField()[patchI];        //1
mesh.boundary()[patchI].magSf();              //2
mag(mesh.boundaryMesh()[patchI].faceAreas()); //3

(3) provides the areas of faces also in empty patches, while (1) and (2) ignore them.

I tested the CPU time for each of these lines in one example. The result I got for this particular example was, normalized to the first one:
1: 1
2: 1.28
3: 37.4 <= One of the reasons why this is higher may be the fact that 76% of the faces in the example were in empty patches, so this line was calculating the area of 4.2 times more faces.

Kind regards,
Thomas

deepbandivadekar April 15, 2019 10:33

Quote:

Originally Posted by t.oliveira (Post 705328)
During the simulation, any of the three lines below provides the area of faces in a patch.

Code:

// mesh is a fvMesh, patchI is a label
mesh.magSf().boundaryField()[patchI];        //1
mesh.boundary()[patchI].magSf();              //2
mag(mesh.boundaryMesh()[patchI].faceAreas()); //3

(3) provides the areas of faces also in empty patches, while (1) and (2) ignore them.

I tested the CPU time for each of these lines in one example. The result I got for this particular example was, normalized to the first one:
1: 1
2: 1.28
3: 37.4 <= One of the reasons why this is higher may be the fact that 76% of the faces in the example were in empty patches, so this line was calculating the area of 4.2 times more faces.

Kind regards,
Thomas


This is useful for, say using this data internally during calculations. However, I'd like to use the data for postprocessing. I tried to find something of this sort in OpenFOAM or through filters in paraview but reached a dead end. Is there any way I can find the individual cell areas of a patch by some postprocessing command?

alberto.lorenzon August 6, 2019 07:06

Quote:

Originally Posted by t.oliveira (Post 705328)
During the simulation, any of the three lines below provides the area of faces in a patch.

Code:

// mesh is a fvMesh, patchI is a label
mesh.magSf().boundaryField()[patchI];        //1
mesh.boundary()[patchI].magSf();              //2
mag(mesh.boundaryMesh()[patchI].faceAreas()); //3

(3) provides the areas of faces also in empty patches, while (1) and (2) ignore them.

I tested the CPU time for each of these lines in one example. The result I got for this particular example was, normalized to the first one:
1: 1
2: 1.28
3: 37.4 <= One of the reasons why this is higher may be the fact that 76% of the faces in the example were in empty patches, so this line was calculating the area of 4.2 times more faces.

Kind regards,
Thomas

This was actually useful for my research. Thank you for the post!


All times are GMT -4. The time now is 00:14.