# How to compute surface area of rising bubble

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

January 10, 2014, 09:52
#21
New Member

Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 5
Quote:
 Originally Posted by Andrea_85 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

 January 10, 2014, 10:06 #22 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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

January 10, 2014, 10:17
#23
New Member

Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 5
Quote:
 Originally Posted by Andrea_85 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
 Capture.PNG (3.5 KB, 30 views)

 January 10, 2014, 10:36 #24 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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?

January 10, 2014, 10:44
#25
New Member

Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 5
Quote:
 Originally Posted by Andrea_85 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??

 January 12, 2014, 06:12 #26 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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

January 22, 2014, 20:14
#27
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,953
Rep Power: 41
Quote:
 Originally Posted by Nazanin 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

 March 13, 2015, 15:59 #28 New Member   Raunak Bardia Join Date: Jan 2015 Posts: 5 Rep Power: 3 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.

 June 23, 2015, 14:54 Normal vector at the interface #29 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 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

 June 23, 2015, 18:05 #30 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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

 June 24, 2015, 12:13 #31 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 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::fvsPatchField, Foam::surfaceMesh>&}’ from expression of type ‘’ my_interFoam.C: In function ‘int main(int, char**)’: my_interFoam.C:106:3: error: ‘interface’ was not declared in this scope

 June 24, 2015, 12:14 #32 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 But I think the main problem is the following error: ‘interface’ was not declared in this scope

 June 24, 2015, 13:13 #33 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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.

 June 24, 2015, 13:27 #34 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 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

 June 24, 2015, 13:40 #35 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 try with mixture.nHatfv();

 June 24, 2015, 13:50 #36 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 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::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

 June 25, 2015, 05:18 #37 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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.

 June 25, 2015, 10:00 #38 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 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::fvsPatchField, Foam::surfaceMesh>:perator=(Foam::tmp, 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 const&, Foam::GeometricField, 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::fvPatchField, Foam::volMesh> const&, Foam::GeometricField 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

 June 25, 2015, 10:28 #39 Senior Member   Andrea Ferrari Join Date: Dec 2010 Posts: 300 Rep Power: 8 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.

 June 27, 2015, 14:51 #40 Member   HM Join Date: Apr 2015 Posts: 30 Rep Power: 3 Done, Thank you very much, ur suggestions really helped.

 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 04:06.