[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47087] trunk/blender: Smoke:
Daniel Genrich
daniel.genrich at gmx.net
Sun May 27 20:45:16 CEST 2012
Revision: 47087
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47087
Author: genscher
Date: 2012-05-27 18:45:16 +0000 (Sun, 27 May 2012)
Log Message:
-----------
Smoke:
a) Another boundary fix. Resulted in smoke getting "sucked" back into the domain
b) Disabling substeps (internal thing). Fixes arbitrary explosions/instabilities.
Part of my Blender Smoke Development.
Modified Paths:
--------------
trunk/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp
trunk/blender/source/blender/blenkernel/intern/smoke.c
Modified: trunk/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp
===================================================================
--- trunk/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp 2012-05-27 18:05:10 UTC (rev 47086)
+++ trunk/blender/intern/smoke/intern/FLUID_3D_STATIC.cpp 2012-05-27 18:45:16 UTC (rev 47087)
@@ -153,9 +153,13 @@
index = x + y * res[0];
field[index] = field[index + 2 * slabSize];
/* only allow outwards flux */
- if(field[index]>0.) field[index] = 0.;
- index += slabSize;
- if(field[index]>0.) field[index] = 0.;
+
+ // DG: Disable this for z-axis.
+ // The problem is that smoke somehow gets sucked in again
+ // from the TOP slab when this is enabled
+ // if(field[index]>0.) field[index] = 0.;
+ // index += slabSize;
+ // if(field[index]>0.) field[index] = 0.;
}
}
Modified: trunk/blender/source/blender/blenkernel/intern/smoke.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/smoke.c 2012-05-27 18:05:10 UTC (rev 47086)
+++ trunk/blender/source/blender/blenkernel/intern/smoke.c 2012-05-27 18:45:16 UTC (rev 47087)
@@ -1592,8 +1592,8 @@
/* adapt timestep for different framerates, dt = 0.1 is at 25fps */
dt *= (25.0f / fps);
- // maximum timestep/"CFL" constraint: dt < dx * maxVel
- maxVel = (sds->dx * 1.0);
+ // maximum timestep/"CFL" constraint: dt < 5.0 *dx / maxVel
+ maxVel = (sds->dx * 5.0);
for(i = 0; i < size; i++)
{
@@ -1607,7 +1607,8 @@
totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
- // totalSubsteps = 2.0f; // DEBUG
+ /* Disable substeps for now, since it results in numerical instability */
+ totalSubsteps = 1.0f;
dtSubdiv = (float)dt / (float)totalSubsteps;
More information about the Bf-blender-cvs
mailing list