|
[Sponsors] |
[Technical] is there any way to get cell surface area? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 21, 2022, 14:18 |
is there any way to get cell surface area?
|
#1 |
New Member
Join Date: Jun 2022
Posts: 10
Rep Power: 4 |
I know that magSf() function can calculate individual face area. However, I want to know the surface area of a cell just like we can get cell volume by using mesh.V().
Does anyone know how to get the cell surface area? Thanks in advance ! |
|
July 22, 2022, 06:43 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
I don't know where that would normally be needed, so there is no such functionality. However, writing it yourself is not actually too hard I think.
The basic algorithm would entail the following:
|
|
July 22, 2022, 14:35 |
|
#3 |
New Member
Join Date: Jun 2022
Posts: 10
Rep Power: 4 |
Hello olesen,
Thank you for your response ! I just want to know where I would need to write this code? in src/OpenFOAM/meshes/primitiveMesh/ there are two files namely primitiveMeshCellCentresAndVols.C and primitiveMeshFaceCentresAndAreas.C . Do I need to write the code in one of these files or I have to create separate .C file. |
|
July 31, 2022, 13:17 |
|
#4 |
New Member
Join Date: Jun 2022
Posts: 10
Rep Power: 4 |
Foam::tmp<Foam::scalarField> Foam::cellQuality::cellSurfaceArea() const
{ tmp<scalarField> tresult ( new scalarField ( mesh_.nCells(), 0.0 ) ); scalarField& result = tresult.ref(); scalar sumCellArea; forAll(result,celli) { const labelList& cellFaces = mesh_.cells()[celli]; //with this line, I expect to access the faces belonging to cell under consideration. const vectorField& areas = mesh_.faceAreas(); forAll(cellFaces,facei) { sumCellArea=0; sumCellArea+=mag(areas[facei]); } result[celli]=sumCellArea; } return tresult; } I am trying to find cell surface area. For this, I am trying to access faces belonging to the particular cell and sum their face areas and assign the sum value to 'result' scalar Field whose size is equal to nCells. Please let me know, if the way I have written code is correct logically. Last edited by AbhishekTAMU; July 31, 2022 at 17:19. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Surface area of each cell for mean beam length calculation | chloe612 | OpenFOAM Programming & Development | 0 | April 14, 2021 01:12 |
[snappyHexMesh] snappyHexMesh generates not planar surface | krzychu111 | OpenFOAM Meshing & Mesh Conversion | 2 | April 23, 2020 17:38 |
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry | pizzaspinate | OpenFOAM Meshing & Mesh Conversion | 1 | February 25, 2015 08:05 |
[snappyHexMesh] Problem with Sanpper, surface still Rough | Zephiro88 | OpenFOAM Meshing & Mesh Conversion | 7 | November 5, 2014 13:05 |
Cluster ID's not contiguous in compute-nodes domain. ??? | Shogan | FLUENT | 1 | May 28, 2014 16:03 |