Thursday 22 May 2014

Fans, actuator disks & snappyHexMesh

Meshing

Dear old snappy offers the ability these days of generating a baffle in one swell foop.  Makes life much easier if you want to generate a mesh with an actuator disk, no?  Just add the following bits in the refinementSurfaces section of snappyHexMeshDict (assuming that you have of course generated and imported the appropriate stl surface)

        disk
        {
        level (6 6);
        faceZone disk;
        faceType baffle;
        }


and Robert will be your mother's proverbial brother.  Well, yes and no.  This will indeed generate a baffle, with the necessary wall-related information for two boundaries, disk and disk_slave, in the boundary file.  If what you wanted was a baffle, this would be fine.  But if what you really wanted was a set of cyclic patches with a pressure jump, this does not work.  There are two steps that need to be taken to set up the cyclic patches, and these won't work with two matching baffle surfaces.

It turns out that the simple answer here is simply to remove the faceType baffle; statement, so that you are left with:
        disk
        {
        level (6 6);
        faceZone disk;
        }


This will mesh to the disk surface, but not assign any boundary faces, although disk and disk_slave will still show up in the boundary file.

createPatch

The above snappyHexMesh process will, with a bit of luck, have provided a faceZone called disk, and this can be used to create the cyclic patches.  However, you first need to clean up the boundary file with createPatch -overwrite, and for this you also need a createPatchDict:

/*--------------------------------*- 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      createPatchDict;
}

pointSync true;

// Patches to create. An empty patch list just removes patches with zero
// faces from $FOAM_CASE/constant/polyMesh/boundary.
patches
(
);

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


createBaffles

Yeah.  Baffles is exactly what we don't want to create, but the necessary directives are included in the following createBafflesDict:

/*--------------------------------*- 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      createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

internalFacesOnly true;

baffles
{
    cyclicFaces
    {
        type        faceZone;
        zoneName    disk;

        patches
        {
            master
            {
                name            fan01;
                type            cyclic;
                neighbourPatch  fan02;
           
            }
            slave
            {
                type            cyclic;
                name            fan02;
                neighbourPatch  fan01;
            }
        }
    }
}

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


Now run createBaffles -overwrite and take a look at the boundary file.  With a bit of luck and alignment of heavenly bodies, the necessary cyclic patches should appear, and can be used as cyclic boundary conditions.

No comments:

Post a Comment