rendering water volume in a glass with correct IORs

Hello,

I have been struggling to render my fluid animation with blender+cycles.
The principal method to render the water in a glass is to set the different materials (air-water, water-glass, and air-glass) for each surface.
FYI, please refer to


http://download.autodesk.com/us/maya/2009help/mr/shaders/architectural/arch_mtl.html#Water_and_Liquids
http://www.yafaray.org/community/forum/viewtopic.php?f=22&t=4134

This method works well and it is not so difficult for an (static) scene. However, it is impossible to apply (by hand) this method for the series of frames which contains an animation of fluid. So I just tested my python scripts (utilizing boolean modifiers such as the Wetted Mesh scripts, http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Mesh/Wetted_Mesh). Since the boolean modifiers in blender sometimes fail to produce the correct mesh, some frames fail to be rendered.

I also found this technique:


and tried a simple test, but the lastly mentioned technique, slightly overlapping water and glass, did not render the correct result (as in the attached image).


(left: overlapping, right: different IORs for each surface)

Does somebody has any good idea?

FYI, I have a series of (fluid mesh) obj files and static blender scene. And, I iteratively import each obj file and render with python script for-loop. Currently, I do apply some boolean modifiers in order to divide “glass+water” into air-water, water-glass, and glass-air interfaces. If the boolean modifiers do a good job, the result is fine. However, the boolean modifiers sometimes fail to generate the correct meshes.

I would appreciate it if you could give me with a comment.