I'm designing a water proof case for a power bank to be used in an occasional underwater condition. The input and out put port components already have a gasket or sealing ring. Now to close the case I am planning to mill a metal with all walls and floor and then screw the top along with and O-ring. I haven't used an O-Ring before and wanted to know how to select an O-ring for a rounded rectangle groove (Does the circumference being equal to the grove length , enough). Is there any handbook for the same?
With any O-ring seal, static or dynamic, the key parameter is "O-ring Squeeze" which is defined as the percentage reduction in cross sectional area when compressed from the free state. Since the o-ring acts like a spring, this squeeze is directly related to the sealing force. The greater the squeeze, the greater the sealing force, and the greater resistance to leakage...at least in general.
As with most things, more is not always better, too much squeeze can result in a poor joint since it can cause excess stress in the mating parts, excess friction (in the case of a dynamic seal), and O ring damage since there's a greater risk of the o-ring getting pinched between the two mating surfaces.
In designing O-ring seals in stainless steel with good surface finish, I would try to stick to < 15% squeeze for dynamic seals and 15%-30% for static seals using a standard NBR O-ring from Parker, but it really depends on the type of O-Ring, the materials involved and all of the other specifics of the application.
In your case, you'll want to use an O-ring that has a circumference close to the mean perimeter of your groove. You can, of course buy custom O-rings, but those can be expensive.
There's a lot that goes into the design of a good O-ring joint. The best resource I've found is the Parker O-ring Handbook.