# How to compute surface area of rising bubble

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

 October 11, 2012, 02:29 How to compute surface area of rising bubble #1 Member   Tayo Join Date: Aug 2012 Posts: 94 Rep Power: 6 Hello, Is there an accurate way to compute the surface area of a rising bubble as it deforms? I'm trying to compute the effective diameter using volume-surfaceArea ratio. I already computed the volume using (1-gamma[cellI])*mesh.V()[cellI]. Or is there an alternative way to compute the diameter? Thanks in advance.

 October 18, 2012, 02:27 #2 Member   Tayo Join Date: Aug 2012 Posts: 94 Rep Power: 6 Hi Foamers, I'm still expecting a response on how to compute bubble surface area at the interface. I read on page 29 of OF2.1.1 programmer's guide that Sf() is the access function for face area vector so I called the area of each mesh using mesh.sf()[cellI] but it won't even compile. Below is what I tried even though I should use an averaged value between 0

 October 18, 2012, 03:56 #3 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 14 I am not sure if you can calculate this accurately with simple integration. Maybe by integration of (1-gamma)*gamma, which is only non-zero at the interface (assuming you use interFoam). Howver, you will still get a volume, and not an area. Maybe if you divide this by the average interface thickness you get an estimate. An alternative procedure, is to store the gamma=0.5 isosurface, and calculate the surface area of such a system by some external tools (I could not tell you how, however).

 October 18, 2012, 16:21 #4 Member   Tayo Join Date: Aug 2012 Posts: 94 Rep Power: 6 Thanks. I'll give your idea a little more thought.

October 18, 2012, 18:30
#5
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by tayo Hi Foamers, I'm still expecting a response on how to compute bubble surface area at the interface. I read on page 29 of OF2.1.1 programmer's guide that Sf() is the access function for face area vector so I called the area of each mesh using mesh.sf()[cellI] but it won't even compile. Below is what I tried even though I should use an averaged value between 0
You are mixing cell and face-adressing here. This won't work

My proposal: let OpenFOAM calculate a sampledSurface on the iso-surface of 0.5 (or whatever threshold you think is appropriate) then sum up area of the faces in that sampledSurface. The easiest way to do this (I think, but I'm extremely biased on this topic) is with swak4Foam: there is even a demo-case (a variation of the capillaryRise-case) where this (calculation of the interface-area) is done
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

October 23, 2012, 12:39
#6
Member

Tayo
Join Date: Aug 2012
Posts: 94
Rep Power: 6
Quote:
 Originally Posted by gschaider You are mixing cell and face-adressing here. This won't work My proposal: let OpenFOAM calculate a sampledSurface on the iso-surface of 0.5 (or whatever threshold you think is appropriate) then sum up area of the faces in that sampledSurface. The easiest way to do this (I think, but I'm extremely biased on this topic) is with swak4Foam: there is even a demo-case (a variation of the capillaryRise-case) where this (calculation of the interface-area) is done
I can't seem to find the actual demo case for this swak4Foam capillaryRise-case. Please provide a link for this demo case. Thanks.

October 23, 2012, 13:44
#7
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by tayo I can't seem to find the actual demo case for this swak4Foam capillaryRise-case. Please provide a link for this demo case. Thanks.
Examples/other/capillaryRise
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 October 23, 2012, 14:21 #8 Member   Tayo Join Date: Aug 2012 Posts: 94 Rep Power: 6 Thanks. I saw this link you gave from your Talk:Tip Surface elevation in time discussion. I've searched but all the links I found won't open for some reason. Few of these links are given below. That's why I requested you to provide the working link to the case. Thanks. http://openfoam-extend.hg.sourceforg.../capillaryRise http://openfoam-extend.hg.sourceforg...em/controlDict

October 23, 2012, 17:15
#9
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by tayo Thanks. I saw this link you gave from your Talk:Tip Surface elevation in time discussion. I've searched but all the links I found won't open for some reason. Few of these links are given below. That's why I requested you to provide the working link to the case. Thanks. http://openfoam-extend.hg.sourceforg.../capillaryRise http://openfoam-extend.hg.sourceforg...em/controlDict
What I gave was the location in the directory structure. I usually only give links to the repository as a whole and describe the location within. Especially for mercurial (and git) links like yours are bound to be outdated because they point to one specific revision. With the "relative" location anyone can click to the file (independent of the revision)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 October 23, 2012, 18:34 #10 Member   Tayo Join Date: Aug 2012 Posts: 94 Rep Power: 6 Oh, I get. I thought you meant that it was located at an online page. I've seen the case in the swak4Foam download that I use. I'll follow it to compute the interfacial area. Thanks for your awesome work on swak4Foam. On a side note, I already some ran cases that takes days to complete. Is there a way to do some post processing using this tool without having to rerun my cases?

October 30, 2012, 19:17
#11
Member

Tayo
Join Date: Aug 2012
Posts: 94
Rep Power: 6
Quote:
 Originally Posted by gschaider You are mixing cell and face-adressing here. This won't work My proposal: let OpenFOAM calculate a sampledSurface on the iso-surface of 0.5 (or whatever threshold you think is appropriate) then sum up area of the faces in that sampledSurface. The easiest way to do this (I think, but I'm extremely biased on this topic) is with swak4Foam: there is even a demo-case (a variation of the capillaryRise-case) where this (calculation of the interface-area) is done

Hi Bernard,

I followed your advice to create an iso-surface with alpha=0.5 and used this to compute the surface area of the bubble. I did a little test run copying the additional code from system/controlDict file of your capillaryRise example and added to my 2D bubble test case but I have few questions here:

1) The surface area computed is quite large (3.32e-4) at 1st time step compared to (7.85e-5) obtained if you check with pi*R^2 as initialized. I used "area()" instead of your "area()/0.001" in my controlDict expression. I initialized with funkysetFields with radius of 0.005. This bring me to why you used "area/0.001" in the surface expression? My guess is you probably divided by the cellsize. I checked your blockmesh and the z-axis mesh width is 0.001. So I simply used "area()" instead.

2) How can I compute the volume in swak4Foam, do I simply use "volume()"? I want to compare with using (1-alpha[cellI])*mesh.V()[cellI].

3) can I compute the bubble center velocity similarly?

Thanks.

libs (
"libOpenFOAM.so" // keeps paraFoam happy
"libtwoPhaseInterfaceProperties.so"
"libinterfaceProperties.so"
"libsimpleSwakFunctionObjects.so"
"libswakFunctionObjects.so"
);

functions
(
createInterface
{
type createSampledSurface;
outputControl timeStep;
outputInterval 1;
surfaceName interface;
surface {
type isoSurface;
isoField alpha1;
isoValue 0.5;
interpolate true;
}

surface
{
type swakExpression;
valueType surface;
surfaceName interface;
verbose true;
expression "area()/0.001";
accumulations (
sum
);
);

Last edited by tayo; October 31, 2012 at 09:17.

November 14, 2012, 18:37
#12
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by tayo Hi Bernard, I followed your advice to create an iso-surface with alpha=0.5 and used this to compute the surface area of the bubble. I did a little test run copying the additional code from system/controlDict file of your capillaryRise example and added to my 2D bubble test case but I have few questions here: 1) The surface area computed is quite large (3.32e-4) at 1st time step compared to (7.85e-5) obtained if you check with pi*R^2 as initialized. I used "area()" instead of your "area()/0.001" in my controlDict expression. I initialized with funkysetFields with radius of 0.005. This bring me to why you used "area/0.001" in the surface expression? My guess is you probably divided by the cellsize. I checked your blockmesh and the z-axis mesh width is 0.001. So I simply used "area()" instead.
Right. That was there to "normalize out" the thickness of the 2D-mesh

About the discrepancy in size: no idea. Of course the isoSurface is naive about what you want to achive. So if in your simulation you have a bubble and a water surface then an iso-value of 0.5 will pick up the bubble AND the surface (that would explain the order-of-magnitude error). A bit creative playing around with the expressionField-functionObject might help here

Quote:
 Originally Posted by tayo 2) How can I compute the volume in swak4Foam, do I simply use "volume()"? I want to compare with using (1-alpha[cellI])*mesh.V()[cellI].
"(1-alpha)*vol()"

Quote:
 Originally Posted by tayo 3) can I compute the bubble center velocity similarly?
That depends on how you define the bubble center. The iso-surface will only help you if you define it by the surface. If you define it by the volume something like "sum(pos()*vol()*(1-alpha1))/(sum(vol()*(1-alpha1)))" calculated on the internalField might be what you want
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 January 30, 2013, 15:17 #13 Senior Member   Mieszko Młody Join Date: Mar 2009 Location: POLAND, USA Posts: 139 Rep Power: 9 Hi I am not sure if swak4FOAM is something I need, but I have a question which seems to be related to this thread. Do you know maybe how to extract isosurface of the field (e.g. field T, isosurface for T = 0) during runtime ? I would need it coordinate in my solver. Thanks ZM

January 30, 2013, 18:59
#14
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by ziemowitzima Hi I am not sure if swak4FOAM is something I need, but I have a question which seems to be related to this thread. Do you know maybe how to extract isosurface of the field (e.g. field T, isosurface for T = 0) during runtime ? I would need it coordinate in my solver. Thanks ZM
If you only want to extract/write the surface then there is a function object that comes with OpenFOAM. If you want to do calculations on it, then swak is your friend

BTW: T is NOT the temperature, right? Because then that isosurface wouldn't exist anyway
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

 January 30, 2013, 19:03 #15 Senior Member   Mieszko Młody Join Date: Mar 2009 Location: POLAND, USA Posts: 139 Rep Power: 9 Thanks for your replay. T is just some random field. But I need to do this during runtime, in my solver, for farther calculations in my solver. Not just passively to write on disc ... Best

January 31, 2013, 05:19
#16
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by ziemowitzima Thanks for your replay. T is just some random field. But I need to do this during runtime, in my solver, for farther calculations in my solver. Not just passively to write on disc ... Best
Then swak4Foam might be your thing. Have for instance a look in the swak-distribution at Examples/other/capillaryRise which calculates the properties of the surface. It is also possible to have these values feed back to boundary conditions etc (for details see the presentations that are linked from the swak-page in the Wiki). All this functionality is available in function-objects: the advantage is that you don't have to modify the solver (disadvantage is that you can only influence/measure at the end of a time-step. But functionality from swak can also be incorporated into a solver. But usually the functionObjects are sufficient)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

January 6, 2014, 11:55
#17
New Member

Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 5
Quote:
 Originally Posted by gschaider Then swak4Foam might be your thing. Have for instance a look in the swak-distribution at Examples/other/capillaryRise which calculates the properties of the surface. It is also possible to have these values feed back to boundary conditions etc (for details see the presentations that are linked from the swak-page in the Wiki). All this functionality is available in function-objects: the advantage is that you don't have to modify the solver (disadvantage is that you can only influence/measure at the end of a time-step. But functionality from swak can also be incorporated into a solver. But usually the functionObjects are sufficient)
Hi EveryBody
I want calculate bubble diameter,bubble surface area,surface diameter and rising velocity for simulation rising bubble (2D&3D) .how I can calculate these parameters? I see ,in this thread that use swak4Foam but I don't find in capillaryRise-case about diameter and Are you sure this code (in capilary case) is correct??

January 7, 2014, 19:18
#18
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,975
Rep Power: 41
Quote:
 Originally Posted by Nazanin Hi EveryBody I want calculate bubble diameter,bubble surface area,surface diameter and rising velocity for simulation rising bubble (2D&3D) .how I can calculate these parameters? I see ,in this thread that use swak4Foam but I don't find in capillaryRise-case about diameter and Are you sure this code (in capilary case) is correct??
You haven't found the case (that is explained in the other posting) or in the case you didn't find the calculation of the diameter (I don't think there is one. Don't see how this would make sense for that kind of surface)

What do you mean with "is it correct"? You are doubting the expressions in the controlDict (I only sanity-checked them some time ago)? That's OK (doubting). These are just examples what can be done but the expressions for your application you've got to "develop" yourself
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request

January 8, 2014, 02:24
#19
New Member

Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 5
Quote:
 Originally Posted by gschaider You haven't found the case (that is explained in the other posting) or in the case you didn't find the calculation of the diameter (I don't think there is one. Don't see how this would make sense for that kind of surface) What do you mean with "is it correct"? You are doubting the expressions in the controlDict (I only sanity-checked them some time ago)? That's OK (doubting). These are just examples what can be done but the expressions for your application you've got to "develop" yourself
I use capilary-case controldict for my case,and I have a question about that:
1-I want calculate surface area bubble and in this code I think :
Code:
functions
(
createInterface
{
type createSampledSurface;
outputControl timeStep;
outputInterval 1;
surfaceName interface;
surface {
type isoSurface;
isoField alpha1;
isoValue 0.5;
interpolate true;
}
}surface
{
type swakExpression;
valueType surface;
surfaceName interface;
verbose true;
expression "area()";
accumulations (
sum

);
calculate surface.but when run my case,for first time step,surface area=pi*r^2 (am I right?/) but in my case I cant get this value.why??
2-for calculating changing diameter can I use this code??:
Code:
 Yheight
{
type swakExpression;
valueType surface;
surfaceName interface;
verbose true;
expression "pos().y";
accumulations (
min
max
);
}
3-how can I calculate relative velocity in rising bubble??
Thank you

 January 10, 2014, 09:37 #20 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 303 Rep Power: 9 Hi all, i guess that the total interfacial area can be simply calculated using: \Sum_i=1:N \grad\alpha_i * \deltaV_i where N is total numer of cells in your domain. This gives you an area in m^2, so if your case is 2-D and you just need the lenght of the interfacial line you have to normalized by the thickness. This is consistent with the CSF method implemented in interFoam. Best andrea yanxiang and amir_kb like this.

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post tayo OpenFOAM Running, Solving & CFD 15 December 5, 2014 04:49 Attesz CFX 7 January 5, 2013 04:32 EVBUCF OpenFOAM Native Meshers: snappyHexMesh and Others 14 August 20, 2012 04:31 Fabiana CFX 0 January 10, 2006 00:51 Chie Min CFX 5 July 12, 2001 23:19

All times are GMT -4. The time now is 03:46.