How to fix boolean artifacts during animation

I am using a cube rising through a cylinder with an “intersect” boolean in order to give the effect of oil filling a tank.

As you can see from the video however, I am getting strange artifacts on the sides of the fluid as it rises. Are there any tricks to remove these? (ignore the top of the very top of the fluid, it’s actually supposed to be doing that)

I already lowered the merge distance to 0 to fix another issue I was having, but it doesn’t seem to affect this problem at all.

You can try increasing the mesh resolutions.

which one should I increase the resolution on, the oil cube or the Boolean “brush?”

In order to get the ripples on top of the oil there’s a decent amount of subdivisions in the oil cube before the boolean is applied.

The file is a draft for a commercial project which I’m contractually obligated not to share, but I’ll see if I can upload a stripped down version tomorrow.

You can also try a edgsplit modifier after the boolean , this should get rid of some shading issues.
You can play with subdivision by applying a subdivision surface modifier set to simple .
If everything fail you can still adjust the frames that don’t work by moving the boolean object a bit.

Booleans are really inappropriate for a task like this. Getting them temporally stable is crap shoot and, even if you do succeed, they could randomly wig out again.
Instead, you could animate the volume increase by compressing the mesh through any number of methods. This would also allow you to use dynamic paint, and potentially extract motion vectors.
fake_volume_fill.blend (669.7 KB)

@sozap I was making the stripped down version and applied a subdivision to the boolean “brush,” cylinder and it appears to have fixed a lot of the issues. Still having 1 or 2 frames glitch out though.

@anon95228951 You solution is very good, and while it would work perfectly for a vertical cylinder, my cylinder is sideways like a tanker truck so the method doesn’t work that well.

what’s weird is that it seems fine in the preview, but not in the render

Here’s the stripped down version:
stripped.blend (727.7 KB)