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

Write the cell area of a patch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 28, 2011, 05:11
Default Write the cell area of a patch
  #1
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
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
Andrea_85 is offline   Reply With Quote

Old   January 28, 2011, 05:30
Default
  #2
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
const scalarField& Ap = mesh.magSf().boundaryField()[i];

scalar patchArea = sum(Ap);
niklas is offline   Reply With Quote

Old   January 28, 2011, 05:41
Default
  #3
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
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
Andrea_85 is offline   Reply With Quote

Old   July 21, 2011, 11:46
Default
  #4
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
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
claco is offline   Reply With Quote

Old   July 21, 2011, 12:31
Default
  #5
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
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
Andrea_85 is offline   Reply With Quote

Old   July 27, 2011, 09:29
Default
  #6
Member
 
Claudio
Join Date: Mar 2010
Posts: 57
Rep Power: 16
claco is on a distinguished road
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
claco is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


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


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