2 2

Next: Model setting without an Up: Alternative formulation Previous: Alternative formulation   Contents   Index

File blockMeshDict

  • Let us go through the file:
    # less $FOAM_RUN/icoFoam/cavity/constant/polyMesh/blockMeshDict
    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  2.2.1                                 |
    |   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        object      blockMeshDict;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
  • Header of OpenFOAM file
    convertToMeters 0.1;
    
  • Parameter convertToMeters allows the whole mesh scaling

     

    vertices        
    (
        (0 0 0)
        (1 0 0)
        (1 1 0)
        (0 1 0)
        (0 0 0.1)
        (1 0 0.1)
        (1 1 0.1)
        (0 1 0.1)
    );
    
  • In section vertices there are written coordinates (points) of blocks of the mesh

     

    blocks          
    (
        hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
    );
    
  • In section blocks there are defined all blocks of the mesh; hex(0 1 2 3 4 5 6 7) (20 20 1) means hexahedral of eight vertices (0-7) according to order in vertices. The block is divided into 20 x 20 x 1 cells
  • Parameter simpleGrading allows refinement setting in directions (x y z)
    (1 1 1) = means uniform distribution in all directions

     

    edges           
    (
    );
    
  • In section edges there are defined edges connecting block vertices
  • If not specified otherwise, blockMesh uses lines

     

    boundary
    (
        movingWall
        {
            type wall;
            faces
            (
                (3 7 6 2)
            );
        }
        fixedWalls
        {
            type wall;
            faces
            (
                (0 4 7 3)
                (2 6 5 1)
                (1 5 4 0)
            );
        }
        frontAndBack
        {
            type empty;
            faces
            (
                (0 3 2 1)
                (4 5 6 7)
            );
        }
    );
    
  • In section patches there are defined types of boundaries

     

    mergePatchPairs 
    (
    );
    
    // ************************************************************************* //
    
  • In section mergePatchPairs there are defined boundaries to be merged
  • Basic types of boundaries in OpenFOAM are shown in following table:
    boundary typepurpose
    patchgeneral boundary
    symmetryPlanesymmetry
    emptyempty, useful for 2D computations
    wedgeaxis symmetry
    cycliccyclic (periodic) boundary
    wallwall
    processorinter-processor boundary (parallel computations)