Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
11-05-2022, 07:01 PM
(This post was last modified: 11-05-2022, 07:32 PM by locque.)
Look at this: https://youtu.be/Y3trDSWeQh0
The fluid behaves normally when I first pour it into the container with a sticky collision material, but as soon as I pick it up it suddenly starts crawling out of the container in all directions, and as soon as I let go it stops again. This happens with any non-zero stickiness value, which sucks because I really need to fluid to stick at least enough to not fall straight out of the bowl when you hold it at an angle or upside down. I tried increasing the solver substeps up to 8 since that fixed some inconsistencies I had in other cases, but it didn't make any difference here.
The container rigidbody doesn't become kinematic when grabbed by a hand in case you suspect that's the issue. It doesn't get parented either, both the hand and the container stay exactly where they are in the hierarchy and only connect through this configurable joint: https://imgur.com/a/AtHImSd
Here are my relevant obi component settings: https://imgur.com/a/hkMHo14
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
12-05-2022, 07:44 AM
(This post was last modified: 12-05-2022, 07:53 AM by josemendez.)
(11-05-2022, 07:01 PM)locque Wrote: Look at this: https://youtu.be/Y3trDSWeQh0
The fluid behaves normally when I first pour it into the container with a sticky collision material, but as soon as I pick it up it suddenly starts crawling out of the container in all directions, and as soon as I let go it stops again. This happens with any non-zero stickiness value, which sucks because I really need to fluid to stick at least enough to not fall straight out of the bowl when you hold it at an angle or upside down. I tried increasing the solver substeps up to 8 since that fixed some inconsistencies I had in other cases, but it didn't make any difference here.
The container rigidbody doesn't become kinematic when grabbed by a hand in case you suspect that's the issue. It doesn't get parented either, both the hand and the container stay exactly where they are in the hierarchy and only connect through this configurable joint: https://imgur.com/a/AtHImSd
Here are my relevant obi component settings: https://imgur.com/a/hkMHo14
Hi!
That seems to be an issue with friction, rather than stickiness. Stickines/adhesion only applies a force in the contact surface's normal direction, keeping particles glued to the surface of the object. The forces applied by friction however, are tangential to the surface, and proportional to the rigidbody's velocity at that point.
My guess would be this is an update order issue:
A) the container's rigidbody has a certain velocity at the start of the frame.
B) fluid is simulated, and particles calculate their friction using the rigidbody's velocity.
C) At a later point in the frame (before rendering), the rigidbody velocity is either discarded or modified. As a result, particles have moved across the surface of the container as if it were to move using the velocity reported in A), but this velocity is not the one finally used to move it. As a result, fluid crawls over the surface of the container.
Off the top of my head, I would try using a ObiLateFixedUpdater component instead. This will ensure the fluid simulation takes place after all FixedUpdate calls in the scene, if my guess is correct this should fix it.
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
Just tried the late fixed updater, unfortunately it didn't make any difference. I also tried different substep settings and the non-fixed late updater just in case.
Any other ideas? How do I find out what is causing it?
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
12-05-2022, 01:23 PM
(This post was last modified: 12-05-2022, 01:24 PM by josemendez.)
(12-05-2022, 01:07 PM)locque Wrote: Just tried the late fixed updater, unfortunately it didn't make any difference. I also tried different substep settings and the non-fixed late updater just in case.
Any other ideas? How do I find out what is causing it?
Could also be an issue with mass ratios, but that's less likely unless they're rather large. What's the mass of the container rigidbody vs the mass of each fluid particle (the mass of each particle appears in the fluid blueprint inspector, inside an info panel)?
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
12-05-2022, 01:38 PM
(This post was last modified: 12-05-2022, 01:40 PM by locque.)
The container is 1 Kg, particle mass is is 0.0013Kg with a rest density of 100. I tried increasing rest density step by step up to a particle mass of 0.5 Kg, that does not make any difference either.
Are you sure this is related only to friction and not stickiness? The problem completely disappears as soon as you set stickiness to 0, even with dynamic and static friction at high levels.
Posts: 6,322
Threads: 24
Joined: Jun 2017
Reputation:
400
Obi Owner:
12-05-2022, 01:55 PM
(This post was last modified: 12-05-2022, 05:00 PM by josemendez.)
(12-05-2022, 01:38 PM)locque Wrote: The container is 1 Kg, particle mass is is 0.0013Kg with a rest density of 100. I tried increasing rest density step by step up to a particle mass of 0.5 Kg, that does not make any difference either.
Are you sure this is related only to friction and not stickiness? The problem completely disappears as soon as you set stickiness to 0, even with dynamic and static friction at high levels.
Stickiness is only applied in the direction normal to the surface, it cannot make particles move tangentially to the surface of the object by itself. However, stickiness will increase the normal force since it pushes particles against the surface, so frictional forces will become much larger since they're proportional to the magnitude of the normal force.
One experiment you can do to tell for sure if friction is to blame is to make the container non-kinematic, but do not move it using joints or external forces. If fluid keeps crawling around, then my assumption is wrong and we should look somewhere else. If fluid only crawls around when the container's velocity is non-zero then something is messing with the container's velocity after the fluid simulation is performed.
Posts: 71
Threads: 18
Joined: Jan 2022
Reputation:
0
13-05-2022, 02:58 PM
(This post was last modified: 13-05-2022, 04:10 PM by locque.)
(12-05-2022, 01:55 PM)josemendez Wrote: One experiment you can do to tell for sure if friction is to blame is to make the container non-kinematic, but do not move it using joints or external forces. If fluid keeps crawling around, then my assumption is wrong and we should look somewhere else. If fluid only crawls around when the container's velocity is non-zero then something is messing with the container's velocity after the fluid simulation is performed.
That's the situation in the video before I pick up the container, right? The fluid doesn't crawl in this state. Or do you mean no external forces as in not even gravity?
Quote:Stickiness is only applied in the direction normal to the surface, it cannot make particles move tangentially to the surface of the object by itself. However, stickiness will increase the normal force since it pushes particles against the surface, so frictional forces will become much larger since they're proportional to the magnitude of the normal force.
If stickiness only amplifies these friction forces, that would mean setting dynamic and static friction to 0 on my material would fix the problem even with non-zero stickiness, or am I understanding that wrong? The fluid is still crawling in this case where there should be no friction, though less than with friction.
Nevermind, I also had some friction on the material of the fluid which was averaging together with the container material. The effect is gone with no friction on both materials. Having no friction at all makes the fluid way to slippery though, as you explained the stickiness has very little effect on keeping the particles in place on the surface without friction.
|