skip to Main Content

Mesh Adaption with Caelus and Pointwise

In this month’s blog we describe the usage of Python to drive a process of mesh adaption with Caelus and Pointwise. Mesh Adaption can be beneficial in reducing the effort in meshing, whilst increasing coupling between the mesh resolution and CFD solution.

Motivation for Mesh Adaption

You might be aware that mesh adaption is one of NASA CFD 2030 goals. It seeks to achieve vast reduction in time to perform CFD. The NASA 2030 goals state that meshing and mesh adaption is still a bottleneck. These goals also state that as HPC improves with higher mesh resolution demands – mesh generation and adaptivity will become more problematic.

Therefore Applied CCM sets about trying to address these aspects by developing a mesh adaption tool that works with Python, Pointwise and Caelus to adapt meshes based on CFD solution data.

How meshAdaption tool works

Initial Mesh

On initial setup, a Pointwise mesh with the appropriate surface mesh, boundary conditions types and locations, and is exported in an OpenFOAM format. The interior isotropic part of the mesh can be coarse, and the objective is to use little or no refinement zones. For example, where the flow is expected to have higher vorticity.

Initial Caelus Case

An initial Caelus case needs setting up, with the associated Pointwise polyMesh exported. The user should check that it runs and is somewhat stable. The Pointwise file is kept locally, which will be used as a template for re-meshing.

Python Script

Python is the main scripting language used to control the cycling between mesh updates with Pointwise and simulation with Caelus. The Python script executes the entire process of mesh/CFD cycling. This includes the re-meshing, CFD simulations, point cloud creation for further cycles.

Point cloud Creation

To obtain a point cloud, Caelus uses a functionObject code written for Caelus to output the point cloud based on user defined variables such as vorticity, velocity gradient. In fact, any other result which could be post-processed can be combined into a “refinement metric”. The point cloud carries the local element sizes used by Pointwise for refining the mesh. 

In any given cycle, the point cloud is used for influencing the refinement of the mesh with Pointwise. Note that the point cloud is imported to Pointwise via a Glyph tcl script, which Pointwise supports.

Examples

Let’s look at a few examples to demonstrate the re-meshing/solver cycling. The mesh adaption tool starts with a coarse mesh and refines the mesh – for example in the wake region of flow around bluff bodies. This process could be applied to OpenFOAM or other CFD solvers.

3 Spheres

The 3 spheres example (Figure 1), shows the vorticity and mesh before and after 10 cycles of mesh adaption. Figure 2 shows an animation of the mesh adaption through the 10 cycles. Ultimately the mesh stops refining the wake in the extent of the point cloud and refinement zone.

Figure 1 - Before and after mesh for 3 spheres example
Figure 1 – Before and after mesh for 3 spheres example
Figure 2 - Animated images of the mesh adaption for 3 Spheres example
Figure 2 – Animated images of the mesh adaption for 3 Spheres example

Another way to look at the 3 spheres case is by plotting the number of points in the point cloud versus cycle number. The number of points in the point cloud for a given cycle, settles out to a certain number of points (around 1400) after peaking i.e. it converges toward an adapted mesh.

Figure 3 - Plot of the number of points in pointcloud for 3 Spheres example
Figure 3 – Plot of the number of points in pointcloud for 3 Spheres example

City Landscape

This example relates to the flow through a city. Figure 4 shows an animation of the mesh adaption process. In Figure 5, a comparison of the two different flow directions for the same initial mesh is shown, indicating the mesh is able to adapt the mesh regardless of the direction of flow

Figure 4 - animated images of the mesh adaption for a city
Figure 4 – animated images of the mesh adaption for a city
Figure 5 - final mesh comparison of the flow from left to right (left) to flow from top of page (right)
Figure 5 – final mesh comparison of the flow from left to right (left) to flow from top of page (right)

Glider

The final example relates to the flow past a glider. Figure 6 shows animated images of the streamlines and evolution of the mesh through the Pointwise/Caelus cycles. This indicates the mesh is able to adapt the wake generated past the wings and downstream. The number of points in the point cloud (Figure 7) rises to a peak and eventually starts falling towards a steady number and distribution of points. It appears further cycles of mesh adaptation may be need for this case to reach a stable number of points in the point cloud.

Figure 6 - animated images of the mesh adaption for a glider
Figure 6 – animated images of the mesh adaption for a glider
Figure 7 - Plot of the number of points in pointcloud for the glider example
Figure 7 – Plot of the number of points in pointcloud for the glider example

There is a webcast video describing Mesh Adaption with Caelus and Pointwise and is available on the Applied CCM YouTube channel.

Thanks for reading, the next edition will be later in December. Until then, happy meshing!

To see more about our Pointwise distribution go here, or for a free trial of Pointwise, go here.

Post Series: Monthly Mesh
Back To Top
×Close search
Search