This tutorial covers the basic functionalities of the curvilinear mesh generator that is provided with NekMesh, the mesh utility program provided with Nektar++. This tutorial is designed to show the main features of the two-dimensional mesh generator.
To achieve the goals of this tutorial you will need an installation of the latest master
version
of Nektar++, available at nektar.info. This is because the features you will be using are
relatively new and have yet to be included in the latest release. Standard installation
instructions are applicable as described in the user guide, with one addition that CMake
should be configured to include NEKTAR_USE_MESHGEN=ON
. This will activate the installation of
the relevant meshing routines.
brew install homebrew/science/oce
port install oce
sudo apt-get install liboce-foundation-dev
liboce-modeling-dev
liboce
.Nektar++ will be able to pick up on any of these OCE installations. Installation of NekMesh on Windows with mesh generation is not possible due to the OpenCascade requirements at this time.
This tutorial additionally requires:
After the completion of this tutorial, you will be familiar with:
$NEK
for the remainder of the tutorial.
tutorial
, and download the
tutorial files from mesh-generation-2d-step.tar.gz into this directory.
tar -xzvf mesh-generation-2d-step.tar.gz
to produce a directory 2d-step
with subdirectories called tutorial
and complete
.
The tutorial folder contains:
Curvilinear mesh generation capability was recently added to NekMesh. These routines aim to take a geometric definition, which is usually in the form of a CAD STEP file, and produce a valid curvilinear mesh. This is not always an easy task, but the system is fast and robust in 2D, so in this tutorial we shall focus our efforts there.
The design of the mesh generation system focuses on automation. As such, once provided with a CAD description of the domain only 4 numerical parameters are required to produce a mesh. The system uses a curvature based refinement and smoothness algorithms to obtain mesh sizings automatically. In this tutorial you will be introduced to using manual refinement fields to achieve more control over the mesh sizing.
NekMesh works on input and output files and both need to be specified as command line arguments. In the case of mesh generation the input is a .mcf, mesh configuration file, which is formatted similarly to the Nektar++ XML. This file contains the instructions and parameters the mesh generation system needs.
A barebones example of an .mcf file is:
Six key pieces of information are required to run the mesh generator:
CADFile
specifies the geometry file which will be meshed;
MeshType
tells the mesher what type of elements to produce: 3D, 3DBndLayer,
2D, 2DBndLayer;
MinDelta
, MaxDelta
and EPS
determine the minimum and maximum element sizes;
and
Order
defines the order of the high-order mesh.The system automatically determines element sizing, δ as
δ = 2R | (1.1) |
where R is the radius of curvature of the CAD entity and MinDelta
and MaxDelta
place limits
on the value of δ. It should be noted that, in the case of constant radius geometries, such as
cylinders, changing the value of MaxDelta
and MinDelta
may not alter the mesh. That is
because in this setting, EPS
is controlling the sizing.
Currently the preferred CAD file format for use with NekMesh is the step203
format, which is
a standard CAD format. This is because it contains topological information that
makes high-order meshing much easier compared to other open CAD formats such as
IGES
.