Skip to content

Create mesh with triangular block #78

@jmozmoz

Description

@jmozmoz

I would like to create a blockMeshDict with classy_blocks with a triangular block. Such blocks are usually used for wedges, but they also seem to work for normal or in my case 2D cases.

I created a blockMeshDict by hand which includes such a block (see below).

Image

The block 0 is the triangular block (the first in the blockMeshDict).

I have not find a way to specify such a block in classy_blocks. classy_blocks.Face requires 4 points which seemingly can only be given as cooridnates and not as a list of Points. Is there a way around this? E.g. by specify/create the block directly from a list of Points (not coordinates)?

The purpose of this would be to create blocks for prism layers around a body. By this way, the refinement for the prism layer is not needed to be carried around through the whole fluid domain.

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

vertices
(

(0   0 0)  // 0
(0   0 -1)
(0.5 1 -1)
(0.5 1 0)

(1 0 0)    // 4
(1 0 -1)

(-2 0 0)   // 6
(-2 1 0)

(-2 1 -1)  // 8
(-2 0 -1)

(3 1 0) // 10
(3 1 -1)
(3 2 -1)
(3 2 0)

(-2 2 0) // 14
(0.5 2 0)
(0.5 2 -1)
(-2 2 -1)

(3 3 0) // 18
(3 3 -1)

);

blocks
(
hex (0 1 2 3 4 5 5 4) (1 1 4) simpleGrading (1 1 1)    // 0
hex (0 1 9 6 3 2 8 7 ) (1 6 1) simpleGrading (1 1 1)   // 1
hex (4 10 11 5 3 13 12 2) (7 1 4) simpleGrading (1 1 1)   // 2
hex (3 2 8 7 15 16 17 14) (1 6 2) simpleGrading (1 1 1)   // 3
hex (3 13 12 2 15 18 19 16) (7 1 2) simpleGrading (1 1 1)   // 4
);

edges
(
);

boundary
(
    front
    {
        type empty;
        faces
        (
            (4 10 13 3)
            (4 3 0 4)
            (0 3 7 6)
            (7 3 15 14)
            (3 13 18 15)
        );
    }
    back
    {
        type empty;
        faces
        (
            (9 8 2 1)
            (8 2 16 17)
            (5 11 12 2)
            (2 12 19 16)
            (5 2 1 5)
        );
    }
    inlet
    {
        type patch;
        faces
        (
            (6 7 8 9)
            (7 14 17 8)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (10 13 12 11)
            (13 18 19 12)
        );
    }
    symmetry
    {
        type symmetry;
        faces
        (
            (6 0 1 9)
            (0 4 5 1)
        );
    }
);

mergePatchPairs
(
);

defaultPatch
{
    name    walls;
    type    wall;
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions