CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Rising bubble with interFoam (http://www.cfd-online.com/Forums/openfoam-solving/107180-rising-bubble-interfoam.html)

tayo September 19, 2012 15:07

Rising bubble with interFoam
 
Hello Foamers,

Please I need your advice here. I'm doing a 2D simulation on rising bubble using interFoam. To simplify it for now, my boundary condition is zero velocity at inlet, zero pressure (p_rgh) on outlet and zero gradient for all other sides. Zero gradient also used on all sides of the alpha1. Volume fraction and pressure (p_rgh) inside is initialized with funkySetfField all identical to what was used in a previous trend.

http://www.cfd-online.com/Forums/ope...elocity-2.html

Bubble position is initially placed at center of the 100 mm^2 domain. nCells is 260480. Time step is 1e-4s (adjustableTimeStep also activated). liquid and gas phases are water and air, gravity is set to (0 -9.81 0). surface tension is 0.0728. Infact, I only slightly modified the damBreak tutorial to set up this case. What else. During simulation, I noticed the pressure (p_rgh) inside the bubble jumps from what I initialized (sigma/radius) to about 150N/m2. It runs fine but here is the problem, the bubble fails to rise, infact it sinks:confused: like a free fall (~0.75m/s). I've also tried to run without initializing the pressure inside the bubble, and it still sinks. I've tried changing the bubble size too, (and also actually flipped the sign of the gravity-makes no sense though but it rises with the same mag. of velocity as it falls when g is negative). How do I get the bubble to rise (with negative g ofcourse)? I've run out of ideas. Could the problem be with this p_rgh? Please I need your help/advice:confused:

nimasam September 19, 2012 16:17

Hi dear tayo
look at this paper:
http://psrcentre.org/images/extraimages/212129.pdf

tayo September 19, 2012 17:09

Quote:

Originally Posted by nimasam (Post 382627)

Hi nima. I can see you did DNS with Re up to 1000 using zerogradient bc for u and p. Did you use interFoam? My test case is a simplified version of the paper and but I'm testing with laminar for now. From the description of my case, is there anything I'm not doing right? how did you treat the p_rgh? Thanks

tayo September 19, 2012 22:32

OK. I've tried my test case on bubbleFoam (one of the few solvers on OF 2.1.1 that still computes pressure as p0+rho*gh) and my bubble rises and behaves as expected. But I still need to use interFoam because it is easier to include the complexities of my cases in the interFoam solver (I'm a newbie to OF). Moreover, bubbleFoam solves Euler-Euler equation (continuity & momentum equations for each phase) which I don't desire. So back to my original question:

How do I include the effects of rho*gh to my pressure (p_rgh)? I honestly still don't see the importance of the change from p to p_rgh:confused:. Someone please reply. Thanks

nimasam September 19, 2012 23:57

Quote:

I can see you did DNS with Re up to 1000 using zerogradient bc for u and p. Did you use interFoam?
yes, i used the interFoam in OpenFOAM-1.6,
BC are mentioned there!, i guess i used fixed pressure for top and no slip for bottom of geometry
Quote:

My test case is a simplified version of the paper and but I'm testing with laminar for now. From the description of my case, is there anything I'm not doing right?
my simulation is laminar too, or in other word i solved laminar equation sets and "direct numerical simulation" is pointed out to interface evolution is calculated directly not means it is a turbulent flow!
Quote:

how did you treat the p_rgh? Thanks
using p-rgh you can apply pressure condition much more easily!
i guess, first you should refine your mesh, then you should apply the BC i mentioned above! meanse put BC zeroGradient for All variable
then put noSlip condition for velocity at the bottom and fixedPressure for top of your geometry

nimasam September 20, 2012 00:00

Quote:

Originally Posted by tayo (Post 382668)
OK. I've tried my test case on bubbleFoam (one of the few solvers on OF 2.1.1 that still computes pressure as p0+rho*gh) and my bubble rises and behaves as expected. But I still need to use interFoam because it is easier to include the complexities of my cases in the interFoam solver (I'm a newbie to OF). Moreover, bubbleFoam solves Euler-Euler equation (continuity & momentum equations for each phase) which I don't desire. So back to my original question:

How do I include the effects of rho*gh to my pressure (p_rgh)? I honestly still don't see the importance of the change from p to p_rgh:confused:. Someone please reply. Thanks

durin runTime it adds rho*gh in its calcualtion, so if you just want to see the Pressure (p) not P-rgh, you just need to add p dictionary in your 0 folder and assign a calculated BC for it!

tayo September 20, 2012 01:21

Quote:

Originally Posted by nimasam (Post 382675)
yes, i used the interFoam in OpenFOAM-1.6,
BC are mentioned there!, i guess i used fixed pressure for top and no slip for bottom of geometry

my simulation is laminar too, or in other word i solved laminar equation sets and "direct numerical simulation" is pointed out to interface evolution is calculated directly not means it is a turbulent flow!

using p-rgh you can apply pressure condition much more easily!
i guess, first you should refine your mesh, then you should apply the BC i mentioned above! meanse put BC zeroGradient for All variable
then put noSlip condition for velocity at the bottom and fixedPressure for top of your geometry

Fixed pressure at outlet, no slip velocity at inlet and zero gradient on all other sides and alpha1 field is exactly what I first started with, yet the bubble sinks. My internalField for pressure was also same as outlet pressure. I've played around with different outlet pressure and I've also tried buoyantPressure BC. I think the problem is there is still no pressure gradient at all inside the domain except inside the bubble. That's how I knew that the rho*gh is missing and thus tried it on bubbleFoam.

As per adding a p file to my 0 dir, how do I add the rho*gh to it. I've tried it by specifying a random rho*gh value at outlet and internal field but it simply adds up but seems not to have any effect on the physics and the bubble still sinks. Think I might not be doing it right too but the point is how do I get buoyancy for my bubble? Thanks

nimasam September 20, 2012 09:06

1 Attachment(s)
i think you need refine your mesh, and recheck your gravity
i attached for you a test case

tayo September 20, 2012 17:50

Hi nima. I've fixed the issue and it's rising. The problem was not with the p_rgh as I earlier thought. Actually, defining either p_rgh or p does not not affect the behavior. Thank you.

jens_klostermann September 21, 2012 02:45

Hi tayo,

You can also check the wiki http://openfoamwiki.net/index.php/Tw...28two_cases%29 and the references therein.

tayo September 21, 2012 12:20

Thanks. Now the issue is computing the bubble position / velocity at each time step.

nimasam September 21, 2012 12:45

hi tayo
look at here for swak4Foam
http://openfoamwiki.net/index.php/Contrib/swak4Foam

and its utilities : swakFunctionObjects or simpleSwakFunctionObjects

tayo September 26, 2012 20:40

Hi,

I'm a little confused using simpleSwakFunctionObjects or simpleFunctionObjects. Please I need enlightenment. Do I add the code to my case's controlDict file before or after running the case or do I activate it afterwards using a command just like it's done in funkySetFields? Does it prints out the averaged values or how do I obtain these values? Finding the average rise velocity for the bubble, do I need to define the initial position of the bubble? I really don't understand. I intend to try the code below for my 2d & 3d bubble. Thanks

U
{
type patchAverage;
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
verbose true;
patches
(
inlet
wall
outlet
);
fields (U);
}

nimasam September 26, 2012 23:12

These libraries are executing meanwhile run-time and printout the result, for this case you wrote above average o U in patches inlet, wall and outlet will be saved in folder U,
however, it will execute in each timestep iteration after all! calculations,
to calculate rise velocity of bubble, you should calculate the position of bubble gravity center in each time step :)

gschaider September 28, 2012 08:57

Quote:

Originally Posted by tayo (Post 383815)
Hi,

I'm a little confused using simpleSwakFunctionObjects or simpleFunctionObjects. Please I need enlightenment. Do I add the code to my case's controlDict file before or after running the case or do I activate it afterwards using a command just like it's done in funkySetFields? Does it prints out the averaged values or how do I obtain these values? Finding the average rise velocity for the bubble, do I need to define the initial position of the bubble? I really don't understand. I intend to try the code below for my 2d & 3d bubble. Thanks

U
{
type patchAverage;
functionObjectLibs
(
"libsimpleFunctionObjects.so"
);
verbose true;
patches
(
inlet
wall
outlet
);
fields (U);
}

functionObjects are executed during the run every time the time is incremented (at the end of a timestep). Depending on the options you set (with simple/swak usually "verbose true") they write to the screen.

Have a look at http://openfoamwiki.net/index.php/Co...unctionObjects and tell me which information you're missing

P Sharma December 5, 2014 04:49

Boundary Conditions
 
Hi,
As this problem is posted 2 yrs before so, I am expecting you already completed this in openFoam and I am new in openfoam I want to know that what are boundary condition you applied in side walls of the bubble rising problem in openFoam.
thank you.




Please I need your advice here. I'm doing a 2D simulation on rising bubble using interFoam. To simplify it for now, my boundary condition is zero velocity at inlet, zero pressure (p_rgh) on outlet and zero gradient for all other sides. Zero gradient also used on all sides of the alpha1. Volume fraction and pressure (p_rgh) inside is initialized with funkySetfField all identical to what was used in a previous trend.

http://www.cfd-online.com/Forums/ope...elocity-2.html

Bubble position is initially placed at center of the 100 mm^2 domain. nCells is 260480. Time step is 1e-4s (adjustableTimeStep also activated). liquid and gas phases are water and air, gravity is set to (0 -9.81 0). surface tension is 0.0728. Infact, I only slightly modified the damBreak tutorial to set up this case. What else. During simulation, I noticed the pressure (p_rgh) inside the bubble jumps from what I initialized (sigma/radius) to about 150N/m2. It runs fine but here is the problem, the bubble fails to rise, infact it sinks:confused: like a free fall (~0.75m/s). I've also tried to run without initializing the pressure inside the bubble, and it still sinks. I've tried changing the bubble size too, (and also actually flipped the sign of the gravity-makes no sense though but it rises with the same mag. of velocity as it falls when g is negative). How do I get the bubble to rise (with negative g ofcourse)? I've run out of ideas. Could the problem be with this p_rgh? Please I need your help/advice:confused:[/QUOTE]


All times are GMT -4. The time now is 20:52.