I swim 3-4 times a week. Occasionally, much less often then ~1 year ago, I get extremely bloated after swimming. My stomach is completely full of air to the point that I can not stand up straight. It can hurt.
I'm trying to find the cause of this. I think it is either because I am not breathing correctly in the water (swallowing air as opposed to breathing air), or possibly due to something I've eaten earlier in the day.
I do not make a habit of swimming soon after I eat. My swims are a mix of easy, relaxed strokes up to anaerobic sets depending on the day.
** UPDATE ** I have adjusted my breathing pattern from breathing every third stroke (left, right, breathe on left, right, left, breath on right) to a 2-2-3 (left, breathe on right, left, breathe on right, left, right, breath on left, right breathe on left). This helps somewhat.
I have also started taking a Gas-X pill or two about 20-30 minutes prior to a hard workout set. This seems to be the best solution for me to eliminate discomfort after the swim. If I do get bloated from swallowing air, the Gas-X seems to help me get rid of it easier.