CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

How to get the volume of a cell

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 19, 2007, 01:35
Default Hi, all: I searched the for
  #1
Member
 
roy fokker
Join Date: Mar 2009
Posts: 44
Rep Power: 8
dbxmcf is on a distinguished road
Hi, all:

I searched the forum and doxygen, found a function mag and the following comments:
// INSTRUCTION FOR USE!
// When one wants to access the cell centre and magnitude, the
// functionality on the mesh level should be used in preference to the
// functions provided here. They do not rely to the functionality
// implemented here, provide additional checking and are more efficient.
// The cell::centre and cell::mag functions may be removed in the future.

// WARNING! See cell::centre

// first calculate the aproximate cell centre as the average of all
// face centres

I am just confused how to use it and what is the best way to find the cell volume? What I am trying to do is something like:
mesh.cells()[cellLabel].V()...

Thanks a lot!
dbxmcf is offline   Reply With Quote

Old   March 19, 2007, 06:57
Default mesh.V()
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
mesh.V()[cellID]
eugene is offline   Reply With Quote

Old   August 1, 2010, 03:09
Default
  #3
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
hi friend
i want to access volume of cells in volScalarField but in openFoam there is two ways to access to the mesh volume and none of them are volScalarField:
const DimensionedField<scalar, volMesh>& V() const;
or
const scalarField& cellVolumes() const;

Last edited by nimasam; August 1, 2010 at 03:28.
nimasam is offline   Reply With Quote

Old   June 9, 2011, 07:15
Default
  #4
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 7
fisch is on a distinguished road
nimasam, did you found a solution?
I have the same problem now...

thanks, rupert
fisch is offline   Reply With Quote

Old   June 9, 2011, 09:40
Default
  #5
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough
mesh.V() is a scalarField, not a volScalarField. Why would you have volumes at patches?
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   June 9, 2011, 10:11
Default
  #6
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 7
fisch is on a distinguished road
thanks for the quick reply, l_r_mcglashan

i used it without thinking because it's written like this in the programmersGuide P33.
fisch is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to fix a volume cell? jpsegura FLUENT 0 May 31, 2007 18:42
negative cell volume alfin FLUENT 2 January 19, 2006 21:17
Cell-vertex and cell-centered finite volume method Praveen Main CFD Forum 4 September 8, 2003 23:58
Cell volume Takeshi CD-adapco 2 July 16, 2003 22:02
How to caculate cell volume Tareq Al-shaalan Main CFD Forum 2 November 4, 2002 09:48


All times are GMT -4. The time now is 07:41.