Surface Cleaner – a New Tool for Resolving Self-Intersections and Overlaps

Introduction

CFD engineers often have to work with geometries that were not created by professionals in the field. This situation then results in the handling of imperfect geometries, presenting challenges in the simulation process. The most common problems occurring in surface meshes are unresolved self-intersections and overlaps. To clean these problems, CF-MESH+ now offers a new utility, “Surface Cleaner”. Guided by a user-defined relative and angle tolerance, this algorithm handles overlaps and intersections, simplifying the surface mesh for improved volume mesh generation. Users now can perform a comprehensive surface mesh preparation within CF-MESH+, utilizing the tools illustrated below.

1) “Surface tools” in the “Tools” ribbon tab

Basic surface cleaning

In the following example, observe the “Surface Cleaner” algorithm in action. It showcases a scenario featuring eight cubes placed inside each other, sharing a common corner. You can see how the algorithm re-triangulates the given geometry, effectively resolving these overlaps and intersections. This example highlights how the algorithm optimizes the surface, creating a more suitable configuration for the mesher and clearly defining different domains, once overlaps and intersections are resolved. The algorithm groups new triangles into a new patch and identifies all patches involved in that specific part of the surface.

2) Unresolved CubesInCube.fms geometry

3) Resolved CubesInCube.fms geometry

This is also demonstrated in the following example, where a cylinder intersects a cube of matching height.

4) Un-resolved CubeCylinder.fms geometry

5) Resolved CubeCylinder.fms geometry

Careful selection of user-defined relative and angle tolerance is crucial when working with complex and imperfect surface meshes. Excessively large tolerance may lead to slight distortions in geometry. In cases focused on resolving intersections, a very small relative tolerance can be sufficient for the cleaner to effectively address intersection issues. The relative tolerance sets the upper limit for the distance between two points on a surface to be considered as overlapping or intersecting. This distance is determined by multiplying the average distance from a triangle’s centroid to its vertices by a user-defined relative tolerance. The angle tolerance defines the maximum acceptable angle between two triangles for them to be considered overlapping.

After the surface re-triangulation, the feature edges are re-detected. Users have the option to specify the angle tolerance or sensitivity for feature edge detection. In cases where these parameters are not specified, the algorithm defaults to using the calculated angle tolerance for feature edge detection.

6) “Surface cleaner” properties

Handling complex and imperfect surface meshes

To illustrate the cleanup process for a complex and imperfect surface mesh, we will utilize the HeatExchanger.fms geometry. In the unresolved geometry, most of the external components are overlapping or intersecting, while there are also internal intersecting elements not visible in the displayed image. Upon executing the ‘Surface Cleaner,’ the tool resolves overlaps and intersections, significantly improving the manageability of the surface mesh and facilitating the correct setup for volume mesh generation.

7) Un-resolved HeatExchanger.fms geometry

8) Un-resolved and resolved HeatExchanger.fms geometry

In the image above, you can observe how the ‘Surface Cleaner’ incorporates edges/triangles to merge intersecting or overlapping triangles. (Slightly lower relative tolerance than the default value, specifically 0.0005, is employed to address the shape of the unresolved triangulation. This adjustment aims to prevent distortions and ensure the effective resolution of overlaps and intersections in the surface mesh.)

Following the cleanup, you can effortlessly manipulate your mesh using the ‘Selection modes’ in the viewer and other ‘Surface tools’ like ‘Remove parts’ or ‘Triangulate missing parts.’ These tools allow you to eliminate unnecessary portions of the mesh or fill holes enclosed by specified edges.

Volume mesh generation algorithms in CF-MESH+ are fault-tolerant, as long as the defect is smaller than the required local cell size. This is especially important for multi-domain meshes, where large gaps in the geometry may cause invalid domain definitions. That’s why utilizing the ‘Surface Cleaner’ is convenient when dealing with imperfect geometries, as it helps minimize these faults.

Preparing surface meshes for MRF simulations

The following example will demonstrate the process of preparing the geometry of a small airplane for an MRF (Multiple Reference Frame) simulation with two domains, where one of these domains represents a rotating zone inside the CF-MESH+.

9) Airplane geometry

Initially, a cylinder primitive is added around the airplane blades and after that, it is merged to the surface mesh (right-click on the newly created primitive->”Merge to surface mesh”).

10) Airplane surface mesh before “Surface cleaner”

Subsequently, the “Surface Cleaner” tool is applied to define a distinct patch for the rotating MRF domain. When employing the “Surface Cleaner” for tasks like this, where we want to create separate patches by intersecting the geometry with a primitive body, it is recommended to use a very small relative tolerance (such as 0.00001 or lower). This helps preserve the geometry and prevent slight distortions during the cleaning process.

11) Airplane surface mesh after “Surface cleaner”

Once the cleanup is completed, the viewer selector is employed to designate an MRF interface patch, facilitating the specification of domain settings. The mesher sees every enclosed geometry as a potential meshing domain and it is necessary to define the domains we want to mesh. Using one of the available selection modes, such as “Manifold” or “Critical angle,” select the portion of the cylinder located on the outside of the aircraft patch. This selection will enable the creation of a new patch named “MRF_rotating” (right-click inside the “Viewer”->”Add faces to patch”), serving as a distinct patch for our rotating domain. Similarly, after resolving intersections, the user can easily remove parts of the surface mesh that could cause issues during the generation of the desired volume mesh (using the “Remove parts” surface tool).

13) “MRF_rotating” patch

Establishing domain settings using bounding patches is now a straightforward process. Two domains need to be specified, as illustrated in the picture below. The “Bounding_box” patch in the image represents the outer mesh boundary box. The user must be aware that the combination of patches used to define a domain must be strictly unique to the given domain.

14) Domain definition

As you can see, the final mesh consists of two domains, “Rotating” and “Outer”. Such a mesh can now be utilized for MRF transient simulations.

16) Multidomain airplane volume mesh

17) “Rotating” domain

I hope that you have found this post useful and that it has made you curious to try out CF-MESH+ and its Surface Cleaner utility. You can also subscribe to our newsletter to stay informed on our newest developments.

Choose your best solution

cfMesh (open source)

cfMesh is an open-source library for mesh generation implemented on top of the OpenFOAM® framework. Read more here.

Note: None of the OpenFOAM® related offering by Creative Fields Holding Ltd is approved or endorsed by OpenCFD, Ltd. (ESI Group), producer of the OpenFOAM® software. OpenFOAM® and OpenCFD® are registered trade marks of ESI Group.

Basic automatic cell sizing

Boundary layers

Cartesian 2D + 3D

Open source

Polyhedral meshing

Tetrahedral meshing

CF-MESH+ (pro)

Discover superior boundary layer generation capabilities, all in an affordable, automated, easy-to-use software.

Basic automatic cell sizing

Cartesian 2D + 3D

Commercial

Polyhedral meshing

Tetrahedral meshing

Advanced control of layer topology

Advanced control of mesh quality

Advanced control for automatic cell sizing

Advanced selection of domains that shall be meshed

CAD import

Hexahedral meshing

Robust algorithms for mesh quality control

Support included (except the hourly licenses)