|
[Sponsors] |
interFoam and cyclic boundary condition issue |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 19, 2010, 06:07 |
interFoam and cyclic boundary condition issue
|
#1 |
New Member
Brian
Join Date: Aug 2010
Location: Southampton
Posts: 12
Rep Power: 16 |
Hi all,
Long time reader, you guys have solved a lot of my problems in FLUENT over the past few years. I have now moved onto openFOAM due to licensing issues and hope that someone can help me out with the following... I am essentially modelling a bubble rising under gravity, in a 2D (one cell thick) tube with periodic boundary conditions top and bottom. Everything seems to work fine until the bubble hits the top boundary - see attached files. I am assuming that I have done something wrong with the boundary condition, but have been pulling my hair out for a week now. blockMeshDict Code:
vertices ( (0 0 0) (2.5 0 0) (2.5 5 0) (0 5 0) (0 0 0.01) (2.5 0 0.01) (2.5 5 0.01) (0 5 0.01) ); blocks ( hex (0 1 2 3 4 5 6 7) (40 80 1) simpleGrading (1 1 1) ); edges ( ); patches ( wall leftWall ( (0 4 7 3) ) wall rightWall ( (1 5 6 2) ) cyclic top_bottom ( (0 1 5 4) (2 3 7 6) ) empty frontandback ( (0 1 2 3) (4 5 6 7) ) ); mergePatchPairs ( ); Code:
dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type zeroGradient; } rightWall { type zeroGradient; } top_bottom { type cyclic; } defaultFaces { type empty; } } Code:
dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type buoyantPressure; value uniform 0; } rightWall { type buoyantPressure; value uniform 0; } top_bottom { type cyclic; } defaultFaces { type empty; } } Code:
dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type fixedValue; value uniform (0 0 0); } rightWall { type fixedValue; value uniform (0 0 0); } top_bottom { type cyclic; value uniform (0 0 0); } defaultFaces { type empty; } } Sorry for the long post, just wanted to give as much info as poss. Any help is greatly appreciated. Cheers Brian |
|
December 13, 2011, 10:46 |
|
#2 |
Member
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16 |
I am aware that this post is already a year old, but just wanted to reply on it because it is very similar to a problem I am facing and I know what it is coming from but do not know whether OF has a build in boundary condition to solve it.
To explain a bit more about my own case: I model a droplet running down an inclined plate where I actually incline the direction of gravity instead of my mesh itself. At the bottom of the plate I have a cyclic condition which enters the droplet at the top. What happens is the following: the droplet (in your case the bubble) moves partially through the periodic boundary and then suddenly has a very different pressure head on the other side of the boundary. Being still in between boundaries, the pressure at the top is higher then at the bottom (reversed in your case) and the droplet will (logically) move down the pressure gradient, which seems to be uphill (see attached image for a crude drawing) Does anybody know whether a BC is implemented that can handle this pressure jump? I am aware of the `fan BC' but this doesn't work out because the pressure jump for the gas and liquid phases is different. |
|
December 14, 2011, 11:23 |
|
#3 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
@General_Gee and @michielm
I had this same problem a few years ago and posted about the issue in the thread http://www.cfd-online.com/Forums/ope...nnel-flow.html I saw that I didn't reply to my thread and give the solution and its been seen by a few people. The issue is not the boundary condition, but the interFoam solver itself. Nothing wrong with it, since it is doing exactly what it was programmed to do. the issue is the dynamic pressure definition that lumps together gravity and pressure into pd. if you separate gravity from pd and add it back into the momentum equation in say Code:
fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(rhoPhi, U) - fvm::laplacian(muEff, U) - (fvc::grad(U) & fvc::grad(muEff)) == rho*g ); After adding the explicit term on the UEqn, you should be able to used your periodic domain with cyclic boundary conditions. if you want channel flow with that one too....then have a look at http://www.cfd-online.com/Forums/ope...interfoam.html Hope this helps and I'm sure others have a better answer, but this is what I've got this morning. |
|
December 14, 2011, 11:45 |
|
#4 |
New Member
Brian
Join Date: Aug 2010
Location: Southampton
Posts: 12
Rep Power: 16 |
Why didn't I see this
Good spot and major props to you for coming back to this, fixing it and updating your old posts too. |
|
December 14, 2011, 12:02 |
|
#5 |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Thanks! I totally raced to work this morning so I could find my old posts and reply to this one (since i actually knew the answer for once). Happy that I could help!
Last edited by chegdan; December 14, 2011 at 12:20. |
|
February 18, 2012, 12:41 |
|
#7 |
Member
Michiel
Join Date: Oct 2010
Location: Delft, Netherlands
Posts: 97
Rep Power: 16 |
Hi Joris,
In the end I resolved the issue in a different way, although I'm pretty sure chegdan's solution will work. What I did is somewhat specific for my case: since it is a droplet running down a slope at some fixed velocity (after an initial period anyway) I shifted my reference frame to a slope with an upward velocity. In this way the droplet remains inside my mesh without a need for periodic boundaries. |
|
February 19, 2012, 06:05 |
|
#8 |
New Member
Join Date: May 2011
Posts: 15
Rep Power: 15 |
Nice done !
I explain how I did in the other post I cited before. it seems to work well. Cheers, joris |
|
May 9, 2012, 06:50 |
|
#9 |
New Member
xiang chai
Join Date: Aug 2009
Posts: 13
Rep Power: 17 |
Hello, Daniel
Thank you for your shared information. Besides the modification in the U equation, I think the pressure also needs a bit modification. Am I right? Chai |
|
May 9, 2012, 12:23 |
|
#10 | |
Senior Member
Daniel P. Combest
Join Date: Mar 2009
Location: St. Louis, USA
Posts: 621
Rep Power: 0 |
Quote:
You are correct, there is a definition of modified pressure with gravity included in there and you will need to change that. i don't have OF near me right now, but if you look for the P = Prgh + rho*gh....this is what I am referring to. I know in the newer versions of interfoam it is called several times throughout the solver. good luck. Last edited by chegdan; May 9, 2012 at 12:25. Reason: added more info |
||
May 10, 2012, 15:35 |
|
#11 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
One option would be to use a moving mesh paradigm. The mesh could track the centroid of the bubble and move with it, avoiding the need to use periodic BCs. If you want I could send you a paper I wrote that talks a little about my implementation, I could even send you the source code if you want, its pretty simple.
|
|
May 14, 2012, 10:29 |
|
#12 |
New Member
xiang chai
Join Date: Aug 2009
Posts: 13
Rep Power: 17 |
Hello kmooney,
it will be very nice if you can share your paper and source code. My email is chaixiang2011@gmail.com . chai |
|
February 13, 2013, 13:37 |
Source Code
|
#13 |
New Member
Felix
Join Date: Aug 2012
Posts: 7
Rep Power: 14 |
Hey guys.
It cost some time to test your suggestions. Please look also to the p equation. There is also then a term which must be commented. For all others for OpenFoam 2.1.x my source code. I hope that helps you to save time and you could concentrate on other scientific things ;-) |
|
March 11, 2013, 11:18 |
|
#14 |
Member
Alex
Join Date: Jun 2011
Posts: 33
Rep Power: 15 |
Flexi: Thank you for providing the code! Compiled and ran fine for my cases.
|
|
June 10, 2013, 07:45 |
|
#15 |
New Member
Felix
Join Date: Aug 2012
Posts: 7
Rep Power: 14 |
Here the interFoamBuoyancySeparated Solver with the correct name p instead of p_rgh
-> interFoamBuoyancySeparatedP The correct name for the pressure in the source code should help that users won't become confused |
|
July 15, 2013, 08:01 |
|
#16 |
New Member
Felix
Join Date: Aug 2012
Posts: 7
Rep Power: 14 |
The interFoamBuoyancySeparatedP Solver is used for an further improvement.
The user can add an impressed body force. Therefore a vector must be inserted into the file userGradP (constant-dir). The appropriate solver for this is interFoamBuoyancySeparatedPUserGrad |
|
June 21, 2018, 07:37 |
Continuous acceleration with cyclic boundary
|
#17 |
New Member
Assen Batchvarov
Join Date: May 2018
Posts: 1
Rep Power: 0 |
Hi All,
Thank you very much for posting a solution to having gravity with cyclic boundaries. Now that I have managed to compile the solver I have generated a falling film case which seems to accelerate well past the analytical values that I would expect. Any ideas why the flow does not want to slow down? |
|
October 8, 2018, 10:33 |
|
#18 |
New Member
Kahlil Fredrick Cui
Join Date: Apr 2018
Posts: 29
Rep Power: 8 |
Hi Assen!
I'm having the same problem. I think the velocities rapidly increase since the trailing end does not start slowly as it should be because of the entrant velocity which exits from the front. This just keeps going on until velocities become unreasonably high. I have no idea how to solve this though. Have you found a way around this? |
|
Tags |
boundary, bubble, cyclic, interfoam, periodic |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cyclic boundaries importing Gambit msh file and interFoam | chegdan | OpenFOAM Running, Solving & CFD | 16 | February 14, 2023 04:56 |
About interFoam solver | zou_mo | OpenFOAM Running, Solving & CFD | 129 | December 2, 2019 06:39 |
interFoam & cyclic condition | Ingenierias2003 | OpenFOAM | 2 | June 7, 2010 12:16 |