jl adv fluids presentation
TRANSCRIPT
HOUDINI 9 ADVANCED FLUIDSBuilding a Fluid SolverSIGGRAPH 2007 Master Class TrainingJeff Lait
http://www.sidefx.com/papers/advfluid07.html
Fluid Solvers in Houdini 9
The Shelf quickly sets up a fluid simulation
Note the auto created Fluid Solver node
Inside Fluid Solver DOPs
The inside of the node is complex
We will rebuild this
Volume Primitives
New Primitive type in Houdini 9
A box divided into a grid with a value stored at each node
Manipulated by SOPs
Single point stores center
Transform stores size/rotation, like Spheres and Metaballs
Mantra can render it directly
IsoOffset, IsoSurface, VolumeMix SOPs
IsoSurface
IsoSurface allowed the expression of implicit functions
Outputs polygons at the zero-crossing of the function
Volume from IsoSurface
Build Volume option stores implicit function value at
every grid point
IsoSurface from Volume
The $V local variable in IsoSurface provides the incoming volume primitive value
Building Velocity Field
snoise is builds three different noise fields
Three fields merged together to provide x, y, and z components of velocity
Import to DOPs
SOP Vector Field imports three volume primitives as
vector field
Velocity Visualization
An abundant number of ways to visualize the velocity field with guide options
Vector Guide Options
Point Geometry
Begin with a lattice of points...
Add Geometry to DOPs
SOP Geometry DOP imports the geometry
Geometry Copy DOP makes it writeable
Advect Geometry
Gas Advect Microsolver moves the points through the velocity field
Advect Geometry
Motion of points follows the streamers
Note the clumping of points at stable points of field
Stamp Tubes
Primitive Tubes are stamped onto the points
Tube Advection
Tubes stay upright in playback as
only points
are moved
Velocity Stretch
Gas Velocity Stretch DOP uses local velocity values to twist the tubes
Tube Rotation
Tubes now rotate as the velocity field twists
Velocity Stretch
Gas Velocity Stretch DOP can also stretch the tubes according to shear/scale in velocity field
Tube Scaling
Tubes now fully distort according to field, swiftly becoming
planes/points
(This is not
a nice field!)
Scalar Fields
IsoOffset allows you to build a Signed Distance field from geometry and store it in a Volume Primitive
Scalar Fields 2
Volume Mix manipulates values in volume primitives
expression builds a shell
Scalar Fields in DOPs
Import volume to DOPs with SOP Scalar Field
View as Smoke guide option
Scalar Field Guides
Inspect a slice with a plane guide
Scalar Field Advection
Gas Advection node can also advect a field
Smoke Advection
Smoke moves through the velocity field
Plane Advection
Single slice of the field as the field moves through the velocity field
Scalar Field Scaling
Respect the expansion/contraction in the field
Smoke Scaling
Note that the smoke stays sharper and we don't get a net gain of smoke
Plane Scaling
Compression effects are clear in single cross section view
Signed Distance Fields
Voxels store 1 for fluid,
0 for none
SDFs store negative for fluid, positive for none
Zero crossing not restricted to voxel boundaries, allows
sub-voxel detail
Iso Guide Options
Guide options for scalar fields allows one to track a specific IsoSurface
SDF Advection
One can advect distance fields in the same way as density fields
What is Divergence?
Measure of imbalance of velocity field
Divergence at center can be measured by comparing in going and outgoing velocties of boundary of cell
Incompressible fluids should have zero divergence
Consists of swirl, shear, translate factors. Does not have scale factor
Removing Divergence
Scale components can be represented as a
pressure field
Find a pressure field that removes our divergence
Changing one cell, however, affects neighbouring cells
Entire fluid is coupled and needs to be solved at once
Use preconditioned conjugate gradient method with an incomplete Cholesky preconditioner.
Or just use a Gas Project Non-Divergent DOP
Project Non-Divergent
Add a Gas Project Non-Divergent DOP to our non-nice velocity field
Pressure Computation
Pressure field created to remove divergence
Pressure Application
Final non-divergent field
2d Divergence
Same process in 2d for clarity
Note the central rarification becomes a low pressure
zone and is removed
Divergent Free Advection
Smoke no longer bunches up
Changing Velocity Field
Add a DOP Fan Force
Gas External Forces updates the velocity field
Fan Motion
Velocity accelerates inside fan
Exterior velocity only adjusted
by pressure
Loss of momentum!
Velocity Advection
Conserve momentum by moving the velocity
Do this by advecting the velocity with itself
Velocity Advection
Fan-accelerated air carries its velocity outside of the fan
Entire system starts moving
Combustion Inputs
Inputs to combustion model
Combustion Flow
Temperature
that exceeds
Ignition Temperature determines
potential burn
Burn clamped by fuel
Actual burn rate determines
feedback effects
Add Fields
We add to our fluid object the required fields,
such as Fuel
Add Field Temperature
Likewise, temperature
Note the initial hotspot to trigger the combustion
Add Burn Field
The output will be this burn field
Add Combustion Model
We use the Gas Combustion DOP to express this model
Inside Combustion Model
Flow chart implemented by a series of Gas
Calculate DOPs
Buoyancy Force
To get hot air to rise, we add a Gas Buoyancy DOP
Simple Combustion
Flame doesn't spread
No expansion at flame front
Intentional Non-Zero Divergence
To get the gas to expand at the flame front, set the burn field to be our desired divergence
With Gas Expansion
Temperature field stays sharp
Flame front doesn't spread against wind direction
Temperature Diffusion
A Gas Diffuse DOP lets us smear out the
temperature field
With Temperature Diffusion
Fire chases
the fuel against the updraft
Only Burn Field
Examining the burn field alone
Shows which voxels burn on this timestep
Soot Field
Turn on the display of the density field we use to store the burnt fuel
Smoke and Fire
Both displayed at once
Augmenting Houdini Solvers
Add a Colour field to Houdini's Fluid Solver
Build three volume primitives for Red/Green/Blue
Add to DOPs
SOP Vector Field adds the colour data
Gas Advect moves it by the velocity
Apply in SOPs
Import extra colour field
apply_colour is copying the colour field onto Cd
VOP SOP for Field Application
red, green, blue, are Volume Sample VOPs
Colour Scalar
Colour tracks fluid
Boundary blends the two colours together
Could add
Gas Diffuse
to increase blending
Sharp Boundaries
Build an SDF to store which colour we want.
Add Colour Key to DOPs
Replace the SOP Vector Field with SOP Scalar Field.
Use Colour Key to set Colour
VOP SOP converts negative/positive to either red or green
Colour Key
Colour tracks fluid
Sharp boundary between colours is maintained
Summary
Arbitrary data fields can be added to extend a fluid simulation
Small atomic microsolvers can be used to build a complicated simulation out of manageable pieces
Packaged solvers are built in this manner a good
source to see how micro solvers can be used
Packaged solvers have extra inputs to take your own added layers of simulation
Click to edit the title text format
Click to edit the outline text format
Second Outline Level
Third Outline Level
Fourth Outline Level
Fifth Outline Level
Sixth Outline Level
Seventh Outline Level
Eighth Outline Level
Ninth Outline Level