|
[Sponsors] |
January 28, 2011, 05:11 |
Write the cell area of a patch
|
#1 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
Hi all,
I am using the sample Dictionary to get the value of the color function alpha1 (using interFoam) on a particular patch (wall for my problem). Is possible to let OF prints not only the value of the color function but also the area of the surface (in m^2) for each cell on the patch wall?? I did not need the area of all cells but only those that are on the patch wall.. Thanks Andrea |
|
January 28, 2011, 05:30 |
|
#2 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
const scalarField& Ap = mesh.magSf().boundaryField()[i];
scalar patchArea = sum(Ap); |
|
January 28, 2011, 05:41 |
|
#3 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
Thanks for the quick response niklas. Sorry but i'm very new user on OF...where i have to put those line? and how can I specify the patch (wall for my problem) on which I want to calculate the area?
thanks andrea |
|
July 21, 2011, 11:46 |
|
#4 |
Member
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16 |
Dear All,
I would like to know if there is a C++ script (also a piece of code, or the post of the needed code lines would be appreciated) that can allow me to store in a file the coordinates of cell centres along with the areas of each cells, for every patch (or the one user specified) of my mesh. In fact, I need these informations for post processing purposes. I thank You in advance. Yours Sincerely. Claudio |
|
July 21, 2011, 12:31 |
|
#5 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
Hi Claudio,
For the cell centres i guess that you can simply use writeCellCentres (under OpenFOAM/OpenFOAM-1.7.1/applications/utilities/postProcessing/miscellaneous/writeCellCentres). You will get the coordinates of the centers of all the mesh cells, including cells close to the boundary. Then, if "areas of each cells, for every patch" means areas of each FACES that belong to a patch, take a look here (post #21) http://www.cfd-online.com/Forums/ope...tml#post297002 Hope this help best andrea |
|
July 27, 2011, 09:29 |
|
#6 |
Member
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16 |
Thank You Andrea. It was just what I needed.
I have another question for you. I would like to split cyclic patches in OF 1.7.1, in order to have two patches, namely patch_half0 and patch_half1, like can be done in OF 2.0.0. Is there an utility to do so, in Openfoam 1.7.1? As a matter of fact, when I try to calculate mass flow rate trough a cyclic patch in OF 1.7.1, the command "patchIntegrate phi cyclic_patch" returns me a near 0 value, whereas the same command given in OF 2.0.0 ("patchIntegrate phi cyclic_patch_half0") returns me a non zero (and correct) value. Thank You in advance. Claudio |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh - no layer added | bejbro | OpenFOAM Meshing & Mesh Conversion | 5 | February 1, 2020 21:05 |
Problem with rhoSimpleFoam | matteo_gautero | OpenFOAM Running, Solving & CFD | 0 | February 28, 2008 07:51 |
cell surface area in boundary.. | Chiar | FLUENT | 0 | March 7, 2007 04:53 |
How to calculate the cell area | Le | FLUENT | 0 | February 18, 2007 23:15 |
AMG versus ICCG | msrinath80 | OpenFOAM Running, Solving & CFD | 2 | November 7, 2006 16:15 |