I’ve thought it’d be easier and maybe faster to use the particle system for fluid simulation, and mentioned it before, figuring that it’d be related to the volumetrics project. (I think I’d first encountered it in OE-CAKE). This morning I found that the right term/method for what I’m thinking of is Smoothed Particle Hydrodynamics.
Searching under this term, I came across a bunch of cool XSI videos, and an open source demo application called Fluids (Windows version requires glut32.dll), which runs ridiculously fast on my puny computer. There’s some white papers linked from the same page.
Maybe something to check out post-2.5…?
EDIT:
Thinking about it, I’m still not sure how it’s converted into a ‘surface’… might be slower than current Fluidsim!
Interesting read. Do you have any articles that explain the current system used by Blender?
I would guess, from my uneducated and aspiring position, that a particle based system would allow a greater range of effects. Water mixing with oil for example. Or a colored water [particles] entering clear water. It might be useful for simulating steam and pressure. Each particle pushes on others with varying degrees of force, etc.
One listed drawback was “many voxels or particles will be used to fill water volumes which are never rendered.” Sometimes this will be true. However, when working with clear fluids everything is rendered. If you watch movement in oil you can actually see the waves moving around. I don’t know if this effect could be reproduced? Also, things like water bubbles are things happening under the surface, which would need to be rendered.
It seems a more processor expensive solution, but probably more flexible?
I’m know little about programming, but I have many theories. I thought this is the way the current system worked, with a bunch of particles moving around, but I guess not.
Wow, check out these effects achieved with the SPH method achieved in the OP. A real wet dream, pun intended. Any one of this guys videos is jaw dropping.
These are some interesting reads, even for a non-coder.
I expect I’m ignorant of plenty of the benefits of LBM, but am just infatuated with particles. From the point of view of an artist, it seems advantageous to exploit the versatility of particles for, like, everything (hair/fur, volumetrics, fluid, etc). Nodes and particles for everything!
You need a lot of particles to simulate big masses of fluid.
You only need to render the outer surface of the fluid mesh.A particle is represented by a vertex.So it does n’t make sense to have vertices inside a mesh…
I was talking about things like bubbles inside the water. Sure, the bubbles are under the surface, but they still need to be rendered. Also, if you’ve ever seen a clear oil, you’ll notice you can see currents and movement inside the liquid itself - not just on the surface.
IMO the particle based approach would be better for these types of effects. However, my opinion is worth very little, because I don’t know much about the programming and maths.
Once the volumetric render from the physics branch is in trunk you won’t need extra geometry to animate movement within fluid like other fluids, you’d just use a special procedural texture and the only interior geometry would be for bubbles.
Not sure why both methods couldn’t be supported. The Navier-Stokes method is the one used in Maya, btw. Depending on what effect you need to achieve the navier-stoke methods seems more applicable, probably for combustibles and fire, etc. For big wave and more solid type effects then the current method makes more sense. My favorite thing about using particles is that they can generate more particles and so things like foam on waves, smoke eddies can be done for you by the algorithm.
The Bullet Physics Library has SPH slated for an upcoming release (looks like there’ll be at least a preview in Bullet 2.75), which means it’ll likely eventually get into Blender by way of the Game Engine at least. Actually, the code contributed to Bullet is the example I cited in the first post of this thread!
Bullet has come a long ways, with Soft Body simulation and now SPH – and all in realtime. I hope Durian might call for a closer integration of Bullet and Blender outside BGE, for VFX simulation, physical (ragdoll) Armature constraints, and SPH!
I have been read up on the theory of SPH as I wanted to code something similar but of late I have not really been spending time on it. Just to clear up some facts that I see people often get wrong when talking about fluids etc.
All fluid simulators, if the physically accurate, solve the Navier Stokes equation. The Navier Stokes equations are what you get when you apply Newton’s second law of motion to fluids. So to call one physically accurate fluid simulator a Navier stoke solver and the other not is a bit of stretch or marketing gimmick. If you want to show that you have a new methodlogy of solving fluid problems you usually have to show that you solution is consitent or a valid way of solving these equations.
Navier Stokes equations are non-linear partial differential equations which unless you are dealing with a trival case don’t have exact solution. You have to ‘solve’ them using what are known as numerical methods.
Fluids sims are essentially numerical methods of solving those equations. In the engineering field (which is what I studied in university) we use finite volume, finite element or finite difference method. LBM and SPH are just altenative methods of doing this both are newer techniques which are not as established as finite volume or finite element methods at least in engineering
SPH have particular advantages in that the are Lagrangian (particle based) and grid free method. LBM is also particle based but needs a grid as far as I know. a lot of research around explosives and astrophysics makes use of SPH
P.S don’t confuse the particles of a fluid sim with cg particles. The particles of fluid sims are a mathematical construct, you should not confuse these with molecules as well. In classical fluids literature, fluids are treated as continuims with no molecules. A ‘particule’ is simply an extremely small chunk of this continuim.
P.S.S so bullet has SPH, this is very interesting and cool news.