HOUDINI 9 ADVANCED FLUIDS Building a Fluid Solver SIGGRAPH 2007 Master Class Training <ul><li>Jeff Lait </li></ul><ul><ul>...
Fluid Solvers in Houdini 9 <ul><li>The Shelf quickly sets up a fluid simulation </li></ul><ul><li>Note the auto created Fl...
Inside Fluid Solver DOPs <ul><li>The inside of the node is complex </li></ul><ul><li>We will rebuild this </li></ul>
Volume Primitives <ul><li>New Primitive type in Houdini 9 </li></ul><ul><li>A box divided into a grid with a value stored ...
IsoSurface <ul><li>IsoSurface allowed the expression of implicit functions </li></ul><ul><li>Outputs polygons at the zero-...
Volume from IsoSurface <ul><li>Build Volume option stores implicit function value at  every grid point </li></ul>
IsoSurface from Volume <ul><li>The $V local variable in IsoSurface provides the incoming volume primitive value </li></ul>
Building Velocity Field <ul><li>snoise is builds three different noise fields </li></ul><ul><li>Three fields merged togeth...
Import to DOPs <ul><li>SOP Vector Field imports three volume primitives as  vector field </li></ul>
Velocity Visualization <ul><li>An abundant number of ways to visualize the velocity field with guide options </li></ul>
Vector Guide Options
Point Geometry <ul><li>Begin with a lattice of points... </li></ul>
Add Geometry to DOPs <ul><li>SOP Geometry DOP imports the geometry </li></ul><ul><li>Geometry Copy DOP makes it writeable ...
Advect Geometry <ul><li>Gas Advect Microsolver moves the points through the velocity field </li></ul>
Advect Geometry <ul><li>Motion of points follows the streamers </li></ul><ul><li>Note the clumping of points at stable poi...
Stamp Tubes <ul><li>Primitive Tubes are stamped onto the points </li></ul>
Tube Advection <ul><li>Tubes stay upright in playback as  only points  are moved </li></ul>
Velocity Stretch <ul><li>Gas Velocity Stretch DOP uses local velocity values to twist the tubes </li></ul>
Tube Rotation <ul><li>Tubes now rotate as the velocity field twists </li></ul>
Velocity Stretch <ul><li>Gas Velocity Stretch DOP can also stretch the tubes according to shear/scale in velocity field </...
Tube Scaling <ul><li>Tubes now fully distort according to field, swiftly becoming planes/points (This is not  a nice field...
Scalar Fields <ul><li>IsoOffset allows you to build a Signed Distance field from geometry and store it in a Volume Primiti...
Scalar Fields 2 <ul><li>Volume Mix manipulates values in volume primitives </li></ul><ul><li>expression builds a shell </l...
Scalar Fields in DOPs <ul><li>Import volume to DOPs with SOP Scalar Field </li></ul><ul><li>View as Smoke guide option </l...
Scalar Field Guides <ul><li>Inspect a slice with a plane guide </li></ul>
Scalar Field Advection <ul><li>Gas Advection node can also advect a field </li></ul>
Smoke Advection <ul><li>Smoke moves through the velocity field </li></ul>
Plane Advection <ul><li>Single slice of the field as the field moves through the velocity field </li></ul>
Scalar Field Scaling <ul><li>Respect the expansion/contraction in the field </li></ul>
Smoke Scaling <ul><li>Note that the smoke stays sharper and we don't get a net gain of smoke </li></ul>
Plane Scaling <ul><li>Compression effects are clear in single cross section view </li></ul>
Signed Distance Fields <ul><li>Voxels store 1 for fluid,  0 for none </li></ul><ul><li>SDFs store negative for fluid, posi...
Iso Guide Options <ul><li>Guide options for scalar fields allows one to track a specific IsoSurface </li></ul>
SDF Advection <ul><li>One can advect distance fields in the same way as density fields </li></ul>
What is Divergence? <ul><li>Measure of imbalance of velocity field </li></ul><ul><li>Divergence at center can be measured ...
Removing Divergence <ul><li>“Scale” components can be represented as a  pressure field </li></ul><ul><li>Find a pressure f...
Project Non-Divergent <ul><li>Add a Gas Project Non-Divergent DOP to our non-nice velocity field </li></ul>
Pressure Computation <ul><li>Pressure field created to remove divergence </li></ul>
Pressure Application <ul><li>Final non-divergent field </li></ul>
2d Divergence <ul><li>Same process in 2d for clarity </li></ul><ul><li>Note the central rarification becomes a low pressur...
Divergent Free Advection <ul><li>Smoke no longer bunches up </li></ul>
Changing Velocity Field <ul><li>Add a DOP Fan Force </li></ul><ul><li>Gas External Forces updates the velocity field  </li...
Fan Motion <ul><li>Velocity accelerates inside fan </li></ul><ul><li>Exterior velocity only adjusted  by pressure </li></u...
Velocity Advection <ul><li>Conserve momentum by moving the velocity </li></ul><ul><li>Do this by advecting the velocity wi...
Velocity Advection <ul><li>Fan-accelerated air carries its velocity outside of the fan </li></ul><ul><li>Entire system sta...
Combustion Inputs <ul><li>Inputs to combustion model </li></ul>
Combustion Flow <ul><li>Temperature  that exceeds  Ignition Temperature determines  potential burn </li></ul><ul><li>Burn ...
Add Fields <ul><li>We add to our fluid object the required fields,  such as Fuel </li></ul>
Add Field Temperature <ul><li>Likewise, temperature </li></ul><ul><li>Note the initial hotspot to trigger the combustion <...
Add Burn Field <ul><li>The output will be this “burn” field </li></ul>
Add Combustion Model <ul><li>We use the Gas Combustion DOP to express this model </li></ul>
Inside Combustion Model <ul><li>Flow chart implemented by a series of Gas  Calculate DOPs </li></ul>
Buoyancy Force <ul><li>To get hot air to rise, we add a Gas Buoyancy DOP </li></ul>
Simple Combustion <ul><li>Flame doesn't spread </li></ul><ul><li>No expansion at flame front </li></ul>
Intentional Non-Zero Divergence <ul><li>To get the gas to expand at the flame front, set the burn field to be our desired ...
With Gas Expansion <ul><li>Temperature field stays sharp </li></ul><ul><li>Flame front doesn't spread against wind directi...
Temperature Diffusion <ul><li>A Gas Diffuse DOP lets us smear out the  temperature field </li></ul>
With Temperature Diffusion <ul><li>Fire chases  the fuel against the updraft </li></ul>
Only Burn Field <ul><li>Examining the burn field alone </li></ul><ul><li>Shows which voxels burn on this timestep </li></ul>
Soot Field <ul><li>Turn on the display of the density field we use to store the burnt fuel </li></ul>
Smoke and Fire <ul><li>Both displayed at once </li></ul>
Augmenting Houdini Solvers <ul><li>Add a Colour field to Houdini's Fluid Solver </li></ul><ul><li>Build three volume primi...
Add to DOPs <ul><li>SOP Vector Field adds the colour data </li></ul><ul><li>Gas Advect moves it by the velocity </li></ul>
Apply in SOPs <ul><li>Import extra colour field </li></ul><ul><li>apply_colour is copying the colour field onto Cd </li></ul>
VOP SOP for Field Application <ul><li>red, green, blue, are Volume Sample VOPs </li></ul>
Colour Scalar <ul><li>Colour tracks fluid </li></ul><ul><li>Boundary blends the two colours together </li></ul><ul><li>Cou...
Sharp Boundaries <ul><li>Build an SDF to store which colour we want. </li></ul>
Add Colour Key to DOPs <ul><li>Replace the SOP Vector Field with SOP Scalar Field. </li></ul>
Use Colour Key to set Colour <ul><li>VOP SOP converts negative/positive to either red or green </li></ul>
Colour Key <ul><li>Colour tracks fluid </li></ul><ul><li>Sharp boundary between colours is maintained </li></ul>
Summary <ul><li>Arbitrary data fields can be added to extend a fluid simulation </li></ul><ul><li>Small atomic “microsolve...
Upcoming SlideShare
Loading in …5
×

Jl Adv Fluids Presentation

1,317 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,317
On SlideShare
0
From Embeds
0
Number of Embeds
28
Actions
Shares
0
Downloads
26
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Jl Adv Fluids Presentation

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

×