Fix: Smoke simulations of very high resolutions often produced weird results, as...
authorMiika Hamalainen <blender@miikah.org>
Tue, 21 May 2013 19:20:48 +0000 (19:20 +0000)
committerMiika Hamalainen <blender@miikah.org>
Tue, 21 May 2013 19:20:48 +0000 (19:20 +0000)
This was caused by a "hack" Daniel Genrich introduced in his moving obstacles commit in r46050. I suppose it was originally added to prevent issues with too fast moving obstacles, but now it ended up limiting maximum velocity of higher resolution simulations.

Here is an comparision of 184 resolution simulation (simulation area limited by adaptive domain):
https://www.miikah.org/blender/smoke_with_pressure_limit_hack.png
https://www.miikah.org/blender/smoke_without_pressure_limit_hack.png

I now reverted that hack until a better solution is found. Daniel, can you check this out? Pressure was limited to maximum of dt * dx (= dt / res) which doesn't make sense to limit pressure based on grid resolution. Maybe better to limit with a constant factor instead?

intern/smoke/intern/FLUID_3D.cpp

index 85d6a7a..780a39e 100644 (file)
@@ -1030,10 +1030,10 @@ void FLUID_3D::project()
                                maxvalue = _pressure[i];
 
                        /* HACK: Animated collision object sometimes result in a non converging solvePressurePre() */ 
-                       if(_pressure[i] > _dx * _dt)
+                       /*if(_pressure[i] > _dx * _dt)
                                _pressure[i] = _dx * _dt;
                        else if(_pressure[i] < -_dx * _dt)
-                               _pressure[i] = -_dx * _dt;
+                               _pressure[i] = -_dx * _dt;*/
 
                        // if(_obstacle[i] && _pressure[i] != 0.0)
                        //      printf("BAD PRESSURE i\n");