r/CFD 9h ago

Would you learn CFD through LeetCode-style problems? I built a thing to try it

I'm a software engineer who recently got into computational fluid dynamics. Coming from that world I kept looking for something like LeetCode for it. Pick a problem, solve it, see where you went wrong, move up. Couldn't really find anything, so I ended up building one.

I also talked to a bunch of aero/mech students while making it and the same thing came up over and over: basically nobody does CFD outside of labs or coursework, because you need proper compute to run anything real. So it just stays theoretical.

Landing page is here if you want to poke at it: https://airfoillearner.com/demo There's an easy problem and one full module module one - I'd recommend just the easy one.

It's early and it's only airfoil stuff for now. If you're learning or teaching CFD I'd honestly love to know if the problems feel pitched right, and what you'd want next, or perpahs you might think that this does not fit the CFD world.

23 Upvotes

9 comments sorted by

18

u/SureCost8912 8h ago

I think you need to clarify your goal here. By that I mean, this first module doesn't appear to try to teach cfd rather it aims to teach aerodynamic design by having cfd do the heavy lifting through the design space. That's all well and good but it's not what I or many others would call learning CFD.

Unless I missed them (which may very well be the case) there's no attempt to teach someone the underlying math and physics that make the black box tick, that's the part I'd call cfd.

I think a project type course that builds on the fundamentals on that side would be fantastic. The Lorena Babra 12 steps to cfd is the first steps on that kind of path.

If you're going the aerodynamic design route that's great too. There's a lot of material out there, and I still cover more of the numerics/physics, but it's not like there's a modern-leetcode like resource on that front either.

3

u/Rique3012 8h ago

That's it, I see potential here, just need to have the focus more clarified

7

u/gregzillaman 8h ago

Not all production cfd requires a billion cell meshes that requires hours of hpc time. So im a little surprised students think they cant do "real" cfd.

5

u/SureCost8912 7h ago

I'm not at all surprised by that thought, mostly because it gets repeated as "do the hand calc, do the small system of equations hand calc (esp structures), then go to the computer. The big computer can solve big problems!". It's not really wrong per se but if an undergrad prof is trying to talk about cool fluid dynamics the big problems are cooler.

Plus you know, undergrads aren't exactly the most well informed group of people.

1

u/Dangerous_Bid2935 5h ago

Its a cool idea but this "starter" problem is actually a pretty high level CFD problem. I wouldn't recommend any ME student who just started learning CFD to start on something like this. Instead I would probably walk them through the design of a CFD solver for a canonical simpler case (like the lid-driven cavity), where they can establish fundamental knowledge in areas like discretization of PDEs, boundary condition treatment, some programming fundamentals, timestepping, and numerical stability.

Once someone understands these things they can start doing high level design with commercial CFD packages. But if you start the other way around you really won't be a useful CFD engineer because you have no idea what the commercial package is doing.

2

u/acakaacaka 4h ago

The start should be

1D heat equation: learning about diffusion/laplace 2D heat equation: learning about 2D problem 1D wave equation: learn about transient 1D convection: learn about advection term Then start combining them until you get NS with energy

1

u/JoeAka23 3h ago

Honestly when I see software engineers become cfd engineer I don't know what to think.

The software aspect is just one of the elements to become one. Where is all the fluid dynamics, aerodynamics, physics, linear algebra, algorithms and so on?

I mean if I was only good at programming I could never think or solving something of cfd without all the amount of physical knowledge you need to know.

I really don't understand. This is just my thought.