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/)
-   -   Open channel Boundary Conditions (https://www.cfd-online.com/Forums/openfoam-pre-processing/180450-open-channel-boundary-conditions.html)

Milad Mohassel November 23, 2016 13:12

Open channel Boundary Conditions
 
Hi dear Foamers
I am trying to run an 2 phase flow in Version 2.4 since methods are changed from 2.3 for interFoam.
and I have problems with that.
1. my first problem is should I Split both outlet and inlet in to 2 face,(water and air separately)?
I caught the free surface (alpha.water) correctly but for Velocity I just Need the water velocity but air have non zero velocity too.
there is my U and alpha.water
any ideas?
thanks
the first 2 codes have 2 inlets
Code:

-*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.4.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    inlet-air
    {
        type            fixedValue;
        value          uniform 0;
    }

    inlet-water
    {
        type            fixedValue;
        value          uniform 1;

    }
    outlet
        {
    type        zeroGradient;

}

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

        walls
            {
          type            zeroGradient;

            }
        rib
            {
          type            zeroGradient;

            }
        front
            {
                type empty;
        };

        back
            {
                type empty;
        };
};

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.4.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (0.1 0 0);

boundaryField
{
inlet-air
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
   
    inlet-water
    {

      type      fixedValue;
        value    uniform (0.1 0 0);
 
    }

    outlet
      {
        //type      zeroGradient;
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
      }

    atmosphere
    {
        type            pressureInletOutletVelocity;
        value          uniform (0 0 0);
    }
   
  walls 
    {
      type            fixedValue;
    value          uniform (0 0 0);


    }

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

        front
            {
                type empty;
        };

        back
            {
                type empty;
        };
}

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.4.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


dimensions      [0 0 0 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    inlet//has changed from inlet-water & inlet-air to inlet
    {
      type            variableHeightFlowRate;
        lowerBound      0.0;
        upperBound      0.5;
        value          uniform 1;
 
    }

    outlet
        {
    //type        inletOutlet;
    //inletValue    uniform 0;
    type        zeroGradient;

     
        }


    atmosphere
        {
        type        inletOutlet;
            inletValue      uniform 0;//Like Spillway tut
                value          uniform 0;
        }

        walls
            {
          type            zeroGradient;

            }
        rib
            {
          type            zeroGradient;

            }
        front
            {
                type empty;
        };

        back
            {
                type empty;
        };
};


Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.4.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField  uniform (0.1 0 0);



boundaryField
{
        inlet
        {
              type            fixedValue;
            value          uniform (0.1 0 0);

        }


        outlet
        {
        type        zeroGradient;
     
        }


    atmosphere
        {
                type            pressureInletOutletVelocity;
              phi            phi;
                value          uniform (0 0 0);
        }

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


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

        front
            {
                type empty;
        };

        back
            {
                type empty;
        };

};


// ************************************************************************* //

at the end I use 0.9 for upper bound but I get nothing!
type variableHeightFlowRate;
lowerBound 0.0;
upperBound 0.9;
value uniform 1;

nimasam December 2, 2016 02:25

whats wrong?
the air has a motion :) becuase there is shear stress between phases.


All times are GMT -4. The time now is 12:10.