CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Interfoam water flowing uphill

Register Blogs Community New Posts Updated Threads Search

Like Tree9Likes
  • 2 Post By Brians200
  • 2 Post By ngj
  • 1 Post By JonW
  • 1 Post By Brians200
  • 1 Post By ngj
  • 2 Post By Brians200

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 23, 2014, 23:29
Default Interfoam water flowing uphill
  #1
New Member
 
Join Date: Mar 2014
Posts: 5
Rep Power: 12
Brians200 is on a distinguished road
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
(
);
alpha.water.org
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;
    }
}
p_rgh
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;
    }
}
U
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;
    }
}
setFieldsDict
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
        );
    }
);
Brians200 is offline   Reply With Quote

Old   March 31, 2014, 20:59
Default
  #2
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18
kmooney is on a distinguished road
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?
kmooney is offline   Reply With Quote

Old   April 1, 2014, 13:44
Default
  #3
New Member
 
Join Date: Mar 2014
Posts: 5
Rep Power: 12
Brians200 is on a distinguished road
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.
Brians200 is offline   Reply With Quote

Old   April 1, 2014, 13:58
Default
  #4
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18
kmooney is on a distinguished road
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
kmooney is offline   Reply With Quote

Old   April 1, 2014, 17:37
Default
  #5
New Member
 
Join Date: Mar 2014
Posts: 5
Rep Power: 12
Brians200 is on a distinguished road
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?

Iose and rafa13 like this.
Brians200 is offline   Reply With Quote

Old   April 3, 2014, 15:58
Default
  #6
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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.
hua1015 and rafa13 like this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   April 3, 2014, 17:21
Default
  #7
Senior Member
 
Jon Elvar Wallevik
Join Date: Nov 2010
Location: Reykjavik, ICELAND
Posts: 103
Rep Power: 20
JonW will become famous soon enough
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
hua1015 likes this.
JonW is offline   Reply With Quote

Old   April 4, 2014, 13:25
Default
  #8
New Member
 
Join Date: Mar 2014
Posts: 5
Rep Power: 12
Brians200 is on a distinguished road
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.
hua1015 likes this.
Brians200 is offline   Reply With Quote

Old   April 4, 2014, 18:32
Default
  #9
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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
rafa13 likes this.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   April 4, 2014, 18:34
Default
  #10
New Member
 
Join Date: Mar 2014
Posts: 5
Rep Power: 12
Brians200 is on a distinguished road
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;
}


// ************************************************************************* //
hua1015 and rafa13 like this.
Brians200 is offline   Reply With Quote

Old   April 4, 2014, 18:43
Default
  #11
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,903
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
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.
ngj is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 17:15.