Regression: Increased instability in fire simulation due to changes of default values #126924

Closed
opened 2024-08-29 11:13:02 +02:00 by Alaska · 12 comments
Member

System Information
Operating system: macOS-14.6.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Pro 1.2

Blender Version
Broken version: 4.3.0 Alpha, branch: main, commit date: 2024-08-29 06:55, hash: e82ba8d4951e
Broken version: 4.2
Worked: 4.1.1

Short description of error
The default CFL number for fluid, smoke, and fire simulations was decreased in 9a0a75eff0 .

This has lead to increased instability in some common simulation settings.

Exact steps for others to reproduce the error
Run this test in 4.1.1 and 4.2 or new:

  1. Add a sphere to your scene.
  2. Scale it down to roughly 1m in diameter.
  3. Apply the scale.
  4. From the top of the 3D viewport select Object -> Quick Effects -> Quick Smoke
  5. Select the sphere.
  6. In the Pyhsics properties tab change the Flow type to fire and fuel to 2.0
  7. Play back or bake the simulation. In 4.1 it will be relatively stable. In 4.2 or newer it won't be.

This was caused by the decrease of the default CFL number on the simulation domain from 4.0 to 2.0 in 9a0a75eff0 .

**System Information** Operating system: macOS-14.6.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 Pro 1.2 **Blender Version** Broken version: 4.3.0 Alpha, branch: main, commit date: 2024-08-29 06:55, hash: `e82ba8d4951e` Broken version: 4.2 Worked: 4.1.1 **Short description of error** The default CFL number for fluid, smoke, and fire simulations was decreased in 9a0a75eff0e43dd009b2c176e2b9b39792a28d2f . This has lead to increased instability in some common simulation settings. **Exact steps for others to reproduce the error** Run this test in 4.1.1 and 4.2 or new: 1. Add a sphere to your scene. 2. Scale it down to roughly 1m in diameter. 3. Apply the scale. 4. From the top of the 3D viewport select `Object -> Quick Effects -> Quick Smoke` 5. Select the sphere. 6. In the `Pyhsics properties` tab change the `Flow type` to `fire` and fuel to `2.0` 7. Play back or bake the simulation. In 4.1 it will be relatively stable. In 4.2 or newer it won't be. This was caused by the decrease of the default CFL number on the simulation domain from 4.0 to 2.0 in 9a0a75eff0e43dd009b2c176e2b9b39792a28d2f .
Alaska added the
Severity
Normal
Status
Needs Triage
Type
Bug
labels 2024-08-29 11:13:02 +02:00

Not quite sure what instability means. Visually it seems very similar in 4.1 and main. Can you explain bit more in detail what the difference is?

Not quite sure what instability means. Visually it seems very similar in 4.1 and main. Can you explain bit more in detail what the difference is?
Author
Member

The stability issue I was refering too was that with a CFL of 2 with this configuration, the fire from the sphere would kind of shoot out in all directions and the simulation steps per frame would increase due to this complexity resulting in the baking slowing down. CFL 2.jpg is a workbench render of the simulation at frame 100 with this configuration. Notice that the fire is spreading out in most directions.

Where as when the CFL was 4, it felt more stable (the fire always generally went upwards, and the simulation steps per frame didn't drastically increase due to the complexity). CFL 4.jpg is a workbench render of the simulation at frame 100 with this configuration. Notice that the fire is generally going up.

The stability issue I was refering too was that with a CFL of 2 with this configuration, the fire from the sphere would kind of shoot out in all directions and the simulation steps per frame would increase due to this complexity resulting in the baking slowing down. `CFL 2.jpg` is a workbench render of the simulation at frame 100 with this configuration. Notice that the fire is spreading out in most directions. Where as when the CFL was 4, it felt more stable (the fire always generally went upwards, and the simulation steps per frame didn't drastically increase due to the complexity). `CFL 4.jpg` is a workbench render of the simulation at frame 100 with this configuration. Notice that the fire is generally going up.
Member

Hi, can indeed confirm. Not sure if we should raise the priority? Easy to fix from UI but might take significant time for someone to figure out the root cause of the difference.

Hi, can indeed confirm. Not sure if we should raise the priority? Easy to fix from UI but might take significant time for someone to figure out the root cause of the difference.
Pratik Borhade changed title from Increased instability in fire simulation due to changes of default values to Regression: Increased instability in fire simulation due to changes of default values 2024-08-30 12:06:45 +02:00

@Bartosz-Kosiorek @brecht /

@Bartosz-Kosiorek @brecht /
Author
Member

I have a suspicion that there's more going on here than just "The default value changed, resulting in instability under common situations". I think the simulations have a bunch of issues/inconsistencies and this just exposes one of them, but to my knowledge the simulation systems are not well maintained so I'm not sure if it will be addressed.

I have a suspicion that there's more going on here than just "The default value changed, resulting in instability under common situations". I think the simulations have a bunch of issues/inconsistencies and this just exposes one of them, but to my knowledge the simulation systems are not well maintained so I'm not sure if it will be addressed.

Ok, now I can reproduce.
It's weird though, I have saved .blend file for 4.1 and main with different cache paths to prevent contamination and the behavior is identical between 2 versions.

Ok, now I can reproduce. It's weird though, I have saved .blend file for 4.1 and main with different cache paths to prevent contamination and the behavior is identical between 2 versions.
Contributor

Hi @Alaska
Please try to increase the "Timesteps Maximum" to 8 and next to 16.
Please provide the screenshots with comparison between those values.
How it is impacting baking time?

Hi @Alaska Please try to increase the "Timesteps Maximum" to 8 and next to 16. Please provide the screenshots with comparison between those values. How it is impacting baking time?
Author
Member

Leaving CFL at 2 and increasing the timesteps maximum just makes it worse. More fire shoots out in unexpected directions faster, and because the number of time steps Blender tries to computes increases, the baking time increases. I don't believe screenshots are neccesary here.

I'm concerned there might be more going on here than "the new default is less than ideal". Here's why:

What the new default CFL value does is it forces more time steps to be taken during the simulation. In theory this is more accurate and it points to the old behaviour actually being wrong and the new behaviour being more correct.

But if you force an increased number of time steps (by increasing the min time steps value) under normal circumstances (Fuel = 1.0, or even 0.5), you get the same general effect. Fire starts shooting out in unexpected directions. I have created a grid of tests where you can see this happen in the video attached to this message.

So I believe one of two things are happening:

  • Fire shooting out in random directions is the correct result and the change in default settings just makes it easier to get to the correct result.
  • There's a problem with the simulation when the time steps are increased, and the decrease in CFL value just means it's more likely the time steps wil increase and expose this issue.
Leaving CFL at 2 and increasing the timesteps maximum just makes it worse. More fire shoots out in unexpected directions faster, and because the number of time steps Blender tries to computes increases, the baking time increases. I don't believe screenshots are neccesary here. I'm concerned there might be more going on here than "the new default is less than ideal". Here's why: What the new default CFL value does is it forces more time steps to be taken during the simulation. In theory this is more accurate and it points to the old behaviour actually being wrong and the new behaviour being more correct. But if you force an increased number of time steps (by increasing the min time steps value) under normal circumstances (Fuel = 1.0, or even 0.5), you get the same general effect. Fire starts shooting out in unexpected directions. I have created a grid of tests where you can see this happen in the video attached to this message. So I believe one of two things are happening: - Fire shooting out in random directions is the correct result and the change in default settings just makes it easier to get to the correct result. - There's a problem with the simulation when the time steps are increased, and the decrease in CFL value just means it's more likely the time steps wil increase and expose this issue.

That's a common Mantaflow problem: stability issues with high temporal resolution.

Use Quick Liquid on the default cube and set Timesteps Maximum and Minimum to 25. This results in a domain filling expansion where the higher the timesteps, the expansion happens earlier and expands more quickly.

On APIC, with 100 timesteps, it does other weird things before exploding such as falling slowly with strings of fluid.

Plain smoke seems to also need high spatial resolution to get it to break. Here it is at 256 resolution and 100 timesteps.

Here is fire with 256 resolution and 100 timesteps (using Quick Smoke and changing the emitter to smoke+fire) (It looks really cool when the instability kicks in).

Here is fire at 1 timestep.

That's a common Mantaflow problem: stability issues with high temporal resolution. Use `Quick Liquid` on the default cube and set `Timesteps Maximum` and `Minimum` to 25. This results in a domain filling expansion where the higher the timesteps, the expansion happens earlier and expands more quickly. <video src="/attachments/a541d02f-5e1a-40d3-aae7-05a0635aefe2" title="flip 32domain 25minmax narrowoff0001-0250.mp4" controls></video> On APIC, with 100 timesteps, it does other weird things before exploding such as falling slowly with strings of fluid. <video src="/attachments/5b4aaf3b-6dad-47f1-bc23-df9eb60df2ad" title="apic 32domain 100minmax narrowoff0001-0250.mp4" controls></video> Plain smoke seems to also need high spatial resolution to get it to break. Here it is at 256 resolution and 100 timesteps. <video src="/attachments/7af24c96-774a-457b-96d7-9ecec8ac3a4b" title="smoke 256domain 100minmax0001-0250.mp4" controls></video> Here is fire with 256 resolution and 100 timesteps (using `Quick Smoke` and changing the emitter to smoke+fire) (It looks really cool when the instability kicks in). <video src="/attachments/c1871362-86be-4303-99d2-b41511baf553" title="fire 256domain 100minmax0001-0250.mp4" controls></video> Here is fire at 1 timestep. <video src="/attachments/ae77a4f0-9436-43af-8b98-767a3065bcfe" title="fire 256domain 1minmax0001-0250.mp4" controls></video>
Contributor

Thanks @Fernando-Alcala for such analysis.
Do you know if commercial plugins also has similar instability?

Flip Fluid Demo download:
https://github.com/rlguy/Blender-FLIP-Fluids/releases/tag/v0.8.1

Thanks @Fernando-Alcala for such analysis. Do you know if commercial plugins also has similar instability? Flip Fluid Demo download: https://github.com/rlguy/Blender-FLIP-Fluids/releases/tag/v0.8.1

@Bartosz-Kosiorek Hi, this is a developer of the FLIP Fluids liquid simulation addon. This addon does not have this type of issue with increased timesteps. Typically, increasing timesteps or reducing CFL results in smoother and more stable motion within the addon simulator.

Apologies in advance if this contribution is off-topic to the discussion.

@Bartosz-Kosiorek Hi, this is a developer of the FLIP Fluids liquid simulation addon. This addon does not have this type of issue with increased timesteps. Typically, increasing timesteps or reducing CFL results in smoother and more stable motion within the addon simulator. Apologies in advance if this contribution is off-topic to the discussion.

FLIP Fluids does not have instability, but it does have excessive damping at high timestepping.
Here is 1 timestep

Here is 100 timesteps

FLIP Fluids does not have instability, but it does have excessive damping at high timestepping. Here is 1 timestep <video src="/attachments/a2e28eba-52a2-40a1-a26c-c8d8e572e230" title="flipfluids apic 32resolution 1timesteps0001-0250.mp4" controls></video> Here is 100 timesteps <video src="/attachments/f42c3955-ecb2-4905-a444-47d7f03665d8" title="flipfluids apic 32resolution 100timesteps0001-0250.mp4" controls></video>
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-09-11 17:48:47 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#126924
No description provided.