Jump to content

Viscosity by Attribute - How?


Recommended Posts

Hey guys. I've just noticed that "Viscosity by Attribute" field inside of the Flip Solver and I'm wondering how can I work with it. 

I know exactly what it does but, how can I create this attribute so then i can work with a variable viscosity?

Here's an image of it, just in case ;)https://www.dropbox.com/s/yn0600cjlzfaz2w/ViscAtt.jpg?dl=0

If, in case it's too hard to explain, can anyone just point me what should i have to study to understand it better?

Edit: Btw, I'm on H14.



Edited by ParticleSkull
Link to comment
Share on other sites

It's actually pretty simple: you have to create a viscosity attribute on your particles (point attribute, float) and enable the viscosity by attribute in the solver.

You can use an attribute create SOP or a wrangle, but if you want to manipulate the viscosity or change it over time, these changes have to be done with the use of a sop solver, but even then it's not too hard.

CMIvfx has a great tutorial on variable viscosity fluids, by Mr. Tonkas. Peter Quint also has some stuff on FLIP, but I'm not sure if he covers viscosity by attribute...



Edited by rafaelfs
  • Like 1
Link to comment
Share on other sites

Here's a quick hip with two ways of doing it.


If you use the "flip fluid from object" shelf tool, in H14 it will not create the particles in the source object, so you will have to create the your custom viscosity attribute within the DOP network. Here I did it inside a Sop Solver behind an Intermittent Solve DOP set to Run Once.


Another way to go about it is to create the particles in SOPs within the source object, e.g. with a Fluid Source SOP, and set the Initial Data -> Input Type to Particle Field inside your flipfluid DOP. This way you can set the viscosity attribute within SOPs before they are sources into the sim, which can be a bit less cumbersome. (This is the second netbox inside the .hip)


edit: Ohh, Rafael beat me to it :)


Edited by eetu
  • Like 1
Link to comment
Share on other sites

eetu, just "copied" your first example and it worked just fine. Although, for some reason, I had to change the "transform type", inside the Object Merge node, to "Into this Op
Here's the image showin' it: https://www.dropbox.com/s/k5nk9epsyuos10b/into.jpg?dl=0

Also, by default in my scene, the Viscosity Scale (on the flip solver) was set to something else (not sure now) and on your scene it's 1e+006 and it worked just fine this way. Do you know what does it means? It's something like a really low value?
Here's the image showing it exactly:  https://www.dropbox.com/s/rjushiz3mhp20i4/VS.jpg?dl=0

And thx man. Now i'll have a look on the other case.

Edited by ParticleSkull
Link to comment
Share on other sites

That scale parameter is a multiplier on the point attribute. It can be convenient to work on a 0..1 range in the point attributes and only adjust this value to change the overall viscosity scale.


1e+006 is so-called scientific notation, and equals one million. Xe+Y means X*10+Y so 1e+006 is 1*106 which is 1000000

1e-006 on the other hand is one millionth. Similarily Xe-Y means X*10-Y so 1e-006 is 1*10-6 which is 0.000001

  • Like 1
Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...