zjie Posted November 11, 2019 Share Posted November 11, 2019 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 Quote Link to comment Share on other sites More sharing options...
Whatsinaname Posted November 11, 2019 Share Posted November 11, 2019 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) Quote Link to comment Share on other sites More sharing options...
zjie Posted November 12, 2019 Author Share Posted November 12, 2019 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"? Quote Link to comment Share on other sites More sharing options...
zjie Posted November 12, 2019 Author Share Posted November 12, 2019 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? Quote Link to comment Share on other sites More sharing options...
jimeng20 Posted November 13, 2019 Share Posted November 13, 2019 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. 1 Quote Link to comment Share on other sites More sharing options...
zjie Posted November 14, 2019 Author Share Posted November 14, 2019 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! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.