A solution for retention with an O-ring is to change from a rectangular groove shape to either a Dovetail or a Half Dovetail. The angled groove walls are an effective way to retain the seal, because the walls essentially pinch the seal, holding it in position. Dovetails have the significant benefit of allowing a commercially available O-ring to be used in an application.
One area of caution with a dovetail or a half dovetail is the naturally high ratio of O-ring volume to gland volume. Many fluids can cause an O-ring material to swell 10 or 20%. Or, very high temperatures can cause the seal to thermally expand, also leading to overfill. If the seal overfills in the groove, failure and leakage will result from the seal extruding out of the gland or from compression set. In the case of lightweight hardware the overfilled O-ring can also damage substrates.
The O-Ring Handbook has suggested groove dimensions for standard O-ring sizes. Standard cutters matching the groove details are commercially available through tooling suppliers.
How To Video
Watch the video for a how to on proper O-ring installation for dovetails and half dovetail seals.