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

InterFoam freeSurface area calculation with sampleSurface

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By PrzemekPL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2007, 07:32
Default Dear Forum Wish you all a v
  #1
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Dear Forum

Wish you all a very nice day.

I am using interFoam and for the post processing i need the surface area of the free surface.

Using sampleSurface i could extract the isoSurface. Didn't know it was so easy !!!!! :-)



This is how the sampleDict looks
-------------------------------------------
interpolationScheme cellPointFace;

surfaceFormat foamFile;

surfaces
(

interpolatedIsoSurface
{
name gammaSurface;
field gamma;
value 0.5;
}
);

fields
(
gamma
);
-----------------------------------------------

As a result i have the faces and points which correspond to this surface. Using the able given dict with the

surfaceFormat vtk;

I could see the surface in paraFoam.

I sense that with points and faces available one can for sure calculate the area of this surface.
Please share if someone knows about a utility or tool in openFoam to take the next step.

Wishing you all Happy Holidays

Jaswinder
jaswi is offline   Reply With Quote

Old   December 28, 2007, 10:38
Default Can't Paraview calculate the a
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Can't Paraview calculate the area?
mattijs is offline   Reply With Quote

Old   December 28, 2007, 16:29
Default Hi Mattijs Thanks for your
  #3
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Mattijs

Thanks for your reply.

I tried various options under the filter section of paraview but couldn't get the job done.

The isoSurface option in paraview shows the free surface corresponding to gamma lying in the interval [0,1] but no where i could find an option which could calculate its area.

It seems from your question that it must be quite easy to do that. please give some tips where to look for or which filter does that.



Best Regards
Jaswinder
jaswi is offline   Reply With Quote

Old   December 29, 2007, 09:57
Default Try selecting the 'foamFile' t
  #4
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Try selecting the 'foamFile' type (sampleSurface/surfaceWriters/foamFile/foamFile.C).

Read in your pointField from an IFstream of the "points" file. Read in a faceList from the "faces" file. Sum all areas:

scalar area = 0;
forAll(faces, i)
{
area += faces[i].mag(points);
}
mattijs is offline   Reply With Quote

Old   December 29, 2007, 12:42
Default It is very interesting to find
  #5
Member
 
vof_user
Join Date: Mar 2009
Posts: 67
Rep Power: 17
asaha is on a distinguished road
It is very interesting to find the area of free surface, though I have never thought of it before doing with interFoam. I would appreciate giving details how to implement this.
asaha is offline   Reply With Quote

Old   December 29, 2007, 15:14
Default Hi Mattijs Thanks once agai
  #6
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Mattijs

Thanks once again for your reply.

Will try it and probably will need some more help if i would get some compiling errors.

Best Regards
Jaswinder
jaswi is offline   Reply With Quote

Old   June 26, 2008, 15:40
Default Jaswinder, I have created a
  #7
New Member
 
Scott Ford
Join Date: Mar 2009
Location: Pennsylvania, USA
Posts: 7
Rep Power: 17
saf5029 is on a distinguished road
Jaswinder,

I have created a sampleSurfaceDict 100% identical to yours, and when I execute it, my files for
sampleSurface/15/gammaSurface/scalarField/gamma
sampleSurface/15/gammaSurface/points and
sampleSurface/15/gammaSurface/faces
merely look like this:

0()

Did you ever experience this sort of issue?? If so can you provide any insight??
saf5029 is offline   Reply With Quote

Old   December 9, 2009, 04:52
Default
  #8
New Member
 
P.M.Bronow
Join Date: Nov 2009
Location: Poland/Germany
Posts: 14
Rep Power: 17
PrzemekPL is on a distinguished road
Hi Jaswinder and other OF users,

Did you manage to calculate freeSurace area?
I'm dealing with the same problem now.
I'm using OF1.6
I understand Jaswinders way of thinking (first post in this thread) but I can't follow mattijs tips.

Could anyone give me and other users more tips regarding to the freeSurface area calculation.

Thanks
Przemek
PrzemekPL is offline   Reply With Quote

Old   December 10, 2009, 09:57
Default
  #9
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Przemek

Please insert this into your code and it shall give you the correct free surface area.
(this code snippet is available courtesy of Eugene De Villiers)

volScalarField gradGamma
= mag(fvc::grad(gamma));
scalar totalSurfaceArea
= sum(gradGamma.internalField()*mesh.V());

For parallel runs, change sum to gSum. For a simple check for validation, try calculating area of circle or rectangle for cylindrical and cube geometries. In that way you will see that this formulation does gives you a very accurate calculation for surface area.

Hope that helps

Best Regards
jaswi
jaswi is offline   Reply With Quote

Old   December 10, 2009, 12:07
Default
  #10
New Member
 
P.M.Bronow
Join Date: Nov 2009
Location: Poland/Germany
Posts: 14
Rep Power: 17
PrzemekPL is on a distinguished road
Hi Jaswi,

Thank you for your answer!!

I'll apply your code before next simulation.
This will give me area of the whole free surface but I need also to measure free surface area only in some particular locations.
I just found how to make it in paraview without any additional coding.
I write it here for others, hope this will help someone

Step by step, how to measure free surface area in paraview:
  1. Use Contour tool to plot free surface.
  2. Use Clip to show only interesting for you part of the domain and free surface which has to be measured.
  3. Use Integrate Variables tool. Table with data should appear. In table change Attribute from Point Data to Cell Data and you should see Area in one of the columns. This is what you are looking for
Alternative way:
  1. Use Contour tool to plot free surface.
  2. Use Clip to show only interesting you part of the domain and free surface which has to be measured.
  3. Export Data to .VRML format which can be imported in some graphical software. I've imported it in Rhinoceros and used it to measure area of the free surface.

Greetings
Przemek
PrzemekPL 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
Calculating Interface Area with InterFoam gopala OpenFOAM Running, Solving & CFD 28 December 23, 2021 03:51
What is the Finite Area Methodamphow to do the FAM calculation in FOAM waynezw0618 OpenFOAM Running, Solving & CFD 5 April 24, 2015 09:35
Frontal area calculation Stefan CFX 1 June 12, 2006 22:03
Numerical calculation interFoam never finishes unoder OpenFOAM Running, Solving & CFD 9 October 18, 2005 06:00
area volume calculation fundamentals Ankur Kulkanri Main CFD Forum 0 September 10, 2003 13:00


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