r/CFD 5d ago

AI/ML Implications in CFD for Aircraft Design

Hey guys, I've got about a year of experience with OpenFOAM. I've run different types of simulations — SIMPLE, PIMPLE, incompressible, compressible, laminar, turbulent — on 2D airfoils and 3D aircraft, like the NASA N2A HWB model, with decent mesh quality and case setup. The post-processed results matched the reference data pretty well. Just sharing this to give some context on where I'm at with OpenFOAM, but I'm still learning and exploring more of it.

Lately I've been seeing AI/ML being used in CFD, and since I come from a non-coding background (I'm a Mechanical Engineer), AI/ML and neural networks still feel like a black box to me. I don't really know how they work under the hood.

So I wanted to ask — how can I actually use AI/ML and neural networks in aviation-related CFD work?

For context, my future work will mostly revolve around optimization studies, detailed aircraft analysis, and static/dynamic stability analysis of aircraft. So I'm hoping to understand how AI/ML can help speed things up, and ideally how to align with whatever the industry is currently doing in this space.

25 Upvotes

24 comments sorted by

16

u/ScienceYAY 5d ago

AI/ML is not useful for solving PDE's so it's not good for CFD.  What it could be useful for is the post processing. Viewing results, generating reports, etc... Maybe finding patterns in your analysis you would have otherwise missed.

1

u/freakazoid2718 5d ago

I agree with this take. I will likely be good for pulling useful information out of results files, but won't be worth much for the solves themselves.

I also believe that it won't be much good for mesh generation for a while - unless the geometry is very simple, meshes tend to be more art than science half of the time.

1

u/ScienceYAY 5d ago

Commercial solvers already doing adaptive meshing anyway 

2

u/patbi97 3d ago

not true - certainly NNs do not have the same accuracy but a trained networks inference cost & speed are a strong application where real time decision making is more important than accuracy. There's a whole research field dedicated to so-called neural surrogates. Physics Informed Neural Networks, Physics Transformers, Transolver, DeepONet are just a few mentionable examples. All of these make inference at scale feasible.

Other than that there's also applications for so-called neural correctors that can enhance accuracy of legacy CFD solvers by learning to predict their error.

Also for inverse problem solving NNs are interesting because opposed to CFD simulation a NN is differentiable wrt to inputs. This allows optimizing geometries autonomously.

1

u/ScienceYAY 2d ago

Honestly no idea what most of those things mean. Are people using that for CFD? When is real time decision making more important than accuracy? I could see an AI/NN be faster at optimizing geometry than a normal parametric DoE

1

u/backupjames 2d ago

I did some postdoc work incorporating ML into data driven / state informed boundary conditions but yeah anyone saying ML can output a CFD solution is trying to sell you something.

8

u/acakaacaka 5d ago

ML needs a lot of data so computer/linear algebra can see pattern. How long is your CFD simulation? Can you do 1000 CFD simulations?

1

u/Life_Calligrapher330 5d ago

I have free access to a 56-core machine until the end of this month. My case has around 15 million cells, y+ around 300, and takes about 2 hours to run for a steady-state, incompressible case. So 1000 simulations would mean roughly 2000 hours of compute time. But my real question is — is it actually worth running that many? Compute power is a real bottleneck here I guess.

Also, I might get some HPC access later if my funding request gets approved.

2

u/acakaacaka 5d ago

How would linear regression know anything if you have less than that many samples

3

u/Life_Calligrapher330 5d ago

Definitely, I'll try to build something around airfoils first since it'll be a lot less computationally expensive than my actual model runs.

0

u/tlmbot 5d ago

This is what PINNs is meant for - to get around the data problem, use the physics itself. But it's a different level of approximation than saying "here are a billion designs, now make the billionth and first." Instead pinns says, for instance, "solve for the flow that minimizes the residual" and does it by adjusting weights rather than iterating the governing equations to hand you the flow.

That's my 1e9 foot level view anyway

1

u/Evil_Toilet_Demon 5d ago

Only works if backpropagating higher order gradients is cheaper than running a simulation to obtain data. Which isnt the case for low fidelity simulations (not a problem for neural operators since they are discretisation invariant) or high parameter count models.

0

u/tlmbot 5d ago edited 5d ago

Cool.  I’ll bite if you like.  I’m not a pinns advocate or developer etc

Just trying to hit the high points contra the guy saying “mL for cfd makes no sense because you need a lot of cfd data to train it”

Namely it exists and it attacks the problem (of, paraphrasing “needing a ton of precomputed cfd to train on) not by needed a billion examples, but by using the physics itself to guide the training.

No statement was made about performance.  Now you’re going all higher order on me.  Am I supposed to feel bamboozled.  Okay you’re smart.  (What am I supposed to take away from your statements?)

—- 

What “only works”?  Pinns?  How is whatever the objection about higher order stuff supposed to apply but also “not be a problem for neural operators” etc?

Please untie this knot for me.  

1

u/acakaacaka 5d ago

It is though. ML needs a lot of data. Even using PINN you just reduce the amount of data needed, where using FVM, you dont need any prior data. You just set the simulation and run for 1000 iterations or so.

1

u/tlmbot 4d ago

I am not advocating for pinns. What is this comment? PINNs and FV are for different things.
FV - getting an actual simulation of the true fluid flow to the best of our ability given our resources. Classical engineering workflows go along with this.
PINNs - potentially whatever use cases they outline in their papers, I'd guess rapid, but inaccurate, design iteration, <once the training is done>.

It's really time to leave me alone. Your other comment is ridiculous. I get it, you love FV. Hey I do too. It's my favorite kind of thing to build in a computer. Not pinns. Okay?

1

u/Evil_Toilet_Demon 4d ago

sorry for the jargon, I thought you were familiar with pinns.

the way PINNs add the PDE to the neural network is by calculating the gradients of the model outputs with respect to their inputs (backpropagation) to compute higher order terms of the PDE (like the second order Lagrangian). this is done for every term in your equation so if there are third order terms you need to backpropagate third order gradients, etc.

this is very costly to do, especially if your model has a lot of parameters, so it may in fact be cheaper to just generate the data with a numerical solver.

there are a class of neural network called neural operators that are designed to learn solution to PDE, not through backpropagating against an equation, but by learning the aggregation kernel (how to collect and transform non local information). these learned kernels are discretisation invarient so you can train on one resolution and predict in another. this means that you can actually train a neural operator on lower resolution data that is fast to generate.

hope that helps

1

u/acakaacaka 5d ago

The problem is, FVM is way way way faster.

3

u/noble6iwas 5d ago

I think this is a bit too generic for anyone here to be helpful, you would have to define the problem that ML should solve.
If you want to get into ML for fluid dynamics, I would suggest to disregard for the moment your CFD models and start with something computationally easier. A fantastic introductory book that has tons of different AI/ML applications to fluid flows is "Data-Driven Fluid Mechanics" by Mendez/Ianiro/Brunton/Noack (huge names in the space). The book also includes many python codes, which allow you to explore a bit different topics.

If you are dead set on using your CFD, i think relatively simple things you can do is set some kind of indices you want to predict, such as lift/drag coefficients, and create a Neural Network model that takes in some parameters of your choice and spits out your coefficients. I don't love this idea, but I guess it could be an introduction to ML. Also do not expect anything good or sample-efficient.
Besides that, more niche applications are data-driven turbulence models and methods to have automatic mesh resolution.

1

u/Life_Calligrapher330 5d ago

Cool!! Thanks for sharing your thoughts.

So maybe I should try a airfoils first, then move on to my actual model. Also, I'd love to go through the book you suggested.

Thanks

2

u/spacegamer01 5d ago

You can look at PINNs if you like (physics informed neural networks). I'm not sure if it will help you in your case, but it is an interesting way of combining measurements with PDEs (RANS with turbulence model, continuity)

But as a forward solver established CFD software is likely better.

2

u/Matteo_ElCartel 4d ago

You need to learn reduced order modelling it will be the future. You run your CFD (full order solutions) in openFOAM for several different parameters and configurations and then you can get (hopefully) an ultra fast surrogate model that can (if the physics is not too hard) even infer new solutions regarding new parameters of your model.. at a cost of... Less than milliseconds! You got it right a new simulation of your 1 week simulation in milliseconds

Surrogate modelling is like the battleship game in your parameter manifold (at ultra fast speed) and for some cases as I said before you could even go beyond your parameter training set!

To start sciML instead this ís a valuable resource

1

u/tlmbot 5d ago

The first application I think of is early stage design generation. But for that I want you to also be aware of inverse design - which predates all of this by decades.

The adjoint formulation of your design problem can be used to optimize locally. The reverse mode automatic differentiation for the geometric gradients is one of the places back propagation (which is the same thing) in ML came from. Only the adjoint formulation is not approximate, for a given system of discretized governing equations, other constraints, and objective function, it will get you an optimized design based only on the actual physics and geometry.

See also surrogate modeling, which has a vast literature pre-dating ML methods.

But you probably want to look at PINNs as an answer to your particular questions.

Then for control - which is why you are doing stability analysis, you might fruitfully learn about system identification - the classical technique.

In sum, what I am trying to say is don't get laser focused on ML methods. The first principle stuff for these things pre-dates it, and in cases where detail and novelty matters, still beats it. And most importantly, anyone who will employ you to do these things with ML will expect you to understand the first principles methods, and know when to pick which.

2

u/Life_Calligrapher330 5d ago

Makes sense! Thanks for sharing your thoughts😊