CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Verification & Validation (https://www.cfd-online.com/Forums/openfoam-verification-validation/)
-   -   interFoam - validation for bubble/droplet flows in microfluidics (https://www.cfd-online.com/Forums/openfoam-verification-validation/124363-interfoam-validation-bubble-droplet-flows-microfluidics.html)

duongquaphim October 3, 2013 08:36

interFoam - validation for bubble/droplet flows in microfluidics
 
Dear all,

It is a bit ashamed but I would like to share one of our work on the validations of interFoam, titled "Benchmark numerical simulations of segmented two-phase flows in microchannels using the Volume of Fluid method". In this work, we presented three benchmark cases - the steady motion of bubbles in a straight two-dimensional channel, the formation of bubbles in two- and three-dimensional T-junctions, and the breakup of droplets in three-dimensional T-junctions - and provided guidelines to set appropriate numerical settings for a simulation of microbubble/microdroplet flows.

Please find here the link to the paper: http://dx.doi.org/10.1016/j.compfluid.2013.06.024

If you can not download the paper, I am more than happy to send you a copy of it.

With best regards,

Duong


kwardle October 4, 2013 12:52

Quote:

Originally Posted by duongquaphim (Post 454869)

It is a bit ashamed but I would like to share one of our work on the validations of interFoam, titled "Benchmark numerical simulations of segmented two-phase flows in microchannels using the Volume of Fluid method".

No need to be ashamed. Thanks for sharing!
-Kent

alighaffari January 9, 2014 11:14

Hi Dear Duong
Thanks for your good paper.
I am new in interFoam. I have two simple questions.
1) how can we apply the smoother function (Eq.9 in your paper) in our problem? I think it can be set: system/fvSolution dictionary, PISO loop subsection was set with m corrections (nCorrectors)
is it true?
2) where should be determined the value of adjustable coefficient "Cγ in Eq.7"?
Thanks
Ali


norkistar July 11, 2014 03:32

Could you please share the case setup for openfoam? Best regards

duongquaphim January 28, 2015 16:02

4 Attachment(s)
Dear all,

I just got a bit of free time lately to reorganize my data. Here you can find the code and the test cases I have run for my validation. Please be aware that all these validations have been performed with OF-1.6-ext.

Best regards,

Duong

Pedro24 February 17, 2015 04:06

Hi,

I'm not sure but I think that the function fvc::average already exists and do the same operation as your "smooth function".

In the OpenFOAM C++ doc, you can read:

volField = fvc::average(SurfaceField)
Area-weighted average a surfaceField creating a volField.

So you can do your smoothing by :

Code:

alpha_smoothed = fvc::average(fvc::interpolate(alpha));
Regards,

Pierre

duongquaphim February 17, 2015 05:15

Quote:

Originally Posted by Pedro24 (Post 532124)
Hi,

I'm not sure but I think that the function fvc::average already exists and do the same operation as your "smooth function".

In the OpenFOAM C++ doc, you can read:

volField = fvc::average(SurfaceField)
Area-weighted average a surfaceField creating a volField.

So you can do your smoothing by :

Code:

alpha_smoothed = fvc::average(fvc::interpolate(alpha));
Regards,

Pierre

Indeed you can also use that function. And it is much simpler I agree.

At the time I implemented that, I would like to have controls on the level of smoothing (averaging) and also to be able to implement different smoothers (which I did not find superior to that simple Laplacian). So that's why you have such a piece of code.

Best,

Duong

Sripadaraja September 30, 2015 02:43

Hi Duong,

I just downloded your file (bubble_generation). I am able to blockMesh.

Check topology

Basic statistics
Number of internal faces : 44
Number of boundary faces : 56
Number of defined boundary faces : 56
Number of undefined boundary faces : 0
Checking patch -> block consistency

Creating block offsets
Creating merge list


Further when I run "interFoam" solver I get this error.

paramesh@HP-WS3:~/OpenFOAM/paramesh-2.4.0/run/tutorials/incompressible/pimpleFoam/bubble_generation$ interFoam
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 2.4.0-f0842aea0e77
Exec : interFoam
Date : Sep 30 2015
Time : 12:12:41
Host : "HP-WS3"
PID : 10778
Case : /home/paramesh/OpenFOAM/paramesh-2.4.0/run/tutorials/incompressible/pimpleFoam/bubble_generation
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0



--> FOAM FATAL IO ERROR:
keyword PIMPLE is undefined in dictionary "/home/paramesh/OpenFOAM/paramesh-2.4.0/run/tutorials/incompressible/pimpleFoam/bubble_generation/system/fvSolution"

file: /home/paramesh/OpenFOAM/paramesh-2.4.0/run/tutorials/incompressible/pimpleFoam/bubble_generation/system/fvSolution from line 55 to line 132.

From function dictionary::subDict(const word& keyword) const
in file db/dictionary/dictionary.C at line 648.

FOAM exiting


What is the problem?



-Sripad

akidess October 12, 2015 02:28

Quote:

Originally Posted by Sripadaraja (Post 565924)
keyword PIMPLE is undefined

That's the problem. As Duong stated the case setup is for OF-1.6. You'll need to update the dictionaries for 2.4.0. Compare the case with the tutorial cases and you will fix the error quickly.

Sripadaraja December 16, 2015 04:02

Akidess. I notice the next error


PIMPLE: Operating solver in PISO mode

Reading field p_rgh



--> FOAM FATAL IO ERROR:
cannot find file

file: /home/paramesh/OpenFOAM/paramesh-3.0.0/run/tutorials/multiphase/interFoam/bubble_generation_trial/0/p_rgh at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 73.

FOAM exiting

akidess December 16, 2015 04:59

You are missing the file p_rgh. Please have a look at the interFoam tutorials.

DevD_10 August 10, 2016 06:56

hey.. do you still have these files?
I wanted to download them and i am unable to get the files from this link

Problem solved, able to download now.

kerim December 18, 2016 15:15

Could you please share the copy of your paper? Best regards

pfavreau April 20, 2017 10:35

Quote:

Originally Posted by duongquaphim (Post 529436)
Dear all,

I just got a bit of free time lately to reorganize my data. Here you can find the code and the test cases I have run for my validation. Please be aware that all these validations have been performed with OF-1.6-ext.

Best regards,

Duong

Hi,

I tried to update your solver to run on OpenFOAM 4.1. Unfortunately, I have obtained so much errors... Did you adapt your code to this version of OpenFOAM ? How can I achieve that ?

Best Regards,

Peter.

duongquaphim May 2, 2017 03:11

Hi,

I think that it should be quite straightforward to adapt/implement the Laplacian solver in interFOAM version. However, I did not work on this topic for a while, so I do not know any details to tell you. The only thing I could think about is the difference in library name and the change of alpha field.

Duong

pfavreau May 19, 2017 10:22

Thank you for the reply. I will try to update the solver, if someone is interested by this update, please contact me, I will share.

Best regards,

Peter

floquation May 24, 2017 05:37

Quote:

Originally Posted by pfavreau (Post 649577)
Thank you for the reply. I will try to update the solver, if someone is interested by this update, please contact me, I will share.

Best regards,

Peter

Have a look at the following.


OF-4.x implementation of 'vofsmooth':
I have implemented Duong's "vofsmooth" in OF-4.x.
It was implemented using OF's run-time selection mechanism and a dynamic library trick, such that it should work with any solver (that uses OF's libinterfaceProperties.so: inter(DyM)Foam, compressibleInter(DyM)Foam, multiphaseInter(DyM)Foam, interPhaseChange(DyM)Foam and very likely some more.)
[Disclaimer: I have only tried inter(DyM)Foam in my work.]

See the README.md on GitHub:
https://github.com/floquation/OF-kva...faceProperties

pfavreau June 21, 2017 05:18

Thanks a lot for sharing your code :-)

Best regards,

Peter

pfavreau June 21, 2017 09:30

Quote:

Originally Posted by floquation (Post 650088)
Have a look at the following.


OF-4.x implementation of 'vofsmooth':
I have implemented Duong's "vofsmooth" in OF-4.x.
It was implemented using OF's run-time selection mechanism and a dynamic library trick, such that it should work with any solver (that uses OF's libinterfaceProperties.so: inter(DyM)Foam, compressibleInter(DyM)Foam, multiphaseInter(DyM)Foam, interPhaseChange(DyM)Foam and very likely some more.)
[Disclaimer: I have only tried inter(DyM)Foam in my work.]

See the README.md on GitHub:
https://github.com/floquation/OF-kva...faceProperties

It's weird, but when I compile your code it works. Bun when I'm running the damBreak case, it returns the following error :

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting curvatureModel vofsmooth
kva: curvatureModel::read(vofsmooth);
kva: curvatureModels::vofsmooth::read();
kva: curvatureModel::read(vofsmooth);
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
Erreur de segmentation (core dumped)

Any idea ??

floquation June 21, 2017 10:38

That had certainly puzzled me for some time as well, because the code is correct... However, since I am a self-educated fool (which I bet most of us are) whose messing with dynamic libraries, I was only thinking in terms of code. But although there is nothing wrong with the code, I did mess up the binary-compatibility, as I didn't know that any such thing (ABI) existed.

I am working on a proper "fix", which I should have soon. (That is, I should regain the binary-compatibility.) For the time being, you can easily work around this, as I described right here:
https://github.com/floquation/OF-kva...rties/issues/2
That solution boils down to recompiling your solver; or rather compiling a clone of your solver that is linked against my library.

pfavreau June 22, 2017 07:00

Yeah ! It works. Thank you, and I hope this version will be implemented in the next release of OpenFOAM, it's really a great work !

Best regards,

Peter

floquation July 10, 2017 12:11

Quote:

Originally Posted by pfavreau (Post 654452)
Yeah ! It works. Thank you, and I hope this version will be implemented in the next release of OpenFOAM, it's really a great work !

Best regards,

Peter

It is already working for you, but for your future reference: I have updated the library with updated instructions.
I could not maintain binary compatibility, hence it is mandatory to recompile your solver. Luckily, this can be done without making any changes to the solver.
I have written a script that can automatically recompile any solver for you, which is located in the "recompileSolvers" directory. See the updated README for instructions.

miao568666 July 30, 2017 18:05

Is there an OF-5.0 version available?

Quote:

Originally Posted by floquation (Post 650088)
Have a look at the following.


OF-4.x implementation of 'vofsmooth':
I have implemented Duong's "vofsmooth" in OF-4.x.
It was implemented using OF's run-time selection mechanism and a dynamic library trick, such that it should work with any solver (that uses OF's libinterfaceProperties.so: inter(DyM)Foam, compressibleInter(DyM)Foam, multiphaseInter(DyM)Foam, interPhaseChange(DyM)Foam and very likely some more.)
[Disclaimer: I have only tried inter(DyM)Foam in my work.]

See the README.md on GitHub:
https://github.com/floquation/OF-kva...faceProperties


floquation July 31, 2017 10:50

Quote:

Originally Posted by miao568666 (Post 658913)
Is there an OF-5.0 version available?

I did not yet know OF-5.0 was released.

I have just adapted the code to work with OF-5.0 for you (and others) and pushed it to the same GitHub page. Make sure to checkout the branch "of50", as is now also mentioned in the updated README file.

miao568666 July 31, 2017 11:16

This is awesome! Thanks Kevin.

Quote:

Originally Posted by floquation (Post 658988)
I did not yet know OF-5.0 was released.

I have just adapted the code to work with OF-5.0 for you (and others) and pushed it to the same GitHub page. Make sure to checkout the branch "of50", as is now also mentioned in the updated README file.


miao568666 August 2, 2017 10:04

Hi Kevin,

May I get your advice on how to adapt old version Openfoam codes to newest version? I know it's not easy. But any general instructions are very helpful.

Quote:

Originally Posted by floquation (Post 658988)
I did not yet know OF-5.0 was released.

I have just adapted the code to work with OF-5.0 for you (and others) and pushed it to the same GitHub page. Make sure to checkout the branch "of50", as is now also mentioned in the updated README file.


floquation August 2, 2017 10:29

Quote:

Originally Posted by miao568666 (Post 659256)
Hi Kevin,

May I get your advice on how to adapt old version Openfoam codes to newest version? I know it's not easy. But any general instructions are very helpful.

Put two similar codes from both the old and new version next to each other.
For example, if you have a custom solver based on interFoam in 2.1.x, then I'd open the real interFoam of 2.1.x and the interFoam of the new version.
Then by first comparing Make/options and then each individual source file of those two interFoams, I can figure out how to adapt my code to the new version.

miao568666 August 2, 2017 10:32

Thanks Kevin for these wonderful advices! I will try out. :)

Quote:

Originally Posted by floquation (Post 659258)
Put two similar codes from both the old and new version next to each other.
For example, if you have a custom solver based on interFoam in 2.1.x, then I'd open the real interFoam of 2.1.x and the interFoam of the new version.
Then by first comparing Make/options and then each individual source file of those two interFoams, I can figure out how to adapt my code to the new version.


miao568666 September 8, 2017 08:24

Quote:

Originally Posted by floquation (Post 659258)
Put two similar codes from both the old and new version next to each other.
For example, if you have a custom solver based on interFoam in 2.1.x, then I'd open the real interFoam of 2.1.x and the interFoam of the new version.
Then by first comparing Make/options and then each individual source file of those two interFoams, I can figure out how to adapt my code to the new version.

Hi Kevin, after I removed this library, Openfoam still asked me to set curvatureModel when using interFoam, how to avoid this problem?

floquation September 11, 2017 03:26

Quote:

Originally Posted by miao568666 (Post 663647)
Hi Kevin, after I removed this library, Openfoam still asked me to set curvatureModel when using interFoam, how to avoid this problem?

What exactly did you do to remove it?
If OF is asking you to set "curvatureModel", the library is not removed.
You should remove the .so file from the directory $FOAM_USER_LIBBIN.

miao568666 September 11, 2017 07:36

Quote:

Originally Posted by floquation (Post 663915)
What exactly did you do to remove it?
If OF is asking you to set "curvatureModel", the library is not removed.
You should remove the .so file from the directory $FOAM_USER_LIBBIN.

Thanks Kevin, I did as what you said, it works, thanks!

saddy October 19, 2017 11:19

Hey Kevin
i saw your discussions on VOF smoothing and i see you 've been working on boiling flows.
i am also working on boiling and i am using intercondensatingevaporatingfoam solver
from OPENFOAM-V1612+ from ESI
I hve added dynamic meshing to it
it's however plagued with spurious currents.
can you please add vof smoothing for openfoam-v1612+ ?? add support for OPENFOAM ESI
my intercondensatinngevaporatingfoam is attached in this forum...
i'll send you the link if you want to try...

JSR October 25, 2017 06:20

Dear all,
I m also validating two phase slug flow in T junction microreactor using interFoam with constantContactAngle of 140 and so on.......till now results matches nicely till slug breaking mechanism....but after that as slug move in main channel it start accelerating and its size increases till outlet comes......what is the issue,I am stuck now (by observation as one phase block other phase at junction and then it break slug, the slug in main channel accelerates)

I think someone can understand my issue....

mikebham669 January 9, 2018 14:06

Quote:

Originally Posted by floquation (Post 658988)
I did not yet know OF-5.0 was released.

I have just adapted the code to work with OF-5.0 for you (and others) and pushed it to the same GitHub page. Make sure to checkout the branch "of50", as is now also mentioned in the updated README file.

Hi Kevin,

for some reason I cannot run ./Allget. At first there was an error saying wrong directory. I have figured that my sh was in bin/sh rather than usr/bin/sh.
Now when I run it I get error from line 33 that "(" is unexpected and pretty much all the other brackets in line 33 and 34. I am pretty sure they should be there and even after removing them I get a syntax error that line 42 "(" is unexpected (expecting "done"). This is seriously doing my head in...

floquation January 19, 2018 07:10

Quote:

Originally Posted by mikebham669 (Post 677483)
Hi Kevin,

for some reason I cannot run ./Allget. At first there was an error saying wrong directory. I have figured that my sh was in bin/sh rather than usr/bin/sh.
Now when I run it I get error from line 33 that "(" is unexpected and pretty much all the other brackets in line 33 and 34. I am pretty sure they should be there and even after removing them I get a syntax error that line 42 "(" is unexpected (expecting "done"). This is seriously doing my head in...

I can ensure you that the script works for me, so especially the brackets should be correct.
First try executing the script by explicitly specifying the running environment (from the directory that contains the script):
Code:

sh ./Allget
If that doesn't work, what version of sh do you have?
Code:

sh --version
The script was written to work with bash. If you have a different shell (like kcsh), then the script has never been checked whether it is compatible. Try executing it explicitly using bash (if your machine has it):
Code:

bash ./Allget
As alternative: you don't need the script to use my library. It is just a convenience thing. In the README on GitHub I also wrote instruction to install my library without the Allget script.
In fact, all that Allget does is use your "list_of_solvers" file to repetitively call the getSolverMake.sh script for all solvers you wish to recompile. You can do that by hand as well (see the README on GitHub).
Then, getSolverMake.sh (I hope that one works for you) modifies some files of the solver like Make/files and Make/options to automagically link it against my library, and set its compilation location to $FOAM_USER_APPBIN: the place where custom solvers should go.

Hope that helps you.

O'nel March 11, 2018 18:53

Hey Kevin and Michal,

first of thanks a lot for the port and your detailed description on github Kevin!
I ran into the same problem that Michal had and managed to fix it, simply by replacing the first line:

#! /usr/bin/sh

with:

#!/bin/bash

in the Allget, Allwmake and the getSolverMake.sh script.

I hope this is helpful for other foamers out there.

Best regards,
Leon

floquation April 30, 2018 07:15

Quote:

Originally Posted by O'nel (Post 684724)
#! /usr/bin/sh

with:

#!/bin/bash

Thank you for putting that out here.
In the meantime I'd run into the same problem with a student of mine who wanted to use his own laptop as well, for which we used that same solution.

I just wonder what the "proper" Linux way of writing the shebang is... Perhaps using env?
Code:

/usr/bin/env bash

dzordz August 24, 2018 07:12

Hi Kevin,

Quote:

Theoretically, it should work with any OF solver that relies on OF's interfaceProperties, as kva_interfaceProperties merely overrides OF's interfaceProperties' behaviour:
I have a question regarding the multiphaseInterFoam solver, which you say it is compatible with kva_interfaceProperties. I find this not to be true, since the curvature calculation is not being done in interfaceProperties.C (like interFoam), but instead in multiphaseMixture.C. Compilation with recompile solver is done without error.



Also the compressibleInterFoam compiles without error. Then it gives an error: keyword water in not defined in the dictionary thermophysicalProperties. Solution: Phases and propreties need to be added there, since the code calls for rho1_ and rho2_ in order to use densityWeighted model. Am I assuming correct that if the model is turned off these values could be arbitrary and will not affect the calculations?


I might be getting something wrong in how your code is implemented though. Any thoughts?

Thanks

stardust111 September 3, 2018 06:08

Dear Kevin,
Thank you very much for sharing your code. It was really useful for my project.
However, now I met a problem when compiling it to the compressibleInterFoam:
compressibleInterFoam.C:46:35: fatal error: twoPhaseMixtureThermo.H: No such file or directory
Do you have any clue to solve this? Thanks a lot.P.S.: I have successfully compiled the interFoam solver with your code without any error.P.S.2: I have both OF40 and OF50 on my computer, both have the same problem.
best
Guang

dzordz September 3, 2018 09:34

Quote:

Originally Posted by stardust111 (Post 705123)
Dear Kevin,
Thank you very much for sharing your code. It was really useful for my project.
However, now I met a problem when compiling it to the compressibleInterFoam:
compressibleInterFoam.C:46:35: fatal error: twoPhaseMixtureThermo.H: No such file or directory
Do you have any clue to solve this? Thanks a lot.P.S.: I have successfully compiled the interFoam solver with your code without any error.P.S.2: I have both OF40 and OF50 on my computer, both have the same problem.
best
Guang


I had the same issue with this compilation. For some reason linking in Make/options file to this twoPhaseMixtureThermo folder fails. What solved my problem (probably not smoothest solution) is adding an additional line in options -I/.....path to twoPhaseMixtureThermo folder.... \


Hope it helps.


All times are GMT -4. The time now is 16:36.