17

I am trying to do a water simulation. I have a small cup that I have created in blender (as an obstacle) and my water source (just an oval). My domain box is large enough to encompass both the glass and the water source:

my scene

Here are my settings for my domain:

domain settings

I am using the default blender renderer. I have the cup setup as a collision for a water simulation and I have the sphere inside of the cup set as a fluid in a fluid simulation. When I bake the scene, here is what I get:

My cup

As you can see, the water is going through the cup, but the cup is having an effect on the water. Here is the rendered view:

render

How can I keep the water in the cup??

iKlsR
  • 43,379
  • 12
  • 156
  • 189
John
  • 3,567
  • 8
  • 27
  • 38

4 Answers4

11

As others have mentioned, it's the resolution that's key here. However, I see that you've baked at two separate resolutions: 120 for final and 45 for preview.

You can see from the render view that the "final" quality bake has less "escaping" water. To preview that in your viewport without rendering, change the "Viewport display" dropdown to "Final." The downside of this is that it may slow down your viewport.

If you want even better quality, you could either:

  • increase the resolution, or:
  • Alt-D to linked-duplicate the cup object, then scale it down a tad (maybe 95%) and position it inside the real cup. Turn off the viewport and render visibility. Set its parent to the "real" cup, but mark both as collision targets (PhysicsFluidObstacle). This will essentially shrink the bounds of your cup and may or may not completely solve the problem.
wchargin
  • 9,452
  • 5
  • 41
  • 66
2

A follow up on 00Ghz answer, I would recommend turning up the resolution of the fluid mesh. It looks like some of the water is coming through, simply because it's so low res(it'll also improve collision detection).

CharlesL
  • 15,316
  • 7
  • 53
  • 88
1

Another technique that I overheard on IRC is to augment the scene with a collison object that is thicker than the rendered object. Just adjust the hide_render property in the outliner (looks like a camera icon) or maybe the layer so it doesn't show up as a rendered object.

Mutant Bob
  • 9,243
  • 2
  • 29
  • 55
-3

You should make the cup a collider object so the water respects the walls. If you don't do that water will just pass through. Choose the cup go to physics tab and choose collision.

It should work fine now.

Check here http://wiki.blender.org/index.php/Doc:2.4/Manual/Physics/Fluid

P.S. Agree with CharlesL, but make sure your current pc configuration can handle it.

00Ghz
  • 751
  • 2
  • 5
  • 13
  • Can you add some more information to this. A link perhaps? One liners can be vague.. – iKlsR Jun 09 '13 at 17:55
  • 3 lines actually :) . Well just check the manual. It gives a very detailed explanation http://wiki.blender.org/index.php/Doc:2.4/Manual/Physics/Fluid – 00Ghz Jun 09 '13 at 18:03
  • Your answer was edited, also post the link in the answer, not here. :) – iKlsR Jun 09 '13 at 18:04
  • 1
    "go to Physics tab and choose collision" don't you have to do Fluid > Obstacle? – wchargin Jun 09 '13 at 20:11
  • Yes however setting directly the collider property should achieve the same effect. There are is one main difference. If you go and set it from the fluid only the fluid is affected by the collider object. If you go from physics then all other object collide with the cup. I think the lat is the best for perfect realism. The collide from fluid, which acts like a bounding box may have errors sometimes. The bounding box acts like a invisible wall, there is no such wall in nature. It all depends on what you want to achieve. – 00Ghz Jun 09 '13 at 20:23
  • 1
    @00Ghz, Setting the Collision property directly from the Physics panel does not make it collide with fluid objects.

    Also the OP said that the cup is a fluid collision object. please read the question before answering.

    – gandalf3 Aug 02 '13 at 19:08
  • He already did that. – krypticbit Aug 24 '16 at 02:32