doyubkim / fluid-engine-dev

Fluid simulation engine for computer graphics applications
https://fluidenginedevelopment.org/
MIT License
1.83k stars 255 forks source link

Variable Viscosity #222

Open PavelBlend opened 5 years ago

PavelBlend commented 5 years ago

References: https://youtu.be/OEfpkvxx5kg https://vimeo.com/44446399 https://vimeo.com/102554547 https://vimeo.com/124184280

doyubkim commented 5 years ago

Nice. What would be the best way to apply variable viscosity? Different viscosity per emitter? Or via interaction with colliders?

PavelBlend commented 5 years ago

I think it is better to implement two options.

The first is the Viscosity parameter of the emitter, which will have access through the python API. So that it can be changed over time.

The second is to realize the temperature of the fluid particles and colliders. And the parameter cooling rate / heating.

If the collider is hotter than the liquid particles, then the particles reduce their viscosity.

And if the cooling parameter is high and positive, then the particles of a liquid increase their viscosity more quickly with time.

And I would like to have access through the Python API to the viscosity of each particle and to the temperature of each particle.

doyubkim commented 5 years ago

Setting different viscosity per particle/emitter sounds feasible. Introducing thermodynamics might take some time and can't promise.

doyubkim commented 5 years ago

Actually, the introducing temperature and having it affect viscosity might not be that complicated. A simple exponential model might work just fine.

PavelBlend commented 5 years ago

I thought now. And I decided that it was not necessary to apply variable viscosity through colliders. You need to create a new class that will act as a source of heat / cold. And this class will take a parameter - a triangular mesh.

doyubkim commented 5 years ago

I will take your suggestions in account. In summary, there will be:

These features won't come very soon, so please wait for any updates. I'm still planning out whether this should be part of current v1 or next v2.