Gravity in fluid simulation #73680

Closed
opened 2020-02-08 20:21:01 +01:00 by David Whitaker · 10 comments

Blender Version
Broken: version: 2.82 (sub 5), branch: fluid-mantaflow, commit date: 2019-12-16 14:05, hash: ed32db06c1

Short description of error
With scene gravity set to zero, if I change the fluid domain gravity, it ends up behaving as if it's about 10 times too strong. So when the gravity is set to -1 m/s squared it behaves like -10m/s squared

Exact steps for others to reproduce the error

  • Add cude,
  • add sphere.
  • scale cube (2x) and make it fluid domain (Liquid),
  • make sphere a fluid liquid flow with flow behavior set to geometry.
  • Turn off scene gravity
  • set gravity in fluid domain settings to -1m/s^2 (default).
  • Bake data and see result

fluid_gravity_bug.blend

**Blender Version** Broken: version: 2.82 (sub 5), branch: fluid-mantaflow, commit date: 2019-12-16 14:05, hash: `ed32db06c1` **Short description of error** With scene gravity set to zero, if I change the fluid domain gravity, it ends up behaving as if it's about 10 times too strong. So when the gravity is set to -1 m/s squared it behaves like -10m/s squared **Exact steps for others to reproduce the error** - Add cude, - add sphere. - scale cube (2x) and make it fluid domain (Liquid), - make sphere a fluid liquid flow with flow behavior set to geometry. - Turn off scene gravity - set gravity in fluid domain settings to -1m/s^2 (default). - Bake data and see result [fluid_gravity_bug.blend](https://archive.blender.org/developer/F8332475/fluid_gravity_bug.blend)
Author

Added subscriber: @davidwhitzim

Added subscriber: @davidwhitzim

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

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

Added subscriber: @mano-wii

Added subscriber: @mano-wii

I can confirm.
The default values already seem to be 10 times faster.
This seems to be a regression with the new fluid system.

I can confirm. The default values already seem to be 10 times faster. This seems to be a regression with the new fluid system.

Added subscriber: @wakin

Added subscriber: @wakin
Member

Added subscribers: @sebbas, @JacquesLucke

Added subscribers: @sebbas, @JacquesLucke
Member

The cause for this behavior is in manta_set_domain_gravity.

It looks like mantaflow uses normalized gravity values, for reasons I don't really understand. Also I noticed that the liquid seems to fall faster than a rigid body object. Not sure why that is.

In any case, I think the Scene Gravity and Gravity in the fluid settings should have the same scale. Two ways to achieve this:

  • Scale up FluidDomainSettings->gravity in versioning code and scale it down in manta_set_domain_gravity in any case.
  • Scale up FluidDomainSettings->gravity only in rna code using getter and setter functions and keep manta_set_domain_gravity as it is.

I prefer the first solution. What do you think @sebbas?

The cause for this behavior is in `manta_set_domain_gravity`. It looks like mantaflow uses normalized gravity values, for reasons I don't really understand. Also I noticed that the liquid seems to fall faster than a rigid body object. Not sure why that is. In any case, I think the Scene Gravity and Gravity in the fluid settings should have the same scale. Two ways to achieve this: * Scale up `FluidDomainSettings->gravity` in versioning code and scale it down in `manta_set_domain_gravity` in any case. * Scale up `FluidDomainSettings->gravity` only in rna code using getter and setter functions and keep `manta_set_domain_gravity` as it is. I prefer the first solution. What do you think @sebbas?

Yes, having gravity on the same scale as in D7483 is definitely a good idea.

Will check now why the liquid still moves down quicker.

Yes, having gravity on the same scale as in [D7483](https://archive.blender.org/developer/D7483) is definitely a good idea. Will check now why the liquid still moves down quicker.

This issue was referenced by 694c0547c2

This issue was referenced by 694c0547c21aa3a5087c0dd4323624358135f4ef
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2020-04-23 15:11:44 +02:00
Thomas Dinges added this to the 2.83 LTS milestone 2023-02-08 16:39:36 +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
6 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#73680
No description provided.