[Bf-blender-cvs] [bc2ce31d794] master: Fluid: Improved behavior at open boundaries
Sebastián Barschkis
noreply at git.blender.org
Fri Feb 28 16:38:24 CET 2020
Commit: bc2ce31d794096d0785b469752451cc035688dcc
Author: Sebastián Barschkis
Date: Fri Feb 28 16:16:02 2020 +0100
Branches: master
https://developer.blender.org/rBbc2ce31d794096d0785b469752451cc035688dcc
Fluid: Improved behavior at open boundaries
Use greater boundary width for smoke simulations
===================================================================
M intern/mantaflow/intern/strings/smoke_script.h
===================================================================
diff --git a/intern/mantaflow/intern/strings/smoke_script.h b/intern/mantaflow/intern/strings/smoke_script.h
index bc073492a4d..1d90aac3bd0 100644
--- a/intern/mantaflow/intern/strings/smoke_script.h
+++ b/intern/mantaflow/intern/strings/smoke_script.h
@@ -273,7 +273,7 @@ def smoke_adaptive_step_$ID$(framenr):\n\
\n\
fluid_pre_step_$ID$()\n\
\n\
- flags_s$ID$.initDomain(boundaryWidth=0, phiWalls=phiObs_s$ID$, outflow=boundConditions_s$ID$)\n\
+ flags_s$ID$.initDomain(boundaryWidth=1, phiWalls=phiObs_s$ID$, outflow=boundConditions_s$ID$)\n\
\n\
if using_obstacle_s$ID$:\n\
mantaMsg('Initializing obstacle levelset')\n\
@@ -295,7 +295,8 @@ def smoke_adaptive_step_$ID$(framenr):\n\
if using_outflow_s$ID$:\n\
phiOut_s$ID$.join(phiOutIn_s$ID$)\n\
\n\
- setObstacleFlags(flags=flags_s$ID$, phiObs=phiObs_s$ID$, phiOut=phiOut_s$ID$, phiIn=phiIn_s$ID$)\n\
+ # Use bwidth=2 for better smoke outflow at borders\n\
+ setObstacleFlags(flags=flags_s$ID$, phiObs=phiObs_s$ID$, phiOut=phiOut_s$ID$, phiIn=phiIn_s$ID$, boundaryWidth=2)\n\
flags_s$ID$.fillGrid()\n\
\n\
applyEmission(flags=flags_s$ID$, target=density_s$ID$, source=densityIn_s$ID$, emissionTexture=emissionIn_s$ID$, type=FlagInflow|FlagOutflow)\n\
@@ -412,7 +413,7 @@ def smoke_step_noise_$ID$(framenr):\n\
copyRealToVec3(sourceX=texture_u_s$ID$, sourceY=texture_v_s$ID$, sourceZ=texture_w_s$ID$, target=uvGrid0_s$ID$)\n\
copyRealToVec3(sourceX=texture_u2_s$ID$, sourceY=texture_v2_s$ID$, sourceZ=texture_w2_s$ID$, target=uvGrid1_s$ID$)\n\
\n\
- flags_sn$ID$.initDomain(boundaryWidth=0, phiWalls=phiObs_sn$ID$, outflow=boundConditions_s$ID$)\n\
+ flags_sn$ID$.initDomain(boundaryWidth=1, phiWalls=phiObs_sn$ID$, outflow=boundConditions_s$ID$)\n\
\n\
mantaMsg('Interpolating grids')\n\
# Join big obstacle levelset after initDomain() call as it overwrites everything in phiObs\n\
@@ -424,7 +425,7 @@ def smoke_step_noise_$ID$(framenr):\n\
interpolateGrid(target=phiIn_sn$ID$, source=phiIn_s$ID$)\n\
interpolateMACGrid(target=vel_sn$ID$, source=vel_s$ID$)\n\
\n\
- setObstacleFlags(flags=flags_sn$ID$, phiObs=phiObs_sn$ID$, phiOut=phiOut_sn$ID$, phiIn=phiIn_sn$ID$)\n\
+ setObstacleFlags(flags=flags_sn$ID$, phiObs=phiObs_sn$ID$, phiOut=phiOut_sn$ID$, phiIn=phiIn_sn$ID$, boundaryWidth=2)\n\
flags_sn$ID$.fillGrid()\n\
\n\
# Interpolate emission grids and apply them to big noise grids\n\
More information about the Bf-blender-cvs
mailing list