CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [blockMesh] Flow in pipe with porous region - How to define cellzone? (https://www.cfd-online.com/Forums/openfoam-meshing/171818-flow-pipe-porous-region-how-define-cellzone.html)

g7fernandes May 17, 2016 12:11

Flow in pipe with porous region - How to define cellzone?
 
I am new OpenFoam user I want to do something very simple:
There is a 2d pipe and in the middle there is a porous wall.
I used blockmesh with 3 blocks with equal sizes and the block in the middle should be the porous media.

How do I indicate to OpenFoam that there is a porous region?

I read about CellZone and Setset, but I can't find exactly what must I write and were :confused:

I'm using porousSimpleFoam and blockMesh.

If someone has the codes for such simulation to share, I and the Internet will be very thankfull to you and many people in the future will love you.

The "tutorials" that come with openFoam are very unclear.

Antimony May 17, 2016 20:52

Hi,

Look at the topoSet utility: https://github.com/OpenFOAM/OpenFOAM...et/topoSetDict

You can define your cellZone using that. There are multiple options: boxToCell, cylinderToCell etc that you can use to get your cellZone.

Cheers,
Antimony

g7fernandes May 18, 2016 08:22

Thank you for your reply!

I created the file topoSetDict and I put it in /system

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;
    object      topoSetDict;
}


actions
(
    // Load initial cellSet
    {
        name    porosity;
        type    cellSet;
        action  new;
        source boxToCell;
        sourceInfo
        {
            box (20 0 0) (40 20 1);
        }
    }
);


With this mesh
Code:


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

convertToMeters 0.001;

vertices  // points in the flow space
(
    (0 0 0)  // 0
    (20 0 0)  // 1
    (20 20 0)  // 2
    (0 20 0)  // 3
    (0 0 1)  // 4
    (20 0 1)  // 5
    (20 20 1)  // 6
    (0 20 1)  // 7
    (40 0 0)  // 8
    (40 20 0)  // 9
    (40 0 1)  // 10
    (40 20 1)  // 11
    (60 0 0)  // 12
    (60 20 0)  // 13
    (60 0 1)  // 14
    (60 20 1)  // 15
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (30 30 1)

// the order of the numbers in hex ( ) defines the vertices of the tetrahedron (region of flow)
// Important: The first two digits in hex ( ) defines x-direction, the first and the third
//            defines the Y, and the first and the fifth defines the Z

    simpleGrading (1 1 1)  //defines the grid

    hex (1 8 9 2 5 10 11 6) (30 30 1)
    simpleGrading (1 1 1)  //defines the grid

    hex (8 12 13 9 10 14 15 11) (30 30 1)
    simpleGrading (1 1 1)  //defines the grid

);   

edges  // used in the case of drawing curves
(
);

boundary  // names the faces
(
    inlet
    {
        type patch;
        faces
        (
            (0 3 4 7)  //face determinated by this vertices is the inlet
        );
    }


    outlet
    {
        type patch;
        faces
        (
            (12 13 15 14)
        );
    }

    walls
    {
        type wall;
        faces
        (
            (0 1 5 4)
            (2 3 6 7)
            (8 12 14 10)
            (9 13 11 15)
        );
    }   

    porosityWall
    {
        type wall;
        faces
        (
            (1 8 5 10) //
            (2 9 6 11) //
        );
    }

    frontAndBack
    {
        type empty;
        faces
        (
            (0 3 2 1)
            (4 5 6 7)
            (5 10 11 6)
            (1 8 9 2)
            (8 12 13 9)
            (10 14 15 11)
        );
    }

);

mergePatchPairs
(
);

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


but I get this error when I run porousSimpleFoam

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  3.0.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 3.0.1-119cac7e8750
Exec  : porousSimpleFoam
Date  : May 18 2016
Time  : 14:12:17
Host  : "ubuntu-mate-1510"
PID    : 29189
Case  : /home/ofuser/OpenFOAM/ofuser-3.0.1/run/sq_porous
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


SIMPLE: no convergence criteria found. Calculations will run for 100 steps.

Reading field p

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RAS
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
    Cmu            0.09;
    C1              1.44;
    C2              1.92;
    C3              -0.33;
    sigmak          1;
    sigmaEps        1.3;
}

No MRF models present

Creating porosity model list from porosityProperties

Porosity region porosity1:
    selecting model: DarcyForchheimer
    creating porous zone: porosity


--> FOAM FATAL ERROR:
cannot find porous cellZone porosity

    From function Foam::porosityModel::porosityModel(const Foam::word&, const Foam::word&, const Foam::fvMesh&, const Foam::dictionary&, const Foam::word&)
    in file cfdTools/general/porosityModel/porosityModel/porosityModel.C at line 121.

FOAM exiting

What I'm doing wrong?

Antimony May 18, 2016 08:56

Hi,

At the moment it is still a cellSet, not a cellZone. You will need to do one more step in your topoSet to get that. Look for setToCellZone to do the conversion.

Hope this helps.

Cheers,
Antimony


All times are GMT -4. The time now is 03:31.