[Mantaflow] Fluid volume loss with moving obstacle. #84287

Open
opened 2020-12-31 05:58:04 +01:00 by Everton Schneider · 18 comments

System Information
Operating system: Linux-5.8.0-33-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.38

Blender Version
Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-30 11:38, hash: f910342c8d
Worked: (newest version of Blender that worked as expected)

Short description of error
The fluid suffers a loss of volume when a container obstacle moves.
MF_MovingObstacle_BUG.mp4

Exact steps for others to reproduce the error
The attached file contains a setup that demonstrates the issue. Just hit play and wath at the moment that the bowl moves the fluid inside simply starts to disappear...

MF_MovingObstacle_BUG.blend

**System Information** Operating system: Linux-5.8.0-33-generic-x86_64-with-debian-bullseye-sid 64 Bits Graphics card: GeForce RTX 2080 SUPER/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.38 **Blender Version** Broken: version: 2.92.0 Alpha, branch: master, commit date: 2020-12-30 11:38, hash: `f910342c8d` Worked: (newest version of Blender that worked as expected) **Short description of error** The fluid suffers a loss of volume when a container obstacle moves. [MF_MovingObstacle_BUG.mp4](https://archive.blender.org/developer/F9540127/MF_MovingObstacle_BUG.mp4) **Exact steps for others to reproduce the error** The attached file contains a setup that demonstrates the issue. Just hit play and wath at the moment that the bowl moves the fluid inside simply starts to disappear... [MF_MovingObstacle_BUG.blend](https://archive.blender.org/developer/F9540126/MF_MovingObstacle_BUG.blend)

Added subscriber: @EvertonSchneider

Added subscriber: @EvertonSchneider

Added subscriber: @rjg

Added subscriber: @rjg

I'm not sure if this is related to your issue, but I'm getting an exception when trying to bake your simulation with Type set to All and Mesh enabled.

Offset index 32768 is out of bounds.

Manta::Error::Error(Manta::Error * const this, const std::string & s) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/general.h:56)
Manta::indexOffset(const Manta::IndexInt gidx, const int i, const int j, const int k, const Manta::MACGrid & ref) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:66)
Manta::knApicMapLinearVec3ToMACGrid::op(Manta::knApicMapLinearVec3ToMACGrid * const this, Manta::IndexInt idx, const Manta::BasicParticleSystem & p, Manta::MACGrid & mg, Manta::MACGrid & vg, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & vp, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:182)
Manta::knApicMapLinearVec3ToMACGrid::run(Manta::knApicMapLinearVec3ToMACGrid * const this) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:253)
Manta::knApicMapLinearVec3ToMACGrid::knApicMapLinearVec3ToMACGrid(Manta::knApicMapLinearVec3ToMACGrid * const this, const Manta::BasicParticleSystem & p, Manta::MACGrid & mg, Manta::MACGrid & vg, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & vp, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:94)
Manta::apicMapPartsToMAC(const Manta::FlagGrid & flags, Manta::MACGrid & vel, const Manta::BasicParticleSystem & parts, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & partVel, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, Manta::MACGrid * mass, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:285)
Manta::_W_0(PyObject * _self, PyObject * _linargs, PyObject * _kwds) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:317)
_PyMethodDef_RawFastCallKeywords(PyMethodDef * method, PyObject * self, PyObject * const * args, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:694)
_PyCFunction_FastCallKeywords(PyObject * func, PyObject * const * args, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:734)
call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4568)
_PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3139)
function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283)
_PyFunction_FastCallKeywords(PyObject * func, PyObject * const * stack, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:415)
call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4616)
_PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3124)
function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283)
_PyFunction_FastCallKeywords(PyObject * func, PyObject * const * stack, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:415)
call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4616)
_PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3124)
function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283)
I'm not sure if this is related to your issue, but I'm getting an exception when trying to bake your simulation with *Type* set to *All* and *Mesh* enabled. `Offset index 32768 is out of bounds`. ```lines Manta::Error::Error(Manta::Error * const this, const std::string & s) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/general.h:56) Manta::indexOffset(const Manta::IndexInt gidx, const int i, const int j, const int k, const Manta::MACGrid & ref) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:66) Manta::knApicMapLinearVec3ToMACGrid::op(Manta::knApicMapLinearVec3ToMACGrid * const this, Manta::IndexInt idx, const Manta::BasicParticleSystem & p, Manta::MACGrid & mg, Manta::MACGrid & vg, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & vp, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:182) Manta::knApicMapLinearVec3ToMACGrid::run(Manta::knApicMapLinearVec3ToMACGrid * const this) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:253) Manta::knApicMapLinearVec3ToMACGrid::knApicMapLinearVec3ToMACGrid(Manta::knApicMapLinearVec3ToMACGrid * const this, const Manta::BasicParticleSystem & p, Manta::MACGrid & mg, Manta::MACGrid & vg, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & vp, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:94) Manta::apicMapPartsToMAC(const Manta::FlagGrid & flags, Manta::MACGrid & vel, const Manta::BasicParticleSystem & parts, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & partVel, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpx, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpy, const Manta::ParticleDataImpl<Manta::Vector3D<float> > & cpz, Manta::MACGrid * mass, const Manta::ParticleDataImpl<int> * ptype, const int exclude, const int boundaryWidth) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:285) Manta::_W_0(PyObject * _self, PyObject * _linargs, PyObject * _kwds) (/home/dev/01-data/01-git/blender-git/blender/extern/mantaflow/preprocessed/plugin/apic.cpp:317) _PyMethodDef_RawFastCallKeywords(PyMethodDef * method, PyObject * self, PyObject * const * args, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:694) _PyCFunction_FastCallKeywords(PyObject * func, PyObject * const * args, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:734) call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4568) _PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3139) function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283) _PyFunction_FastCallKeywords(PyObject * func, PyObject * const * stack, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:415) call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4616) _PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3124) function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283) _PyFunction_FastCallKeywords(PyObject * func, PyObject * const * stack, Py_ssize_t nargs, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:415) call_function(PyObject *** pp_stack, Py_ssize_t oparg, PyObject * kwnames) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:4616) _PyEval_EvalFrameDefault(PyFrameObject * f, int throwflag) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Python/ceval.c:3124) function_code_fastcall(PyCodeObject * co, PyObject * const * args, Py_ssize_t nargs, PyObject * globals) (/home/blender/Developer/build_linux/deps/build/python/src/external_python/Objects/call.c:283) ```
Member

Added subscribers: @sebbas, @lichtwerk

Added subscribers: @sebbas, @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Can confirm the volume loss.
(have not tried baking to mesh though)

CC @sebbas

Can confirm the volume loss. (have not tried baking to mesh though) CC @sebbas
Philipp Oeser changed title from Fluid volume loss with moving obstacle. to [Mantaflow] Fluid volume loss with moving obstacle. 2021-01-08 13:21:31 +01:00

Added subscriber: @darklord666

Added subscriber: @darklord666

Hey i'm seeing this pretty badly also (2.91). Moving Effector and volume loss. Have tried so many things including:

  • Increasing Particle Radius
  • Increasing Sampling Substeps on the Flow and the Effector
  • Increasing Resolution Divisions
  • Decreasing CFL Number
  • Increasing Timesteps Min & Max

Just to re-iterate, particles are definitely NOT leaking through my effector. It just seems to be a volume loss over time. Happens pretty quickly too. I've read that this is one of the issues with FLIP in general?

Either way @sebbas @lichtwerk is this something we can expect some workaround/fixes to?

Thank you!

Hey i'm seeing this pretty badly also (2.91). Moving Effector and volume loss. Have tried so many things including: - Increasing Particle Radius - Increasing Sampling Substeps on the Flow and the Effector - Increasing Resolution Divisions - Decreasing CFL Number - Increasing Timesteps Min & Max Just to re-iterate, particles are definitely NOT leaking through my effector. It just seems to be a volume loss over time. Happens pretty quickly too. I've read that this is one of the issues with FLIP in general? Either way @sebbas @lichtwerk is this something we can expect some workaround/fixes to? Thank you!

Hi @EvertonSchneider @sebbas @lichtwerk

I may be close to a solution for mass conservation / volume loss issue. Please let me know if I'm on the right track and if this can be more clear in the tooltips

Playing with Narrow Band Width setting - which to my understanding removes particles from the inner volume of the fluid to save on calculations (seeing as how it’s mostly the surface that sees activity that requires constant calculation). Looks like by increasing Narrow Band Width, the simulation will fill the inner volume with particles giving more accuracy. So far so good, my volume is remaining!!

I’m also playing with Fractional obstacles settings a bit to see if I can smoothen the boundary between fluid & obstacle.

Narrow Band Width:

Controls the width in grid cell units of the narrow band that liquid particles are allowed to flow in. A high value will result in a thicker band and can result in an inflow region completely filled with particles. Unless the goal of the simulation is to visualize the liquid particles it is recommended to not increase the band width significantly as more particles slow down the simulation.

In some situations increasing this value can help create volume when the simulation appears to leak. In all other cases it is best to keep the narrow band as thin as possible since the liquid surface contains most details and simulating particles inside the liquid is not an optimal use of computing resources.

Hi @EvertonSchneider @sebbas @lichtwerk I may be close to a solution for mass conservation / volume loss issue. Please let me know if I'm on the right track and if this can be more clear in the tooltips Playing with Narrow Band Width setting - which to my understanding removes particles from the inner volume of the fluid to save on calculations (seeing as how it’s mostly the surface that sees activity that requires constant calculation). Looks like by increasing Narrow Band Width, the simulation will fill the inner volume with particles giving more accuracy. So far so good, my volume is remaining!! I’m also playing with Fractional obstacles settings a bit to see if I can smoothen the boundary between fluid & obstacle. Narrow Band Width: Controls the width in grid cell units of the narrow band that liquid particles are allowed to flow in. A high value will result in a thicker band and can result in an inflow region completely filled with particles. Unless the goal of the simulation is to visualize the liquid particles it is recommended to not increase the band width significantly as more particles slow down the simulation. In some situations increasing this value can help create volume when the simulation appears to leak. In all other cases it is best to keep the narrow band as thin as possible since the liquid surface contains most details and simulating particles inside the liquid is not an optimal use of computing resources.

Added subscriber: @dfelinto

Added subscriber: @dfelinto

OK so update on my research. I'd really like for someone to chip in with more experience though. (the following could be the wrong direction I'm not sure)

I've seen a lot of people mention that volume loss is kind of an inherent behavior to FLIP fluids. And that other solvers are recommended for different types of fluid animations. In this case, I've seen people mention SPH as a more capable solver when dealing with moving boundaries.

With further digging, I realized that blender's fluid particle system uses SPH! After testing using blender's fluid particles, and then using metaballs to fill in the blanks, I found SPH to be a super good solver for this kind of fluid.

Can I suggest that blender adds SPH as a potential solver to use in the Fluid options? So, FLIP, APAIC, and SPH? It would be nice to a) have all fluid solvers be in the same place and 2) allow SPH to benefit from whatever meshing solution is used in fluid simulations (because using metaballs is OK but not perfect).

@dfelinto @sebbas @lichtwerk @EvertonSchneider

OK so update on my research. I'd really like for someone to chip in with more experience though. (the following could be the wrong direction I'm not sure) I've seen a lot of people mention that volume loss is kind of an inherent behavior to FLIP fluids. And that other solvers are recommended for different types of fluid animations. In this case, I've seen people mention SPH as a more capable solver when dealing with moving boundaries. With further digging, I realized that blender's fluid particle system uses SPH! After testing using blender's fluid particles, and then using metaballs to fill in the blanks, I found SPH to be a super good solver for this kind of fluid. Can I suggest that blender adds SPH as a potential solver to use in the Fluid options? So, FLIP, APAIC, and SPH? It would be nice to a) have all fluid solvers be in the same place and 2) allow SPH to benefit from whatever meshing solution is used in fluid simulations (because using metaballs is OK but not perfect). @dfelinto @sebbas @lichtwerk @EvertonSchneider

Added subscriber: @Erosion139

Added subscriber: @Erosion139

This has never worked with mantaflow since it was introduced in some version (2.82?) Every once in a while I check to see if they fixed it but I haven't once been able to utilize mantaflow simulations with anything more than a static scene, which means I don't make anything that looks cool. Even when you change it from FLIP to whatever the other algorithm is it doesn't make any difference, unfortunately.

This has never worked with mantaflow since it was introduced in some version (2.82?) Every once in a while I check to see if they fixed it but I haven't once been able to utilize mantaflow simulations with anything more than a static scene, which means I don't make anything that looks cool. Even when you change it from FLIP to whatever the other algorithm is it doesn't make any difference, unfortunately.

Added subscriber: @yiusay

Added subscriber: @yiusay

I encountered the same problem in 2.92.

I have found that this problem does not seem to occur if we use flip fluids addon. It is the paid addon but you can try the demo version for free so you may want to see if the addon can solve your problem.
https://github.com/rlguy/Blender-FLIP-Fluids/wiki/FLIP-Fluids-Demo-Addon

I encountered the same problem in 2.92. I have found that this problem does not seem to occur if we use flip fluids addon. It is the paid addon but you can try the demo version for free so you may want to see if the addon can solve your problem. https://github.com/rlguy/Blender-FLIP-Fluids/wiki/FLIP-Fluids-Demo-Addon

Yeah I like how people say the FLIP addon is irrelevant because blender now does flip. At the same time the FLIP addon is still superior in multiple ways, and laughably especially in the simulation characteristics part too. In blender, matter is created and destroyed randomly lol.

Yeah I like how people say the FLIP addon is irrelevant because blender now does flip. At the same time the FLIP addon is still superior in multiple ways, and laughably especially in the simulation characteristics part too. In blender, matter is created and destroyed randomly lol.

Removed subscriber: @dfelinto

Removed subscriber: @dfelinto

Mantaflow (fluid simulator) has no active developer at the moment. Moving those bugs as known issues so at least other users can find their issues already reported.

Mantaflow (fluid simulator) has no active developer at the moment. Moving those bugs as known issues so at least other users can find their issues already reported.
Philipp Oeser removed the
Interest
Nodes & Physics
label 2023-02-10 08:45:06 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
7 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#84287
No description provided.