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

How to compute surface area of rising bubble

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2014, 09:52
Default
  #21
New Member
 
Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 13
Nazanin is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
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
Thank you very much for reply andrea..
Do you know how I can determine changing bubble diameter during run and relative velocity??
Best
Nazanin is offline   Reply With Quote

Old   January 10, 2014, 10:06
Default
  #22
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi,

supposing that your bubble remains a sphere (or circle in 2-D) and does not deform then if you have the surface area you can calculate the radius(diameter) using area formulas

2-D -> 2*Pi*R = surfaceArea/thickness
3-D -> 4*Pi*R^2 = surfaceArea

and what do you mean with "relative velocity"? Is it the mean rising velocity?
If yes, you can for example calculate the mean velocity of the center of mass which gives you the mean velocity of the rising bubble.

best

andrea
Andrea_85 is offline   Reply With Quote

Old   January 10, 2014, 10:17
Default
  #23
New Member
 
Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 13
Nazanin is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
Hi,

supposing that your bubble remains a sphere (or circle in 2-D) and does not deform then if you have the surface area you can calculate the radius(diameter) using area formulas

2-D -> 2*Pi*R = surfaceArea/thickness
3-D -> 4*Pi*R^2 = surfaceArea

and what do you mean with "relative velocity"? Is it the mean rising velocity?
If yes, you can for example calculate the mean velocity of the center of mass which gives you the mean velocity of the rising bubble.

best

andrea
Thank you very much.
If I want use your idea,should I writing code for my solver or I can use swak4foam?
relative velocity means:
that Ux Uy Uz is bubble velocty and Ul is local liquid velocity...
Attached Images
File Type: png Capture.PNG (3.5 KB, 49 views)
Nazanin is offline   Reply With Quote

Old   January 10, 2014, 10:36
Default
  #24
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
It depends what you want to do with diameter and velocity. Do you need them during the simulation, because for example they appear in some new equations you are solving or you just need them in the post-processing?
Andrea_85 is offline   Reply With Quote

Old   January 10, 2014, 10:44
Default
  #25
New Member
 
Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 13
Nazanin is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
It depends what you want to do with diameter and velocity. Do you need them during the simulation, because for example they appear in some new equations you are solving or you just need them in the post-processing?
I want plot these parameters after simulation (post-prosessing) ..
I found in swak4Foam examples (capilaryRise-test case) that use simpleSwakFunctionObjects and swakFunctionObjects for compute some parameters like this but I dont know how determine for my case study??
Nazanin is offline   Reply With Quote

Old   January 12, 2014, 06:12
Default
  #26
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi,

i think the best would be write your own script that does all the calculations. Have a look in application/utilities/postprocessing.
There you have a lot of examples. You can modify the main part of one of those to read the correct quantities and print what you need.


best
andrea
Andrea_85 is offline   Reply With Quote

Old   January 22, 2014, 20:14
Default
  #27
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Nazanin View Post
I want plot these parameters after simulation (post-prosessing) ..
I found in swak4Foam examples (capilaryRise-test case) that use simpleSwakFunctionObjects and swakFunctionObjects for compute some parameters like this but I dont know how determine for my case study??
I'm still unsure what the actual problem is:
- you have already done the simulation and want to do the calculation on the data on disc: funkyDoCalc might help you there (it can do all the things swakExpression can do)
- or you want to use swakExpression and are unclear about the actual expressions to use?
__________________
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
gschaider is offline   Reply With Quote

Old   March 13, 2015, 15:59
Default
  #28
Member
 
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11
raunakbardia is on a distinguished road
Thanks a lot.

I needed an approximate and I was trying to implement a lot of different techniques to get the surface area but swak did the trick easily.
raunakbardia is offline   Reply With Quote

Old   June 23, 2015, 15:54
Default Normal vector at the interface
  #29
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Hello Foamers;
I am using interFoam, and I was wondering if there is anyway that we can access to the normal vector at the interface. I mean I want to have the normal vector in my results. Any feedback is appreciated
hojjat.m is offline   Reply With Quote

Old   June 23, 2015, 19:05
Default
  #30
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
The interface unit normal vector is defined as:

n = grad(alpha)/mag(grad(alpha))

In interfaceProperties.C it is calculated at the face centres at line 125

surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN_));

(deltaN is just a correction to avoid division by zero).

To print the vectors i would add a constructor in interfaceProperties.C (also modify interfaceProperties.H accordingly) with the declaration of nHatfv (something similar to what you find for the other variables).
Then you can call it in the main code using

interface.nHatfv()

Hope this help

Andrea
Andrea_85 is offline   Reply With Quote

Old   June 24, 2015, 13:13
Default
  #31
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Andrea,

Thanks for the reply, I went the procedure you had mentioned and I get this error:
from my_interFoam.C:43:
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H:129:9: error: ‘const surfaceVectorField& Foam::interfaceProperties::nHatfv() const’ conflicts with a previous declaration
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H:73:21: note: previous declaration ‘Foam::surfaceVectorField Foam::interfaceProperties::nHatfv’
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H: In member function ‘const surfaceVectorField& Foam::interfaceProperties::nHatfv() const’:
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H:128:20: error: invalid initialization of reference of type ‘const surfaceVectorField& {aka const Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>&}’ from expression of type ‘<unresolved overloaded function type>’
my_interFoam.C: In function ‘int main(int, char**)’:
my_interFoam.C:106:3: error: ‘interface’ was not declared in this scope
hojjat.m is offline   Reply With Quote

Old   June 24, 2015, 13:14
Default
  #32
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
But I think the main problem is the following error:

‘interface’ was not declared in this scope
hojjat.m is offline   Reply With Quote

Old   June 24, 2015, 14:13
Default
  #33
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Did you compile the library (interfaceProperties) after implementing the changes?


anyway you have two errors...try to post here the changes you did

Best,
Andrea
hojjat.m likes this.
Andrea_85 is offline   Reply With Quote

Old   June 24, 2015, 14:27
Default
  #34
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Andrea,
You were right, I hadn't compiled it, now that I have compiled it, when I add

interface.nHatfv();

I get the following error again:

error: ‘interface’ was not declared in this scope


This is the only error I get, is it because of the version that I am using, I am using openFoam 2.3.x
hojjat.m is offline   Reply With Quote

Old   June 24, 2015, 14:40
Default
  #35
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
try with

mixture.nHatfv();
Andrea_85 is offline   Reply With Quote

Old   June 24, 2015, 14:50
Default
  #36
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Actually, I had tried this, but I get this error:

In file included from /home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/lnInclude/immiscibleIncompressibleTwoPhaseMixture.H:39:0,
from my_interFoam.C:43:
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H: In function ‘int main(int, char**)’:
/home/magma/OpenFOAM/OpenFOAM-2.3.1/src/transportModels/interfaceProperties/lnInclude/interfaceProperties.H:73:28: error: ‘Foam::surfaceVectorField Foam::interfaceProperties::nHatfv’ is private
my_interFoam.C:109:10: error: within this context
my_interFoam.C:109:17: error: no match for call to ‘(Foam::surfaceVectorField {aka Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>}) ()’


I mean it works for mixture.nHatf(), but not for mixture.nHatfv()
But nHatf=nHatfv.sf is the surfaceScalar field, not the one that we want
hojjat.m is offline   Reply With Quote

Old   June 25, 2015, 06:18
Default
  #37
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
I tried with OF 2.1 and it works. This is what i have done:

1) in interfaceProperties.C
- removed the declaration of nHatfv
- add

nHatfv_ = gradAlphaf/(mag(gradAlphaf) + deltaN_);
correctContactAngle(nHatfv_.boundaryField(), gradAlphaf.boundaryField()); //just add "_"

// Face unit interface normal flux
nHatf_ = nHatfv_ & Sf; //Just add "_"

---------------
- In "Constructors" add (after the declaration of nHatf_)
nHatfv_
(
IOobject
(
"nHatfv",
U_.time().timeName(),
U_.mesh()
),
U_.mesh(),
dimensionedVector("nHatfv", dimless, vector::zero)
),
----------------------

2) in interfaceProperties.H

-add (after the declaration of nHatf_)
surfaceVectorField nHatfv_;

-in "Member Function" add (after the declaration of nHatf_)
const surfaceVectorField& nHatfv() const
{
return nHatfv_;
}

--------------


3) Re-compile interfaceProperties with "wmake libso"

4) in interFoam.C add

surfaceVectorField n = interface.nHatfv(); //(here you probably have to change "interface" with "mixture")
n.write();

5) Re-compile interFoam with "wmake"


I tried right now and it works, i am not 100% sure that the correction for the contact angle at wall is taken into account when you write nHatfv(), you may want to check this.

Best,
Andrea
hojjat.m likes this.
Andrea_85 is offline   Reply With Quote

Old   June 25, 2015, 11:00
Default
  #38
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Andrea,
Thank you very much for the response, I tried the procedure that you had mentioned, and it compiles perfectly, but when I enter interFoam to start the simulations, I get the following error:


--> FOAM FATAL ERROR:
Different dimensions for =
dimensions : [0 2 0 0 0 0 0] = [0 0 0 0 0 0 0]


From function dimensionSet:perator=(const dimensionSet&) const
in file dimensionSet/dimensionSet.C at line 171.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2 Foam::dimensionSet:perator=(Foam::dimensionSet const&) const in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#3 Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh>:perator=(Foam::tmp<Foam::Geom etricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> > const&) in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libinterfaceProperties.so"
#4 Foam::interfaceProperties::calculateK() in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libinterfaceProperties.so"
#5 Foam::interfaceProperties::interfaceProperties(Foa m::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::IOdictionary const&) in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libinterfaceProperties.so"
#6 Foam::immiscibleIncompressibleTwoPhaseMixture::imm iscibleIncompressibleTwoPhaseMixture(Foam::Geometr icField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/magma/OpenFOAM/OpenFOAM-2.3.1/platforms/linux64GccDPOpt/lib/libimmiscibleIncompressibleTwoPhaseMixture.so"
#7
in "/home/magma/OpenFOAM/magma-2.3.1/platforms/linux64GccDPOpt/bin/my_interFoam"
#8 __libc_start_main in "/lib64/libc.so.6"
#9
at /home/abuild/rpmbuild/BUILD/glibc-2.15/csu/../sysdeps/x86_64/elf/start.S:116
Aborted


Thanks,
Hojjat
hojjat.m is offline   Reply With Quote

Old   June 25, 2015, 11:28
Default
  #39
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
I don't have this error. Remember that OF always checks about dimensions.
nHatfv is dimensionless and you are setting nHatfv equal to something which has dimension of m^2. This generates the error.

debug your code and try to understand from where the error comes.

Best,
Andrea
hojjat.m likes this.
Andrea_85 is offline   Reply With Quote

Old   June 27, 2015, 15:51
Default
  #40
Member
 
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11
hojjat.m is on a distinguished road
Done,

Thank you very much, ur suggestions really helped.
hojjat.m 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
Rising bubble with interFoam tayo OpenFOAM Running, Solving & CFD 16 March 12, 2020 13:11
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32
[snappyHexMesh] Layers don't fully surround surface EVBUCF OpenFOAM Meshing & Mesh Conversion 14 August 20, 2012 05:31
Cross section and surface area factor Fabiana CFX 0 January 10, 2006 00:51
CFX4.3 -build analysis form Chie Min CFX 5 July 13, 2001 00:19


All times are GMT -4. The time now is 23:25.