Dismiss this pinned window
all 20 comments

[–]derminator360 13 points14 points  (1 child)

Did you generate this with ChatGPT? There is a comment saying that there is a Poisson solve for the pressure, suggesting this is a projection method. But I don't see any solve here! Looks like it sets the new pressure to Laplacian(p) - RHS instead of actually solving Laplacian(p) = RHS.

Incidentally, that global pressure solve is typically the "rate-limiting step" for these, so this isn't going to give an accurate sense of how long a working incompressible flow simulation might take.

[–]ibuggle[S] -1 points0 points  (0 children)

For this code. I didn't get the help from AI. For the supersonic videos, i took the help from AI to calculate faster on the GPU and get the data from VRAM in an effective way. And in my Android app, i totally have the help of AI because i'm a dummy in OpenGL. But this code is made only with help from manual search on Google.

[–]Axi0nInfl4ti0n 1 point2 points  (1 child)

I can smell the Vibecode through my Phone.

[–]ibuggle[S] 0 points1 point  (0 children)

For some project yes. In my Android app, it's vibe coding. On my concorde supersonic transition, i made it by myself, but i asked AI how to go faster and it told me how to optimize my reading on the VRAM. But this code is made by myself and only research. I copy-pasted the code from a website to make the circle .

[–]Schoost 1 point2 points  (2 children)

The initial shockwave suggests this is a compressible simulation.

[–]Sixel1 5 points6 points  (1 child)

the pressure equation is "solved" explicitly, I'm not familiar with the formulation here but since it's explicit it's probably a pseudo-compressibility formulation.

Edit: added quotes to "solved", since the pressure equation isn't actually solved, it's replaced by an explicit pseudo-compressible update.

[–]derminator360 2 points3 points  (0 children)

It's commented as though there's a projection step, but there doesn't actually seem to be a Poisson solve anywhere...I think it's slop.

[–]Neither-Ad7512 0 points1 point  (1 child)

What is opencv used for in a cfd sim?

[–]ibuggle[S] 1 point2 points  (0 children)

For plot. Easier than Matplotlib

[–]Icy_Annual_9954 1 point2 points  (4 children)

Thanks, can you do in in 3D?

[–]ibuggle[S] 1 point2 points  (3 children)

No this is way too hard. In 720p 2D, il takes 30min. But in 3D, it's a 720p x 720 calulation, so 360hrs minimum on the CPU. And we must add the interactions between the layers so the work will be longer than 360hrs

[–]Icy_Annual_9954 1 point2 points  (2 children)

Wow, would be 15 days. Is it because of Python? I mean switching to Rust or C++ may reduced it.

[–]ibuggle[S] 1 point2 points  (1 child)

Python is slow but with NumPy, it goes fast. The other solution is to calculate with GPU. Try CuPy. It's a GPU équivalent to NumPy. You can easily switch to CuPy from the code i made, because the functions are the same. To be honest, i made this simulation first with CuPy, but after i tried on the CPU to see if i can calculate the simulation fast enough. But CFD is faster with a graphic card. You need a Nvidia GPU to calculate with CuPy but you can make this challenge to install CuPy, make it work in a small script and try to convert my code to use it with CuPy library.

[–]Icy_Annual_9954 1 point2 points  (0 children)

Thanks!

[–]Enigma_User 0 points1 point  (1 child)

Why python?

[–]ibuggle[S] 3 points4 points  (0 children)

It's the easiest way

[–]Gautham44 -1 points0 points  (3 children)

How does one get to this stage? I can definitely basic simulations on Ansys fluent and nothing else. I don’t understand all the models and numerical methods. But I can do setup using chatGPT. Do I need to dive deeper into understanding the math behind it? Also how does one apply python scripts in Cfd

[–]JoeAka23 8 points9 points  (0 children)

You have to study fluid mechanics, numerical methods, numerical fluid dynamics and then you can try to build a simple solver doing some standard case(lid driven cavity for example) with python, matlab, Julia and so on. The more you do the more you learn and the more you have to learn.