6

Next: Inflow mesh Up: Mesh Generation using snappyHexMesh Previous: Mesh Generation using snappyHexMesh   Contents   Index

Background mesh

Although we want to prepare three different meshes for three regions “inflow”, “wheel” and “volute”, the background mesh can stay the same for all of them. The background mesh is composed from hexahedrons and it is created by the simple meshing utility blockMesh.

# blockMesh

Settings for blockMesh are given in the following listing of the file constant/polyMesh/blockMeshDict.

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

convertToMeters 1;

vertices
(
    (-3 -1 -2)  // 0
    ( 1 -1 -2)  // 1
    ( 1  1 -2)  // 2
    (-3  1 -2)  // 3
    (-3 -1  0.5)  // 4
    ( 1 -1  0.5)  // 5
    ( 1  1  0.5)  // 6
    (-3  1  0.5)  // 4
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (40 20 30) simpleGrading (1 1 1)
);

boundary
(
    outflow_outlet
    {
        type    patch;
        faces
        (
            (0 4 7 3)
        );
    }
    
    inflow_inlet
    {
        type    patch;
        faces
        (
            (0 3 2 1)
        );
    }
);

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

There are only two patches specified in the boundary section – inflow_inlet and outflow_outlet. The rest of the boundry faces will be assigned to the patch defaultFaces. The dimensions of the boundary mesh are chosen in such a way that the patches inflow_inlet and outflow_outlet will cut the artificially prolonged inflow and outflow tubes. Those cuts will then become the final inlet and outlet patches, see figure crossref 2.

fan bgmesh

Figure: Background mesh common to all regions.