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

calculate surface area

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By santiagomarquezd

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 6, 2010, 07:37
Default calculate surface area
  #1
Member
 
Duong A. Hoang
Join Date: Apr 2009
Location: Delft, Netherlands
Posts: 93
Rep Power: 17
duongquaphim is on a distinguished road
Send a message via Yahoo to duongquaphim
Deal OpenFOAM User,

I am implementing PLIC in interFOAM. Then I need to find the way to calculate the volume of each liquid occupied in each cell. I found in the primitiveMesh class two functions that can help me:

void Foam: primitiveMesh::makeFaceCentresAndAreas ( const pointField& p, vectorField& fCtrs, vectorField& fAreas )

and

void Foam: primitiveMesh::makeCellCentresAndVols ( const vectorField& fCtrs, const vectorField& fAreas, vectorField& cellCtrs, scalarField& cellVols )

However, I have a problem with construct pointField p in function
makeFaceCentresAndAreas. Let's say we have four points:

(1 0 0)
(2 0 0)
(2 1 0)
(1 2 0)

Does anyone have ideas about how to construct variable p from these four points for the input of this function?

Regards,

Duong



duongquaphim is offline   Reply With Quote

Old   December 6, 2010, 13:26
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Hi Duong, what about doing,

volScalarField alpha1Vol=mesh.V()*alpha1;
volScalarField alpha2Vol=mesh.V()*(scalar(1)-alpha1);

or something like this.

Best.
mhgolestan likes this.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   December 7, 2010, 11:03
Default
  #3
Member
 
Duong A. Hoang
Join Date: Apr 2009
Location: Delft, Netherlands
Posts: 93
Rep Power: 17
duongquaphim is on a distinguished road
Send a message via Yahoo to duongquaphim
Hi Santiago,

Thanks for the suggestion. However, since I want to construct the interface which has a form n.x+const = 0 (n is the normal vector and x is the point), I should find value of the constant to ensure the conservation of volume fraction. Then, I must find a way to use those function.

Btw, I found how to construct this pointField p. What you can do is:

pointField& p(4,point(0,0,0));
p[0] = point(1,0,0);
p[1] = point(2,1,0);
etc..

That's how we define pointField in OpenFOAM.

Regards,

Duong
duongquaphim is offline   Reply With Quote

Old   December 7, 2010, 14:00
Default
  #4
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 452
Rep Power: 24
santiagomarquezd will become famous soon enough
Aha, I see. My answer was related to "then I need to find the way to calculate the volume of each liquid occupied in each cell". I understand that you need to calculate a plane within a cell such as the sub-volumes would be equal to those are calculated by the formulas I exposed before...

Bye.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd 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
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
Export Cell Surface Area Thierros CFX 0 April 28, 2010 07:01
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
Compute total surface area of Dpm figo FLUENT 0 September 8, 2004 22:44


All times are GMT -4. The time now is 16:40.