CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Boundary conditions for a free surface flow using interfoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/108892-boundary-conditions-free-surface-flow-using-interfoam.html)

FrolovOY November 4, 2012 03:35

Boundary conditions for a free surface flow using interfoam
 
2 Attachment(s)
HI all! I simulate flow in a channel with a free surface using interfoam solver. For this purpose I built a channel with length of 10 meters, width of 2 meters. For the velocity, pressure and alpha asked the following boundary conditions:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0 0 0);

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform (1 0 0);
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    lowerWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    frontAndBack
    {
        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
{
    inlet         
    {
        type            zeroGradient;
    }

    outlet         
    {
        type            totalPressure;
        p0              uniform 0;
        U              U;
        phi            phi;
        rho            rho;
        psi            none;
        gamma          1;
        value          uniform 0;
    }

    upperWall     
    {
        type            zeroGradient;
    }

    lowerWall     
    {
        type            zeroGradient;
    }

    frontAndBack
    {
        type            empty;
    }
}

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      alpha;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 1;
    }

    outlet
    {
        type            zeroGradient;
    }

    upperWall
    {
        type            zeroGradient;
    }

    lowerWall
    {
        type            zeroGradient;
    }

    atmosphere
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value          uniform 0;
    }

    frontAndBack
    {
        type            empty;
    }
}

The geometry of the fluid is defined as follows:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha1 0
);

regions
(
    boxToCell
    {
        box (0 0 0) (2 2 1);
        fieldValues
        (
            volScalarFieldValue alpha1 1
        );
    }
);

However, as seen in the following figure 1, the problem arises in that the channel width from 0 to 2 meters is not completely filled. In other words, alfa1 must equal 1 throughout the width of the section to the left of the front of the free surface.
Attachment 16632
Attachment 16633

Нow can I fix it? What I asked wrong in the boundary conditions?

Thanks!
Regards, FrolovOY

vonboett January 7, 2013 09:27

Hi FrolovOY,
could you tell what cell size you apply, and maybe post your transportProperty file?
The surface between air and liquid depends on the grid and on the transportProperties...

FrolovOY January 10, 2013 08:59

1 Attachment(s)
Quote:

Originally Posted by vonboett (Post 400498)
Hi FrolovOY,
could you tell what cell size you apply, and maybe post your transportProperty file?
The surface between air and liquid depends on the grid and on the transportProperties...

Hi, vonboett. This is my transportProperty:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

phase1
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 10;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1000;
    /*CrossPowerLawCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m              m [ 0 0 1 0 0 0 0 ] 1;
        n              n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k              k [ 0 0 1 0 0 0 0 ] 99.6;
        n              n [ 0 0 0 0 0 0 0 ] 0.1003;
    }*/
}

phase2
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1.48e-5;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1;
    /*CrossPowerLawCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        m              m [ 0 0 1 0 0 0 0 ] 1;
        n              n [ 0 0 0 0 0 0 0 ] 0;
    }

    BirdCarreauCoeffs
    {
        nu0            nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
        nuInf          nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
        k              k [ 0 0 1 0 0 0 0 ] 99.6;
        n              n [ 0 0 0 0 0 0 0 ] 0.1003;
    }*/
}

sigma          sigma [ 1 0 -2 0 0 0 0 ] 0.07;

and blockMeshDict file:

Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(
    (0 0 0)
    (10 0 0)
    (0 2 0)
    (10 2 0)
    (0 0 1)
    (10 0 1)
    (0 2 1)
    (10 2 1) 
);

blocks
(
    hex (0 1 3 2 4 5 7 6) (100 20 10) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (0 4 6 2)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (1 5 7 3)
        );
    }
    upperWall
    {
        type wall;
        faces
        (
            (2 3 7 6)
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
            (0 1 5 4)
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
            (0 1 3 2)
            (4 5 7 6)
        );
    }
);

mergePatchPairs
(
);

In such a way ten cells form one meter.
I would be grateful for your help.

Attachment 18086

Thanks!
Regards, FrolovOY

danvica January 11, 2013 02:21

Hi Frolov,
why you have such a high kinematic viscosity for alpha1 ?

Quote:

phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 10;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;

...
Regards,

michielm January 11, 2013 11:31

Quote:

Originally Posted by FrolovOY (Post 390119)
However, as seen in the following figure 1, the problem arises in that the channel width from 0 to 2 meters is not completely filled. In other words, alfa1 must equal 1 throughout the width of the section to the left of the front of the free surface.

Нow can I fix it? What I asked wrong in the boundary conditions?

There is two things that come to mind:
- have you tried using -1 to 3 instead of 0 to 2 in the setFieldsDict? Maybe the fact that you put it exactly on the boundary is the issue
- the other thing is indeed the extremely high viscosity (10000 Pas so 1E8 bigger than that of water) which might cause excessive wall drag therefore causing a sort of vena contracta type of behaviour

Edit: given the other properties you use I guess you meant to use the (kinematic) viscosity of whether. Which is 1e-6

FrolovOY January 21, 2013 01:25

Quote:

Originally Posted by danvica (Post 401316)
Hi Frolov,
why you have such a high kinematic viscosity for alpha1 ?



Regards,

Hi danvitsa. For alpha1 given such a large kinematic viscosity, because I'm trying to simulate a polymer flow in the channel. For example, High-density polyethylene (HDPE). Such polymers are characterized by high dynamic viscosity, namely 10e3 - 10e5 Pa * sec. Accordingly, the kinematic viscosity is set from 1 to 100 m2/sec.

FrolovOY January 21, 2013 01:59

2 Attachment(s)
Quote:

Originally Posted by michielm (Post 401416)
There is two things that come to mind:
- have you tried using -1 to 3 instead of 0 to 2 in the setFieldsDict? Maybe the fact that you put it exactly on the boundary is the issue
- the other thing is indeed the extremely high viscosity (10000 Pas so 1E8 bigger than that of water) which might cause excessive wall drag therefore causing a sort of vena contracta type of behaviour

Edit: given the other properties you use I guess you meant to use the (kinematic) viscosity of whether. Which is 1e-6

Hi michielm.
Following your advice, I expanded setFields borders on Y ((-1 -1 0) (3 4 1) ;), but it did not help.
Liquid with small kinematic viscosity (eg water) behaves well. See Figure 1. (Nu = 1.3 * 10e-6; deltaX = 0.05 m)
Attachment 18332
Figure 2 shows the flow of fluid with a high kinematic viscosity without gravity.
Attachment 18333
It is seen that during the motion between the fluid and the wall is formed air. But it is given no-slip condition?
Code:

upperWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    lowerWall
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

Maybe there are other settings in the boundary conditions that need to be considered?
Maybe to simulate motion of polymers or similar to them, there is another solver rather than interfoam?
How can I set the phase1 parameters (in my case, HDPE) for the non-Newtonian fluid in a file transportProperties? May be it is necessary to ask the contact angle in alpha1 file?

vonboett January 21, 2013 04:51

No slip means that at your boundary nothing moves, so it might be the air cant be pushed away here, although I didn't face that problem in my simulations. With low viscosity your cell center at the boundary probably gets an alpha1 value of liquid due to the high possible gradient in the phase interface, so you won't see the air in your longitudinal sections, but maybe you could check this if you look at the boundary itself in paraview, colored by cell values of alpha1, not by interpolated values.

The other more reasonable explanation would be that because you have no gravity there is no buoyancy to move the air upwards from the lower boundary, which could be the reason for the difference between your two simulations.

michielm January 25, 2013 05:27

Quote:

Originally Posted by vonboett (Post 403063)
No slip means that at your boundary nothing moves, so it might be the air cant be pushed away here, although I didn't face that problem in my simulations.......

Indeed this is a well-known problem in fluid dynamics of moving contact lines. With a perfectly sharp interface it would be impossible for the fluid-fluid interface to move at the wall, because of the no-slip condition. However, with VOF this is automatically solved because the alpha1 field in cells at the boundary can still be advected as long as the viscous stress allows it and the contact line location is adjusted according to that field, therefore removing the issue of a non-mobile contact line.

That said, for a sharp interface the viscous stress diverges at the contact line because of the no-slip condition and the rate of divergence is obviously worse when the viscosity of the fluid is higher. Therefore it might be (I am guessing a bit here), that the very high viscosity of your fluid causes the contact line to remain immobile, despite the diffuse interface.

What you could try to get rid of the stress singularity is to use a navier slip BC to see if that indeed makes the contact line mobile.

[EDIT] for a first try you can use the partialSlip BC, if it indeed works you can always implement the navier slip BC for more `logical' behaviour


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