FLIP fluid question

   5370   5   3
User Avatar
Member
31 posts
Joined: Jan. 2012
Offline
Hey guys!

So I'm trying to recreate a scene from last week's class on Fluids and I think my notes are incomplete. Basically, I'm trying to convert the 3 colored box into a flip fluid then apply a spin force to it so that the colors will swirl together. I'm confused because I know I have to add the point SOP with an added velocity of $TX2-$TX (the same for y and z) and also within a vopsop I have to configure the vectors using a quaternion, I just don't know how it all relates or how to incorporate everything together.

For now, I just want the colors to swirl, but I'll be experimenting with blending the colors later on as well.

Thanks for the help!

Attachments:
FLIP_spin.hipnc (915.0 KB)

User Avatar
Member
10 posts
Joined: May 2012
Offline
hello, thanks for coming to the class.

The PointSOP and the VopSOP are actually two separate methods to get the same effect. You do either or, not both.

The point SOP method basically just creates a vector from the position in input 1 or the position coming into input 2. So if you rotate the box coming into input, the vectors the point to those rotated points form a swirling pattern. The problem with this is the vectors on the edges of the geometry are longer than the vectors near the origin. That would mean the the force swirling the fluid would be stronger at the edges.

The VOP SOP creates a bunch of vector attributes on your points, and all the vectors are the same length. The quaternion (and quaternion multiply) rotates all of those vectors about the Y axis. (You can rotate about any arbitrary vector, but in that example I specified 0 1 0). This approach is nice because there is a uniform swirling force throughout the fluid.

Does that make sense?
User Avatar
Member
31 posts
Joined: Jan. 2012
Offline
Thanks for the explanation Travis, it definitely made a lot of sense and helped clarify it for me. I'm still having trouble visualizing the vectors to edit them. Do I have to create a custom marker to view the vectors? and after I set up everything in the VOP SOP with the quaternion and all that, do I need to edit anything else to get the circular motion of the particles?

Thanks and sorry for the late reply!
User Avatar
Member
10 posts
Joined: May 2012
Offline
If you want to view your velocity point attribute in the viewport, you'll need to create a custom marker.

The way you do that is by moving your cursor over the viewport and pressing the “d” key. That brings up your viewport display options. Under the markers tab there is a section at the bottom called “custom”. If you click on the “new vector display option” in the corner, that will allow you to create a new custom vector visualization.



When the new window pops up, you specify which point attribute you want to visualize. In this case, you want to see the point attribute “v”, so just put v in all of the fields.



the only one that really matters is “attribute”, but keeping them all the same is an easy way to keep track of what you're visualizing.

As far as the VOP SOP goes, you should just need to set the angle of rotation (in my case I used 200) and the axis about which to rotate. I've attached a simple example file that illustrates how I used the quaternion to rotate that velocity vector about the y-axis.

Attachments:
quaternion_example.hip (68.6 KB)

User Avatar
Member
31 posts
Joined: Jan. 2012
Offline
Thanks for the example. I think I've finally figured it out. I applied the quaternion like your example and I've gotten almost the same effect. For some reason when my particles swirl they begin to create a vortex/whirlpool that didn't happen when you did it in the class. I kind of like it but I was just wondering what caused it. Can you take a look and let me know?

Thanks again for all the help!

Attachments:
swirl.hipnc (886.6 KB)

User Avatar
Member
10 posts
Joined: May 2012
Offline
You aren't supposed to add the velocity to the source FLIP points, that only gives them an initial velocity. You want to add the velocity attribute to another object and then bring that into DOPs using the SOP geometry node. That insures that they will be given a constant swirling force.

The way that you have your field force node set up, it's not really doing anything because you're not giving it any information to use to generate the force. You don't have anything going into the green input on the right side of the node.

The FLIP source and force that swirls the particles are two separate objects. I've attached an example HIP with some stickies. Hopefully that clears things up.

Also, I enabled viscosity in my examples to keep the fluid together.

Attachments:
swirl_fixed.hipnc (915.8 KB)

  • Quick Links