How to selectively render part of an ocean which is inside a round object?
Try using a boolean modifier:

Create a cylinder the same size of the inside of your cup:


Add a boolean modifier and an edge-split modifier to the ocean object, with the cylinder object set as the target:



Make sure the cylinder is set to be hidden in the render, so it doesn't get in the way: