Page MenuHome

Mantaflow FLIP particles not working correctly
Closed, ResolvedPublicBUG

Description

System Information
Operating system: Linux-5.4.0-7642-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce RTX 2080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100

Blender Version
Broken: version: 2.90.0 Beta, branch: master, commit date: 2020-08-21 15:35, hash: rBebf10b72b05f
Worked: 2.83.5

Short description of error
FLIP particles jump around and behave erratically. They seem to over-react to collisions.

But also note that:

  • in the first frame the particles have already moved outside of the fluid flow object. I think that instead they should have stayed still since gravity wouldn't have had the time to affect them?
  • in the second frame the particles drop outside of the domain! Is this supposed to happen?
  • in the third they're back in! but still traveling down!

Exact steps for others to reproduce the error

  1. Open file
  2. Play animation

Event Timeline

Funny what happens if you load the fluid-290.blend into 2.83.5 :D

Richard Antalik (ISS) changed the task status from Needs Triage to Needs Information from User.Aug 26 2020, 7:53 AM

I can't reproduce difference when looking at fluid-285.blend in 2.83 or 2.90 or 2.91. You can not compare behavior of 2 files in 2 versions.
fluid-290.blend looks broken in both versions. Perhaps there is some bug in this file, I am not sure. You can change report or create new one to report issue in that file.

So my issue with report is that there are too many files to cross check. it should be possible to use one file to demonstrate bug. I think steps to create such file could help.

Ervin Weber (lusque) added a comment.EditedAug 26 2020, 9:11 AM

Hi Richard, you're right, let me explain better.
I did the tests starting from the same file and then saving the results as new files in 2.83.5 and 2.90.
If the fuild-290.blend seems broken, I think maybe it's because blender 290 broke it. I don't know either.
Here are the steps I used to reproduce the behavior.

Open the attached setup.blend (done in 2.83.5). It contains 2 cubes and an animated cylinder, no fluid enabled.

  1. enable fluid domain on the bigger cube, type liquid, default settings, just change the cache to frames 1-120 (Also you may want to change particle size to 0.001m to see them better)
  2. enable fluid flow on the little cube, type liquid, default settings
  3. enable fluid effector on the cylinder, type collision, default settings

If you repeat the test in both 2.83.5 and 2.90 you'll see the results are similar to the videos I posted above.
At least that's what's happening to me.

To reproduce the slow-motion video I did the following:

  1. changed the animation end frame to 1200
  2. scaled the cylinder keyframes 10 times with the cursor on frame 1
  3. changed the domain time scale to 0.1
  4. changed the fluid cache to 1200

Let me know if you need any more info

I could not create a simulation in 2.90. The particles were not visible. No idea what is happening...
But I followed your steps with success in 2.83. Either I am doing something wrong or 21cb6f09ffa8 is broken...

Raimund Klink (Raimund58) changed the task status from Needs Information from User to Needs Triage.Aug 26 2020, 1:08 PM

Now I could reproduce it in 2.91 (396d39c6b904). But still not in 2.90. The particles are only visible to me if I open the .blend saved from 2.91. Super weird...

Sorry Raimund, I forgot to mention that that's also happening to me.
The particles don't appear in 2.90.

But I saw that by changing one of the domain parameters (eg. resolution) makes them appear.
I guess it triggers an update in the fluid sim?

@Ervin Weber (lusque) Can you tag the report as Blender 2.90?

Could it also be related to OpenVDB somehow?

Maybe it's particle-related.
It looks like the particles are 1 frame ahead in respect of where they should be.

Eg. in the first frame they should be still inside the emitter. Instead they've already fallen out of it.

Open the attached setup.blend (done in 2.83.5). It contains 2 cubes and an animated cylinder, no fluid enabled.

  1. enable fluid domain on the bigger cube, type liquid, default settings, just change the cache to frames 1-120 (Also you may want to change particle size to 0.001m to see them better)
  2. enable fluid flow on the little cube, type liquid, default settings
  3. enable fluid effector on the cylinder, type collision, default settings

If you repeat the test in both 2.83.5 and 2.90 you'll see the results are similar to the videos I posted above.
At least that's what's happening to me.

I was looking at this file yesterday, but I had trouble producing output from setup.blend even in 2.83.4 version. So I started to download 2.83.5 just to be 100% sure there is not any bugfix and return to report later.

So I am testing this file with 2.83.5 now and I am not able to produce output still. Even if I make sure cache folder is fresh or even if I bake cache. Am I missing something?

I was looking at this file yesterday, but I had trouble producing output from setup.blend even in 2.83.4 version. So I started to download 2.83.5 just to be 100% sure there is not any bugfix and return to report later.

So I am testing this file with 2.83.5 now and I am not able to produce output still. Even if I make sure cache folder is fresh or even if I bake cache. Am I missing something?

For some reason, and I didn't notice it the first times I tried this, you need to update one setting and then the particles are visible. Looks like we found another bug. :)
See attached video

PS: Sorry, Shadowplay didn't record my mouse :(

For some reason, and I didn't notice it the first times I tried this, you need to update one setting and then the particles are visible. Looks like we found another bug. :)

I am aware of this bug - it is already reported. I did exactly same thing as you, but I still can't see particles.

I don't have any problem when I apply quick liquid on default cube or when I create simulation myself. Even if I scale things down to similar scale things are working.
I have looked at flow mesh in edit mode to check if it is watertight, and things started working. So I am not sure what's going on there. At least I can reproduce the issue now.

I will change the file a bit and also subject of report to fluid effector not working correctly, because that's the problem here with this case.

Richard Antalik (ISS) renamed this task from strange behaviour in mantaflow for blender 2.90 beta to Mantaflow liquid effector not working correctly.Aug 28 2020, 12:21 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.
Richard Antalik (ISS) updated the task description. (Show Details)
Richard Antalik (ISS) edited projects, added BF Blender; removed BF Blender (2.90).

@Richard Antalik (ISS) Great to hear that you were able to reproduce the issue. But why did you remove the 2.90 tag? I mean, it is in 2.90 and in 2.91.

@Richard Antalik (ISS) Great to hear that you were able to reproduce the issue. But why did you remove the 2.90 tag? I mean, it is in 2.90 and in 2.91.

Tag is used to indicate in which version issue should be fixed. it is up to developer to assign it.

I will change the file a bit and also subject of report to fluid effector not working correctly, because that's the problem here with this case.

I don't think it's the effector at fault here.
In my tests:

  • in the first frame the particles have already moved outside of the fluid flow object. Instead they should have stayed still since gravity wouldn't have had the time to affect them.
  • in the second frame the particles drop outside of the domain!!! That should never happen!
  • in the third they're back in! but still traveling down!
  • Also, in the slow-motion example, the particles gain too much energy when they collide with the domain borders. At the end they became a tornado.

I can only guess here, but I think that the particles are out of synch with the rest of the simulation.
It looks like they are 1 frame ahead of where they should be.
Another possibility is that the gravity gets applied two times per simulation step.

I will download the latest 2.90 beta and check again. In case the particles are still behaving as above I will change the subject of the report and the file.

Ervin Weber (lusque) renamed this task from Mantaflow liquid effector not working correctly to Mantaflow FLIP particles not working correctly.Aug 28 2020, 11:16 PM
Ervin Weber (lusque) updated the task description. (Show Details)

Please keep the discussion in the comment section and not in the description...

Sorry, didn't know was against the rules

It is not a rule per se as far as I know but a bad practice in my honest opinion.

It seems this bug is caused by the (relatively small) size of the geometry. If you scale everything up then things start to look normal again.

Will investigate this further.

Well, then what is the recommended size of a simulation?
Do I now need to do one meter wine glasses and scale them down after simulating? :D

I did a few more tests with the same setup: an inflow object and a moving glass.
This time for each simulation I've changed the domain size, AND the domain resolution accordingly, to keep the same cell dimension.
Inflow and glass are the same dimension in each simulation.

domain sizedomain resolutioncell size
20 cm326.25 mm
40 cm646.25 mm
80 cm1286.25 mm
160 cm2566.25 mm

I've attached the blends in a zip file.

From the results it looks like the problem is not the "scale of the simulation" but just the "size of the domain".
Please look at the image, in each row you can see various frames of the same simulation.

  • frame 1: the smaller the domain the higher the particles initial velocity (gravity)
  • frame 2: the smaller the domain size the more particles overshoot (but in fr.3 they go back)
  • frame 3 & 4: identical result at each domain size
  • frame 30: the smaller the domain the wilder the particles reaction

My question is: why the results are so different while the cell sizes are the same?
It is my understanding that, everything else being equal, the stability and realism of a simulation depend basically on the particles velocities in relation to the cell size (that's why we use adaptive timesteps). So, if the cell size are the same, the particles should behave the same regardless of the domain size.

Is there something I'm not aware of that explains this behaviour or is it a bug?

Jacques Lucke (JacquesLucke) changed the subtype of this task from "Report" to "Bug".Oct 14 2020, 11:53 AM

I can reproduce the issue and think this behavior should either be fixed or documented by @Sebastián Barschkis (sebbas). I don't really know what is happening here.

Thanks for the detailed test @Ervin Weber (lusque)! Looked into it a bit and it seems there are 2 bugs in this report.
For the 1st one I just committed a fix (rB11a8a6d0e6b5). This should make sure that particles never leave the domain bounds. Particles at frame 1 should now also be at the correct position (inside inflow object).

Another fix will follow!

Added two more commits:

  • Some versioning so that the previous 1st fix (rB11a8a6d0e6b5) will also work with older files (rB1f046e05b63c)
  • Adjustments to external forces: The moving cup from the example scenes should no longer blow up the liquid inside of it (rB663e047102c4)

There is still some fine-tuning that can to be done as right now especially the smaller scenes seem to lose liquid once the surrounding obstacle is raised. This is a tricky use-case and would need to be investigated separately.

So in my view this report can be closed. @Ervin Weber (lusque) if you can, please check if the latest version works better for you and reopen if find things that seems to be off.

Wonderful! Thanks a lot @Sebastián Barschkis (sebbas) :-) I'm a little busy now, but I will check for sure when possible