18-05-2022, 01:44 PM
(This post was last modified: 18-05-2022, 01:47 PM by josemendez.)
(18-05-2022, 12:22 PM)locque Wrote: I made a lab scale which is supposed to weigh fluid in a container, which worked really well up until I had to raise the solver substeps in my project to 8 to get viscous fluids to behave properly. Now suddenly all particles weigh only about a fourth of what they did on 1 substep, and also vary in their weight by a factor of at least 2 depending on how you pour them into the container and how long you wait after that. Sometimes the fluid even lifts the container up so much that it lifts itself up and the filled container actually weighs less than the empty one.
I can compensate for a weight reduction, but I can't work around the inconsistency. Is there anything that can be done to mitigate it?
Hi,
How are you weighting the particles? keep in mind that using more substeps decreases the simulations effective timestep, so if you're factoring the timestep in your weight calculations you will need to account for the number of substeps.
Also, all forces involving rigidbodies will be affected by using substeps, since substepping updates the fluid solver more often than the rigidbody solver (which uses Unity's global timestep). The only way to get them both to agree regarding the forces "seen" by each other is to update them in sync: if you're using 8 substeps, use 1 substep and a fixed timestep that's 8 times smaller instead.