Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Fluid oddities at <= 4 particles
#1
Pregunta 
Hello. I have an Obi Fluid Emitter of 12 Particles, which generally just sits there (purple) without any input. But I noticed that at low particle numbers, the individual particles seem to narrowly clump together, and become somewhat jittery, like boiling water droplets. They also seem to gain a lot of friction to the WASD controls, making it generally annoying/ impossible to control.

I had no intuition that it was Particle Velocities, but on trying to refine the WASD controls I discovered that bodies of 4 or less particles have these interesting symmetrical velocities. I don't know if they are pointing in or out vs the position of the centermass of the droplet.
Obi seems to modify velocities in a lot of places, and I was wondering if you could point me in the right direction. Where might there be relevant forces applied, that I can try to hook into?

I had previously attempted passing around a duplicated velocities array, and copying/zeroing it out, but it didn't work at all in the few locations I tried.

Images of Debug Velocities: various numbers of particles. At just 1 particle remaining, the particle is a bit jumpy and sometimes meanders around a little even without any input

.png   12 moving.png (Size: 6.58 KB / Downloads: 14)
.png   4 still.png (Size: 6.84 KB / Downloads: 13)
.png   3 still.png (Size: 10.77 KB / Downloads: 12)
.png   2 still.png (Size: 10.05 KB / Downloads: 13)
.png   1 jitter.png (Size: 6.75 KB / Downloads: 13)
Reply
#2
(13-08-2025, 11:48 PM)slimedev Wrote: Hello. I have an Obi Fluid Emitter of 12 Particles, which generally just sits there (purple) without any input. But I noticed that at low particle numbers, the individual particles seem to narrowly clump together, and become somewhat jittery, like boiling water droplets.

Hi,

That sounds like surface tension. It's a force that acts on particles whose neighborhood is not full of other particles. It acts to clump small groups of particles together into groups while attempting to minimize the surface of the fluid. Since the shape that has less surface to volume ratio is a sphere (circle in 2D), the result is radially symmetric droplets.

Setting the fluid's "polarity" parameter to zero should disable this.


(13-08-2025, 11:48 PM)slimedev Wrote: They also seem to gain a lot of friction to the WASD controls, making it generally annoying/ impossible to control.

How are you controlling them? using external forces, acceleration (directly writing to solver.velocities), force zones...?


(13-08-2025, 11:48 PM)slimedev Wrote: I had no intuition that it was Particle Velocities, but on trying to refine the WASD controls I discovered that bodies of 4 or less particles have these interesting symmetrical velocities. I don't know if they are pointing in or out vs the position of the centermass of the droplet.

Yes, this sounds about right. Surface tension results in (intentional) inward pointing forces that keep particles together, forming a droplet.

(13-08-2025, 11:48 PM)slimedev Wrote: Obi seems to modify velocities in a lot of places,

Actually it modifies velocities only once at the end of each simulation step. Obi is a position-based engine, which means all internal calculations take place using particle positions, not velocities. Velocities are calculated as a function of the change in position and the timestep duration.

(13-08-2025, 11:48 PM)slimedev Wrote: Images of Debug Velocities: various numbers of particles. At just 1 particle remaining, the particle is a bit jumpy and sometimes meanders around a little even without any input

A single isolated particle is not affected by surface tension, so this "jumpy" behavior you describe should come from somewhere else. Could you share a video - or even better, a repro project - that shows this behavior so that I can take a closer look?

kind regards,
Reply
#3
(14-08-2025, 11:26 AM)josemendez Wrote: That sounds like surface tension. It's a force that acts on particles whose neighborhood is not full of other particles. It acts to clump small groups of particles together into groups while attempting to minimize the surface of the fluid. Since the shape that has less surface to volume ratio is a sphere (circle in 2D), the result is radially symmetric droplets.

Setting the fluid's "polarity" parameter to zero should disable this.
That makes sense. I tested Surface Tension 0 and it got rid of the "point collapse" physics and rendering, although each particle still jitters a bit and meanders. Interesting, thanks for the explanation.

Here are some sample "LittleBigFluid" scenes for Obi 6 & 7 (Unity 2021.3) with the basics setup similarly to my project. Movement is by setting solver's externalForces
I apologize because my copy of Obi 6 is bugged outside of working scenes (no particle/particle interaction) so I cannot say if this Obi6_LittleBigFluid.unity shows a bug or not

   

No sticky issues in Obi 7 with 1-4 particles Cansado  (but a new visual bug: At 2 particles the fluid mesh is invisible, so I added 2 fake particle sphere meshes)
Back in my Obi 6 project, changing Viscocity from 10 to 1 .... seems not to change much of the jitter or meandering. I think upgrading to Obi 7 is the solution.

P.S. Obi 7 is very nice! The reduction in components is great. Seeing the fluid mesh in the editor is incredible!! And there are some nice new callbacks as well.


Attached Files
.zip   LittleBigFluid.zip (Size: 25.39 KB / Downloads: 2)
Reply
#4
(15-08-2025, 08:44 AM)slimedev Wrote: No sticky issues in Obi 7 with 1-4 particles Cansado  (but a new visual bug: At 2 particles the fluid mesh is invisible, so I added 2 fake particle sphere meshes)

That's not a bug, reduce your ObiFluidSurfaceMesher's isosurface value to a smaller value. This will allow areas with less density to be captured by the mesh, if your isosurface value is above the density field that a single particle (or 2, or 3, etc) yields, it will be ignored during mesh generation.

Also, you migh want to reduce the solver's max anisotropy value. This will deform particles into ellipsoids that approximate the shape of their local neighborhood, which looks good for large-ish particle formations but won't look that good on just 2 or 3 particles, as it will result in cross or star-like shapes.

In your scene, I found that max anisotropy = 1.5 and isosurface = 0.05 works well.

(15-08-2025, 08:44 AM)slimedev Wrote: Back in my Obi 6 project, changing Viscocity from 10 to 1 .... seems not to change much of the jitter or meandering. I think upgrading to Obi 7 is the solution.

Viscosity = 10 is very likely to make the simulation unstable. High viscosity values require a extremely small timestep to be stable, for this reason the manual recommends keeping it below 2.


(15-08-2025, 08:44 AM)slimedev Wrote: P.S. Obi 7 is very nice! The reduction in components is great. Seeing the fluid mesh in the editor is incredible!! And there are some nice new callbacks as well.

Thanks! Sonrisa
Reply