rendering water volume in a glass with correct IORs


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

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, 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.