Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
fluid disappear from moving bottle
#1
Hi,

I'm trying to simulate the chemical experiment which required fluid pouring, mixing between bottles.

I simply pour the fluid from a bottle to another, some fluid flies off, and if I move the bottle quickly, all the fluid goes out of the bottle and disappear. 

https://youtu.be/fP3F8r2qk9g

How to keep the fluid stay inside the bottle if I did not pour it out?

Please kindly help, thanks.
Albert
Reply
#2
(21-09-2020, 07:40 AM)actsai Wrote: Hi,

I'm trying to simulate the chemical experiment which required fluid pouring, mixing between bottles.

I simply pour the fluid from a bottle to another, some fluid flies off, and if I move the bottle quickly, all the fluid goes out of the bottle and disappear. 

https://youtu.be/fP3F8r2qk9g

How to keep the fluid stay inside the bottle if I did not pour it out?

Please kindly help, thanks.
Albert

Hi Albert,

This is called tunneling and it affects all physics engines. See this video for more info:
https://www.youtube.com/watch?v=ms0Z35GY6pk
Reply
#3
(21-09-2020, 07:43 AM)josemendez Wrote: Hi Albert,

This is called tunneling and it affects all physics engines. See this video for more info:
https://www.youtube.com/watch?v=ms0Z35GY6pk

Hi, 

The attached script "ObiKinematicVelocities" and the parameter "Fixed Timestep" did help a little, but still the fluid fly off when moving the bottle. 

Really need some hint, please kindly help, PM the project link to you.

In unity Game mode
movement: WASD
camera: mouse
mode switch: T
hold bottle: left click
pour bottle: Q, E, A, or D

 


Many many many thanks,
Albert
Reply
#4
(22-09-2020, 01:46 PM)actsai Wrote: Hi, 

The attached script "ObiKinematicVelocities" and the parameter "Fixed Timestep" did help a little, but still the fluid fly off when moving the bottle. 

Really need some hint, please kindly help, PM the project link to you.

Many many many thanks,
Albert

Make sure you're not using a MeshCollider for the container, as MeshColliders are hollow (which means they're made of paper-thin triangles, and have no concept of inside/outside).

If possible, use distance fields instead as they're much more robust. See:
http://obi.virtualmethodstudio.com/tutor...ields.html
Reply
#5
(22-09-2020, 01:58 PM)josemendez Wrote: Make sure you're not using a MeshCollider for the container, as MeshColliders are hollow (which means they're made of paper-thin triangles, and have no concept of inside/outside).

If possible, use distance fields instead as they're much more robust. See:
http://obi.virtualmethodstudio.com/tutor...ields.html

Hi Josemendez,

Thanks for the suggestions. 

The water is ratoting after cooperated with distance fields, please see  https://youtu.be/6uOrPHEIHaE

How do we keep the water steady? 

Thanks,
Albert
Reply
#6
(23-09-2020, 05:00 AM)actsai Wrote: Hi Josemendez,

Thanks for the suggestions. 

The water is ratoting after cooperated with distance fields, please see  https://youtu.be/6uOrPHEIHaE

How do we keep the water steady? 

Thanks,
Albert

Hi Albert,

Particles should not rotate or move, unless:
- The container's scale is non-uniform. Distance fields only support uniform scaling, as described in the docs.
- Collision constraint iteration count is very low.

Also, a thickness of 0.1 in your collider might be a bit too much. If you need a thicker container to prevent tunneling, use a second, different mesh to derive the distance field from, instead of using the same mesh used for rendering.
Reply
#7
Hello,

Is it possible to have an example in Obi with a fluid container that is never losing fluid, however you move it?

Thank you
Reply
#8
(28-09-2020, 03:06 PM)gontz Wrote: [...] however you move it?

Not possible, not in Obi, not in any physics engine. There's always a movement speed beyond which tunneling will take place. It's built in the digital nature of computers and the way they represent time. Best you can do is try to prevent it in as many cases as possible, but it will never go away completely.

Best practices to avoid tunneling:

- Use the ObiKinematicVelocities component to help CCD.
- Use distance fields or primitive colliders instead of MeshColliders, as they're more robust to tunneling.
- The thicker your container's walls are, the better.
- Limit user interaction speed below tunneling speed.
- If all else fails, reduce your simulation timestep.

Will make an example scene using these for you.
Reply
#9
Hi there,

I modified the ObiKinematicVelocities script to update rigidbody velocities always in sync with the particle solver. This allows robust CCD even at very high speeds.

Replace your ObiKinematicVelocities.cs file with this one. Also make sure to give it a reference to the solver in your scene.

let me know how it goes.


Attached Files
.cs   ObiKinematicVelocities.cs (Size: 1.4 KB / Downloads: 16)
Reply
#10
Thank you 
Yes, it is very stable now.

Quick question: how can I set the lifespan of the particles to infinite?
Reply