rlguy / Blender-FLIP-Fluids

The FLIP Fluids addon is a tool that helps you set up, run, and render high quality liquid fluid effects all within Blender, the free and open source 3D creation suite.
https://www.blendermarket.com/products/flipfluids
GNU General Public License v3.0
1.7k stars 190 forks source link

Fluid Adhesion #344

Closed Jandals closed 6 years ago

Jandals commented 6 years ago

I'm working on a waterfall and the generated fluid surface is aggressively sticking to nearby surfaces and it's affecting the look of the simulation.

Is there a setting anywhere that will affect how much the fluid will adhere to a vertical surface? I'd like to get a clean drop straight-down (ish) but it seems like the fluid is hunting for something to stick to and it fans out a lot. I'm sure I could workaround this by altering the geometry of my obstacle objects. I'd prefer to change this behavior with a setting, though, if possible.

The picture shows the kind of adhesion I'm trying to eliminate. In a lot of places, it's totally appropriate, but on a larger scale, it looks out of place. screen shot 2018-06-24 at 12 14 42 am

rlguy commented 6 years ago

Hello Jandals,

At the moment, the only setting that affects surface adhesion is the obstacle friction. But by default, that value is at the lowest value set at 0.

I am wondering: does the simulation improve with a higher resolution?

Would you be able to attach the .blend file for me to test? You will need to create a .zip of the scene to attach it to this issue. Alternatively, you may send the file to flip.fluids.beta[at]gmail.com. Perhaps there is a way that I could modify the simulator to prevent fluid from adhering to surfaces like this.

- Ryan

Jandals commented 6 years ago

Thanks, Ryan. I'll make a portable version to send to you. I'll try to get it ready tomorrow.

I turned the simulation resolution as high as 500 without seeing much effect, but it's also a fairly large area to simulate so I may need to try again after I trim down the scene for email.

Jandals commented 6 years ago

Here's the sample scene. For some reason, the simulated fluid is offset from the obstacle object but it still fans out the same when simulated.

Thanks for taking a look.

Fanning Waterfall Portable.blend.zip

rlguy commented 6 years ago

Hello Jandals,

Thanks for providing the scene file!

I finally had some time to test this and did some research into fluid adhesion techniques. I tried a few things, but nothing would get the fluid to adhere less to the obstacle surface. I looked into the paper that we used to implement the fluid physics and wall adhesion and it turns out that this fluid sticking is a necessary part of the fluid physics and there is not a workaround. At the moment, we implement the best publicly known method of fluid/solid interaction for the FLIP simulation method. I remembered this quote regarding the issue:

A common numerical artifact seen in water simulations is fluid “crawling” up walls and even along ceilings, eventually dripping down or crossing over to another wall to descend. While this is well established physically for many flow situations, it has the unfortunate side-effect of not allowing fluid to separate from a wall, a phenomena which is readily observed in everyday life. Without getting into the physical chemistry of molecular-scale interactions that actually govern surface wetting/drying (and that are not captured by continuum mechanics) we argue heuristically that in reality only a thin film of fluid is left on the wall in these situations. This film, at most a wet patch, is far too small to be resolved on an animation grid.

- paraphrased from A Fast Variational Framework for Accurate Solid-Fluid Coupling https://www.cs.ubc.ca/labs/imager/tr/2007/Batty_VariationalFluids/variationalFluids.pdf

Since the simulation has a finite particle size, a thin layer of particles will always adhere to an obstacle surface. Increasing resolution will make the particles smaller which will create a thinner layer and help fluid unstick, but in your simulation, the domain is quite large and a higher resolution will greatly affect simulation times and is a an unrealistic solution.

Through some testing, I found that a workaround in your scene is to increase the flow speed of your inflow. There seems to be a higher speed that allows the fluid to overcome the vertical wall and flow without sticking. I am not sure if this is suitable for your scene.

Sorry that I am unable to do more to help with your scene!

Best Regards, Ryan

On Mon, Jun 25, 2018 at 11:27 PM, Jandals notifications@github.com wrote:

Here's the sample scene. For some reason, the simulated fluid is offset from the obstacle object but it still fans out the same when simulated.

Thanks for taking a look.

Fanning Waterfall Portable.blend.zip https://github.com/rlguy/Blender-FLIP-Fluids/files/2135777/Fanning.Waterfall.Portable.blend.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rlguy/Blender-FLIP-Fluids/issues/344#issuecomment-400193619, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFjBxk4KgzOYdIwiBxa4d8vkSW0WDNmks5uAdRNgaJpZM4U1Df8 .

-- The FLIP Fluids Team http://github.com/rlguy/Blender-FLIP-Fluids-Beta

rlguy commented 6 years ago

Forgot to address this issue:

Here's the sample scene. For some reason, the simulated fluid is offset from the obstacle object

This was a bug that caused the mesh to be offset if world scaling was enabled. This bug was fixed and the fix should be included in version 1.0.3 which is the most recent version available on the Blender Market. If you are using version 1.0.3 and are still experiencing this issue, please let me know!

On Tue, Jul 3, 2018 at 2:32 PM, FLIP Fluids Team <flip.fluids.beta@gmail.com

wrote:

Hello Jandals,

Thanks for providing the scene file!

I finally had some time to test this and did some research into fluid adhesion techniques. I tried a few things, but nothing would get the fluid to adhere less to the obstacle surface. I looked into the paper that we used to implement the fluid physics and wall adhesion and it turns out that this fluid sticking is a necessary part of the fluid physics and there is not a workaround. At the moment, we implement the best publicly known method of fluid/solid interaction for the FLIP simulation method. I remembered this quote regarding the issue:

A common numerical artifact seen in water simulations is fluid “crawling” up walls and even along ceilings, eventually dripping down or crossing over to another wall to descend. While this is well established physically for many flow situations, it has the unfortunate side-effect of not allowing fluid to separate from a wall, a phenomena which is readily observed in everyday life. Without getting into the physical chemistry of molecular-scale interactions that actually govern surface wetting/drying (and that are not captured by continuum mechanics) we argue heuristically that in reality only a thin film of fluid is left on the wall in these situations. This film, at most a wet patch, is far too small to be resolved on an animation grid.

- paraphrased from A Fast Variational Framework for Accurate Solid-Fluid Coupling https://www.cs.ubc.ca/labs/imager/tr/2007/Batty_VariationalFluids/variationalFluids.pdf

Since the simulation has a finite particle size, a thin layer of particles will always adhere to an obstacle surface. Increasing resolution will make the particles smaller which will create a thinner layer and help fluid unstick, but in your simulation, the domain is quite large and a higher resolution will greatly affect simulation times and is a an unrealistic solution.

Through some testing, I found that a workaround in your scene is to increase the flow speed of your inflow. There seems to be a higher speed that allows the fluid to overcome the vertical wall and flow without sticking. I am not sure if this is suitable for your scene.

Sorry that I am unable to do more to help with your scene!

Best Regards, Ryan

On Mon, Jun 25, 2018 at 11:27 PM, Jandals notifications@github.com wrote:

Here's the sample scene. For some reason, the simulated fluid is offset from the obstacle object but it still fans out the same when simulated.

Thanks for taking a look.

Fanning Waterfall Portable.blend.zip https://github.com/rlguy/Blender-FLIP-Fluids/files/2135777/Fanning.Waterfall.Portable.blend.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rlguy/Blender-FLIP-Fluids/issues/344#issuecomment-400193619, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFjBxk4KgzOYdIwiBxa4d8vkSW0WDNmks5uAdRNgaJpZM4U1Df8 .

-- The FLIP Fluids Team http://github.com/rlguy/Blender-FLIP-Fluids-Beta

-- The FLIP Fluids Team http://github.com/rlguy/Blender-FLIP-Fluids-Beta

Jandals commented 6 years ago

Thanks for the help, Ryan.

What you described about adhesion makes sense for a lot of cases, it just looks awkward when a simulation is supposed to be large scale. I’ll be working around it by altering my collision object to steer particles where I want them.

And thanks for the not about the translational shift that was happening. I discovered that deleting the generated fluid surface object forced the add-on to generate a new object in the right place. I’m having trouble updating to version 1.0.3 through BlenderMarket but they should be able to help resolve that soon.

Thanks again for the help, Jandals

On Jul 3, 2018, at 2:32 PM, Ryan Guy notifications@github.com wrote:

Hello Jandals,

Thanks for providing the scene file!

I finally had some time to test this and did some research into fluid adhesion techniques. I tried a few things, but nothing would get the fluid to adhere less to the obstacle surface. I looked into the paper that we used to implement the fluid physics and wall adhesion and it turns out that this fluid sticking is a necessary part of the fluid physics and there is not a workaround. At the moment, we implement the best publicly known method of fluid/solid interaction for the FLIP simulation method. I remembered this quote regarding the issue:

A common numerical artifact seen in water simulations is fluid “crawling” up walls and even along ceilings, eventually dripping down or crossing over to another wall to descend. While this is well established physically for many flow situations, it has the unfortunate side-effect of not allowing fluid to separate from a wall, a phenomena which is readily observed in everyday life. Without getting into the physical chemistry of molecular-scale interactions that actually govern surface wetting/drying (and that are not captured by continuum mechanics) we argue heuristically that in reality only a thin film of fluid is left on the wall in these situations. This film, at most a wet patch, is far too small to be resolved on an animation grid.

- paraphrased from A Fast Variational Framework for Accurate Solid-Fluid Coupling https://www.cs.ubc.ca/labs/imager/tr/2007/Batty_VariationalFluids/variationalFluids.pdf

Since the simulation has a finite particle size, a thin layer of particles will always adhere to an obstacle surface. Increasing resolution will make the particles smaller which will create a thinner layer and help fluid unstick, but in your simulation, the domain is quite large and a higher resolution will greatly affect simulation times and is a an unrealistic solution.

Through some testing, I found that a workaround in your scene is to increase the flow speed of your inflow. There seems to be a higher speed that allows the fluid to overcome the vertical wall and flow without sticking. I am not sure if this is suitable for your scene.

Sorry that I am unable to do more to help with your scene!

Best Regards, Ryan

On Mon, Jun 25, 2018 at 11:27 PM, Jandals notifications@github.com wrote:

Here's the sample scene. For some reason, the simulated fluid is offset from the obstacle object but it still fans out the same when simulated.

Thanks for taking a look.

Fanning Waterfall Portable.blend.zip https://github.com/rlguy/Blender-FLIP-Fluids/files/2135777/Fanning.Waterfall.Portable.blend.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rlguy/Blender-FLIP-Fluids/issues/344#issuecomment-400193619, or mute the thread https://github.com/notifications/unsubscribe-auth/AEFjBxk4KgzOYdIwiBxa4d8vkSW0WDNmks5uAdRNgaJpZM4U1Df8 .

-- The FLIP Fluids Team http://github.com/rlguy/Blender-FLIP-Fluids-Beta — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rlguy/Blender-FLIP-Fluids/issues/344#issuecomment-402298167, or mute the thread https://github.com/notifications/unsubscribe-auth/AFL_DZ74TUyGtFqs3zkjvmJRUUGp7nP2ks5uC-L8gaJpZM4U1Df8.