For bugs related to volumetrics, you can post a description on this blenderartists thread (you have first to create an account).
For bugs related to volumetrics, you can post a description on this blenderartists thread (you have first to create an account).
hi farsthary,
i spend the last weekend on doing some own research regarding the instability of the SPH particle implementation. the first thing i noticed was, that it is very stable as long as no deflector is being involved. if a deflector is present i detected the occurrence of some NaNs in the velocity vectors of the exploding particles (at the particle_fluidsim() function). Those NaNs leading only to more NaNs at any further calculation destroying the whole simulation, so I tried to pinpoint its origin.
i found out that they were generated by the deflect_particle() function. but only when using SPH particles and not when using newtonian particles.
after further testing i noticed that it has to do with the detection of multiple collisions at once (see max_deflections var). for some reason it sometimes detects multiple collisions even if there can only be one, at flat wide surface for instance. then the rebouncing velocity is escalating to huge speeds and in a few cases it becomes so high that it even generates a NaN which is fatal for any further calculation as i said above.
to work around that problem i have implemented a little sanity check in the end of the function, since i don’t wanted to set max_deflections to 1 because multiple deflections are per se a good thing. so i checked the calculated reflection velocity for its length and if it’s higher than the original it will get dropped back to it’s original state. since this is only a workaround i didn’t prepare a patch. the code is like this:
float vel_before[3]; /* velocity before collision */
VECCOPY(vel_before, pa->state.vel);
[... main deflection code ...]
if ( len_v3(pa->state.vel) > len_v3(vel_before) )
VECCOPY(pa->state.vel, vel_before);
the maintainer or someone who understands that function better than me needs to look deeper into it. i’m still unsure why it seems to work correctly with newtonian particles and only has problems with SPH particles so it could still being a problem with the SPH function itself. to demonstrate the difference after patching i put up a little comparison video on youtube:
and finally here is a blend file for easier testing:
http://www.pasteall.org/blend/3451
it contains a very small particle system with only three particles. when pressing alt+a they are falling straight to the ground without interacting with each other and then one of them suddenly shoots away. you will notice it better when you switch to grid distribution with a lot more particles. more than a hand full will bounce higher back than its original height was, which should be impossible.
i didn’t file a report in the official bugtracker yet. just tell me if you want me to do this as well.
hope that helps and saves you some research time.
This has been fixed now in rev. 32073 after reporting in bugtracker.