Automated Meshing for Internal Flow

Automated Meshing for Internal Flow#

This tutorial shows how to create a mesh for internal flow using the automated meshing process.

Geometry#

As shown in Fig. 230, the geometry is a wind tunnel enclosing a sphere that is supported by four cylindrical struts. The corresponding CSM file is provided, so the readers can easily reconstruct the geometry on their local machines.

Several details are worth emphasizing in the CSM file:

  1. For internal flow, a single solid body representing the fluid must be provided to the automated meshing process. To do this, once the wind tunnel (box) and the sphere with struts are constructed, the next step is to subtract the sphere and struts from the wind tunnel.

  2. Fig. 230 shows the faceName and groupName attributes on the faces of the wind tunnel. In general faces with the same faceName will be treated as the same surface patch for assigning surface (maxEdgeLength) and volume (firstLayerThickness) mesh attributes. Conversely, the user can set different surface and volume mesh attributes for faces with a different faceName. Faces with the same groupName will be considered as the same boundary when exporting the CGNS file.

../../_images/geometry.svg

Fig. 230 Sphere in wind tunnel, geometry with face attributes. sideNegY is hidden to show the interior of the wind tunnel.#

Surface Mesh#

The surfaceMesh.json is provided as follows:

{
    "maxEdgeLength": 1, 
    "curvatureResolutionAngle": 15,
    "growthRate": 1.2,
    "faces": {
        "sphere": {"maxEdgeLength": 0.1},
        "strut":  {"maxEdgeLength": 0.01}
    }
}

Noteworthy details in this surfaceMesh.json:

  1. The global maxEdgeLength governs the mesh size on all faces.

  2. In subsection faces, users can define local maxEdgeLength for the sphere and struts, overwriting the global maxEdgeLength.

Volume Mesh#

The volumeMesh.json is provided as follows:

{
    "refinementFactor": 1.0,
    "volume": {
        "firstLayerThickness": 1e-6,
        "growthRate": 1.2
    },
    "farfield": {
        "type": "user-defined"
    },
    "faces": {
        "floor": {
            "type": "aniso",
            "firstLayerThickness": 1e-5
        },
        "ceiling": {
            "type": "none"
        },
        "adjacent2floor": {
            "type": "projectAnisoSpacing"
        }
    }
}

Regarding the volumeMesh.json above, please note that:

  1. farfield is set as user-defined, indicating that the user already provided the “farfield” geometry, which is the wind tunnel box in this example.

  2. In the faces subsection, the keys should match the attribute faceName in the CSM file.

    • By default, all faces are treated as aniso and the global firstLayerThickness is applied.

    • The floor is set as aniso, so the local firstLayerThickness 1e-5 overwrites the global value of 1e-6. The first layer thicknesses provided here are just for illustration. The users need to adjust these values according to the target \(y^+\) in their simulations.

    • The ceiling is set as none, hence the anisotropic layers won’t be grown from the ceiling. Meanwhile, the surface mesh on the ceiling remains unaltered when generating the volume mesh.

    • The faces adjacent to the floor adjacent2floor are set as projectAnisoSpacing. The surface mesh on those faces is updated when populating the volume mesh. As shown in Fig. 231, the “spacing” of anisotropic layers grown from the floor are “projected” onto the faces adjacent to the floor.

../../_images/mesh.png

Fig. 231 Sphere in wind tunnel, populated volume mesh.#