CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   bubbleFoam validation case (http://www.cfd-online.com/Forums/openfoam-solving/79302-bubblefoam-validation-case.html)

balkrishna August 19, 2010 06:09

bubbleFoam validation case
 
I faced the following difficulty.
I switch off the dispersed phase volume fraction at inlet . That is inlet alpha = uniform 0 and also the dispersed phase velocity . I keep my continuous phase velocity Ub = 0.1 m/s . Continuous properties are rho = 1000 kg/m3 , nu = 1e-06 m2/s . This means now i am studying single phase flow . I compared the results to simpleFoam results and have found a problem with the velocity plots in the plane z=0.2 on the same timestep . Specifically on the line joining (0 0.5 0.2) and (1 0.5 0.2) . Can someone help me resolve this issue ....
My blockMeshDict is as follows :
Code:

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

convertToMeters 1;

vertices       
(
 (0 0 0)
 (0.25 0 0)
 (0.25 0.25 0)
 (0 0.25 0)
 (0 0.75 0)
 (0.25 0.75 0)
 (0 1 0)
 (0.25 1 0)
 (0.75 0 0)
 (0.75 0.25 0)
 (1 0 0)
 (1 0.25 0)
 (0.75 0.75 0)
 (1 0.75 0)
 (0.75 1 0)
 (1 1 0)

 (0 0 2)
 (0.25 0 2)
 (0.25 0.25 2)
 (0 0.25 2)
 (0 0.75 2)
 (0.25 0.75 2)
 (0 1 2)
 (0.25 1 2)
 (0.75 0 2)
 (0.75 0.25 2)
 (1 0 2)
 (1 0.25 2)
 (0.75 0.75 2)
 (1 0.75 2)
 (0.75 1 2)
 (1 1 2)
 
);

blocks         
(
 hex (0 1 2 3 16 17 18 19) (10 10 10) simpleGrading (1 1 1)
 hex (3 2 5 4 19 18 21 20) (10 10 10) simpleGrading (1 1 1)
 hex (4 5 7 6 20 21 23 22) (10 10 10) simpleGrading (1 1 1)
 hex (1 8 9 2 17 24 25 18) (10 10 10) simpleGrading (1 1 1)
 hex (2 9 12 5 18 25 28 21) (10 10 10) simpleGrading (1 1 1)
 hex (5 12 14 7 21 28 30 23) (10 10 10) simpleGrading (1 1 1)
 hex (8 10 11 9 24 26 27 25) (10 10 10) simpleGrading (1 1 1)
 hex (9 11 13 12 25 27 29 28) (10 10 10) simpleGrading (1 1 1)
 hex (12 13 15 14 28 29 31 30) (10 10 10) simpleGrading (1 1 1)
 );

edges         
(
);

patches       
(
 patch inlet (
              (2 5 12 9)
              )

 patch outlet (
              (16 19 18 17)
              (19 20 21 18)
              (20 22 23 21)
              (17 18 25 24)
              (18 21 28 25)
              (21 23 30 28)
              (24 25 27 26)
              (25 28 29 27)
              (28 30 31 29)
             
                      )

  wall fixedWalls
    (
    (0 16 19 3)
    (3 19 20 4)
    (4 20 22 6)
    (6 22 23 7)
    (7 23 30 14)
    (14 30 31 15)
    (15 31 29 13)
    (13 29 27 11)
    (11 27 26 10)
    (10 26 24 8)
    (8 24 17 1)
    (1 17 16 0)
    (0 3 2 1)
    (3 4 5 2)
    (4 6 7 5)
    (5 7 14 12)
    (12 14 15 13)
    (9 12 13 11)
    (8 9 11 10)
    (1 2 9 8)
    )


   
);

mergePatchPairs
(
);

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

The velocity plots are on this page .... https://sites.google.com/site/balkrishnanitt/

alberto August 20, 2010 02:09

How is the model set up in bubbleFoam? Are you using the turbulence model or performing a laminar simulation?

Best,

balkrishna August 20, 2010 02:12

I am performing a laminar simulation .

alberto August 20, 2010 02:23

Ignore my previous answer (removed). I generated the mesh, and run the case, noticing you have an expansion. Could you post your case setup?

balkrishna August 20, 2010 02:52

Thanks for the reply ...
I was unable to place an image of the mesh in the post ... I have uploaded the image of the mesh on the link ... Sorry for the inconvienience ....

Secondly , I am not seeking convergence ... All that I am saying is if I switch off my dispersed phase , my equations reduce to those solved by simpleFoam and hence should give the same results at the same time on the same mesh .

Do clarify me if I am wrong somewhere ....

balkrishna August 20, 2010 03:20

Case setup
 
Alpha :
Code:

/*--------------------------------*- C++ -*----------------------------------* \
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
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 0;
    }

    outlet         
    {
      type            zeroGradient;
    }

    fixedWalls         
    {
        type            zeroGradient;
    }


}

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

Pressure
Code:

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

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

internalField  uniform 0;
boundaryField
{
    inlet
    {
        type            zeroGradient;
    }

    outlet
    {
        type            fixedValue;
        value          uniform 0;
    }

    fixedWalls
    {
        type            buoyantPressure;
        value          uniform 0;
    }

    defaultFaces
    {
        type            empty;
    }
}

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

Ub velocity of continuous phase
Code:

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

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

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

    outlet         
    {
      type            zeroGradient;
    }

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


}

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

Ua velocity of dispersed phase
Code:

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

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

internalField  uniform (0 0 0) ;

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

    outlet         
    {
      type            zeroGradient;
    }

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


}

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

k
Code:

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

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 1e-8;

boundaryField
{
    inlet         
    {
        type            fixedValue;
        value          uniform 1e-8;
    }

    outlet         
    {
        type            inletOutlet;
        inletValue      uniform 1e-8;
        value          uniform 1e-8;
    }

    fixedWalls         
    {
        type            zeroGradient;
    }

    defaultFaces   
    {
        type            empty;
    }
}

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

epsilon
Code:

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

dimensions      [0 2 -3 0 0 0 0];

internalField  uniform 0.1;

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

    outlet         
    {
      type      zeroGradient;   
    }

    fixedWalls         
    {
        type            zeroGradient;
    }

   
}

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

controlDict
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application    bubbleFoam;

startFrom      startTime;

startTime      0;

stopAt          endTime;

endTime        2;

deltaT          0.001;

writeControl    runTime;

writeInterval  0.5;

purgeWrite      0;

writeFormat    ascii;

writePrecision  6;

writeCompression uncompressed;

timeFormat      general;

timePrecision  6;

runTimeModifiable yes;


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

fvSchemes
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;
    div(phia,Ua)    Gauss limitedLinearV 1;
    div(phib,Ub)    Gauss limitedLinearV 1;
    div(phib,k)    Gauss limitedLinear 1;
    div(phib,epsilon) Gauss limitedLinear 1;
    div(phi,alpha)  Gauss limitedLinear01 1;
    div((-nuEffa*grad(Ua).T())) Gauss linear;
    div((-nuEffb*grad(Ub).T())) Gauss linear;
}

laplacianSchemes
{
    default        none;
    laplacian(nuEffa,Ua) Gauss linear corrected;
    laplacian(nuEffb,Ub) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}


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

fvSolution
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-10;
        relTol          0;
    }

    Ua
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0;
    }

    Ub
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0;
    }

    alpha
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-10;
        relTol          0;
    }

    beta
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-10;
        relTol          0;
    }

    k
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0;
    }

    epsilon
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-05;
        relTol          0;
    }
}

PISO
{
    nCorrectors    2;
    nNonOrthogonalCorrectors 0;
    nAlphaCorr      2;
    correctAlpha    no;
    pRefCell        0;
    pRefValue      0;
}


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

g
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      uniformDimensionedVectorField;
    location    "constant";
    object      g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -2 0 0 0 0];
value          ( 0 0 -9.81  );


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

RASProperties
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      RASProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

RASModel        laminar;

turbulence      off;

printCoeffs    off;


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

transportProperties
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

rhoa            rhoa [ 1 -3 0 0 0 0 0 ] 1;

rhob            rhob [ 1 -3 0 0 0 0 0 ] 1000;

nua            nua [ 0 2 -1 0 0 0 0 ] 1.6e-05;

nub            nub [ 0 2 -1 0 0 0 0 ] 1e-06;

da              da [ 0 1 0 0 0 0 0 ] 0.003;

db              db [ 0 1 0 0 0 0 0 ] 0.0001;

Cvm            Cvm [ 0 0 0 0 0 0 0 ] 0.5;

Cl              Cl [ 0 0 0 0 0 0 0 ] 0;

Ct              Ct [ 0 0 0 0 0 0 0 ] 1;


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


alberto August 20, 2010 03:47

You are correct. The result should be the same.

Did you use the same numerical schemes and the same tolerances in the linear solvers also in simpleFoam?

Also, set to zero the lift (Cl), virtual mass coefficients (Cvm) and Ct (not necessary in theory, since bubbleFoam uses a formulation depending on alpha, so these term should be zero automatically).

Best,
Alberto

balkrishna August 20, 2010 03:50

Will recheck on the same .... Thanks for the help ...

balkrishna August 20, 2010 04:38

Yes checked it .... the schemes are the same ....

balkrishna August 20, 2010 05:17

But they should not matter as alpha or the dispersed phase is 0 . Those equations are written for the dispersed phase ....

alberto August 20, 2010 12:32

Yes that's correct. I was just removing everything term that makes the two equations different.

The only additional difference I see in your files is g. There is no g in simpleFoam.

Best,

balkrishna August 20, 2010 12:34

inclusion of g is only going to affect the pressure contours ... not the velocity plots ...
thanks ...

alberto August 20, 2010 12:45

I did not imply this is going to cause a difference in the velocity plot, just that the only physical element of difference is that one in the equations.

The difference in the two solutions is located essentially at the walls, and the rest of the profile adapts as a consequence.

At what tolerance is the solution converged? Would you share a case so I can take a look at it (I sent my email address if you cannot upload)?

Best,

alberto August 20, 2010 16:36

1 Attachment(s)
Since I was a bit puzzled by the problem, because I did a similar validation in the past, I run a simpler case of a flow between two parallel plates.

You find the cases here: http://dl.dropbox.com/u/659842/bubbl...bleFoam.tar.gz

And as you can see in the attached picture, the velocity profiles are identical.

Best,

balkrishna August 21, 2010 03:15

your test case works great . have you found any problem in my case setup ?

alberto August 21, 2010 03:33

Hi,

the case you sent me stops at 2 seconds, which is not enough for the solution to reach convergence. You might want to run the case with a larger time step (0.1 for example, or a bit smaller if you want residuals to be low) until t = 1000.

Additionally, the contour plots show quite a clear influence of the mesh on the solution, mainly due to the non-uniformity and the jumps in grid size between the different blocks.

I hope this helps.

Best,

balkrishna August 27, 2010 03:40

modifying bubbleFoam
 
I wish to modify bubble Foam of 2 phases to n phase and add heat transfer and species mixing to it .. One stumbling block i came across was the way the alpha equation was programmed .
it consists of the following line in the header file alphaEqn.H
Code:

word scheme("div(phi,alpha)");

    surfaceScalarField phir = phia - phib;

This means they perform the phase calculation as stated in the wiki here . How does one extend the relative flux to n phase ...

alberto August 27, 2010 03:50

Silva and Lage did it and have a conference paper on this topic. Check your email :-)

balkrishna August 27, 2010 04:00

thanks a lot ..... :)

balkrishna August 30, 2010 01:46

Thanks for the link .... Can i get the source code of the solver ?? The implementation of the algorithm is the tough aspect in OpenFOAM .....


All times are GMT -4. The time now is 13:57.