blockMesh: New experimental support for projecting block face point to geometric surfaces

For example, to mesh a sphere with a single block the geometry is defined in the
blockMeshDict as a searchableSurface:

    geometry
    {
        sphere
        {
            type searchableSphere;
            centre (0 0 0);
            radius 1;
        }
    }

The vertices, block topology and curved edges are defined in the usual
way, for example

    v 0.5773502;
    mv -0.5773502;

    a 0.7071067;
    ma -0.7071067;

    vertices
    (
        ($mv $mv $mv)
        ( $v $mv $mv)
        ( $v  $v $mv)
        ($mv  $v $mv)
        ($mv $mv  $v)
        ( $v $mv  $v)
        ( $v  $v  $v)
        ($mv  $v  $v)
    );

    blocks
    (
        hex (0 1 2 3 4 5 6 7) (10 10 10) simpleGrading (1 1 1)
    );

    edges
    (
        arc 0 1 (0 $ma $ma)
        arc 2 3 (0 $a $ma)
        arc 6 7 (0 $a $a)
        arc 4 5 (0 $ma $a)

        arc 0 3 ($ma 0 $ma)
        arc 1 2 ($a 0 $ma)
        arc 5 6 ($a 0 $a)
        arc 4 7 ($ma 0 $a)

        arc 0 4 ($ma $ma 0)
        arc 1 5 ($a $ma 0)
        arc 2 6 ($a $a 0)
        arc 3 7 ($ma $a 0)
    );

which will produce a mesh in which the block edges conform to the sphere
but the faces of the block lie somewhere between the original cube and
the spherical surface which is a consequence of the edge-based
transfinite interpolation.

Now the projection of the block faces to the geometry specified above
can also be specified:

    faces
    (
        project (0 4 7 3) sphere
        project (2 6 5 1) sphere
        project (1 5 4 0) sphere
        project (3 7 6 2) sphere
        project (0 3 2 1) sphere
        project (4 5 6 7) sphere
    );

which produces a mesh that actually conforms to the sphere.

See OpenFOAM-dev/tutorials/mesh/blockMesh/sphere

This functionality is experimental and will undergo further development
and generalization in the future to support more complex surfaces,
feature edge specification and extraction etc.  Please get involved if
you would like to see blockMesh become a more flexible block-structured
mesher.

Henry G. Weller, CFD Direct.
This commit is contained in:
Henry Weller
2016-10-13 15:05:24 +01:00
parent 12d0707b84
commit 009203188f
59 changed files with 1774 additions and 605 deletions

View File

@ -47,8 +47,6 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
/*---------------------------------------------------------------------------*\
Class searchableSurfaceCollection Declaration
\*---------------------------------------------------------------------------*/
@ -57,8 +55,6 @@ class searchableSurfaceCollection
:
public searchableSurface
{
private:
// Private Member Data
// Per instance data
@ -82,6 +78,7 @@ private:
//- Region names
mutable wordList regions_;
//- From individual regions to collection regions
mutable labelList regionOffset_;
@ -133,6 +130,7 @@ public:
const dictionary& dict
);
//- Destructor
virtual ~searchableSurfaceCollection();
@ -163,7 +161,6 @@ public:
return transform_;
}
virtual const wordList& regions() const;
//- Whether supports volume type below
@ -281,7 +278,6 @@ public:
NotImplemented;
return false;
}
};

View File

@ -92,6 +92,7 @@ public:
ClassName("searchableSurfaces");
// Constructors
//- Construct with length specified. Fill later.
@ -119,6 +120,7 @@ public:
{
return names_;
}
wordList& names()
{
return names_;
@ -128,6 +130,7 @@ public:
{
return regionNames_;
}
List<wordList>& regionNames()
{
return regionNames_;