[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49603] branches/soc-2012-fried_chicken/ intern/smoke/intern: Two fixes for domain boundary conditions.
Miika Hamalainen
miika.hamalainen at kolumbus.fi
Mon Aug 6 11:47:52 CEST 2012
Revision: 49603
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49603
Author: miikah
Date: 2012-08-06 09:47:52 +0000 (Mon, 06 Aug 2012)
Log Message:
-----------
Two fixes for domain boundary conditions.
* Domain vertical velocity was accelerating over time. This issue has been in trunk since smoke was first introduced, but was especially troublesome for fire simulations due to higher temperatures and therefore higher buoyancy lift.
* Domain sides were partly considered obstacles regardless of the active "Border Collisions" setting. Now all boundaries behave identically. This should be especially useful when using new gsoc features like domain rotation or changing gravity direction.
Modified Paths:
--------------
branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D.cpp
branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D_STATIC.cpp
Modified: branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D.cpp
===================================================================
--- branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D.cpp 2012-08-06 09:33:43 UTC (rev 49602)
+++ branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D.cpp 2012-08-06 09:47:52 UTC (rev 49603)
@@ -149,9 +149,6 @@
_domainBcRight = _domainBcLeft;
_colloPrev = 1; // default value
-
- setBorderObstacles(); // walls
-
}
void FLUID_3D::initHeat()
@@ -1455,14 +1452,9 @@
{
Vec3Int res = Vec3Int(_xRes,_yRes,_zRes);
- if(!_domainBcLeft) copyBorderX(_xVelocityOld, res, zBegin, zEnd);
- else setZeroX(_xVelocityOld, res, zBegin, zEnd);
-
- if(!_domainBcFront) copyBorderY(_yVelocityOld, res, zBegin, zEnd);
- else setZeroY(_yVelocityOld, res, zBegin, zEnd);
-
- if(!_domainBcTop) copyBorderZ(_zVelocityOld, res, zBegin, zEnd);
- else setZeroZ(_zVelocityOld, res, zBegin, zEnd);
+ setZeroX(_xVelocityOld, res, zBegin, zEnd);
+ setZeroY(_yVelocityOld, res, zBegin, zEnd);
+ setZeroZ(_zVelocityOld, res, zBegin, zEnd);
}
//////////////////////////////////////////////////////////////////////
Modified: branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D_STATIC.cpp
===================================================================
--- branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D_STATIC.cpp 2012-08-06 09:33:43 UTC (rev 49602)
+++ branches/soc-2012-fried_chicken/intern/smoke/intern/FLUID_3D_STATIC.cpp 2012-08-06 09:47:52 UTC (rev 49603)
@@ -92,18 +92,10 @@
// left slab
index = y * res[0] + z * slabSize;
field[index] = field[index + 2];
- /* only allow outwards flux */
- if(field[index]>0.) field[index] = 0.;
- index += 1;
- if(field[index]>0.) field[index] = 0.;
// right slab
index = y * res[0] + z * slabSize + res[0] - 1;
field[index] = field[index - 2];
- /* only allow outwards flux */
- if(field[index]<0.) field[index] = 0.;
- index -= 1;
- if(field[index]<0.) field[index] = 0.;
}
}
@@ -120,18 +112,10 @@
// front slab
index = x + z * slabSize;
field[index] = field[index + 2 * res[0]];
- /* only allow outwards flux */
- if(field[index]>0.) field[index] = 0.;
- index += res[0];
- if(field[index]>0.) field[index] = 0.;
// back slab
index = x + z * slabSize + slabSize - res[0];
field[index] = field[index - 2 * res[0]];
- /* only allow outwards flux */
- if(field[index]<0.) field[index] = 0.;
- index -= res[0];
- if(field[index]<0.) field[index] = 0.;
}
}
@@ -152,14 +136,6 @@
// front slab
index = x + y * res[0];
field[index] = field[index + 2 * slabSize];
- /* only allow outwards flux */
-
- // 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.;
}
}
@@ -170,10 +146,6 @@
// back slab
index = x + y * res[0] + cellsslab;
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.;
}
}
More information about the Bf-blender-cvs
mailing list