|
[Sponsors] |
January 10, 2014, 09:52 |
|
#21 | |
New Member
Nazanin
Join Date: Sep 2013
Posts: 22
Rep Power: 13 |
Quote:
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: 319
Rep Power: 16 |
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: 13 |
Quote:
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... |
||
January 10, 2014, 10:36 |
|
#24 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
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: 13 |
Quote:
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: 319
Rep Power: 16 |
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: 4,225
Rep Power: 51 |
Quote:
- 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 |
Member
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11 |
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, 15:54 |
Normal vector at the interface
|
#29 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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, 19:05 |
|
#30 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
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, 13:13 |
|
#31 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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 |
|
June 24, 2015, 13:14 |
|
#32 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
But I think the main problem is the following error:
‘interface’ was not declared in this scope |
|
June 24, 2015, 14:13 |
|
#33 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
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 |
|
June 24, 2015, 14:27 |
|
#34 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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, 14:40 |
|
#35 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
try with
mixture.nHatfv(); |
|
June 24, 2015, 14:50 |
|
#36 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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 |
|
June 25, 2015, 06:18 |
|
#37 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
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 |
|
June 25, 2015, 11:00 |
|
#38 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
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 |
|
June 25, 2015, 11:28 |
|
#39 |
Senior Member
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16 |
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 |
|
June 27, 2015, 15:51 |
|
#40 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
Done,
Thank you very much, ur suggestions really helped. |
|
|
|
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 |