6

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

Wheel mesh

The wheel is a crucial section of the whole mesh. The blades are rather fine and need the mesh to be fine as well in order to catch the exact shape. For this reason we will use deeper subdivision for cells intersected by the blades’ surface geometry.

First of all we create the background mesh using blockMesh:

# blockMesh
We use exactly the same background mesh as in the case of inflow. After the background mesh is done, we continue by executing snappyHexMesh:

# snappyHexMesh
The program snappyHexMesh uses settings from the file system/snappyHexMeshDict, which is summarized in the listing below:

castellatedMesh true;
snap            true;
addLayers       false;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
    housing.obj
    {
        type triSurfaceMesh;
        name wheel_housing_wall;
    }
    wheel_disc1.obj
    {
        type triSurfaceMesh;
        name wheel_disc1_wall;
    }
    wheel_disc2.obj
    {
        type triSurfaceMesh;
        name wheel_disc2_wall;
    }
    wheel_blades.obj
    {
        type triSurfaceMesh;
        name wheel_blades_wall;
    }
    wheel_pivot.obj
    {
        type triSurfaceMesh;
        name wheel_pivot_wall;
    }
    wheel_pad.obj
    {
        type triSurfaceMesh;
        name wheel_pad_wall;
    }
    wheel_inlet.obj
    {
        type triSurfaceMesh;
        name wheel_inlet_2;
    }
    wheel_outlet.obj
    {
        type triSurfaceMesh;
        name wheel_outlet_1;
    }
};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

    // Refinement parameters
    // ~~~~~~~~~~~~~~~~~~~~~

    // If local number of cells is >= maxLocalCells on any processor
    // switches from from refinement followed by balancing
    // (current method) to (weighted) balancing before refinement.
    maxLocalCells 1000000;

    // Overall cell limit (approximately). Refinement will stop immediately
    // upon reaching this number so a refinement level might not complete.
    // Note that this is the number of cells before removing the part which
    // is not 'visible' from the keepPoint. The final number of cells might
    // actually be a lot less.
    maxGlobalCells 5000000;

    // The surface refinement loop might spend lots of iterations refining just a
    // few cells. This setting will cause refinement to stop if <= minimumRefine
    // are selected for refinement. Note: it will at least do one iteration
    // (unless the number of cells to refine is 0)
    minRefinementCells 0;

    // Number of buffer layers between different levels.
    // 1 means normal 2:1 refinement restriction, larger means slower
    // refinement.
    nCellsBetweenLevels 2;



    // Explicit feature edge refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
    );



    // Surface based refinement
    // ~~~~~~~~~~~~~~~~~~~~~~~~

    // Specifies two levels for every surface. The first is the minimum level,
    // every cell intersecting a surface gets refined up to the minimum level.
    // The second level is the maximum level. Cells that 'see' multiple
    // intersections where the intersections make an
    // angle > resolveFeatureAngle get refined up to the maximum level.

    refinementSurfaces
    {
        "(wheel_disc1_wall|wheel_disc2_wall|wheel_blades_wall|wheel_inlet_2)"
        {
            level (5 5);
            patchInfo
            {
                type wall;
            }
        }
        "(wheel_housing_wall|wheel_pivot_wall|wheel_pad_wall)"
        {
            level (3 3);
            patchInfo
            {
                type wall;
            }
        }
        wheel_outlet_1
        {
            level (4 4);
        }
    }

    resolveFeatureAngle 10;


    // Region-wise refinement
    // ~~~~~~~~~~~~~~~~~~~~~~

    // Specifies refinement level for cells in relation to a surface. One of
    // three modes
    // - distance. 'levels' specifies per distance to the surface the
    //   wanted refinement level. The distances need to be specified in
    //   descending order.
    // - inside. 'levels' is only one entry and only the level is used. All
    //   cells inside the surface get refined up to the level. The surface
    //   needs to be closed for this to be possible.
    // - outside. Same but cells outside.

    refinementRegions
    {
    }

    // Mesh selection
    // ~~~~~~~~~~~~~~

    // After refinement patches get added for all refinementSurfaces and
    // all cells intersecting the surfaces get put into these patches. The
    // section reachable from the locationInMesh is kept.
    // NOTE: This point should never be on a face, always inside a cell, even
    // after refinement.
    // This is an outside point locationInMesh (-0.033 -0.033 0.0033);
    locationInMesh (0 0 0.0055); // Inside point

    // Whether any faceZones (as specified in the refinementSurfaces)
    // are only on the boundary of corresponding cellZones or also allow
    // free-standing zone faces. Not used if there are no faceZones.
    allowFreeStandingZoneFaces true;
}

The first section of the file, geometry, specifies all surface files that will be used to contain the computational mesh. Apart from walls (i.e. blades and other parts of the wheel) there are also supplementary boundaries wheel_inlet and wheel_outlet (with some indices). As noted before, wheel_inlet is the interface between the wheel region and the inflow region, and wheel_outlet is the interface between the wheel region and the volute region.

fan wheel interface

Figure: Wheel interfaces: wheel_inlet in purple, wheel_outlet in blue.

The next section, castellatedMeshControls, specifies refinement levels for all boundary geometries. We set the refinement level to 3 at outer walls, to 4 at the purple interface and to 5 on all other patches. For this particular geometry it leads to a satisfactory mesh (the blue part of figure crossref 2).

The rotation of the wheel can be simulated in several ways. Both methods explained in this manual (MRF and SBM) require prior selection of the rotating region as a cell zone. Cell zone is a set of cells that can be used for some tasks and is conserved in operations that change the mesh (like mergeMesh). Thanks to the splitting of the mesh into the three regions all we need to do is to select all cells of the wheel region. This is done by topoSet.

# topoSet
The utility topoSet uses settings in system/topoSetDict:

actions
(
    {
        name    rotorMRFSet;
        type    cellSet;
        action  clear;
    }
    {
        name    rotorMRFSet;
        type    cellSet;
        action  invert;
    }
    {
        name    rotorMRFZone;
        type    cellZoneSet;
        action  new;
        source  setToCellZone;
        sourceInfo
        {
            set rotorMRFSet;
        }
    }
);

The first action of the dictionary clears the set rotorMRFSet, the second action inverts the set (selects all cells) and the last action converts the set to a cell zone.