Wednesday, 6 May 2015

Velocity Field from Moving Geometry

If you want to create a velocity field from a moving mesh, here is a way to do it:




1. With your geometry selected, emit nParticles.



2. For the emitter, set:
  • Emitter Type to 'surface'
  • Increase the rate to, say, 50000 (depending on the size of your mesh)
  • Key the emission rate so that emission stops after a couple of frames.
  • Emission Speed and Normal Speed to 0
  • check the 'Need Parent UV' option


  4 Add the following per-particles attributes:
  • parentU
  • parentV
  • goalU
  • goalV



Make a creation expression on the nParticle object:

goalU=parentU;
goalV=parentV;



 6. Assign the geometry mesh as a goal for the nParticles. Set the Goal Smoothness to 0 and Goal Weight to 1.0




 Now you should have some particles sticking to the mesh.

7. Create a fluid container. You can use auto-resize if you want.

8. Select the fluid and the nParticles and create a fluid emitter.


 9. Set the emission to zero for Density, Heat and Fuel. Set the emission speed attributes to 'Add' and the Inherit Velocity to a value greater than zero.



That's it. You should now have the nParticles emitting velocity in the fluid. You can visualise the velocity field with the Velocity Draw option on the Fluid shape node.

You can use the velocities generated by this method to drive other simulations - nCloth, particles or fluids.



No comments:

Post a Comment