Techniques for detaching particles from fluid force
#2
This is a trickier problem than intuition might suggest.

Fluid force is nothing fancy, all it does it read velocities from each cell of your fluid grid. Each cell velocity has a direction and a magnitude. Those values are used to push particles around that are inside each respective cell. When set to 'Add' mode, the integration method is no different from the way a normal wind, gravity or noise force pushes particles.

However, by default "Blend" mode blends between existing velocities on particles and grid velocities, using linear interpolation...and when affect is at 100%, that means each time step the particle velocities are getting completely replaced with grid velocities. This is where a Fluid Force operator and a typical force operator diverge (wind/gravity/etc are all purely additive).

What you'll probably want to use is "Add" mode, which adds grid velocities to existing particle velocities, the same way any other force works (gravity/wind/etc). The problem, however, is that you're not going to want the grid to continually accelerate your particles, as fluid grids have accelerations already baked into their values over time...so you'll essentially be doubling up on your accelerations which will cause particles to move too fast. You'll have to add some damping (in the form of a Slow operator above the Fluid Force) and balance the Fluid Force influence %, along with your gravity strength.

Alternatively, you could just do a velocity or age test or something on particles and send them to an event with just a gravity force (maybe a fluid force as well, set to 'add' with just a little bit of influence so you don't lose all vorticities) after a while.

You can't really have them only affect particles beyond a certain threshold, because then you'll get strange/unnatural motion, where particles aren't affected by the grid at all and then suddenly when they reach a cell that crosses the threshold, they're immediately pushed by the full force of that cell. I guess a compromise in that regard would be to add a threshold value, and also use that as a water level for all grid velocities, so you'd essentially be cropping all velocities by that value (the threshold would be subtracted from the magnitude of all grid forces, thereby scaling the strength of all grid forces down)...but I don't think that would really solve the original problem you're facing, instead it would just add dead spaces to the grid which themselves could result in strange, unnatural motion.

The best solution would be to simply setup your fluid sim with the gravity force you want. So you'd inject your fluid into it (liquid, smoke, whatever) and then let gravity do its thing within that sim. Then, once you're ready to use it to advect particles, all the proper forces are already baked in.
  Reply


Messages In This Thread
RE: Techniques for detaching particles from fluid force - by tyFlow - 05-10-2019, 09:26 PM

Forum Jump: