CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   problem in running icoFoam (http://www.cfd-online.com/Forums/openfoam/98688-problem-running-icofoam.html)

Alucard March 16, 2012 06:34

problem in running icoFoam
 
Good morning I'm dealing with a "simple" problem:
A cylindrical gemoetry where the fluid enters from two lateral openings and flows out from a small central tube.

The reynolds has to be small (i'm doing some parametric study in the range [0:20] with Reynolds defined as:
Re=UR/v v=cinematic viscosity, R= external radius of the geometry and U the inlet horizontal velocity (supposed constant).

Well the boundary conditions are simply an exit (imposed pression value ) at the bottom of the small pipe and an inlet radial velocity. On the top I put a symetry condition
icoFoam doesn"t converge in any case also for a Stokes case ( I removed the convective terms in the momentum equations)...so i think i'm doing something stupid with the mesh.

Can someone help me?
Thank you!


here I copy the blockMeshDict (i copied and modified this file from an ancient discussion: http://www.cfd-online.com/Forums/ope...nder-mesh.html)
HTML Code:

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


// * * * * * * * * * * * * * * * * * * * * * * * * * *//
//meshGenApp blockMesh;
convertToMeters 0.017677664;
vertices
(
( 1.0 -1.0 -15.0) //0
( 1.0 1.0 -15.0)
( -1.0 1.0 -15.0)
( -1.0 -1.0 -15.0)

( 1.0 -1.0 -2.0) //4
( 1.0 1.0 -2.0)
( -1.0 1.0 -2.0)
( -1.0 -1.0 -2.0)

( 3.0 -3.0 0.0) //8
( 3.0 3.0 0.0)
( -3.0 3.0 0.0)
( -3.0 -3.0 0.0)

/*( 6.0 -6.0 0.0) //12
( 6.0 6.0 0.0)
( -6.0 6.0 0.0)
( -6.0 -6.0 0.0)
*/
( 40.0 -40.0 0.0) //12
( 40.0 40.0 0.0)
( -40.0 40.0 0.0)
( -40.0 -40.0 0.0)

( 3.0 -3.0 20.0) //16
( 3.0 3.0 20.0)
( -3.0 3.0 20.0)
( -3.0 -3.0 20.0)

( 40.0 -40.0 20.0) //20
( 40.0 40.0 20.0)
( -40.0 40.0 20.0)
( -40.0 -40.0 20.0)


/*( 6.0 -6.0 10.0) //20
( 6.0 6.0 10.0)
( -6.0 6.0 10.0)
( -6.0 -6.0 10.0)
*/
);
blocks
(
/*hex (0 1 2 3 4 5 6 7) (20 20 15) simpleGrading (1 1 1)        // tubo
hex (4 5 6 7 8 9 10 11) (20 20 10) simpleGrading (1 1 1)      //raccordo
hex (8 9 10 11 16 17 18 19) (20 20 50) simpleGrading (1 1 1)  //raccordo riportato fino in alto
hex (14 10 9 13 22 18 17 21) (30 20 50) simpleGrading (3 1 1) //
hex (15 11 10 14 23 19 18 22) (30 20 50) simpleGrading (3 1 1)//
hex (12 8 11 15 20 16 19 23) (30 20 50) simpleGrading (3 1 1) //
hex (13 9 8 12 21 17 16 20) (30 20 50) simpleGrading (3 1 1)  //
*/

hex (0 1 2 3 4 5 6 7) (40 40 80) simpleGrading (1 1 1)        // tubo
hex (4 5 6 7 8 9 10 11) (40 40 80) simpleGrading (1 1 1)      //raccordo
hex (8 9 10 11 16 17 18 19) (40 40 100) simpleGrading (1 1 1)  //raccordo riportato fino in alto
hex (14 10 9 13 22 18 17 21) (60 40 100) simpleGrading (0.2 1 1) //
hex (15 11 10 14 23 19 18 22) (60 40 100) simpleGrading (0.2 1 1)//
hex (12 8 11 15 20 16 19 23) (60 40 100) simpleGrading (0.2 1 1) //
hex (13 9 8 12 21 17 16 20) (60 40 100) simpleGrading (0.2 1 1)  //

);
edges
(
arc 2 1 (0.0 1.414214 -15.0)
arc 1 0 (1.414214 0.0 -15.0)
arc 0 3 (0.0 -1.414214 -15.0)
arc 3 2 (-1.414214 0.0 -15.0)
arc 6 5 (0.0 1.414214 -2.0)
arc 5 4 (1.414214 0.0 -2.0)
arc 4 7 (0.0 -1.414214 -2.0)
arc 7 6 (-1.414214 0.0 -2.0)
arc 10 9 (0.0 4.242641 0.0)
arc 9 8 (4.242641 0.0 0.0)
arc 8 11 (0.0 -4.242641 0.0)
arc 11 10 (-4.242641 0.0 0.0)
/*arc 14 13 (0.0 8.485281 0.0)
arc 13 12 (8.485281 0.0 0.0)
arc 12 15 (0.0 -8.485281 0.0)
arc 15 14 (-8.485281 0.0 0.0)
*/
arc 14 13 (0.0 56.56856 0.0)
arc 13 12 (56.56856 0.0 0.0)
arc 12 15 (0.0 -56.56856 0.0)
arc 15 14 (-56.56856 0.0 0.0)

arc 18 17 (0.0 4.242641 20.0)
arc 17 16 (4.242641 0.0 20.0)
arc 16 19 (0.0 -4.242641 20.0)
arc 19 18 (-4.242641 0.0 20.0)
/*arc 22 21 (0.0 8.485281 10.0)
arc 21 20 (8.485281 0.0 10.0)
arc 20 23 (0.0 -8.485281 10.0)
arc 23 22 (-8.485281 0.0 10.0)
*/

arc 22 21 (0.0 56.56856 20.0)
arc 21 20 (56.56856 0.0 20.0)
arc 20 23 (0.0 -56.56856 20.0)
arc 23 22 (-56.56856 0.0 20.0)
);

patches
(
patch outlet
(
(0 3 2 1)
)
patch symmetry
(
(16 17 18 19)
(17 21 22 18)
(18 22 23 19)
(20 16 19 23)
(20 21 17 16)
)

patch inlet1
(
(14 15 23 22)
)
patch inlet2
(
(13 12 20 21)
)

patch walls
(
(13 14 22 21) //lat walls
(15 12 20 23) //lat walls

(12 13 9 8) //bottom walls
(13 14 10 9) //bottom walls
(14 15 11 10) //bottom walls
(15 12 8 11) //bottom walls

(4 5 9 8)
(5 6 10 9)
(6 7 11 10)
(7 4 8 11)

(0 1 5 4)
(1 2 6 5)
(2 3 7 6)
(3 0 4 7)

)

);
mergePatchPairs
(
);

And for U and p:
HTML Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.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 0 0);

boundaryField
{
    inlet1
    {
        type            fixedValue;
        value          uniform (1. 0 0);
    }
    inlet2
    {
        type            fixedValue;
        value          uniform (-1. 0 0);
    }
    walls
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }
    symmetry
    {
        type            zeroGradient;
//        type            fixedValue;
//        value          uniform (0 0 0);

    }

    outlet
    {
        type            zeroGradient;
    }

 
}

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

HTML Code:

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

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

internalField  uniform 0;

boundaryField
{
    inlet1
    {
        type            zeroGradient;
    }
    inlet2
    {
        type            zeroGradient;
    }
    symmetry
    {
        type            zeroGradient;
    }

    walls
    {
        type            zeroGradient;
    }


    outlet
    {
        type            fixedValue;
        value          uniform 0;
    }

}

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


niaz March 17, 2012 09:50

plz copy your error firstly.

Alucard March 17, 2012 10:01

Quote:

Originally Posted by niaz (Post 349976)
plz copy your error firstly.

Hello,
Im still working on that and now everything it's fine (I did everything again from 0) , thanks anyway:)
Just to be "useful" for someone else I'll copy the mesh file I've done (and that now is working). The mesh size has to be "calibrated between the parts but everything it's fine now).

HTML Code:

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

/*-----------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.3 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*-----------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object blockMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * *//
//meshGenApp blockMesh;
convertToMeters 0.01;
vertices
(



( 5.0 0 0) //0   
( 0 5.0 0)
( -5.0 0 0)
( 0 -5.0 0)

( 5.0 0 50.) //4   
( 0 5.0 50.)
( -5.0 0 50.)
( 0 -5.0 50.)


( 10. 0 0) //8 
( 0 10. 0)
( -10. 0 0)
( 0 -10. 0)

( 10. 0 50.) //12   
( 0 10. 50.)
( -10. 0 50.)
( 0 -10. 50.)

( 5.0 0 -50) //16   
( 0 5.0 -50)
( -5.0 0 -50)
( 0 -5.0 -50)

( 10. 0 -50) //20   
( 0 10. -50)
( -10. 0 -50)
( 0 -10. -50)

( 100. 0 0) //24   
( 0 100. 0)
( -100. 0 0)
( 0 -100. 0)

( 100. 0 50) //28   
( 0 100. 50)
( -100. 0 50)
( 0 -100. 50)

);
blocks
(
// pipe
hex (0 1 2 3 4 5 6 7) (30 30 60) simpleGrading (1 1 2)
hex (0 8 9 1 4 12 13 5) (30 30 60) simpleGrading (1 1 2)  //1st quater
hex (1 9 10 2 5 13 14 6) (30 30 60) simpleGrading (1 1 2)  //2nd quater
hex (2 10 11 3 6 14 15 7) (30 30 60) simpleGrading (1 1 2) //3rd quater
hex (0 3 11 8 4 7 15 12) (30 30 60) simpleGrading (1 1 2)  //4th quater
//internal part of the domain
hex (16 17 18 19 0 1 2 3) (30 30 60) simpleGrading (1 1 1)
hex (16 20 21 17 0 8 9 1) (30 30 60) simpleGrading (1 1 1)  //1st quater
hex (17 21 22 18 1 9 10 2) (30 30 60) simpleGrading (1 1 1)  //2nd quater
hex (18 22 23 19 2 10 11 3) (30 30 60) simpleGrading (1 1 1) //3rd quater
hex (16 19 23 20 0 3 11 8) (30 30 60) simpleGrading (1 1 1)  //4th quater*/
// external part of the domain
hex (8 24 25 9 12 28 29 13) (60 30 60) simpleGrading (7 1 2)  //1st quater
hex (9 25 26 10 13 29 30 14) (60 30 60) simpleGrading (7 1 2)  //2nd quater
hex (10 26 27 11 14 30 31 15) (60 30 60) simpleGrading (7 1 2) //3rd quater
hex (11 27 24 8 15 31 28 12) (60 30 60) simpleGrading (7 1 2)  //4th quater


);
edges
(
 
arc 8 9    (7.071067812 7.071067812 0.0)  //1st quater
arc 12 13  (7.071067812 7.071067812 50.0) //1st quater
arc 20 21  (7.071067812 7.071067812 -50.0) //1st quater

arc 9 10  (-7.071067812 7.071067812 0.0)  //2nd quater
arc 13 14  (-7.071067812 7.071067812 50.0) //2nd quater
arc 21 22  (-7.071067812 7.071067812 -50.0) //2nd quater

arc 10 11  (-7.071067812 -7.071067812 0.0) //3rd quater
arc 14 15  (-7.071067812 -7.071067812 50.0) //3rd quater
arc 22 23  (-7.071067812 -7.071067812 -50.0) //3rd quater

arc 11 8  (7.071067812 -7.071067812 0.0)  //4th quater
arc 15 12  (7.071067812 -7.071067812 50.0) //4th quater
arc 23 20  (7.071067812 -7.071067812 -50.0) //4th quater

//******** EXTERNAL PART *********************************
arc 24 25  (70.71067812 70.71067812 0) //1st quater
arc 28 29  (70.71067812 70.71067812 50.0) //1st quater

arc 25 26  (-70.71067812 70.71067812 0.0)  //2nd quater
arc 29 30  (-70.71067812 70.71067812 50.0) //2nd quater

arc 26 27  (-70.71067812 -70.71067812 0.0) //3rd quater
arc 30 31  (-70.71067812 -70.71067812 50.0) //3rd quater

arc 27 24  (70.71067812 -70.71067812 0.0)  //4th quater
arc 31 28  (70.71067812 -70.71067812 50.0) //4th quater



);


boundary
(
    inlet1
    {
        type patch;
        faces
        (
            (24 25 29 28)
           
        );
    }

    inlet2
    {
        type patch;
        faces
        (
        (26 27 31 30)
           
        );
    }

    outlet
    {
        type patch;
        faces
        (

      //  exit of the pipe
        (16 17 18 19)
        (16 20 21 17)
        (17 21 22 18)
        (18 22 23 19)
        (19 23 20 16)
     

        );
    }

    symmetry
    {
        type patch;
        faces
        (

              // top faces
        (12 28 29 13)
        (13 29 30 14)
        (14 30 31 15)
        (12 15 31 28)

        (4 12 13 5)
        (5 13 14 6)
        (6 14 15 7)
        (4 7 15 12)
        (4 5 6 7)

        );
    }



    fixedWalls
    {
        type wall;
        faces
        (
        (25 26 30 29) //lat walls
        (27 24 28 31)

 
        (8 24 25 9)
        (9 25 26 10)
        (10 26 27 11)
        (11 27 24 8)

        // lateral draining pipe walls
        (9 8 20 21)
        (10 9 21 22)
        (11 10 22 23)
        (8 11 23 20)
       
        );

    }

);


mergePatchPairs
(
);





All times are GMT -4. The time now is 08:48.