Lumpy Water - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html) +--- Thread: Lumpy Water (/thread-3306.html) |
Lumpy Water - devPatrick - 07-02-2022 Hello, I have an issue I hope you can help me with. For lack of anything better to call it, I'm calling it lumpy (surface) water. I have a 'glass' cube with Obi Fluid in it. For the fluid, I'm using the particle renderer with enlarged particles. For the cube, I have Obi colliders on the interior walls and a menu to allow the user to control the dimensions of the cube. When the fluid particles are first produced, they settle out about how you would expect- relatively flat surface. In playing around with the cube dimensions, however I can produce a non-flat surfaces like the one illustrated in the image below. Notice the large bulge on the left side compared to the ride side. I took the screenshot after the particles had settled. I've also produced smaller 'lumps' than what's depicted in the picture. Additionally, I noticed this odd lumping behavior in a different environment in which I was using the emitter to produce a continuous stream through a cube-like channel (like a pipe, but with cubed/squared walls). RE: Lumpy Water - josemendez - 07-02-2022 (07-02-2022, 07:20 AM)devPatrick Wrote: Hello, I have an issue I hope you can help me with. For lack of anything better to call it, I'm calling it lumpy (surface) water. Hi! This could just be a result of the fact that fluids are discretized. There's very few particles in your fluid, and it seems to be only 2 - 3 vertical layers of them: the top layer might just have not enough particles to fill the entire surface, so depending on where it's positioned it will look like a "lump". If you set the solver's max anisotropy to zero, particles will be rendered as spheres and this issue will become apparent. Using more surface tension, more density iterations, more substeps or simply more particles should help. kind regards, RE: Lumpy Water - devPatrick - 07-02-2022 Increasing the iterations of the Density constraint seems to help, but I can still get this lumping to occur pretty easily. The attached pictures are with 12 iterations. I've also tried playing with the relaxation. Lower relaxation values seems to help, but comes with the added issue of un-evening the distribution of the particles throughout the fluid volume. On the surfaces of the fluid (surface, walls, and floor), the particles seem compressed (overlapping each other) while a void area (blank space with no particles in it) forms just above the floor surface. The first two pictures illustrate the compressed overlapping and void space I'm trying to describe with a relaxation of 0.1. The picture on the right had a relaxation of 0.7, I believe. (07-02-2022, 09:03 AM)josemendez Wrote: Hi! Thanks for the input! I'll give your suggestions a go tomorrow. RE: Lumpy Water - josemendez - 07-02-2022 (07-02-2022, 09:36 AM)devPatrick Wrote: Increasing the iterations of the Density constraint seems to help, but I can still get this lumping to occur pretty easily. The attached pictures are with 12 iterations. Relaxation is just a multiplier on constraint "force". Lower relaxation values simply enforce constraints less strictly. Applied to density constraints (whose job is to enforce even distribution of mass over volume and hence, even spatial distribution of particles) will result in uneven distributions. I still think this is just due to discretization, and the fact that there's very few particles in there. If you set the max anisotropy to the minimum value (1) you'll see the problem more clearly. (07-02-2022, 09:36 AM)devPatrick Wrote: On the surfaces of the fluid (surface, walls, and floor), the particles seem compressed (overlapping each other) while a void area (blank space with no particles in it) forms just above the floor surface. When max anisotropy is set > 1, particles will be "pulled" towards the surface and flattened into ellipsoidal shapes, to try and get a smoother surface. This will result in less densely packed fluid volumes, since particles try to make a smoother surface. RE: Lumpy Water - devPatrick - 10-02-2022 Thanks for the explanation. That all makes sense. I changed the max anisotropy to 1 as you suggested and I do see the issue. Correct me if I'm wrong, but it seems like this wouldn't really have much to do with the number of particles or layers. Rather this just seems like a normal, expected behavior when a fluid cannot support even distribution of the particles throughout its layers. So I'm my use case, as the fluid is compressed by reducing the size of the container, I'll inevitably reach a point where the current layers can no longer support the current number of particles in them. Thus, some of the particles will be forced to the surface to create a new layer. If the number of particles in this new layer are less than the number of particles in lower layers, that's when we'll have this appearance of an uneven, 'lumpy' surface. Moreover, the lower layers don't even have to be 'full', i.e. filled to capacity, stretching from one side of the container to the other. Since the particles are spheres, you can actually have a situation where successively less complete layers are stacked on one another in a kind of mound or pyramid type of shape. I'm guessing increasing the surface tension would largely eliminate this scenario, though leaving us with just one incomplete layer. Excluding fluid 'beading' of course. If my assessment is correct, then wouldn't the solutions generally be: 1) Keep the scale of the particles small enough so that you won't be able to notice the uneven surface 2) If you want to use larger particles, just be aware that this is the situation and try not to focus on it RE: Lumpy Water - josemendez - 10-02-2022 Hi Patrick! (10-02-2022, 12:50 AM)devPatrick Wrote: Thanks for the explanation. That all makes sense. I changed the max anisotropy to 1 as you suggested and I do see the issue. Correct me if I'm wrong, but it seems like this wouldn't really have much to do with the number of particles or layers. Rather this just seems like a normal, expected behavior when a fluid cannot support even distribution of the particles throughout its layers. It's normal behavior in the sense that it stems from discretization (the process of chopping up a continuous quantity/surface/volume into a finite number of individual pieces). This is necessary when doing anything in a computer, since computers are digital and cannot deal with continuous stuff. In the case, particles are to fluids what triangles are to meshes, or texels to textures. If you want a smoother fluid surface, just use more particles (and layers). If you want a smoother mesh, use more triangles, if you want a less pixelated texture, use more texels. So in a sense, it does have to do with the number of particles/layers: the more particles you use (the higher your fluid resolution is) the less pronounced the effect will be. (10-02-2022, 12:50 AM)devPatrick Wrote: So I'm my use case, as the fluid is compressed by reducing the size of the container, I'll inevitably reach a point where the current layers can no longer support the current number of particles in them. Thus, some of the particles will be forced to the surface to create a new layer. If the number of particles in this new layer are less than the number of particles in lower layers, that's when we'll have this appearance of an uneven, 'lumpy' surface. Yes, that's a good analysis of what happens. Keep in mind that the thing that makes fluid "fluid" is constant density. Ideally, the amount of mass per volume unit in a fluid shouldn't change. In Obi, all particles in a fluid have the same mass, so the amount of particles per volume unit should stay constant. This is what makes particles repel/attract each other: try and keep their neighborhood constant. When a layer of fluid has too many particles, any new particles added to it will instead "pop up" and begin forming a new layer on top. This is what causes the 'lumpy' look. (10-02-2022, 12:50 AM)devPatrick Wrote: Moreover, the lower layers don't even have to be 'full', i.e. filled to capacity, stretching from one side of the container to the other. Since the particles are spheres, you can actually have a situation where successively less complete layers are stacked on one another in a kind of mound or pyramid type of shape. I'm guessing increasing the surface tension would largely eliminate this scenario, though leaving us with just one incomplete layer. Excluding fluid 'beading' of course. Large surface tension would help indeed, but it's not always desired. Al larger smoothing radius (which determines the size of the neighborhood considered by each particle when calculating local density) should help create a more even particle distribution too. (10-02-2022, 12:50 AM)devPatrick Wrote: If my assessment is correct, then wouldn't the solutions generally be: 100% spot on. The only real solution to this is to have more, smaller particles: that is, increase fluid resolution. Same as you would increase the amount of triangles in a mesh to make it less "blocky". If you can't afford to have such high resolution fluid, your only option is to live with it. |