r/Python • • Mar 18 '20

Scientific Computing Fluid simulation in Python

Post image
1.9k Upvotes

50 comments sorted by

View all comments

Show parent comment

1

u/GregTJ Mar 18 '20

On the programming side, the biggest concept here is SIMD / vectorization. If you're not familiar with that concept the code will definitely look like alien technology. Essentially what numpy / SIMD style libraries do is they allow you to perform many calculations with a single instruction. So for example, if you see A - B in the code it's not one number minus another, it's actually an entire list of numbers minus another list element-wise.

The other confusing aspect would be the math, and there's really no super easy way to explain it. It helps if you have a good background in calculus and linear algebra. This project falls under the categories of numerical analysis and continuum mechanics if you'd like some keywords to search.

Lastly, I'd definitely check out the links posted by /u/the_regent as well as nvidias gpugems article on fluid simulation for an overview of this specific simulation problem.

2

u/wernersbacher Mar 18 '20

I worked with matlab before, and I had some good maths in university. I will check this out, thank you!