# 4 ways to CFD speed-up: don’t calculate hard-calculate smart!

As you might now, with cloud technology, we will run Digital Twins on a Power-on-Demand model. Swiping your (company) credit card will give you immediate access to thousand of processors without having them on-site to gain a massive CFD speed-up. The advantages are of course numerous and computational power won’t be a limiting factor anymore.

Having so much computational power readily available, doesn’t mean that we should waste it. And in product management, we know it very well. CFD Speed-up is one of the fundamental concerns for a CFD engineer.

And sometimes CFD engineers happily sacrifice accuracy for a speed-up gain. But should this always be the case? No, no and no!

Even if in the future the computational power available will be growing, code efficiency will always be central for software vendors. And personally, I am a big fan of those physical models that don’t calculate hard, but calculate smart. Such models use smart solutions which trigger a significant speed-up, **without sacrificing accuracy**. And often times, such solutions are so elegant that lead you thinking: why did no one think about this before?

Here are four smart strategies to CFD speed-up, just to name a few that are available in Simcenter STAR-CCM+:

## CFD speed-up strategy 1: **If you calculated a quantity before, why calculating it again?**

The first approach starts from this question: **if you calculated a quantity before, why calculating it again?** Such approach is **clustering**, which we normally use in combustion simulations. Imagine the most simple flame: a candle for instance. To make it very simple, the reactants will continuously mix and burn inside the reaction zone. Depending on the local condition and the respective quantities of each reactant, a given temperature is achieved. Such local conditions will repeat continuously in very similar mixtures and achieve very similar temperatures all around the candle.

The fact that a given mixture leads to a given temperature is intelligently exploited in clustering. The algorithm looks at similar conditions of the mixture, groups them and calculates one given source term of species and energy for each group. The calculation is thus not repeated at each computational cell. It is a brilliant and elegant approach, which leads to significant speed-up up to 5!

## CFD speed-up strategy 2: **Calculate only what is important…**

Since a couple of Simcenter STAR-CCM+ releases, we introduced our Adaptive Mesh Refinement (AMR) approach. Needless to say, I am also a big fan of it. Even a very young CFD engineer knows that we have to take care of both time and length scales. If we do not respect length scales, gradients of the calculated quantities diffuse and your solutions will end up being quite inaccurate…

The AMR algorithm increases the number of cells only in those regions in which gradients are stiffer. This simplifies the life of the engineer as she doesn’t need to refine any pre-defined region. And of course, at theoretical equal accuracy, AMR allows you to achieve a higher speed-up, depending on your configuration and physics.

## CFD speed-up strategy 3: **Divide et impera..**

As said above, length and time scales are one of the main concern of the Digital Twin engineer. You have to solve them correctly, otherwise you will end up with an inaccurate solution. But what if the problem you solve has very short and very long time scales simultaneously? The problem is, this is more typical than you think, heat transfer calculations being the typical example.

You have then three options: **#1** you use a very low time step to solve correctly the shortest time scales. And you will end up with an incredibly slow calculation. **#2** Or second option, you use a higher time step, but your calculation would be inaccurate. **#3** Or you use Simcenter STAR-CCM+…

In Simcenter STAR-CCM+, Simulation Operations allows you to implement efficient workflows to deal with such problems. Without writing a single line of coding you can easily switch from one physics to the other, every time respecting the time scales. And coordinate the information exchange between physics with very different time scales. Speed-up in this case: up to 40 for an SCR calculation!

## CFD speed-up strategy 4: **Reuse and recycling applied to meshing.**..

A very last example of how the Digital Twin becomes smart to speed-up your CFD is the** new remeshing for periodic cyclic motion feature that will be introduced in the Simcenter STAR-CCM+ 2021.2 release.** Imagine a rotating element around one axis, for instance the gears of a gear pump. The boundary conditions of the pump do not vary. The repeating flow patterns and gradients can be thus solved with the same meshes. In this case we will be using morphing, that is computational cells vertexes move accordingly to the movement of the boundaries. In this case, the gears movement will drive the movement of the cells.

There’s a problem though: some cells might squeeze, especially in the tight gaps. As a consequence, after some degrees of rotation, a remeshing is necessary to build higher quality cells. **With the new feature, the new remeshed meshes will be stored and reused** with a frequency established by the user.

### …with outstanding speed-ups

Let’s take the example of a gear pump for instance, widely used in the chemical or oil sector. The video below shows a gear pump simulated in Simcenter STAR-CCM+. First of all we need to deal with the remeshing: the remeshing occurs every 2.5 degrees. Such small rotational interval is small enough to avoid bad cells. Furthermore, these gears have 12 teeth, meaning that the geometry repeats itself every 30 degrees. In other words, to describe the rotation of one single tooth, we are remeshing 12 times. And the solver builds 12 meshes in the first phase of the simulation, stores them and continuously reuses them afterwards.

How bad would it be to remesh every 2.5 degrees without recycling? The answer is in the figure below, in which the Solver Elapsed Time is compared for a simulation with and without reusage.

In the first phase, the Solver Elapsed Time is of course identical. However, when we start reusing, the difference becomes quite evident, almost achieving a speed-up factor of 2!

**Stop calculating hard, calculate smart**!

It is our duty to build a digital twin that uses computational resources in a productive way; that is doing the same thing in less time. Take again the example of the cloud. A speed-up factor of 2, 5 or 10 means that you will be paying half, one fifth or even one tenth to run the same simulation with the same level of accuracy. Looking thoroughly at the technicalities of the software to find bottlenecks and write the code in the most efficient way will always be fundamental. However, the four strategies above are just an excerpt of what we do in Simcenter STAR-CCM+ to make you run your simulations even more efficiently. So, always stay tuned to discover new elegant algorithms, as the ones presented above, that will trigger significant CFD speed-ups.

The target is to stop calculating hard, but calculating smart.