Of white storks, babies, drones and parametric gradient-based optimization for CFD
It was this moment that all parents expect to come one day, and despite all mental preparation – when it is finally here – you find yourself caught off-guard. And so, it was no different for me when – some time ago – my daughter came to see me and asked:
“Papa, where do the babies come from?”
I was rather embarrassed by the question. Now here was it, that moment when I had to explain to her how babies arrived in homes. Immediately, the usual suspects went through my had: The “birds and the bees”, “love, kiss and marriage”, “ask mama” (where is she by the way?), and – as I was just staring at my screen with some airfoil study:
The White Stork tale
Here in France, or more generally in folklore from Europe, the Americas, North Africa and the Middle East, it is often said that the white storks bring the babies. Who came up with that idea you wonder? And more importantly why would you use that one as an engineer? Well, I frankly admit it, in that moment of non-reflected embarrassment and the desperate need for quick answers, I threw all scientific idealism overboard and went for – what I thought was – the quick win:
“It is the White Stork” I went “that brings the babies…”
And by the time I had finished that sentence, and knowing my daughter, I knew:
“You will not get away with this.”
Immediately, her engineering fever began to develop.
“But papa, how can a white stork carry a baby. It is too heavy, no?”
Of course, my daughter knows I am a meticulous engineer, and so I now had to invent a “plausible” explanation how a stork could carry the weight of a baby. And who would have thought that computational fluid dynamics CFD and adjoint based optimization would come in handy in a moment like this…
And so, my fairy tale continued – thanks to science…
Who needs birds and bees – when you have lift and drag
“Look my little bird, a stork, in normal times, must be able to travel from Africa to France bearing only its weight. And yet this trip already requires extraordinary flying skills.”
“Ok papa but, it still does not explain why the stork manages to deposit the babies in the chimneys.”
“Well to do this, the stork must minimize its efforts while still staying up in the air with that little package. That is to say, on the one hand, the stork must be able to compensate for its own (and the baby’s!) weight and on the other hand, it must slip through the air with as little friction as possible to not run out of energy for the long flight.”
[Before you judge me, try yourself to explain to your little kid that the ratio of lift to drag should be as high as possible… ]
Anyways, I wasn’t surprised when my daughter said.
“Okay, papa, but how does it do that? The stork?”
And so unavoidably, what had started as a very simple question, on where the babies come from lead us deeper down the aerodynamics rabbit hole. But as an engineer, I was at least in my comfort zone now. And my current project for work just came in handy:
Keep the white stork tale flying with CFD
Being Product Manager for Computational Fluid Dynamics based Design Exploration, I have access to some nice optimization tools. And lucky as I was, we were just about to introduce a new optimization technique and – guess what – our first demonstrator case of choice was a wing profile (to be fair an airfoil, but good enough to keep the white stork tale flying).
“Show her how the stork would arrange his feathers intelligently to create a wing shape that maximizes the ratio of lift over drag and I should get away with it” I thought. But like many children (and today’s customers and markets) my daughter is not very patient. So, I had to show her results quickly.
“Let’s start with a wing profile” I went and showed her the optimization study of an airfoil profile based on the Parametric Gradient-Based Optimization capability that will be released in Simcenter STAR-CCM+ 2306.
Parametric Gradient-Based Optimization for CFD
For the interested – slightly more patient – reader, this is (in a nutshell) what this new technology is all about:
The innovative element is that, compared to an unguided parametric optimization, parametric gradient-based optimization allows parametric studies to be performed using the adjoint sensitivity of design parameters to guide an optimization study. To do this, the adjoint sensitivity of the specific objective function is first evaluated with respect to the surface position. In the examples discussed in this article, we will consider the lift-to-drag ratio, L/D, as the objective function to be maximized. In a second step, geometric sensitivities are evaluated, namely the sensitivities of the surface positions with respect to the CAD parameters. The methodology finally combines these two metrics to calculate the sensitivity of the objective function with respect to the CAD parameters. This information is in turn used to drive the optimizer in the right direction.
Compared to traditional “unguided” parametric DX this method enables a rapid convergence towards local best designs with a minimum number of simulations, something that comes in handy if a little girl (and your customers) are pushing for quick results. And – to further address a little girl’s (and the markets’) impatience the integration of the technique into Simcenter STAR-CCM+ Design Manager comes in handy. The streamlined workflow and automated process makes the setup, execution and postprocessing of the optimization studies a breeze.
Rapid airfoil optimization
And so, to illustrate my point on optimized lift over drag, I chose to show my daughter how the stork could organize its feathers with cutting edge optimization technology to come up with a more performent wing section profile. In the hope that would be good enough… or just bore her enough.
Among us – fellow engineers: the wing profile is called NASA Common Research Model (CRM) Transonic Airfoil – not exactly a stork wing to be honest – but it should do the trick. Also, I did not go into the explanation of the speed at which a stork flies and refrained from warning it that Mach 0.8 was not realistic for a stork…
But apart from those details, I got a good enough profile to make the case: In our parametric design the wing profile is determined by 17 parameters with the initial CRM profile obtained from a least square fit to the upper and lower profile chord respectively (I will spare you the details on the parameter space).
Once a meaningful and CAD-robust parameterized airfoil is available with such a high number of parameters it makes it the perfect candidate for the Parametric Gradient-Based Optimization with the objective of maximizing the L/D ratio. Setting up the study in Simcenter STAR-CCM+, is straight forward, you prepare your reference simulation file and run the adjoint solver, as any other adjoint computation. You just need to add the geometric sensitivity calculation, to have all input data for Gradient Based Optimization.
Then just finalize the design exploration study setup in the embedded Design Manager and off you fly:
And here you go, in 14 Designs iterations (with a total of 32 designs evaluated), the optimal result is found, and our stork, by reorganizing its feathers, is already 8.5% more effective:
As you probably ask yourself the question (at least I asked myself), is this the better approach than the direct approach with no gradient-based guidance using the classic SHERPA algorithm ?
When running SHERPA we found a global optimum in 500 trials. It is commonly said that it takes about 30 trials per parameter to find an overall optimum of quality using a direct approach. A guided optimization – while not suited to find a global optimum – finds a decent local minimum while doing a similar job as SHERPA for that in a fraction of designs attempts. So each has their place.
Well, back to my interrogation – as my daughter did not really care.
“This is boring, papa. And I don’t see a stork on your screen.”
Storks, drones and winglets
Maybe this kind of result was just not visual enough for her, and she apparently did not understand my point without seeing some results in 3D.” I thought. “Let’s shift gears.”
To make things clearer, I decided to talk to her about the winglets, as it echoed a question from last summer when we flew. She had asked me why planes do not flap their wings to fly (I will skip this question here), and why the wing of the plane is bent at the end.
“For sure, the stork puts its tips of feathers towards the sky when it flies (like eagles, falcons…), that’s maybe it’s secret why it can carry a baby” I said, “let’s try to prove it!” Well, again, I did not have a stork model handy, so I had to improvise:
“That is not a stork, papa”
“Let’s forget that for a second, just focus on the wings and let me show you how we can make that thing fly even better – like a stork… and carry a baby.”
As she saw from the picture, the drone I had at my disposal had straight wings, and as she believed me, it can fly. Again, I pulled out gradient based optimization method, this time on the fully parameterized 3D wing structure. Again, the objective was to maximize lift while minimizing drag… this time we add a constraint (remember we must carry a baby) to define a minimal acceptable lift force, corresponding to more than 57 kN, (stork plus baby).
As the optimization goes within a few design iterations almost majestically, the drone lifts its wing tips and forms winglets. Just like a stork.
But how much does this concept of winglets really add to improved drag at a given lift: Within 20 design loops the drag improves by almost 7% at sufficient lift, good enough to carry drone (I mean stork and baby). And with that drag improvement even the long distance.
Gradient Based Optimization | Direct approach (SHERPA) | |
Drag Force (N) | 3,331 | 3,260 |
Improvement (%) | 6.7 | 8.7 |
Lift Force (N) | 57,392 | 57,723 |
Runtime (hours) | 34.4 | 122.8 |
Again, in comparison to the SHERPA approach (here with 60 designs studied), you can see how Gradient Based Optimization is faster to get a local optimal value, even with constrains. Also you do not need to know how many designs I have to run upfront, and rest assured it’s reliable enough to get a result. Looking at the evolution of the best designs we see the gradient based method is (as one might expect for a gradient based method) moving within a local region of the design space, while SHERPA is exploring the design space more extensively considering more global optima at an increased exploration cost.
A harsh touch-down
I was quite proud of myself, and the optimizer to actually come up with some winglets. I will keep in mind to use Gradient Based Optimization whenever I have a lot of parameters and try to quickly find a local optimum. I was at peace engineering-wise. But parent-wise I still had to get this over the finishing line. Proudly pointing to the screen I went back to my daughter and said:
“Look, given this, if the white stork can arrange its feather like this, it can fly with a baby.”
She stared at the screen, then back at me, and went:
“Nice story, papa. I think storks are amazing fliers. For the baby question, I think I’ll go ask mama.”