Вы находитесь на странице: 1из 10

Simulation of Flows in Complex Geometries:

New Meshing and Solution Methods

Milovan Perić
CD adapco Group, Nürnberg Office, Germany

Summary

The use of CFD is spreading in all areas of engineering. The flow domains are usually very
complicated, which places high demands on both meshing and solution methods.

In this manuscript the newest developments in the handling of complex geometries in CFD are
presented. The limitations with respect to the shape of control volumes that may appear in a
numerical grid are lifted: cells of arbitrary polyhedral shape are allowed. CAD-integration of all CFD
tools and automatic generation of polyhedral meshes, as well as a solution method that can use such
meshes, are also presented and the advantages of the new technology are discussed. The emphasis
is on CAD integration, automatic mesh generation, and optimization of mesh quality. The aim of all of
these measures is the shortening of analysis time in all phases of a CFD simulation and at the same
time an improvement of solution quality.

Keywords:

Complex Geometry, Automatic Meshing, Polyhedral Control Volumes, Finite-Volume Methods

Introduction

Most flows of engineering interest take place in complex geometries. The flow domain is in many
cases difficult to define: the CAD-data provides a description of parts surrounded by fluid, but the
extraction of a closed fluid volume is often a non-trivial job. CFD-engineers usually spend a large – if
not the largest – portion of their analysis time on this task.

The starting point for a CFD simulation is often a CAD-data, usually provided by designers or analysts
from another department; CFD-engineer has to import this data into one or more tools and work on it
until a satisfactory mesh is created.

A tool for the clean-up and repair of CAD-data is indispensable in the process of grid generation for
complex geometries. Not only that it has to provide the possibility of creating a closed surface
enclosing the flow domain, but it also has to facilitate the desired simplification and removal of
geometry details which are deemed unimportant for the flow analysis. Such details can make
meshing substantially more complicated while having little effect on the computed flow; however, one
has to be careful as sometimes small geometrical details can trigger phenomena which otherwise
may not be captured in the simulation (separation, unsteadiness etc.). This step often requires a
skilled analyst who can evaluate the surface and make adequate decisions about the level of detail
that is to be retained in the final closed surface.

In addition to flow volume extraction from “exact” geometry defined by CAD-data, surface-wrapping
techniques are often used to create an approximated closed surface of the flow domain. This
approach usually leads to small geometry details getting lost during the wrapping process, which is
often satisfactory; caution is needed in order to ensure that the main flow features are captured. The

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 1 Niedernhausen/Wiesbaden, Germany
advantage of this approach is that it can be fully automated. An example of application of a surface-
wrapping technique to create a closed surface of a car for the simulation of external air flow is shown
in Fig. 1.

Once a closed surface of the flow domain is obtained, it needs to be analyzed in order to identify
features which must be preserved in the mesh. These include sharp edges and surface curvature,
which may require special treatment during the meshing process.

CAD-Integration of CFD

The approach to mesh generation described above – which is the current state-of-the-art – is slowly
changing; as CFD is becoming a part of the global CAE process, the need for its integration into CAD
tools becomes obvious. CFD add-ins are today available for almost all major CAD-packages (STAR-
CD and Comet CFD-solvers have been fully integrated into SolidWorks, Pro/ENGINEER, Unigraphics
18 and NX, CATIA V5). This enables the designer both to generate the solid model of the flow do -
main from scratch, and to extract the flow domain from a CAD-model of solid parts. The major ad -
vantage of this approach is that parametric studies are made easier, since the parametrization of the
solid model remains preserved and a mesh with the same properties can be generated for a modified
geometry with a push of one button. Also, as CFD becomes CCM (Computational Continuum
Mechanics), coupled analysis of fluid flow, heat transfer, and solid body deformation requires mesh -
ing of both solid and fluid domains. Thus, mesh generation within the CAD environment is desired.

Fig. 1: An example of a surface-wrapping technique to create a closed surface of a vehicle for


performing a simulation of external air flow (also showing a trimmed, locally refined hexahedral mesh
in the symmetry plane). Courtesy of AUDI AG.

The above-mentioned CAD-integrations of CFD tools provide not only the automatic meshing
capabilities within the CAD environment; the solution as well as the post-processing of the results can
also be performed without ever leaving the native environment of the hosting CAD tool. Thus,
enterprise-wide solutions become possible, by allowing designers to run CFD simulations and

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 2 Niedernhausen/Wiesbaden, Germany
analysis of the results on the spot. Non-specialists in CFD can benefit from collaboration with
specialists within the same or from another organization, who can set up a sample problem in an
optimal way and allow the designer to continue with parametric studies on his own.

An example of a CAD-integrated CFD solution is shown in Fig. 2. The boundary conditions and all
other simulation parameters are set up on the solid model and remain associated with it, so that no
changes are needed during geometry variation as long as the flow conditions remain the same. The
mesh is generated fully automatically, with only a small number of parameters that need to be set
globally or at specific solid model surfaces.

Meshing of Complex Flow Domains

Since flow domains can be arbitrarily complex, the meshing procedure should be fully automatic, as
any manual intervention by the CFD-engineer may require both too much time and special skills to
produce an optimal result. Therefore, block-structured grids can seldom be used; unstructured
meshes are the only practical alternative.

Fig. 2: An example of a CAD-integrated set of CFD tools (Comet-Pro/E): solid modeling, automatic
meshing, flow simulation, and post-processing within Pro/ENGINEER environment. Shown is the
shear stress on vehicle surface and streamlines around the vehicle; red ellipse indicates the Comet-
Pro/E button in the Pro/ENGINEER GUI.

The meshing tool – in addition to being automatic – needs to fulfill the following criteria:

Prismatic layers should be automatically created along walls, if viscous flows are to be computed.
The prisms may have any polygonal base (from triangle onwards) – it is most important that there
_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 3 Niedernhausen/Wiesbaden, Germany
are enough of cells with two faces parallel to wall in order to allow for an appropriate treatment of
the wall boundary layer. Also, parts like ducts, pipes, narrow gaps etc. should be recognized and
meshed with prismatic cells, both for accuracy (allowing for an accurate treatment of parallel flow)
and efficiency reasons (allowing for higher aspect ratios).

The mesh fineness should be controllable, both by the user (who often knows in advance where
the mesh should be finer) and by the solver (for a subsequent mesh adaptation and error-guided
mesh refinement).

The mesh quality should be controlled and, where necessary, automatically repaired. This can be
achieved by re-meshing, merging, or splitting of “bad” cells.

The most widely used type of unstructured meshes are those made of tetrahedra, usually with a layer
of triangular prisms along walls to allow for an appropriate treatment of boundary layers. While such
meshes are the easiest to generate, their quality is often inappropriate. The prism layers along walls
alleviate the problems associated with flat tetrahedra near boundary, but the fact that a tetrahedron
has only four faces – and thus only four neighbor cells – makes cells of this type less suitable for
approximation of diffusive fluxes than hexahedra or polyhedra. The problem is that, in order to
compute gradients of dependent variables, the four nearest neighbors of a given cell are often not
sufficient to achieve the accuracy offered by control volumes with six or more faces. The
consequence is that a larger number of tetrahedral control volumes is needed when computing
viscous flows to achieve the desired accuracy than when hexahedra or polyhedra are used.

Hexahedral control volumes are probably optimal from efficiency and accuracy point of view, but
meshes made of good quality hexahedra are difficult to generate automatically. Polyhedral meshes,
on the other hand, can be generated automatically as easily as tetrahedral meshes; while they have
more neighbors and thus require both more storage and computing time per cell, the higher accuracy
usually compensates for the extra effort, as will be demonstrated below.

While purely hexahedral meshes cannot be easily generated, an approach of generating


predominantly hexahedral meshes, with a limited number of polyhedra and prisms, has been
commercially introduced by the CD adapco Group more than five years ago. In this method, a so
called “subsurface” is created by displacing the surface of the solution domain inwards by a certain
distance. This subsurface cuts then cells of a “custom mesh” – typically Cartesian – creating trimmed
cells (polyhedra). Between subsurface and solution domain boundary a layered mesh (made of
hexahedra and some prisms) is created. The limited number of trimmed (polyhedral) cells are thus
away from walls, ensuring a high-quality mesh. An example of such a mesh for a relatively simple
geometry is shown in Fig. 3.

Fig. 3: An example of an automatically generated trimmed mesh (left) and a polyhedral mesh (right),
both with five prism layers along walls.

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 4 Niedernhausen/Wiesbaden, Germany
A truly polyhedral mesh for the same geometry is also shown in Fig. 3. While a polyhedral mesh is
not an optimal choice for straight pipes, it is used in this example for illustration purposes. Both
meshes are generated fully automatically, using a solid model of the flow domain created by a CAD-
tool. The user-specified parameters are: thickness of the layer along wall boundaries, number of
prism layers, and the mean cell size. High boundary curvature is automatically recognized by the
polyhedral mesher and smaller cells are generated there.

The question often asked is: which grid is optimal for my application? Any grid type leads
asymptotically to the same solution (there are exceptions where the error is not reduced by grid
refinement, but these are not typical and will not be considered here); however, the effort needed to
obtain a solution of a required accuracy depends largely on the mesh type and quality. A general
recommendation is to use prismatic cells not only along walls but also whenever flow direction is fixed
by the geometry (pipes, channels, ducts, small gaps etc.). This means that the side prism faces
should be aligned with the flow while the prism base should be orthogonal to flow direction. On the
other hand, when recirculating flows are encountered, polyhedral cells tend to generally be the most
efficient ones. Tetrahedral cells – if used as control volumes – are the least suitable; there are
methods, however, which use tetrahedral meshes but solve on a dual mesh (which is effectively a
polyhedral mesh), thus alleviating the problems associated with tetrahedral control volumes.

Solver Requirements for Polyhedral Meshes

The capability of the flow solver to use a truly polyhedral mesh is desired for many reasons, even if
the mesh is not created originally as polyhedral. The key feature of such a solver is to handle a
control volume with any number of faces (which is the case with CCM-solvers of CD adapco Group).
With this capability at hand, one can provide a unified treatment of many situations encountered in
engineering practice, which would otherwise require a special treatment:

Cell-wise local refinement: One can locally split some cells into a number of smaller cells. The one
face of a non-refined cell is now simply replaced by a number of smaller faces, which are common
to that cell and the newly-created cells by refining the original neighbor cell. Thus, only a pre-
processing step is needed to update the face and cell data, while the solver itself is not affected.

Non-matching grid block interfaces: One can join grid blocks of different topology, and again only a
pre-processing step is needed to find pieces of the interface surface that are common to two cells
on either side of the interface. The cells along the interface become polyhedra even if they are
regular Cartesian “bricks”, because the faces originally lying in the interface are replaced by a
number of smaller faces.

Sliding interfaces: The above is also true when grid blocks slide along each other, the difference
being that the faces in the sliding interface need to be updated every time the mesh is moved.

Cyclic boundaries: In the case of boundary pairs where cyclic conditions are to be applied, the
same treatment as for non-matching grid blocks can be used (upon an appropriate rotation or
translation of one boundary surface to match the other).

In all the above cases, nothing special needs to be considered in the solver, making it simpler and
easier to maintain and extend than when the so called “hanging-node” approach is applied. With
extensions of CFD to a wider range of CCM-applications in mind, keeping the solver simple and
unaffected by mesh details is a highly desirable feature.

Another advantage of the poyhedral capability of the solver is that grid quality can be better
optimized. With no topological constraints attached to the mesh, cells whose quality is not appropriate
can be modified in many ways to improve them. For example, cells can be individually split (e.g. if
they turn out to be concave) or joined with neighbor cells (e.g. if thin cells are generated through the
trimming process described above). Also, a group of cells can be removed and replaced by a set of
different cells which fulfill the quality criteria better. This is in particular true for moving meshes, where

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 5 Niedernhausen/Wiesbaden, Germany
the limitation of a fixed cell type (e.g. tetrahedron) would require more frequent re-meshing over a
larger part of the solution domain than when polyhedral cells are used. There are practically no limits
to cell manipulation possibilities and it is expected that we shall see a lot of effort in this area in the
future, as mesh optimization will become a major task after automatic mesh generation has become a
routine.

A solver intended for polyhedral meshes requires a different data structure than existing “legacy
codes”. However, second-order discretization of convective and diffusive fluxes as well as for source
terms can be easily accomplished for any cell type; actually, the same approximations used for
structured grids can be applied:

Midpoint rule for surface and volume integration is the simplest second-order approximation that
does not depend on the shape of integration domain. It requires only that the value of the function
to be integrated is either known or approximated at the centroid of face or volume in question.

Evaluation of surface integrals requires interpolation, since the variable values are not available at
face centroids. To this end, various practices are possible, relying on values of variables and their
gradients at centroids of the two common cells. The simplest one of second order is based on
linear interpolation and is commonly referred to as “central-differencing scheme”.

In order to evaluate diffusive fluxes, gradients are also required at face centroids. Again, various
practices are available, the simplest one of second order reducing to central differences.

In order to obtain a solution method that is efficient both with respect to memory usage and
computing time, deferred-correction approach is extensively used. In it, simple but inaccurate
approximations for surface integrals are used to build the implicit coefficient matrix, while an explicit
correction term is used to subtract the simplified approximation and replace it with a higher-order one.
Thus, the implicit coefficient matrix contains only entries from the nearest neighbors of each cell,
while all deferred corrections are summed in the source term.

Fig. 4: Two typical polyhedral control volumes with a common face (from the polyhedral mesh shown
in Fig. 3).

Figure 4 shows two typical polyhedral control volumes with one common face. The cells created
using the automatic mesher of CD adapco Group have on average 10 to 12 faces; these are defined
by straight edges but are in general not planar.

Time-integration of second order is also easily implemented; it does not depend on cell topology. The
fully-implicit scheme that uses quadratic interpolation in time (three time levels) is favored for its
simplicity and stability; another popular method is the Crank-Nicolson scheme.

The second-order approximations described above are suitable not only for RANS-type simulations

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 6 Niedernhausen/Wiesbaden, Germany
but also for LES and DES, as has been demonstrated in a number of studies performed by different
authors over the past few years. A recent (to be published) analysis performed at UMIST,
Manchester, has shown that polyhedral cells also offer good energy-conservation properties when the
above-described second-order approximations are used, verifying that this type of cells is – contrary
to tetrahedra – also well suited for LES.

Examples of Use of Polyhedral Meshes

In order to verify the accuracy and computational efficiency of polyhedral meshes, numerous
computations have been performed with test cases which poses either an analytical solution or an
accurate benchmark solution obtained on a very fine hexahedral mesh. These tests have indicated
that, for the same accuracy, polyhedral meshes require half the memory and five to 10 times less
computing time than tetrahedral meshes (using the same discretization and solution methods, i.e. the
same flow solver). While a different solver specially tuned for tetrahedral meshes may be more
efficient than the one used in the aforementioned tests, the general conclusion is likely to remain the
same.

Fig. 5: Cross-section through tetrahedral (left; 650000 cells) and polyhedral (right; 138000 cells)
mesh used to compute the flow around a sphere in a channel.

One of these basic test cases involved a computation of flow around a sphere mounted on a
cylindrical support in a wind tunnel. Figure 5 shows cross-sections through a tetrahedral mesh
(consisting of 650000 cells) and a polyhedral mesh (consisting of 138000 cells). Both meshes had
five layers of prisms along sphere and support walls.

Figure 6 shows convergence of iterations on the two meshes. As in all other test cases, the rate at
which the residual norm is reducing with iterations is substantially higher on the polyhedral mesh.
This is partly due to the fact that the polyhedral mesh has 4.7 times less control volumes than the
tetrahedral mesh, but another substantial contribution is due to better properties of polyhedral control
volumes compared to tetrahedral ones. Note that both computations are performed using the same
code, the same discretization schemes (central differences for both convective and diffusive fluxes)
and the same under-relaxation parameters; all cells are treated as polyhedra, irrespective of how
many faces they have. This certifies that any improvement in convergence behavior is due to the
difference in cell topology.

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 7 Niedernhausen/Wiesbaden, Germany
Fig. 6: Convergence of iterations for laminar flow around sphere at Re = 100 on the two meshes.

Fig. 7: Comparison of profiles of axial (left) and radial (right) velocity component computed on a
tetrahedral (650000 cells) and a polyhedral (138000 cells) mesh: through the sphere center (upper)
and 0.814 D downstream of sphere center (lower). Profile data is obtained from the solution using
interpolation to a number of predefined points along a line.

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 8 Niedernhausen/Wiesbaden, Germany
Figure 7 shows comparisons of axial and radial velocity profiles computed on the two meshes at two
cross-sections. Since the points on the profile do not coincide with computational nodes, interpolation
was used to obtain the variable values at desired locations. To this end, the variable value and its
gradient at the nearest cell center were used. Note that, although the cells are substantially larger in
the polyhedral mesh, the obtained profiles are smoother than those from the tetrahedral mesh, where
cells are smaller (the same interpolation method is used in both cases). This also indicates that the
gradients computed on the polyhedral mesh are more accurate (more neighbor nodes contribute to
the gradient at cell center, even though distances between nodes are larger on the polyhedral mesh).

The profiles obtained on the two meshes agree both qualitatively and quantitatively very well (apart
from larger interpolation errors in profiles from the tetrahedral mesh), which shows that – for the same
solution accuracy – substantially less control volumes are needed when polyhedral cells are used
compared to tetrahedra. In all tests performed so far, it turned out that about five times less polyhedra
than tetrahedra are needed to obtain solutions of the same quality on both mesh types. Although the
computing effort per cell is larger for polyhedra than tetrahedra (due to a larger number of faces per
cell – typically three times more faces), the overall effort is substantially lower: between five and 10
times less computing time for the same accuracy has been observed in all applications so far.

Fig. 8: Computation of flow and conjugate heat


transfer in an engine head: polyhedral mesh for
the assembly of solid and fluid domains (upper left)
and for the fluid domain alone (upper right), and
streamlines in the fluid domain colored by
temperature (right).

Finally, Fig. 8 shows the polyhedral mesh used to compute flow and conjugate heat transfer in an
engine head, along with streamlines in the fluid domain. The mesh was generated fully automatically,
starting from a solid model obtained in one of CAD-tools. With CAD-integrated CCM tools and
unrestricted shape of control volumes, coupled analysis of fluid-structure interaction and solution of
other continuum mechanics problems is becoming a lot easier.
_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 9 Niedernhausen/Wiesbaden, Germany
Conclusions

The major improvements in methods for flow simulation in complex geometries have recently been
achieved in three areas:

Creation of a closed surface of the flow domain (CAD integration, manipulation of CAD data,
surface wrapping) as the starting point for mesh generation;

Automatic meshing, using either trimming technique (for a predominantly hexahedral mesh) or
methods for polyhedral mesh generation;

Development of a solution method that allows control volumes to have an arbitrary polyhedral
shape.

The trends for a further increase of productivity and a better integration of CFD into the overall CAE
process are:

Automatic optimization of mesh quality, including mesh motion and re-meshing;

Extension of CFD to a wider range of computational continuum mechanics (CCM) problems;

Development of expert system tools for specific CCM application areas;

Development of novel software engineering techniques to meet the challenges of future parallel
computations on very large meshes, requiring new solutions for interfaces between the user and
the software and between different software modules.

The CD adapco Group is active in all these areas and aims to lead the development of new CCM
technologies.

_______________________________________________________________________________________________________
NAFEMS Seminar: “Simulation of Complex May 3-4, 2004
Flows (CFD) – Application and Trends 10 Niedernhausen/Wiesbaden, Germany