Fix: Smoke simulations of very high resolutions often produced weird results, as if smoke was colliding in an invisible wall.

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?
This commit is contained in:
Miika Hamalainen 2013-05-21 19:20:48 +00:00
parent a8ec403d72
commit 2345f0ee99

@ -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");