The Sketcher in FreeCAD has the ability to daw lines accordint to the refraction law (Shell's Law).
FreeCAD is a mechanical cad package though, and this functionality is probably not very advanced.
I would also not be surprised if animation packages such as Blender were able to simulate lenses in the raytracing part.
This gives some interesting results to the capabilities of Blender:
https://www.youtube.com/results?search_query=blender+lens+simulationIt also points to a separate project called "luxrender", which sounds like it might be interesting to you. Blender / Luxrender seems perfectly capable of this, but Blender is a multy headed monster and a bitch to tame / learn. You probably only need a very smal portion of it though...