|
[Sponsors] |
March 23, 2014, 23:29 |
Interfoam water flowing uphill
|
#1 |
New Member
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
Hello,
I am trying to create a situation where water flows over a dam. I have been mostly successful, but there are couple of oddities. I have a dam that is in the shape of a trapezoid, with the outer part of the dam having a height of 2 meters and the inner part of the dam having a height of 1.6 meters. I have set some water initially at 1.4 meters and the rest of the water fills in from the back wall, as can be seen here. After I run interFoam and check the results in ParaView, there is water flowing uphill immediately. Here is a picture from a few frames later where it has made it over the top when it shouldn't even be going up the hill. The other problem I have is that the water always follows the corner, where the wall meets the ground, even when water shouldn't be going over the top of the dam in those parts. Here is an example from several seconds later. How can I prevent these things from happening, or what am I doing wrong? I started with the damBreak example and modified the following. Thank you for your time. blockMeshDict Code:
FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } convertToMeters 1; vertices ( (0 0 0) //0 (2 0 0) //1 (8 2 0) //2 (0 5 0) //3 (2 5 0) //4 (8 5 0) //5 (0 0 1) //6 (2 0 1) //7 (8 2 1) //8 (0 5 1) //9 (2 5 1) //10 (8 5 1) //11 (9 2 0) //12 (9 5 0) //13 (9 2 1) //14 (9 5 1) //15 (15 0 0) //16 (15 5 0) //17 (15 0 1) //18 (15 5 1) //19 (18 0 0) //20 (18 5 0) //21 (18 0 1) //22 (18 5 1) //23 (0 0 2) //24 (2 0 2) //25 (2 5 2) //26 (0 5 2) //27 (0 0 3) //28 (2 0 3) //29 (2 5 3) //30 (0 5 3) //31 (0 0 4) //32 (2 0 4) //33 (2 5 4) //34 (0 5 4) //35 (0 0 5) //36 (2 0 5) //37 (2 5 5) //38 (0 5 5) //39 (8 1.6 2) //40 (8 5 2) //41 (8 1.6 3) //42 (8 5 3) //43 (8 2 4) //44 (8 5 4) //45 (8 2 5) //46 (8 5 5) //47 (9 1.6 2) //48 (9 5 2) //49 (9 1.6 3) //50 (9 5 3) //51 (9 2 4) //52 (9 5 4) //53 (9 2 5) //54 (9 5 5) //55 (15 0 2) //56 (15 5 2) //57 (15 0 3) //58 (15 5 3) //59 (15 0 4) //60 (15 5 4) //61 (15 0 5) //62 (15 5 5) //63 (18 0 2) //64 (18 5 2) //65 (18 0 3) //66 (18 5 3) //67 (18 0 4) //68 (18 5 4) //69 (18 0 5) //70 (18 5 5) //71 ); blocks ( hex (0 1 4 3 6 7 10 9) (20 30 10) simpleGrading (1 1 1) hex (6 7 10 9 24 25 26 27) (20 30 10) simpleGrading (1 1 1) hex (24 25 26 27 28 29 30 31) (20 30 10) simpleGrading (1 1 1) hex (28 29 30 31 32 33 34 35) (20 30 10) simpleGrading (1 1 1) hex (32 33 34 35 36 37 38 39) (20 30 10) simpleGrading (1 1 1) hex (1 2 5 4 7 8 11 10) (60 30 10) simpleGrading (1 1 1) hex (7 8 11 10 25 40 41 26) (60 30 10) simpleGrading (1 1 1) hex (25 40 41 26 29 42 43 30) (60 30 10) simpleGrading (1 1 1) hex (29 42 43 30 33 44 45 34) (60 30 10) simpleGrading (1 1 1) hex (33 44 45 34 37 46 47 38) (60 30 10) simpleGrading (1 1 1) hex (2 12 13 5 8 14 15 11) (10 30 10) simpleGrading (1 1 1) hex (8 14 15 11 40 48 49 41) (10 30 10) simpleGrading (1 1 1) hex (40 48 49 41 42 50 51 43) (10 30 10) simpleGrading (1 1 1) hex (42 50 51 43 44 52 53 45) (10 30 10) simpleGrading (1 1 1) hex (44 52 53 45 46 54 55 47) (10 30 10) simpleGrading (1 1 1) hex (12 16 17 13 14 18 19 15) (60 30 10) simpleGrading (1 1 1) hex (14 18 19 15 48 56 57 49) (60 30 10) simpleGrading (1 1 1) hex (48 56 57 49 50 58 59 51) (60 30 10) simpleGrading (1 1 1) hex (50 58 59 51 52 60 61 53) (60 30 10) simpleGrading (1 1 1) hex (52 60 61 53 54 62 63 55) (60 30 10) simpleGrading (1 1 1) hex (16 20 21 17 18 22 23 19) (30 30 10) simpleGrading (1 1 1) hex (18 22 23 19 56 64 65 57) (30 30 10) simpleGrading (1 1 1) hex (56 64 65 57 58 66 67 59) (30 30 10) simpleGrading (1 1 1) hex (58 66 67 59 60 68 69 61) (30 30 10) simpleGrading (1 1 1) hex (60 68 69 61 62 70 71 63) (30 30 10) simpleGrading (1 1 1) ); boundary ( leftWall { type patch; faces ( (0 6 9 3) (6 24 27 9) (24 28 31 27) (28 32 35 31) (32 36 39 35) ); } rightWall { type patch; faces ( (68 69 71 70) (66 67 69 68) (64 65 67 66) (22 23 65 64) (20 21 23 22) ); } lowerWall { type wall; faces ( (16 20 22 18) (18 22 64 56) (56 64 66 58) (58 66 68 60) (60 68 70 62) (52 60 62 54) (50 58 60 52) (48 56 58 50) (14 18 56 48) (12 16 18 14) (2 12 14 8) (8 14 48 40) (40 48 50 42) (42 50 52 44) (44 52 54 46) (33 44 46 37) (29 42 44 33) (25 40 42 29) (7 8 40 25) (1 2 8 7) (32 33 37 36) (28 29 33 32) (24 25 29 28) (6 7 25 24) (0 1 7 6) ); } atmosphere { type patch; faces ( (35 39 38 34) (31 35 34 30) (27 31 30 26) (9 27 26 10) (3 9 10 4) (34 38 47 45) (30 34 45 43) (26 30 43 41) (10 26 41 11) (4 10 11 5) (45 47 55 53) (43 45 53 51) (41 43 51 49) (11 41 49 15) (5 11 15 13) (13 15 19 17) (15 49 57 19) (49 51 59 57) (51 53 61 59) (53 55 63 61) (61 63 71 69) (59 61 69 67) (57 59 67 65) (19 57 65 23) (17 19 23 21) ); } frontWall { type wall; faces ( (36 37 38 39) (37 46 47 38) (54 62 63 55) (46 54 55 47) (62 70 71 63) ); } backWall { type wall; faces ( (16 17 21 20) (12 13 17 16) (2 5 13 12) (1 4 5 2) (0 3 4 1) ); } ); edges ( ); Code:
FoamFile { version 2.0; format ascii; class volScalarField; object alpha.water; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type fixedValue; value uniform 1; } rightWall { type inletOutlet; inletValue uniform 0; value uniform 0; } lowerWall { type zeroGradient; } frontWall { type zeroGradient; } backWall { type zeroGradient; } atmosphere { type inletOutlet; inletValue uniform 0; value uniform 0; } defaultFaces { type empty; } } Code:
FoamFile { version 2.0; format ascii; class volScalarField; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { leftWall { type fixedFluxPressure; value uniform 0; } rightWall { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } backWall { type fixedFluxPressure; value uniform 0; } frontWall { type fixedFluxPressure; value uniform 0; } lowerWall { type fixedFluxPressure; value uniform 0; } atmosphere { type totalPressure; p0 uniform 0; U U; phi phi; rho rho; psi none; gamma 1; value uniform 0; } defaultFaces { type empty; } } Code:
FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { leftWall { type fixedValue; value uniform (0.1 0 0); } rightWall { type pressureInletOutletVelocity; value uniform (0 0 0); } backWall { type fixedValue; value uniform (0 0 0); } frontWall { type fixedValue; value uniform (0 0 0); } lowerWall { type fixedValue; value uniform (0 0 0); } atmosphere { type pressureInletOutletVelocity; value uniform (0 0 0); } defaultFaces { type empty; } } Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object setFieldsDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // defaultFieldValues ( volScalarFieldValue alpha.water 0 ); regions ( boxToCell { box (0 0 -1) (7 1.4 6); fieldValues ( volScalarFieldValue alpha.water 1 ); } ); |
|
March 31, 2014, 20:59 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
According to your alpha and U boundary conditions you have a alpha=1 inflow on the 'leftWall' boundary. Is it possible you're just pumping in liquid and its overflowing?
|
|
April 1, 2014, 13:44 |
|
#3 |
New Member
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
I would like to eventually have water pumping in, however the water is immediately flowing uphill and over the dam before it should be doing that.
I set the alpha.water.org to leftWall { type zeroGradient; } And the U to leftWall { type fixedValue; value uniform (0 0 0); } So now no water is pumping in and it still happens. |
|
April 1, 2014, 13:58 |
|
#4 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
I'd say there are a few things you can do to try and mitigate this:
1. Refine the mesh. Looking at the thickness of the interface cells it appears the your cell size vs. domain size is rather coarse. The accuracy of many VOF simulations is going to be heavily dependant on the mesh density. 2. Try a fixed contact angle bc for alpha. There is an example of this in the interFoam tutorial capillaryRise in foam 2.3.x 3. Try increasing the interface compression value in fvSolution. Here, cAlpha sets the ammount of artificial interface compression the solver applied. I think its called a 'counter gradient' scheme. Anyway, its typically set to 1 but you could try to turn it up to 1.5 or 2 and see how that effects things. Cheers! Kyle |
|
April 1, 2014, 17:37 |
|
#5 |
New Member
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
I have tried doing the following things to try and fix it.
1) I shrunk the all the size of the mesh to 1/10th the size in every direction and doubled the amount of cells. 2) Do you have a suggestion for the angle to use? The dam break tutorial suggest 90 degrees for that case. That does the same thing as my original post. If I try the 45 angle from the capillary example, the water becomes airborne as it goes over the dam. 3) I have tried setting cAlpha to 1.5 and 2 and still got the same results. Do you have any other suggestions? |
|
April 3, 2014, 15:58 |
|
#6 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Brian,
I would recommend you to look into some of the articles by Wemmehove and Veldman. They describe quite nicely (for orthogonal, square meshes with a staggered variable arrangememt), how to specifically address the interpolation of the density to the faces. They derive a unique interpolation method, which gives rise to a well-balanced momentum equation. They also show how spurious currents develop, when they use other methods such as linear interpolation. To the best of my understanding, the interFoam implementation of the momentum equation is ill-balanced, and things can become bad on meshes, which are only slightly non-orthogonal. Considering the dimensions of your case, I do not think surface tension effect have any (engineering) relevance, why I always use a surface tension coefficient of 0.00. You can convince yourself about the above mentioned issues by making the damBreak case into a bucket of water. After some time you will see motion in the air. If you add a small skewness to the mesh, you can create even larger amounts of energy. I am sorry, but I do not have a solution to your problems, but I hope that this might help you nonetheless. Kind regards, Niels P.S. Unfortunately, I do not have any information on the mentioned articles, and they were archieved, when I left university.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
April 3, 2014, 17:21 |
|
#7 |
Senior Member
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 103
Rep Power: 19 |
Dear Brians200, this is a long shot, but keeping the aspect ratio of the cells close to 1 might help. This has at least helped me in another situation with interFoam, see
http://www.cfd-online.com/Forums/ope...-behavior.html cheers Jon |
|
April 4, 2014, 13:25 |
|
#8 |
New Member
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
Hello Neils,
Taking what you said into account, I switched to a different interpolator and it is producing wonderful results! Thank you for your help! For right now, I am using the midpoint one. I will look for those papers when I have a chance so I can figure out the correct one. |
|
April 4, 2014, 18:32 |
|
#9 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Brian,
For future reference, could you be more specific on which parameters you changed to the midpoint method, e.g. provide the fvSchemes file here. I am glad that I could help, Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
April 4, 2014, 18:34 |
|
#10 |
New Member
Join Date: Mar 2014
Posts: 5
Rep Power: 12 |
Sure. Here is my fvSchemes. All I changed was the interpolationSchemes
Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div((muEff*dev(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default midPoint; } snGradSchemes { default corrected; } fluxRequired { default no; p_rgh; pcorr; alpha.water; } // ************************************************************************* // |
|
April 4, 2014, 18:43 |
|
#11 |
Senior Member
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,902
Rep Power: 37 |
Hi Brian,
Thank you and happy foaming. Kind regards, Niels P.S. If you need wave level gauges in your computations, then I can recommend that you use the waves2Foam package (though, be careful, as I am doing PR for my own work).
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
interFoam Average velocity of water only! | dsanza | OpenFOAM Post-Processing | 5 | August 3, 2015 13:44 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
Make a simulation of water flowing into a vase !?? | Vu Trinh Tuan | CFX | 7 | April 6, 2005 15:23 |
Terrible Mistake In Fluid Dynamics History | Abhi | Main CFD Forum | 12 | July 8, 2002 10:11 |
uptodate water distribution network | fredius,magige,tanzanian,(e.a) | Main CFD Forum | 0 | January 27, 2002 08:10 |