Documentation

Main Settings for Hex-dominant parametric

In this chapter the main settings that are generally required as input by the user are detailed. These parameters appear under the global Hex-dominant parametric settings. These include defining the base domain size and discretization, several types of mesh refinements and their corresponding settings.

Many of the settings and refinements described below are similar to the settings described in the automatic Hex-dominant (only CFD) settings. However, one key difference is that the mesh cell size is defined as absolute length in the automatic meshing algorithm while it is defined via refinement levels here.

Geometry Primitives & Main Properties

The Geometry Primitives by default contain the BaseMeshBox and the Material Point which must be specified by the user. Based on the requirements, additional geometries can be added (e.g. to define mesh refinement regions).

Base Mesh Box

The Base Mesh Box specifies the bounding extents for the base mesh. The bounding extents must then be selected depending upon whether the user requires a mesh for External flow or Internal flow simulations.

  • External flow mesh: The bounding extents for the Base Mesh Box also serve as the flow domain boundaries/surfaces that are later specified with a certain Boundary Condition. Therefore in this case, the extents must be some distance upstream, downstream and in the lateral directions to the object. Generally it is recommended that the extents be at least 2-3D upstream, 6-8D downstream and 2-3D in the lateral directions, where D is the object reference length.
  • Internal flow mesh: Here the bounding extents for the Base Mesh Box only serve as a reference for the base mesh and therefore are NOT used as the flow domain. The domain then results in the inner volume of the geometry. The Boundary Conditions are specified on the resulting geometry surfaces. Thus, the BaseMeshBox extents should at least just be slightly larger than the geometry bounds. It is recommended that the Base Mesh Box should not be smaller than the geometrical bounding dimension, otherwise the geometry would be truncated by the Base Mesh Box extents.
example of a background mesh box for a f1 car
An example for the Base Mesh Box around a race car. In this case a half model would be created.

Material Point

The material point is used to specify the enclosed space inside the Base Mesh Box that will be kept as the mesh in the Cell Removal part of Castellated Mesh step (see Background for snappy hex mesh). This will be the space which constitutes the final mesh.

So, independent of the Base Mesh Box, the material point determines whether the resulting mesh is for an External flow simulation or Internal flow simulation. The figures below show two scenarios resulting from different specification of the material point for the same BaseMeshBox and object.

comparison of meshing results with material point inside or outside the cad geometry
Top: An example of the material point outside the object and the corresponding mesh; Bottom: An example of the material point inside the object and the corresponding mesh.

Note

The material point should never be located on a face, always inside a cell, even after refinements of the mesh. Therefore, coordinates ending in odd values should be preferred.

Additional geometric entities

Additional geometries can be added by the user via the ‘+’ button on the Geometry primitives node in the mesh tree. These geometries can then be used to refine specific areas in the mesh to limit the extents of custom mesh refinements.

The following three types of shapes can be defined:

  • Cartesian box
  • Sphere
  • Cylinder

The figure below shows an example of a Cartesian box inside the Base Mesh Box and around the object.

Cartesian box geometry primitive around a F1 car

An example of a Cartesian box geometry primitive stacked inside the outer mesh bounding box.

Main Properties

For the creation of the base mesh the user must specify the number of cells (for the Base Mesh Box) in each coordinate direction under Bounding box resolution.

The base mesh cell size (in X-direction) is then given as:

(Xmax-Xmin)/(Nx)

where, Xmax is the maximum X-coordinate, Xmin is the minimum X-coordinate of the Base Mesh Box and Nx is the number of cells in X-direction.

For the discritization it is recommended to have a base mesh with perfect cube cells to yield better results. This can be achieved if the following formulation holds:

(Xmax−Xmin)/Nx=(Ymax−Ymin)/Ny=(Zmax−Zmin)/Nz

Following the above formulation, a sample Base Mesh with perfect cube cells is shown in the figure below

mesh with cube sized base cells
Base mesh consisting of cube-shaped cells.

Based on the discretized Base Mesh Box, the Coarsest (largest) cell size is determined for each coordinate direction and is used to define a refinement of Level 0. This means that any Mesh refinements of Level 0 will have the same cell dimensions as the base mesh cell in respective coordinate directions.

Refinement Levels

Further, each increment of refinement level reduces the cell dimensions by half. With reference to ΔXo, base mesh cell size at level 0, the following formulation holds for cell size in each coordinate direction:

ΔXn=ΔXo/2^n

This refinement levels are illustrated by the figures below:

mesh refinement level definition
Figure showing how the refinement levels effect cell size.
mesh example with different refinement levels
An example of different refinement levels for a sample mesh.

Important

It is recommended that the maximum level be set to achieve a minimum cell size in the order of the minimum geometry dimension. Refinement Levels are not limited, you are able to specify any level of refinement (e.g. level 10), but this may result in a overly large mesh size.

Mesh Refinements

For the SnappyHexMesh, several refinement option can be selected by the user to get the required mesh. These are all specified under the Mesh Refinement sub-tree. Each refinement plays a specific role in the meshing process that is briefly described below:

  • Surface and Feature refinements are specifically used for the Cell Splitting phase in the Castellated Mesh step. It is recommended to specify a refinement level that results in a cell size of the order of the smallest geometrical dimension that should be resolved by the mesh.
  • Region refinements are used to refine one or more volume regions that may be part of the geometry or user-defined under Geometry Primitives.
  • Layer refinement is used in the Layer addition step of the meshing process for addition of hexahedral cells aligned to the selected surfaces of the body to increase the accuracy of results.
  • Box layers are similar to Layer refinement, but used to generate a layer mesh on a surface of the outer bounding box. Therefore, are only applicable for an external flow mesh.

The settings and parameters for each type of refinement are described in detail below.

Surface refinement

The surface refinement is done only for the selected surfaces. If the user assigns a volume to the surface refinement, the refinement is applied to all surfaces of that volume. Surface refinement can also be used to group cells together – such a group of cells is called a cell zone.

The user must specify two refinement levels, level min and level max. The minimum level is applied first across all of the surfaces. The maximum level is only applied to cells in areas where the normals form an angle greater than the specified resolve feature angle (in Advanced Settings). Therefore, in the following cases, only the minimum level is applied.

  1. A flat surface.
  2. A surface that has an angle between normals less than the value specified for resolve feature angle.

Consequently, cells that get multiple intersections where the intersections form an angle larger than the resolve feature angle value get refined up to the maximum level.

The figure below shows a mesh with surface refinement of minimum level = 2 and maximum level = 4.

comparison between surface refinements with different refinement levels
Left: Mesh with surface refinement of minimum level = 2 and maximum level = 4; Right: Mesh with surface refinement of the same minimum and maximum level of 4.

Cell Zones

This option is by default inactive. If the user assigns a closed volume to this surface refinement and sets this option to Active, the refinement will group together all cells enclosed by this volume – such a group of cells is called a cell zone. It is then possible to assign different properties to a cell zone. For example, the user can set it as a rotating region (MRF (Multiple Reference Frame) or AMI (Arbritrary Mesh Interface)), a momentum source, a heat source or a passive scalar source. If the geometry that is being meshed is of STL format, the user can also assign a list of faces that form a closed volume to create a cell zone.

Important

It is recommended that the maximum level be set to give a cell size in the order of the minimum surface dimension. The surface refinement is overwritten by a feature refinement at the geometry edges by the specified feature refinement distance (see Feature refinement below for details).

Feature refinement

This refinement type is specifically important as it is used to refine the geometry’s feature edges. The feature edges are extracted based on the Included angle under Surface Feature Extract. So, the edges whose adjacent surface normals form an angle less than the included angle are marked for extraction and refinement.

The user must specify the Distance and the Level. The edge and surface mesh will then be refined up until the specified distance in all directions from the extracted edges as depicted by the figure below.

example result for a mesh with feature refinements
A sample mesh with feature refinements

Important

This feature refinement is based on the explicit Feature Snap method that provides better conformation. If this refinement is not used, an implicit feature Snap is used by default. (see Snap Controls in Advanced Settings for details)

Region refinement

The region refinement is used to refine the volume mesh for one or more user specified volume regions under geometry primitives or geometry regions. One of the following refinement modes can be applied to each region:

  • Inside: Refines all volume mesh cells inside the surface up to the specified level. The surface needs to be closed for this to be possible.
  • Outside: Refines the outside volume mesh cells up to the specified level.
  • Distance: Refines according to distance to the surface and can accommodate different levels at multiple distances. It is important to note that the distances need to be specified in descending order.

In the case of inside and outside refinement, the distance is not required and will be ignored (but it must be specified). The level then determines the cell size relative to the Base Mesh cell size.

example of a mesh with region refinements
A sample mesh showing the region refinement.

Inflate boundary layer

The layer refinement adds a volume mesh with cells aligned to the surface. The user must enter the following 4 basic parameters:

  • Number of layers: Specifies the total number of layers
  • Expansion ratio: Specifies the growth of successive layers. The larger the value the greater the difference in height of the layers.
  • Min. thickness: This specifies the overall minimum thickness of all the layers. This value must be less than the total thickness of all the layers. Otherwise, layers will not be generated.
  • Final layer thickness: Specifies the height (thickness) of the layer that is furthest away from the surface.

The values need to be specified relative to the neighboring volume cell size after refinements. The figures below shows sample image of layers along an object’s surfaces.

example mesh with inflated boundary layers added
Example of a mesh with inflated boundary layers on the mesh surface.

Bounding box layer addition

The Bounding box layer addition refinement is similar to the Layer refinement but only applicable to the bounding box. This is mainly useful for external flow analysis where the box surface acts as a wall for the flow domain and must be refined with a layer mesh for accuracy. The user must select one additional parameter, which is the box face for layer generation.

References

[1] Snappy Hex Mesh official user guide, http://cfd.direct/openfoam/user-guide/snappyHexMesh
[2] snappyWiki, https://sites.google.com/site/snappywiki/snappyhexmesh/snappyhexmeshdict

Disclaimer

This offering is not approved or endorsed by OpenCFD Limited, producer and distributor of the OpenFOAM software and owner of the OPENFOAM® and OpenCFD® trademarks. OPENFOAM® is a registered trademark of OpenCFD Limited, producer and distributor of the OpenFOAM software.

Contents

Cookie Policy

SimScale uses cookies to improve your user experience. By using this website you consent to our cookie policy. Don't worry, we are not storing any personal information.

Accept Data Privacy