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:
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.Fig. 230 shows the
faceName
andgroupName
attributes on the faces of the wind tunnel. In general faces with the samefaceName
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 differentfaceName
. Faces with the samegroupName
will be considered as the same boundary when exporting the CGNS file.
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:
The global
maxEdgeLength
governs the mesh size on all faces.In subsection
faces
, users can define localmaxEdgeLength
for the sphere and struts, overwriting the globalmaxEdgeLength
.
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:
farfield
is set asuser-defined
, indicating that the user already provided the “farfield” geometry, which is the wind tunnel box in this example.In the
faces
subsection, the keys should match the attributefaceName
in the CSM file.By default, all
faces
are treated asaniso
and the globalfirstLayerThickness
is applied.The
floor
is set asaniso
, so the localfirstLayerThickness
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 asnone
, 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 asprojectAnisoSpacing
. 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.