Jump to content
Sign in to follow this  
zjie

Adding geometry attraction force to Flip?

Recommended Posts

Hi guys, is there a way to add attraction force from the collider to the fluid? What I want to achieve is the fluid to slide, sticking closely to the collider geometry instead of raining down once it passes the top edge.

flipToSlide.mp4
flipToSlide.hip

Share this post


Link to post
Share on other sites

I cannot see your scene at the moment, so I'm just guessing. There are multiple ways of doing this. The easiest way might be using Volume Motion -> Collisions -> Stick on collision and controlling stickyness bey a field (Control Field). You will have to add that firld to your sim, though. 

You could also use a POP Wrangle node (op POPVOP if you like that any better).

You might take the FLIP particle's velocity and cross this with the volume gradient of your collider (turn it into a volume, first) and then take the cross product of this and again the volume gradient of the collider (please apologize me being slightly imprecise, I'm on a train)

Share this post


Link to post
Share on other sites

Hi Ernest, thanks for the reply, what do you mean by "and then take the cross product of this and again the volume gradient of the collider"? 

Share this post


Link to post
Share on other sites

I did turned on stick on collision, the first layer of fluid will stick but the second layer will just fall off from the first layer, is there a reason to add control field when there is no varying sticky attribute?

Share this post


Link to post
Share on other sites

What Ernest meant was using double cross product to get the velocity that follows the surface tangent, for example you can use any test geometry, add normal and do in wrangle v@v = cross(cross(@N, {0,1,0}), @N); and visualize that in your viewport, that is the surface flow vector based on the vector {0,1,0}.

In volume, there is no "Normal", but you can use volume gradient, basically is a vector field that vectors pointing from high density to low density (if I remember correctly), so a normalized negated volume gradient can be treated as "Normal". And you can sample the volume gradient use volumegradient vex function or in the vop. A double cross product like cross(cross(-normalize(gradient), v@vel), -normalize(gradient)); will give you the surface flow vector based on your velocity. And you can use this velocity to add to your current velocity, or use a fancier method to store it in a temp field and use current velocity to advect it, then use gascalculate to blend it in.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks guys! So what I did in the end is to negate the volume gradient of the collider and use it as force, it is working well!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×